<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Java Tuning</title>
	
	<link>http://www.javatuning.com</link>
	<description>Software Development, Java, and some more.</description>
	<lastBuildDate>Tue, 15 Jan 2013 14:59:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JavaTuning" /><feedburner:info uri="javatuning" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Quickest way for a one-off XML sort – OR – Learning to keep the heavy tools in the shed</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/Lz-Ylrms_lk/</link>
		<comments>http://www.javatuning.com/quickest-way-for-a-one-off-xml-sort-or-learning-to-keep-the-heavy-tools-in-the-shed/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 14:51:38 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=360</guid>
		<description><![CDATA[What&#8217;s the quickest way/tool to sort a 1000 entries xml file? Your requirements: The xml is parked on your desktop. You only need to sort it just once so you can manually examine it. Sort by the tag &#8220;relevance:score&#8221;. How would you go about it? Would you: A) Craft a pipe stream of shell utils?&#8230;]]></description>
				<content:encoded><![CDATA[<p><strong>What&#8217;s the quickest way/tool to sort a 1000 entries xml file?</strong><br />
Your requirements: The xml is parked on your desktop. You only need to sort it just once so you can manually examine it. Sort by the tag &#8220;relevance:score&#8221;.</p>
<p>How would you go about it? Would you:<br />
A) Craft a pipe stream of shell utils?<br />
B) Use the heavy tools &#8211; a Java main() that with uses JDom?<br />
C) Refresh the XSLT skills you never had?<br />
D) Try your luck with a Python script?<br />
E) search for an online XML editor tool?<br />
F) Or, my pick at the bottom.</p>
<p>Example xml document to sort:</p>
<pre>&lt;feed&gt;
    &lt;entry&gt;
        &lt;title&gt;Bibi&lt;/title&gt;
        &lt;score&gt;0.21000001&lt;/score&gt;
    &lt;/entry&gt;
    &lt;entry&gt;
        &lt;title&gt;Lapid&lt;/title&gt;
        &lt;score&gt;0.42000002&lt;/score&gt;
    &lt;/entry&gt;
    &lt;entry&gt;
        &lt;title&gt;Yechimovich&lt;/title&gt;
        &lt;score&gt;0.235&lt;/score&gt;
    &lt;/entry&gt;
    &lt;!--- 997 more entries --&gt;
&lt;/feed&gt;</pre>
<p>My Pick: considered all the above but it sounded like a headache for a simple sort operation. So I&#8217;ve &#8230;. thrown the file at MS Excel, turns out it can digest it rather well, and then I sorted by the score column. Yes! Surprising. But crappy MS Excel did the job (the original schema had more nesting than the document in the example above).</p>
<p><strong>Life-saver lesson</strong>: Spend time picking the right tool for the job, than on the job itself.</p>
<div id="attachment_361" class="wp-caption alignleft" style="width: 239px"><img class="size-full wp-image-361 " title="Sorted the bugger" alt="One click to sort" src="http://www.javatuning.com/wp-content/uploads/2013/01/xml-sort-by-excel.png" width="229" height="179" /><p class="wp-caption-text">One click to sort</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/quickest-way-for-a-one-off-xml-sort-or-learning-to-keep-the-heavy-tools-in-the-shed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/quickest-way-for-a-one-off-xml-sort-or-learning-to-keep-the-heavy-tools-in-the-shed/</feedburner:origLink></item>
		<item>
		<title>Specifing arrays size/capacity – my latest buggy code and a best practice</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/XsQSxmqQLqU/</link>
		<comments>http://www.javatuning.com/specifing-arrays-sizecapacity-my-latest-buggy-code-and-a-best-practice/#comments</comments>
		<pubDate>Wed, 05 Dec 2012 09:30:06 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=346</guid>
		<description><![CDATA[We&#8217;re often required to specify size/capacity when allocating array like structures. While you MUST specify size for Java&#8217;s primitive arrays. With realizable arrays like ArrayList/Vector, specifying #capacity is too often a #premature-optimization, that you could avoid. &#160; &#160; I happened to introduce a bug to our code base, by initialized an ArrayList with a negative&#8230;]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.javatuning.com/wp-content/uploads/2012/12/minus841.png"><img class="alignleft  wp-image-349" title="minus84" src="http://www.javatuning.com/wp-content/uploads/2012/12/minus841-300x210.png" alt="" width="147" height="104" /></a>We&#8217;re often required to specify size/capacity when allocating array like structures.<br />
While you MUST specify size for Java&#8217;s primitive arrays. With realizable arrays like ArrayList/Vector, specifying #capacity is too often a #premature-optimization, that you could avoid.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I happened to introduce a bug to our code base, by initialized an ArrayList with a negative capacity value:</p>
<pre>List&lt;RetrievedDocument&gt; docs =  new ArrayList&lt;RetrievedDocument&gt;(scoreDocs.length - resultsOffset);</pre>
<p>Performing such profanity results in an #IAE being thrown (triggered by a NegativeArraySizeException thrown by the underlying primitive array structure.</p>
<pre>public ArrayList(int capacity) {
firstIndex = lastIndex = 0;
try {
array = newElementArray(capacity);
} catch (NegativeArraySizeException e) {
throw new IllegalArgumentException();
}
}</pre>
<h3>Lesson for the next 50 years (or until I switch off from Java):</h3>
<p>Whenever setting the size of an array (or anything sizable) to an unknown ahead value, spend a second to consider whether the value could be negative.<br />
Then, if the desired resulting behavior is to create a zero-sized array instead, use this one-liner for that:</p>
<pre>new ArrayList( Math.max(0, possiblyNegativeCapacity) );</pre>
<p>Q: Do you know if other languages makes the use case above easier/less error prone?</p>
<p>Q: Any other related best practices and pitfalls you would like to share?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/specifing-arrays-sizecapacity-my-latest-buggy-code-and-a-best-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/specifing-arrays-sizecapacity-my-latest-buggy-code-and-a-best-practice/</feedburner:origLink></item>
		<item>
		<title>Cleaner code with Apache Commons</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/S-Z5ojNhCjQ/</link>
		<comments>http://www.javatuning.com/cleaner-code-with-apache-commons/#comments</comments>
		<pubDate>Sun, 26 Aug 2012 08:12:01 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache-commons]]></category>
		<category><![CDATA[clean-code]]></category>
		<category><![CDATA[commons-lang]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[launage]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=327</guid>
		<description><![CDATA[It seems I can no longer write any piece of code without including the Apache Commons libraries. They just contain everything that the ancient architects of the Java language forgot to include in the java.* APIs; Commons save huge amounts of coding debugging time, by capturing ever repeating patterns, allowing effective reuse which results helps&#8230;]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.javatuning.com/wp-content/uploads/2012/08/commons-logo.png"><img class="wp-image-333 alignright" title="commons-logo" src="http://www.javatuning.com/wp-content/uploads/2012/08/commons-logo-300x85.png" alt="" width="186" height="57" /></a>It seems I can no longer write any piece of code without including the<a href="http://commons.apache.org/"> Apache Commons libraries</a>.<br />
They just contain everything that the ancient architects of the Java language forgot to include in the java.* APIs; Commons save huge amounts of coding debugging time, by capturing ever repeating patterns, allowing effective reuse which results helps with clean code.</p>
<h3><span id="more-327"></span>Pattern 1 &#8211; Strings comparison</h3>
<p lang="en">consider the (Apache) common(s) pattern of checking whether two Strings are equal, while any of them is a potential null.<br />
Naively you might try:</p>
<pre>if (s1!=null &amp;&amp; s1.equals(s2)) {...}</pre>
</p>
<p>But there&#8217;s a bug coming your way &#8211; what if both Strings are null?<br />
Fixing:</p>
<pre>if (s1==s2 || (s1!=null &amp;&amp; s1.equals(s2))) {...}</pre>
<p>And we result in verbose ugly, detail oriented, code when all we wanted to know was if two Strings are equal.</p>
<p>With the <a href="http://commons.apache.org/lang/userguide.html#lang3.">Apache commons Lang</a> lib, you&#8217;re exempt from dogging bugs, handling nulls, and reading blurred code, with this intentional piece of code:</p>
<pre>if(StringUtils.equals(s1, s2)) {...}</pre>
<p>Embedding such calls throughout your code seriously cuts down on LOC. Hurray!</p>
<p>Are you using Commons, or you have some other secret weapon down you sleeve?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/cleaner-code-with-apache-commons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/cleaner-code-with-apache-commons/</feedburner:origLink></item>
		<item>
		<title>HPEL – A fast binary logging for WebSphere v8</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/hv7xfGLjdBM/</link>
		<comments>http://www.javatuning.com/hpel-a-fast-binary-logging-for-websphere-v8/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 13:26:07 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=320</guid>
		<description><![CDATA[Troubleshooting Java EE apps running on WebSphere just got a bit easier with WebSphere v8&#8242;s new binary logging and tracing mechanism: HPEL (High Performance Extensible Logging). HPEL provides logging/tracing run-time performance boost (x3.5-x5 claimed) increasing the chances that you&#8217;ll be able to turn on tracing on a production system. HPEL comes with two offline viewing&#8230;]]></description>
				<content:encoded><![CDATA[<p>Troubleshooting Java EE apps running on WebSphere just got a bit easier with WebSphere v8&#8242;s new binary logging and tracing mechanism: <a href="http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.was_v8/was/8.0/ProblemDetermination/WASv8_HPEL/player.html">HPEL (High Performance Extensible Logging)</a>.<br />
HPEL provides logging/tracing run-time performance boost (x3.5-x5 claimed) increasing the chances that you&#8217;ll be able to turn on tracing on a production system.<br />
HPEL comes with two offline viewing tools: A crafty command-line tool for log analysis, and a web based traces viewer on the Web admin console (handy for remote servers).</p>
<p>The command line utility has a tail function and can filter by: Logger/Thread ID/Time/Server startup instance/etc. Which is a good enough reason for me to get rid of my (slow performing) custom Python based filtering scripts.</p>
<p>Good old legacy text based logs are still supported but are recommended for development mode only.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2011/11/binary-text.jpg"><img class="alignleft size-full wp-image-321" title="binary-text" src="http://www.javatuning.com/wp-content/uploads/2011/11/binary-text.jpg" alt="" width="200" height="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/hpel-a-fast-binary-logging-for-websphere-v8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/hpel-a-fast-binary-logging-for-websphere-v8/</feedburner:origLink></item>
		<item>
		<title>10 things I like about Android development</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/lZ8gxZ7pU0E/</link>
		<comments>http://www.javatuning.com/10-things-i-like-about-android-development/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 15:03:55 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=305</guid>
		<description><![CDATA[Java &#8211; Write in Java on both the Client and Server sides. Simplifies development and presents a low learning curve for newcomers. Paid apps culture - Unlike when using web apps, mobile app users we&#8217;re tamed to pay for the apps they like (Thank you Apple for cracking the ice). Developing for Android might be&#8230;]]></description>
				<content:encoded><![CDATA[<ol>
<li><strong>Java</strong> &#8211; Write in Java on both the Client and Server sides. Simplifies development and presents a low learning curve for newcomers.</li>
<li><strong>Paid apps culture </strong>- Unlike when using web apps, mobile app users we&#8217;re tamed to pay for the apps they like (Thank you Apple for cracking the ice). Developing for Android might be the first time that you&#8217;ll sell a piece of software <em>directly </em>to your users (it is my first time, and I&#8217;ve been programming since 1996).</li>
<li><strong><a href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">TTD</a></strong> &#8211; When creating a new Android Eclipse project it auto suggest to create matching test project. Proves to show that the Eclipse perspective designer had TTD in mind.</li>
<li><strong><a href="http://developer.android.com/resources/samples/ApiDemos/index.html" target="_blank">API Demos</a></strong> &#8211; Good samples project to copy code segments from. Bundled with the SDK.</li>
<li><strong>No single point of entry </strong>- No single main() function. Your application  can have multiple entry points (<a href="http://developer.android.com/guide/topics/fundamentals/activities.html" target="_blank">Activities</a>), which can be used to  service the user&#8217;s <a href="http://developer.android.com/guide/topics/intents/intents-filters.html" target="_blank">Intents</a>. Different from what I&#8217;m used to.</li>
<li><strong><a href="http://developer.android.com/guide/topics/ui/declaring-layout.html" target="_blank">Construct UI using XML</a> </strong>- specifying UI elements using a markup language makes more sense than doing it programmatically (attention Swing).</li>
<li><strong>Multiple App markets</strong> &#8211; More choices for us developers.</li>
<li><strong><a href="http://developer.android.com/guide/topics/resources/more-resources.html#Dimension" target="_blank">Coping with multiple device resolutions</a></strong> &#8211; using density independent pixels worked well for my modest needs.</li>
<li><strong><a href="http://appinventor.googlelabs.com/about/" target="_blank">App Inventor</a> </strong>- Ridiculously easy to build your first app. Go try it.</li>
<li><strong>What&#8217;s your 10th?</strong> Comment if you have one.</li>
</ol>
<h3>My first App:</h3>
<p><a href="http://www.javatuning.com/wp-content/uploads/2011/04/hi-256-2-d47bd4b1848d98268cb94c21e7f3a256b36b8ae7.png"><img class="alignleft size-full wp-image-309" title="hi-256-2-d47bd4b1848d98268cb94c21e7f3a256b36b8ae7" src="http://www.javatuning.com/wp-content/uploads/2011/04/hi-256-2-d47bd4b1848d98268cb94c21e7f3a256b36b8ae7.png" alt="" width="256" height="256" /></a>My first app is the <a href="https://market.android.com/details?id=com.gilinachum&amp;feature=search_result" target="_blank">Weight Watchers Points Tracker</a> (diet related), that I&#8217;ve initially created for my own usage, then later posted to the Android Market. Surprisingly it has been doing pretty good (&gt;10K installations). I&#8217;ll need to see what comes next&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/10-things-i-like-about-android-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/10-things-i-like-about-android-development/</feedburner:origLink></item>
		<item>
		<title>Spice up your tests – execute in (repeatable) random order</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/EHu2QMPsinc/</link>
		<comments>http://www.javatuning.com/spice-up-your-tests-execute-in-repeatable-random-order/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 21:56:35 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=299</guid>
		<description><![CDATA[We have a series of SIPp tests that periodically runs against a SIP server we develop. The tests repository keeps on growing and we&#8217;ve gathered up a nice pile of tests. As good tests should be isolated from one another, their order of execution is arbitrary by definition. The tests should produce the same results&#8230;]]></description>
				<content:encoded><![CDATA[<p>We have a series of SIPp tests that periodically runs against a SIP server we develop. The tests repository keeps on growing and we&#8217;ve gathered up a nice pile of tests.</p>
<p>As good tests <a href="http://stackoverflow.com/questions/2669414/choose-order-to-execute-junit-tests" target="_blank">should be isolated from one another</a>, their order of execution is arbitrary by definition. The tests should produce the same results consistently regardless of where they are located in the execution chain. I thought I might take this to the test, and perhaps find a bug or two along the way.<br />
Working in Python, I now simply shuffle the list of tests prior to execution:<br />
<code><br />
random.shuffle(testList)<br />
executor.exec(testList)<br />
</code></p>
<p>Nice. Now what happens if a certain execution order fails? I would find the issue and fix it, what else?! Right, but how will I reproduce the same exact execution order that failed before, in order to validate the fix?<br />
One naive option is saving the entire execution order as a list of indices, this is not very comfortable. A simpler option is to simply seed your random object with the <em>same </em><a href="http://en.wikipedia.org/wiki/Random_seed" target="_blank">seed</a> int value used during the execution to reproduce. Here&#8217;s the code:<br />
<code><br />
import random<br />
seedValue = options.get('shuffleSeed', random.randint(0, 10000))  # Seed is provided by the user in an attempt to reproduce, otherwise it's set to some random value.<br />
random.seed(seedValue)<br />
random.shuffle(testList)<br />
print 'Shuffled with seed=' + str(seedValue)<br />
executor.exec(testList)<br />
</code></p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2011/03/shuffling.jpg"><img class="alignleft size-full wp-image-300" title="shuffling" src="http://www.javatuning.com/wp-content/uploads/2011/03/shuffling.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/spice-up-your-tests-execute-in-repeatable-random-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/spice-up-your-tests-execute-in-repeatable-random-order/</feedburner:origLink></item>
		<item>
		<title>Case insensitive Map key – code smell</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/QalkBIlqP_4/</link>
		<comments>http://www.javatuning.com/the-maps-key-case-insensitivity-code-smell/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 18:05:40 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[case sensitivity]]></category>
		<category><![CDATA[code smell]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[programming language]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=290</guid>
		<description><![CDATA[Here&#8217;s the bug that had me working today (a Sukot holiday): _myMap.put(key.toLowerCase()) ... _myMap.get(key) // without lower casing the key. At first you might think of this as a common human error, but I claim that it&#8217;s no less of a code smell: Why trust yourself to always remember to lower/upper case all of the&#8230;]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s the bug that had me working today (a Sukot holiday):<br />
<code><br />
_myMap.put(key.toLowerCase())<br />
...<br />
_myMap.get(key) // without lower casing the key.<br />
</code><br />
At first you might think of this as a common human error, but I claim that it&#8217;s no less of a <strong>code smell:</strong></p>
<p>Why trust yourself to always remember to lower/upper case all of the interactions with the map? What about trusting others?<br />
So, instead of using a HashMap, use an Apache <a href="http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/CaseInsensitiveMap.html">CaseInsensitiveMap</a> that nicely and safely encapsulates this key&#8217;s case concern.</p>
<p>P.S.<br />
I would expect <a href="http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/CaseInsensitiveMap.html">CaseInsensitiveMap</a> to become a part of the Java SDK.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/09/toLowerCase.png"><img class="alignleft size-medium wp-image-291" title="toLowerCase" src="http://www.javatuning.com/wp-content/uploads/2010/09/toLowerCase-300x297.png" alt="" width="300" height="297" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/the-maps-key-case-insensitivity-code-smell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/the-maps-key-case-insensitivity-code-smell/</feedburner:origLink></item>
		<item>
		<title>My attempts with IP Spoofing – Revisited</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/hl2Fh8_Xf9Q/</link>
		<comments>http://www.javatuning.com/my-attempts-with-ip-spoofing-revisited/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 15:51:13 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[network]]></category>
		<category><![CDATA[IP spoofing]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=269</guid>
		<description><![CDATA[One upon a time (Jan 2009) I&#8217;ve written this post, basically saying that you&#8217;re not likely to be able to spoof IP address over the Internet. Turns out I was dead wrong! It happened so the very experienced Mr Filipe, from Brazil, came across the post and left me a comment saying that Spoofing over&#8230;]]></description>
				<content:encoded><![CDATA[<p>One upon a time (Jan 2009) I&#8217;ve written <a href="http://www.javatuning.com/ip-spoofing-%E2%80%93-only-in-a-lan/">this post</a>, basically saying that you&#8217;re not likely to be able to spoof IP address over the Internet.<br />
Turns out I was dead wrong!</p>
<p>It happened so the very experienced Mr Filipe, from Brazil, came across the post and left me a comment saying that Spoofing over the internet is quiet possible.<br />
I replied surprised, and after a number of comments ping-pongs, we started chatting online, and Felipe had agreed to give me a live spoofing demo:<br />
On my end, I&#8217;ve configured my home router to forward TCP/UDP packets to my desktop, where I ran a wireshark network capture to monitor any incoming packets.<br />
Then Felipe sent a burst of packets from random IP source addresses. Proving me that IP spoofing over the Internet is a reality indeed.</p>
<p>(<em>What do you think? Isn&#8217;t this kind of stuff is what makes the Internet  so amazingly wonderful? two people from two different parts of the world, united by  joint interest and kindness <img src='http://www.javatuning.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em>)</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/09/mask.gif"><img class="size-full wp-image-270 alignright" title="mask" src="http://www.javatuning.com/wp-content/uploads/2010/09/mask.gif" alt="" width="250" height="250" /></a>So,<strong> Thank you Filipe!</strong></p>
<p>A few notes on why spoofing might *not* work:</p>
<ol>
<li>According to Filipe, the recipient&#8217;s ISP is much more likely to block the spoofed packet, than the sender&#8217;s ISP. For example if the recipient&#8217;s ISP see a <a href="http://www.countryipblocks.net/bogons/">bogon </a>source IP.<br />
That&#8217;s a bit counter-intuitive, because, assuming the ISPs really do care about preventing spoofing, it&#8217;s a very easy job for the sender&#8217;s ISP to tell if the packet&#8217;s source IP is one of the IPs that it handed out to customers, or moreover, to the particular customer (sender).</li>
<li>If you are behind a NAT device, then any source address you are planning to use (be it spoofed or real) will be overwritten by the NAT anyway, so make sure you are on a real public IP.</li>
<li>No reason to get excited. TCP spoofing is very limited as you won&#8217;t make it across the TCP handshake, because the recipients will send their ACK,SYN response to the spoofed IP, which you probably don&#8217;t have much control over.<br />
In a LAN things are a bit different, if you can manipulate the recipient&#8217;s ARP table to think that the spoofed IP MAC address is yours. I haven&#8217;t dag deep.</li>
</ol>
<p><em>Feel free to comment.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/my-attempts-with-ip-spoofing-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/my-attempts-with-ip-spoofing-revisited/</feedburner:origLink></item>
		<item>
		<title>“Hypervisor edition” – what’s that?</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/APbjpxbJT_w/</link>
		<comments>http://www.javatuning.com/hypervisor-edition-whats-that/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 19:50:04 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[a glimpse into the future]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[OVF]]></category>
		<category><![CDATA[Websphere]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=251</guid>
		<description><![CDATA[WebSphere have announced  WAS hypervisor edition. You get an OVF package with a ready to use WAS profile running on Linux. The OVF package can be deployed on VMWare ESX/ESXi and IBM&#8217;s cludeburst appliance. Websphere also say that they carried out WAS best-practice tuning for the OS. Not sure how mattering this tuning is considering&#8230;]]></description>
				<content:encoded><![CDATA[<p>WebSphere have announced  <a href="http://www-01.ibm.com/software/webservers/appserv/hypervisor/features/?S_CMP=rnav" target="_blank">WAS hypervisor edition</a>.</p>
<p>You get an <a href="http://en.wikipedia.org/wiki/Open_Virtualization_Format">OVF</a> package with a ready to use WAS profile running on Linux. The OVF package can be deployed on VMWare ESX/ESXi and IBM&#8217;s <a href="http://www-01.ibm.com/software/webservers/cloudburst/">cludeburst</a> appliance.<br />
Websphere also say that they carried out WAS best-practice tuning for the OS. Not sure how mattering this tuning is considering the generic nature of WAS (different application=different tuning), and the generic drivers that a VM uses.</p>
<div id="attachment_252" class="wp-caption alignnone" style="width: 220px"><a href="http://www.javatuning.com/wp-content/uploads/2010/04/installing.jpg"><img class="size-full wp-image-252 " title="Joys of installation" src="http://www.javatuning.com/wp-content/uploads/2010/04/installing.jpg" alt="" width="210" height="210" /></a><p class="wp-caption-text">Joys of installation</p></div>
<p>I wonder how enterprise IT administrators would accept an OS different  from what they usually roll with.</p>
<p>important to mention that similar zero-install pre-configured WAS  environment are available on the <a href="http://www-180.ibm.com/cloud/enterprise/beta/dashboard" target="_blank">IBM test cloud</a> (in Beta).</p>
<p>The real <a href="http://www.ibm.com/developerworks/websphere/techjournal/0811_col_willenborg/0811_col_willenborg.html" target="_blank">important message made here by IBM</a> is that the WAS hypervisor edition is only a first bird. Although naked manual WAS installation is not a biggy, IBM products running on WAS are. As the OVF standard matures and virtualization becomes the default production hosting environment, we will be seeing complex WAS based products (say Portal, and Process Server) shipped as ultra consumable OVF packages. Even a complete topology consisting of many servers can be delivered as a single OVF package.<br />
This delivery mode is quite similar to VMWare&#8217;s <a href="http://www.vmware.com/appliances/" target="_blank">software appliances</a>, only applicable to more than one Hypervisor when packaged as OVF (theoretically).</p>
<p>Bad news to professional services people and install manager software developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/hypervisor-edition-whats-that/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/hypervisor-edition-whats-that/</feedburner:origLink></item>
		<item>
		<title>IBM’s PLDE seminar 2010 – Review</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/M_Frd3CdMcE/</link>
		<comments>http://www.javatuning.com/ibms-plde-seminar-2010-review/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 17:00:10 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[a glimpse into the future]]></category>
		<category><![CDATA[computer language]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[programming language]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=246</guid>
		<description><![CDATA[I spent today at the IBM Programming Languages and Development Environments Seminar 2010, that took place at the beautiful Haifa Research lab mount Carmel campus. Things worth mentioning: Gilad Bracha, father of Java Generics and auto-boxing, spent 60 minutes repenting Sun&#8217;s Java 1.0 early design mistakes, such as allowing primitives and static members into the&#8230;]]></description>
				<content:encoded><![CDATA[<p>I spent today at the <a href="https://www.research.ibm.com/haifa/Workshops/plde2010/program.shtml" target="_blank">IBM Programming Languages and Development Environments Seminar 2010</a>, that took place at the beautiful Haifa Research lab mount Carmel campus. Things worth mentioning:</p>
<p>Gilad Bracha, father of Java Generics and auto-boxing, spent 60  minutes repenting Sun&#8217;s Java 1.0 early design mistakes, such as allowing  primitives and static members into the language. IMHO the lecture  itself was so-so. Gilad pointed out Java&#8217;s soft spots, but didn&#8217;t bother  presenting the crowd what he views as the alternatives. What he did  suggest was to check out his new baby programing language <a href="http://en.wikipedia.org/wiki/Newspeak_%28programming_language%29" target="_blank">Newspeak</a> (something for the purists I guess).</p>
<p>Perhaps some of Java&#8217;s charm at the early days was its simplicity and  low learning curve, I&#8217;m not sure that a semantically perfect Java  (could there by anything like this?) using nested classes instead of  static members would have enjoyed the same mojo.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/04/plde20101.jpg"><img class="alignnone size-full wp-image-258" title="plde2010" src="http://www.javatuning.com/wp-content/uploads/2010/04/plde20101.jpg" alt="" width="497" height="359" /></a></p>
<p>In one additional <a href="https://www.research.ibm.com/haifa/Workshops/plde2010/abstracts.shtml#2" target="_blank">interesting lecture</a>, <em>Kathy Barabash,</em> talked about how data structures with a sequential references object graph (say a LinkedList) do not allow traditional concurrent GC Tracing algorithms to scale on many-core (i.e., massive multi-core) platforms.</p>
<p>What good is your new 1,024 cores Intel processor if the desktop widget nuclear explosion simulation flickers because it can only scale on 400 of the available cores, right?</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/04/many-core.jpg"><img class="alignnone size-full wp-image-247" title="many-core" src="http://www.javatuning.com/wp-content/uploads/2010/04/many-core.jpg" alt="" width="247" height="221" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/ibms-plde-seminar-2010-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/ibms-plde-seminar-2010-review/</feedburner:origLink></item>
	</channel>
</rss>
