<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-566351192911506928</id><updated>2011-10-18T18:14:28.537+02:00</updated><category term='linux'/><category term='proxy'/><category term='multi-threaded'/><category term='guide'/><category term='s3'/><category term='mysql'/><category term='java'/><category term='intro'/><category term='development'/><category term='blogspot'/><category term='ssh'/><category term='101'/><category term='tunneling'/><category term='api'/><category term='cloud'/><category term='fuzzy logic'/><category term='template'/><category term='http'/><category term='book'/><category term='demo'/><category term='hadoop'/><category term='it'/><category term='bytecode'/><category term='jasper-reports'/><category term='user-agent'/><category term='simple-math'/><category term='blogger'/><category term='heuristics'/><category term='socks5'/><category term='browser'/><category term='reference'/><category term='log'/><category term='free-software'/><category term='dev'/><category term='nosql'/><category term='eclipse'/><category term='code'/><category term='aws'/><category term='review'/><category term='svn'/><category term='google'/><category term='reporting'/><title type='text'>Everything Code</title><subtitle type='html'>Java Bytecode Assembly, Interesting concepts in the art of Computer Science/Software Development, maybe from time to time other pesky corp. related development issues.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-8048736516968575294</id><published>2011-10-18T18:13:00.001+02:00</published><updated>2011-10-18T18:14:28.575+02:00</updated><title type='text'>Chrome and java applet plugin on ubuntu tails</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;To enable do this:&lt;br /&gt;&lt;br /&gt;sudo ln -sf &amp;nbsp;/usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so &amp;nbsp; &amp;nbsp; /usr/lib/firefox-addons/plugins/libnpjp2.so&lt;br /&gt;sudo ln -sf &amp;nbsp;/usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so &amp;nbsp; &amp;nbsp; &amp;nbsp;/usr/lib/mozilla/plugins/libnpjp2.so&lt;br /&gt;mkdir ~/.mozilla/plugins&lt;br /&gt;cd ~/.mozilla/plugins/&lt;br /&gt;ln -s /usr/lib/firefox-addons/plugins/libnpjp2.so&lt;br /&gt;&lt;br /&gt;&lt;div&gt;More info here&amp;nbsp;&lt;a href="http://www.google.com/support/forum/p/Chrome/thread?tid=3ef7b4f7b08118ed&amp;amp;hl=en"&gt;http://www.google.com/support/forum/p/Chrome/thread?tid=3ef7b4f7b08118ed&amp;amp;hl=en&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-8048736516968575294?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/8048736516968575294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2011/10/chrome-and-java-applet-plugin-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8048736516968575294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8048736516968575294'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2011/10/chrome-and-java-applet-plugin-on-ubuntu.html' title='Chrome and java applet plugin on ubuntu tails'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-8383950416269840456</id><published>2011-01-17T11:27:00.005+02:00</published><updated>2011-03-27T16:46:23.031+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nosql'/><title type='text'>Collection of noSQL presentations and terms</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Some great noSQL resources&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/guestdfd1ec/design-patterns-for-distributed-nonrelational-databases"&gt;http://www.slideshare.net/guestdfd1ec/design-patterns-for-distributed-nonrelational-databases&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/Eweaver/cassandra-presentation-at-nosql"&gt;http://www.slideshare.net/Eweaver/cassandra-presentation-at-nosql&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/jbellis/cassandra-open-source-bigtable-dynamo"&gt;http://www.slideshare.net/jbellis/cassandra-open-source-bigtable-dynamo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/jbellis/what-every-developer-should-know-about-database-scalability"&gt;http://www.slideshare.net/jbellis/what-every-developer-should-know-about-database-scalability&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/jboner/scalability-availability-stability-patterns"&gt;http://www.slideshare.net/jboner/scalability-availability-stability-patterns&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/xlight/google-designs-lessons-and-advice-from-building-large-distributed-systems"&gt;http://www.slideshare.net/xlight/google-designs-lessons-and-advice-from-building-large-distributed-systems&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slideshare.net/iamcal/scalable-web-architectures-common-patterns-and-approaches-web-20-expo-nyc-presentation"&gt;http://www.slideshare.net/iamcal/scalable-web-architectures-common-patterns-and-approaches-web-20-expo-nyc-presentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;A book club for noSQL papers&amp;nbsp;&lt;a href="http://nosqlsummer.org/papers"&gt;http://nosqlsummer.org/papers&lt;/a&gt;&amp;nbsp;with difficulty ratings and local meetings everyone can attend.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;noSQL concepts that you really do want to understand:&amp;nbsp;Bloom Filter, Vector Clocks, Gossip Protocol, Dynamo, Paxos, MapReduce, CAP, Eventual Consistency, Column Storage, Consistent Hashing, Hinted Handoff, Read Repair, Write Ahead. Also make sure to know what: Hadoop, GFS, Cassandra, Mongo are.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lectures:&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://www.infoq.com/presentations/Riak-Core?"&gt;http://www.infoq.com/presentations/Riak-Core&lt;/a&gt;&amp;nbsp;- Andy Gross review of Dynamo (and Riak)&lt;/li&gt;&lt;li&gt;&lt;a href="http://nosqltapes.com/"&gt;http://nosqltapes.com/&lt;/a&gt;&amp;nbsp;- Collection of lectures about the noSQL ecosystem, plus the technical aspects.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-8383950416269840456?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/8383950416269840456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2011/01/collection-of-nosql-presentations-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8383950416269840456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8383950416269840456'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2011/01/collection-of-nosql-presentations-and.html' title='Collection of noSQL presentations and terms'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-955094616313064737</id><published>2011-01-05T02:30:00.004+02:00</published><updated>2011-01-06T11:54:37.491+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='api'/><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='multi-threaded'/><category scheme='http://www.blogger.com/atom/ns#' term='s3'/><category scheme='http://www.blogger.com/atom/ns#' term='aws'/><title type='text'>Recursive delete utility for version enabled S3 bucket</title><content type='html'>Deleting S3 bucket that contains anything more then the most trivial collection of keys (&amp;gt;1000) is a never ending saga. Deleting S3 bucket that has versioning enabled is with today's tools simply not possible.&lt;br /&gt;&lt;br /&gt;We had 2 buckets that were taking up storage space: the first had ~300,000,000 keys, the second ~2500 but with versioning enabled and keys that contain "\n" (new line), "//" (double slash) and " " (space) in their names. Trying to use tools such as jets3, boto, bucket explorer, aws s3 console, s3fox on either of these buckets failed in the most pathetic/exotic of ways.&lt;br /&gt;&lt;br /&gt;I quickly understood that this requires a custom implementation.&lt;br /&gt;&lt;br /&gt;Doing some googling I found this&amp;nbsp;&lt;a href="http://mark.koli.ch/2010/09/recursively-deleting-large-amazon-s3-buckets.html"&gt;http://mark.koli.ch/2010/09/recursively-deleting-large-amazon-s3-buckets.html&lt;/a&gt;&amp;nbsp;excellent post proving some pseudo-code for multi threaded delete operation against S3. Good, the correct post in the correct time! Based on Mark's code I've implemented BucketDestroy which has the sole purpose of doing everything it takes to delete an S3 bucket, a seek &amp;amp; destroy S3 bucket commando if you like.&lt;br /&gt;&lt;br /&gt;I've enhanced Mark code with the ability to delete not just bucket keys but bucket key versions, this is required because Amazon will not let you delete S3 bucket that has old versions of a Key.&lt;br /&gt;&lt;br /&gt;The code is provided below, I've also &lt;a href="http://code.google.com/p/bucket-destroy/"&gt;hosted it on google code&lt;/a&gt; where you can find maven based setup instructions and the latest version.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background: #ffffff; color: black;"&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; java&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;util&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;List&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; java&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;util&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;concurrent&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;CountDownLatch&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; java&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;util&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;concurrent&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;ExecutorService&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; java&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;util&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;concurrent&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;Executors&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; java&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;util&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;concurrent&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;atomic&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;AtomicInteger&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; com&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;amazonaws&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;auth&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;BasicAWSCredentials&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; com&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;amazonaws&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;services&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;s3&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;AmazonS3Client&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; com&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;amazonaws&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;services&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;s3&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;model&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;DeleteVersionRequest&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; com&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;amazonaws&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;services&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;s3&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;model&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;S3VersionSummary&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;import&lt;/span&gt;&lt;span style="color: #004a43;"&gt; com&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;amazonaws&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;services&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;s3&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;model&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;&lt;span style="color: #004a43;"&gt;VersionListing&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Efficient delete of version enabled bucket.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; This code will delete all keys from gives bucket and all previous versions of given key.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; This is done in an efficient multi&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;threaded ExecutorService environment&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Launching&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;:&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; $java &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;Daws&lt;/span&gt;&lt;span style="color: #008c00;"&gt;.&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;key=AK7895IH1234X2GW12IQ &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;Daws&lt;/span&gt;&lt;span style="color: #008c00;"&gt;.&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;secret=&lt;/span&gt;&lt;span style="color: #008c00;"&gt;1234567890123456789012345678901234456789&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; BucketDestroy "bucketName"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;@author&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;Maxim Veksler &amp;lt;maxim@vekslers.org&amp;gt;&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;@author&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;Mark S. Kolich http://mark.koli.ch/2010/09/recursively-deleting-large-amazon-s3-buckets.html&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;@version&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #008c00;"&gt;0.1&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; First pseudo code version&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;,&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Written by Mark S. Kolich. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;@version&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #008c00;"&gt;0.2&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Maxim Veksler &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Fix paging. Implement deletion of versioned keys.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; For the latest version see &lt;/span&gt;&lt;span style="color: #5555dd;"&gt;http://code.google.com/p/bucket-destroy/&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;class&lt;/span&gt; BucketDestroy &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: maroon; font-weight: bold;"&gt;private&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;static&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; AWS_ACCESS_KEY_PROPERTY &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"aws.key"&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: maroon; font-weight: bold;"&gt;private&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;static&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; AWS_SECRET_PROPERTY &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"aws.secret"&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: maroon; font-weight: bold;"&gt;private&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;static&lt;/span&gt; AmazonS3Client s3&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: maroon; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;static&lt;/span&gt; &lt;span style="color: #bb7977;"&gt;void&lt;/span&gt; main&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt;&lt;span style="color: #808030;"&gt;[&lt;/span&gt;&lt;span style="color: #808030;"&gt;]&lt;/span&gt; args&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; accessKey &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;getProperty&lt;span style="color: #808030;"&gt;(&lt;/span&gt;AWS_ACCESS_KEY_PROPERTY&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; secret &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;getProperty&lt;span style="color: #808030;"&gt;(&lt;/span&gt;AWS_SECRET_PROPERTY&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #808030;"&gt;(&lt;/span&gt;accessKey &lt;span style="color: #808030;"&gt;=&lt;/span&gt;&lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;null&lt;/span&gt; &lt;span style="color: #808030;"&gt;|&lt;/span&gt;&lt;span style="color: #808030;"&gt;|&lt;/span&gt; secret &lt;span style="color: #808030;"&gt;=&lt;/span&gt;&lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;null&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;err&lt;span style="color: #808030;"&gt;.&lt;/span&gt;println&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #0000e6;"&gt;"You're missing the -Daws.key and -Daws.secret required VM properties."&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;exit&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #008c00;"&gt;100&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #808030;"&gt;(&lt;/span&gt;args&lt;span style="color: #808030;"&gt;.&lt;/span&gt;length &lt;span style="color: #808030;"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color: #008c00;"&gt;1&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;err&lt;span style="color: #808030;"&gt;.&lt;/span&gt;println&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #0000e6;"&gt;"Missing required program argument: bucketName."&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;exit&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #008c00;"&gt;100&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;span style="color: dimgrey;"&gt;// S3 Initialization&lt;/span&gt;&lt;br /&gt;        s3 &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; AmazonS3Client&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; BasicAWSCredentials&lt;span style="color: #808030;"&gt;(&lt;/span&gt;accessKey&lt;span style="color: #808030;"&gt;,&lt;/span&gt; secret&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: dimgrey;"&gt;// Instantiate BucketDestroy and call destroyBucket() - Bucket deleting beast!&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; BucketDestroy&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;destroyBucket&lt;span style="color: #808030;"&gt;(&lt;/span&gt;args&lt;span style="color: #808030;"&gt;[&lt;/span&gt;&lt;span style="color: #008c00;"&gt;0&lt;/span&gt;&lt;span style="color: #808030;"&gt;]&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #3f5fbf;"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Do everything it takes to delete amazon S3 bucket. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Currently it means delete all versions of bucket keys.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; TODO&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;:&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;  &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Support distributed operation by doing shuffle on first level of bucketName&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;/&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;..&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;/&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;  &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Seek a method to obtain MFA to delete MFA enabled bucket&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;*&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;  &lt;/span&gt;&lt;span style="color: #7f9fbf; font-weight: bold;"&gt;-&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt; Implement starvation prevention for deleting threads (do not wait until next s3&lt;/span&gt;&lt;span style="color: #008c00;"&gt;.&lt;/span&gt;&lt;span style="color: #3f5fbf;"&gt;listVersions finishes)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3f5fbf;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: maroon; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #bb7977;"&gt;void&lt;/span&gt; destroyBucket&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; bucketName&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: dimgrey;"&gt;// Set up a new thread pool to delete 20 objects at a time.&lt;/span&gt;&lt;br /&gt;        ExecutorService _pool &lt;span style="color: #808030;"&gt;=&lt;/span&gt; Executors&lt;span style="color: #808030;"&gt;.&lt;/span&gt;newFixedThreadPool&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #008c00;"&gt;20&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: dimgrey;"&gt;// Get counter, just for status&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; AtomicInteger ATOMIC_INTEGER &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; AtomicInteger&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;        &lt;span style="color: dimgrey;"&gt;// List all key in the bucket&lt;/span&gt;&lt;br /&gt;        VersionListing versionListing &lt;span style="color: #808030;"&gt;=&lt;/span&gt; s3&lt;span style="color: #808030;"&gt;.&lt;/span&gt;listVersions&lt;span style="color: #808030;"&gt;(&lt;/span&gt;bucketName&lt;span style="color: #808030;"&gt;,&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;""&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #bb7977; font-weight: bold;"&gt;List&lt;/span&gt;&lt;span style="color: #808030;"&gt;&amp;lt;&lt;/span&gt;S3VersionSummary&lt;span style="color: #808030;"&gt;&amp;gt;&lt;/span&gt; versionSummaries &lt;span style="color: #808030;"&gt;=&lt;/span&gt; versionListing&lt;span style="color: #808030;"&gt;.&lt;/span&gt;getVersionSummaries&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;while&lt;/span&gt;&lt;span style="color: #808030;"&gt;(&lt;/span&gt;versionSummaries &lt;span style="color: #808030;"&gt;!&lt;/span&gt;&lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;null&lt;/span&gt; &lt;span style="color: #808030;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #808030;"&gt;&amp;amp;&lt;/span&gt; versionSummaries&lt;span style="color: #808030;"&gt;.&lt;/span&gt;size&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: #808030;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #008c00;"&gt;0&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; CountDownLatch latch &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; CountDownLatch&lt;span style="color: #808030;"&gt;(&lt;/span&gt;versionSummaries&lt;span style="color: #808030;"&gt;.&lt;/span&gt;size&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: maroon; font-weight: bold;"&gt;for&lt;/span&gt;&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;final&lt;/span&gt; S3VersionSummary objectSummary &lt;span style="color: #808030;"&gt;:&lt;/span&gt; versionSummaries&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                _pool&lt;span style="color: #808030;"&gt;.&lt;/span&gt;execute&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; Runnable&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                    &lt;span style="color: #808030;"&gt;@&lt;/span&gt;Override&lt;br /&gt;                    &lt;span style="color: maroon; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #bb7977;"&gt;void&lt;/span&gt; run&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; keyName &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;null&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; versionId &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;null&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: maroon; font-weight: bold;"&gt;try&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                            keyName &lt;span style="color: #808030;"&gt;=&lt;/span&gt; objectSummary&lt;span style="color: #808030;"&gt;.&lt;/span&gt;getKey&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                            versionId &lt;span style="color: #808030;"&gt;=&lt;/span&gt; objectSummary&lt;span style="color: #808030;"&gt;.&lt;/span&gt;getVersionId&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                            &lt;br /&gt;                            &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; info &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"&amp;gt;&amp;gt;&amp;gt;&amp;gt;   INFO: "&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; ATOMIC_INTEGER&lt;span style="color: #808030;"&gt;.&lt;/span&gt;incrementAndGet&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;" deleting: ("&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; bucketName &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"/"&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; keyName &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"@"&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; versionId &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;")"&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;out&lt;span style="color: #808030;"&gt;.&lt;/span&gt;println&lt;span style="color: #808030;"&gt;(&lt;/span&gt;info&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                            &lt;br /&gt;                            s3&lt;span style="color: #808030;"&gt;.&lt;/span&gt;deleteVersion&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: maroon; font-weight: bold;"&gt;new&lt;/span&gt; DeleteVersionRequest&lt;span style="color: #808030;"&gt;(&lt;/span&gt;bucketName&lt;span style="color: #808030;"&gt;,&lt;/span&gt; keyName&lt;span style="color: #808030;"&gt;,&lt;/span&gt; versionId&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: purple;"&gt;}&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;catch&lt;/span&gt; &lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #bb7977; font-weight: bold;"&gt;Exception&lt;/span&gt; e&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                            &lt;span style="color: #bb7977; font-weight: bold;"&gt;String&lt;/span&gt; err &lt;span style="color: #808030;"&gt;=&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"&amp;gt;&amp;gt;&amp;gt;&amp;gt; FAILED delete: ("&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; bucketName &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"/"&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; keyName &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;"@"&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; versionId &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;")"&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;err&lt;span style="color: #808030;"&gt;.&lt;/span&gt;println&lt;span style="color: #808030;"&gt;(&lt;/span&gt;err&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: purple;"&gt;}&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;finally&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                            latch&lt;span style="color: #808030;"&gt;.&lt;/span&gt;countDown&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;                        &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;                    &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;                &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;            &lt;span style="color: dimgrey;"&gt;// After sending current batch of delete tasks we block until Latch reaches zero, this &lt;/span&gt;&lt;br /&gt;            &lt;span style="color: dimgrey;"&gt;// allows to not over populate ExecutorService tasks queue. &lt;/span&gt;&lt;br /&gt;            &lt;span style="color: maroon; font-weight: bold;"&gt;try&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;                latch&lt;span style="color: #808030;"&gt;.&lt;/span&gt;await&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: purple;"&gt;}&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;catch&lt;/span&gt; &lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #bb7977; font-weight: bold;"&gt;Exception&lt;/span&gt; exception&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: dimgrey;"&gt;// Paging over all S3 keys...&lt;/span&gt;&lt;br /&gt;            versionListing &lt;span style="color: #808030;"&gt;=&lt;/span&gt; s3&lt;span style="color: #808030;"&gt;.&lt;/span&gt;listNextBatchOfVersions&lt;span style="color: #808030;"&gt;(&lt;/span&gt;versionListing&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            versionSummaries &lt;span style="color: #808030;"&gt;=&lt;/span&gt; versionListing&lt;span style="color: #808030;"&gt;.&lt;/span&gt;getVersionSummaries&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;        &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;        _pool&lt;span style="color: #808030;"&gt;.&lt;/span&gt;shutdown&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: maroon; font-weight: bold;"&gt;try&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: dimgrey;"&gt;// This code fails with HTTP 400 from aws API &lt;/span&gt;&lt;br /&gt;&lt;span style="color: dimgrey;"&gt;//            SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest = new SetBucketVersioningConfigurationRequest(bucketName, new BucketVersioningConfiguration().withStatus(BucketVersioningConfiguration.OFF));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: dimgrey;"&gt;//            s3.setBucketVersioningConfiguration(setBucketVersioningConfigurationRequest);&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: dimgrey;"&gt;// So we do this:&lt;/span&gt;&lt;br /&gt;            s3&lt;span style="color: #808030;"&gt;.&lt;/span&gt;deleteBucket&lt;span style="color: #808030;"&gt;(&lt;/span&gt;bucketName&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;out&lt;span style="color: #808030;"&gt;.&lt;/span&gt;println&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #0000e6;"&gt;"&amp;gt;&amp;gt;&amp;gt;&amp;gt;   INFO: bucket "&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; bucketName &lt;span style="color: #808030;"&gt;+&lt;/span&gt; &lt;span style="color: #0000e6;"&gt;" deleted!"&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: purple;"&gt;}&lt;/span&gt; &lt;span style="color: maroon; font-weight: bold;"&gt;catch&lt;/span&gt; &lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #bb7977; font-weight: bold;"&gt;Exception&lt;/span&gt; e&lt;span style="color: #808030;"&gt;)&lt;/span&gt; &lt;span style="color: purple;"&gt;{&lt;/span&gt; &lt;br /&gt;            &lt;span style="color: #bb7977; font-weight: bold;"&gt;System&lt;/span&gt;&lt;span style="color: #808030;"&gt;.&lt;/span&gt;err&lt;span style="color: #808030;"&gt;.&lt;/span&gt;println&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #0000e6;"&gt;"Failed to ultimately delete bucket: "&lt;/span&gt; &lt;span style="color: #808030;"&gt;+&lt;/span&gt; bucketName&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;            e&lt;span style="color: #808030;"&gt;.&lt;/span&gt;printStackTrace&lt;span style="color: #808030;"&gt;(&lt;/span&gt;&lt;span style="color: #808030;"&gt;)&lt;/span&gt;&lt;span style="color: purple;"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;&lt;span style="color: purple;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-955094616313064737?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/955094616313064737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2011/01/recursive-delete-utility-for-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/955094616313064737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/955094616313064737'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2011/01/recursive-delete-utility-for-version.html' title='Recursive delete utility for version enabled S3 bucket'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-7176057840850209398</id><published>2010-08-09T14:24:00.005+03:00</published><updated>2010-08-09T14:44:10.298+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='socks5'/><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='tunneling'/><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='aws'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='hadoop'/><title type='text'>Accessing hadoop web interface on AWS</title><content type='html'>Hadoop exports status interface via HTTP, using DNS names. &lt;br /&gt;Amazon uses internal DNS names in their AWS cloud. &lt;br /&gt;&lt;br /&gt;Therefor, should you request to access Hadoop status interface from outside the cloud (like your office pc... you will fail).&lt;br /&gt;&lt;br /&gt;This guide suggest a solution (using a claver work around) to this problem.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Problem Description&lt;/h2&gt;Hadoop builds status html pages &amp;amp; links based on current machine hostname. This hostname represents internal machine DNS name which is resolvable from within the AWS cloud using AWS internal DNS server: &lt;br /&gt;&lt;pre&gt;cat /etc/resolv.conf &lt;br /&gt;nameserver 172.16.0.23&lt;br /&gt;domain ec2.internal&lt;br /&gt;search ec2.internal &lt;/pre&gt;the problem here comes into existence when trying to access the status page from your development box (Office, home, mobile, telepathic...) here your machine will try to resolve ip-10-202-30-119.ec2.internal using your ISP DNS server, which will obviously fail.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;The solution to the above problem is to use a combination of several cool tricks in the basis of which stands SOCKS5 proxy. Let's get started:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install Firefox 3 &lt;a href="http://www.mozilla.com/firefox/"&gt;http://www.mozilla.com/firefox/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;FoxyProxy Standard is a proxy manipulation utility for firefox, install it from &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2464/"&gt;https://addons.mozilla.org/en-US/firefox/addon/2464/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Make the following configurations to FoxyProxy&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Right click on &lt;a href="http://4.bp.blogspot.com/_TlHOdIeMDOA/TF_oQQ3hNKI/AAAAAAAAAU4/KAS2VAV9Z08/s1600/foxy_proxy_options.png"&gt;foxy proxy Icon and choose options&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Choose "Add New Proxy"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;General&lt;/b&gt;&lt;br /&gt;&lt;tt&gt;Proxy Name&lt;/tt&gt; = AWS Internal&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Proxy Details&lt;/b&gt;&lt;br /&gt;Select * Manual proxy configuration&lt;br /&gt;&lt;tt&gt;Host or IP Address&lt;/tt&gt; = localhost &lt;tt&gt;Port&lt;/tt&gt; = 6666&lt;br /&gt;&lt;tt&gt;[v]&lt;/tt&gt; SOCKS proxy? &lt;tt&gt;(x)&lt;/tt&gt; SOCKS v5&lt;br /&gt;&lt;br /&gt;&lt;b&gt;URL Patterns&lt;/b&gt;&lt;br /&gt;Create 2 patterns: &lt;tt&gt;*ec2.internal*&lt;/tt&gt;, &lt;tt&gt;*domu*.internal*&lt;/tt&gt;&lt;br /&gt;* Tip: You might want to consider a 3rd patten if you are for example from Israel... &lt;tt&gt;*pandora.com*&lt;br /&gt;&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;Make sure you have selected "Use proxies based on their pre-defined patterns and priorities" from the FoxyProxy options menu.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;This step diverts for Windows &amp;amp; Linux users&lt;br /&gt;&lt;b&gt;Windows&lt;/b&gt;&lt;br /&gt;//TODO// Configure putty with dynamic tunning.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Linux&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;nohup ssh -CqTnN -D 6666 ubuntu@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;OK... now try to access &lt;a href="http://ip-10-202-30-119.ec2.internal:50070/dfshealth.jsp"&gt;http://ip-10-202-30-119.ec2.internal:50070/dfshealth.jsp&lt;/a&gt; you should be getting a nice GUI allowing you to browse your HDFS file system.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;How it works&lt;/h2&gt;&lt;br /&gt;You are creating using SSH protocol a socks proxy tunned over ssh. From one hand your ssh client accepts SOCKS5 proxy requests on port 6666 (localhost) and transfers them to the host inside AWS cloud. Your firefox is set to do requests for *patten* which matches internal host names inside AWS cloud over a proxy (using foxyproxy). So what happens is the following:&lt;br /&gt;&lt;br /&gt;Firefox: "Hmmm, I need to do HTTP GET for ip-10-202-30-119.ec2.internal" - Who should I be talking to? OH! I know, foxyproxy tells me I should delegate this to my friends, the socks5 proxy at localhost:6666, cool.&lt;br /&gt;Firefox: Hey localhost:6666 (socks5 proxy), do me a favor, get me the content for ip-10-202-30-119.ec2.internal:50070&lt;br /&gt;localhost:6666: Hmmm, ok. &lt;br /&gt;localhost:6666 -&amp;gt; ssh -&amp;gt; ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com &lt;br /&gt;ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com: HTTP GET http://ip-10-202-30-119.ec2.internal:50070&lt;br /&gt;ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com: Hey, I know him. let me do a quick http get on his ass&lt;br /&gt;ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com: HTTP GET 10.202.30.119:50070&lt;br /&gt;ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com -&amp;gt; ssh -&amp;gt; localhost:6666 -&amp;gt; Firefox&lt;br /&gt;&lt;br /&gt;This completes the cycle. At this point (skipped a few for clerity) you, the user, can the context of the HTTP GET request. &lt;br /&gt;&lt;br /&gt;Mission accomplished.&lt;br /&gt;&lt;br /&gt;Note that other DNS address (not from the aws ec2 cloud) are not being served over the socks proxy, for example if you go to http://google.com you get a direct hit by the browser - Which is exactly what you want to happens because traffic that goes via proxy has it's costs (bandwidth, latency).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope you enjoyed this, comments (as always) are welcome.&lt;br /&gt;Maxim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-7176057840850209398?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/7176057840850209398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/08/accessing-hadoop-web-interface-on-aws.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/7176057840850209398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/7176057840850209398'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/08/accessing-hadoop-web-interface-on-aws.html' title='Accessing hadoop web interface on AWS'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-794414441400990954</id><published>2010-07-31T21:33:00.008+03:00</published><updated>2010-07-31T21:42:45.248+03:00</updated><title type='text'>Ubuntu perfect setup for Java Developers</title><content type='html'>&lt;div id="waveframe" style="height:1200px;"&gt;&lt;/div&gt;&lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt; google.load("wave", "1"); google.setOnLoadCallback(function() { new google.wave.WavePanel({target: document.getElementById("waveframe")}).loadWave("googlewave.com!w+OaewlYLFA");}); &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-794414441400990954?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/794414441400990954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/07/ubuntu-perfect-setup-for-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/794414441400990954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/794414441400990954'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/07/ubuntu-perfect-setup-for-java.html' title='Ubuntu perfect setup for Java Developers'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-8179270868451768937</id><published>2010-07-13T12:56:00.004+03:00</published><updated>2010-07-14T01:16:01.146+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='log'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>MySQL General Query Log Filtering using grep and regular expressions</title><content type='html'>MYSQL has a very useful feature called &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/query-log.html"&gt;Query Log&lt;/a&gt;&amp;nbsp;which allows you among other things to debug your application code by viewing DB DML's submitted live from the application&amp;nbsp;straight&amp;nbsp;into DB&amp;nbsp;back-end&amp;nbsp;(Low level, the best!).&lt;br /&gt;&lt;br /&gt;To configure this little joy you will need to play a bit with your mysql server settings.&lt;br /&gt;&lt;br /&gt;Edit your my.cnf file (Under debian that is /etc/mysql/my.cnf) in the section of &lt;br /&gt;&lt;pre&gt;[mysqld]&lt;/pre&gt;add &lt;br /&gt;&lt;pre&gt;log=/var/log/mysql/query.log&lt;/pre&gt;This is explained in greater details at&amp;nbsp;&lt;a href="http://techchorus.net/enable-mysql-general-query-and-slow-query-log"&gt;this post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now the thing is query log as the name suggests logs everything that has SQL smell on it and I do mean&amp;nbsp;&lt;b&gt;EVERYTHING&lt;/b&gt;&amp;nbsp;(besides CRUD operations you will see: commit/rollbacks, show tables, use DB-XYZ and co.) - Which is mostly junk when the only thing you really need is to trace your hibernate based Console save to get the&amp;nbsp;back-end&amp;nbsp;integration going... To summarize in a catch phrase: You wan't to filter out the log spam when debugging your application (vs. your replication ;).&lt;br /&gt;&lt;br /&gt;To be more efficient and be able to look at the logs in real time I've created a fast and dirty regex. The following chain of piped grep's will leave you only with INSERT, UPDATE, DELETE&amp;nbsp;statements which is exactly what I was after (Your mileage might vary).&lt;br /&gt;&lt;br /&gt;One would use something like this: &lt;br /&gt;&lt;code&gt;tailf /var/log/mysql/query.log | grep -E '[[:space:]]+[[:digit:]]+[[:space:]]Query' | grep -ivE 'Query([[:space:]])+(/\*.*\*/)?(select|set|show|commit|rollback|use)' &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The&amp;nbsp;command&amp;nbsp;works by constantly (tail&lt;b&gt;f&lt;/b&gt;) pushing events from mysql query.log throw the 2 greps which do some smarty ass filtering to leave you with the interesting part. If you need other command (SELECT for example) you can remove them from the second grep section. If you want to see just a single table add another 3'rd grep to the chain and filter just by table name.&lt;br /&gt;&lt;br /&gt;Comments are welcome.&lt;br /&gt;&lt;br /&gt;Enjoy,&lt;br /&gt;Maxim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-8179270868451768937?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/8179270868451768937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/07/mysql-query-log-insert-and-update-regex.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8179270868451768937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8179270868451768937'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/07/mysql-query-log-insert-and-update-regex.html' title='MySQL General Query Log Filtering using grep and regular expressions'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-1900327579842621665</id><published>2010-06-19T13:08:00.001+03:00</published><updated>2010-06-19T13:11:03.849+03:00</updated><title type='text'>Eclipse 3.6 Helios - Final version available for download</title><content type='html'>I don't know what's so special about &lt;a href="http://wiki.eclipse.org/Helios/Summary_of_Helios_Projects"&gt;this build&lt;/a&gt; from &lt;a href="http://eclipse.org/"&gt;eclipse.org&lt;/a&gt; foundation but for some reason the&lt;a href="http://www.eclipse.org/helios/"&gt;&amp;nbsp;excitement&amp;nbsp;is high&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Well friends, without further adieu I give you the path to the final release download location &lt;a href="http://wiki.eclipse.org/Helios_Simultaneous_Release#Milestones_and_Release_Candidates"&gt;4 days before the official release schedule&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Check it out from here&amp;nbsp;&lt;a href="http://mirrors.xmission.com/eclipse/technology/epp/downloads/release/helios/R/"&gt;http://mirrors.xmission.com/eclipse/technology/epp/downloads/release/helios/R/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-1900327579842621665?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/1900327579842621665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/06/eclipse-36-helios-final-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/1900327579842621665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/1900327579842621665'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/06/eclipse-36-helios-final-version.html' title='Eclipse 3.6 Helios - Final version available for download'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-1152983970696586973</id><published>2010-04-01T10:27:00.002+03:00</published><updated>2010-04-01T10:29:48.695+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fuzzy logic'/><category scheme='http://www.blogger.com/atom/ns#' term='dev'/><category scheme='http://www.blogger.com/atom/ns#' term='heuristics'/><category scheme='http://www.blogger.com/atom/ns#' term='user-agent'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>In the working for automatic User Agent Detecting algorithem</title><content type='html'>I'm thinking about writing a tool that will extract information from User-Agent strings.&lt;br /&gt;&lt;br /&gt;In the mean time, here is a quite comprehensive list of tools I've been able to find around the net that can assist me in this task&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tone of links for known User Agent strings &lt;br /&gt;&lt;br /&gt;DB:&lt;br /&gt;&lt;a href="http://www.useragentstring.com/"&gt;http://www.useragentstring.com/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.user-agents.org/index.shtml?moz"&gt;http://www.user-agents.org/index.shtml?moz&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.icehousedesigns.com/useragents/spiderlist.php"&gt;http://www.icehousedesigns.com/useragents/spiderlist.php&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.botsvsbrowsers.com/"&gt;http://www.botsvsbrowsers.com/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://useragentstring.com/pages/useragentstring.php"&gt;http://useragentstring.com/pages/useragentstring.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Auto detection tools:&lt;br /&gt;&lt;a href="http://nerds.palmdrive.net/useragent/code.html"&gt;http://nerds.palmdrive.net/useragent/code.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/1005153/auto-detect-mobile-browser-via-user-agent"&gt;http://stackoverflow.com/questions/1005153/auto-detect-mobile-browser-via-user-agent&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mdbf.codeplex.com/"&gt;http://mdbf.codeplex.com/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://detectmobilebrowser.com/"&gt;http://detectmobilebrowser.com/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/2508214/regexp-that-matches-user-agents-of-end-user-browsers-but-not-crawlers-with-90"&gt;http://stackoverflow.com/questions/2508214/regexp-that-matches-user-agents-of-end-user-browsers-but-not-crawlers-with-90&lt;/a&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/927552/parsing-http-user-agent-string"&gt;http://stackoverflow.com/questions/927552/parsing-http-user-agent-string&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.djangosnippets.org/snippets/267/"&gt;http://www.djangosnippets.org/snippets/267/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://browsers.garykeith.com/downloads.asp"&gt;http://browsers.garykeith.com/downloads.asp&lt;/a&gt;&lt;br /&gt;&lt;a href="http://user-agent-string.info/"&gt;http://user-agent-string.info/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://pypi.python.org/pypi/httpagentparser"&gt;http://pypi.python.org/pypi/httpagentparser&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.handsetdetection.com/"&gt;http://www.handsetdetection.com/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.tnl.net/ua/OS/Cross-Platform"&gt;http://www.tnl.net/ua/OS/Cross-Platform&lt;/a&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/1005153/auto-detect-mobile-browser-via-user-agent"&gt;http://stackoverflow.com/questions/1005153/auto-detect-mobile-browser-via-user-agent&lt;/a&gt;&lt;br /&gt;&lt;a href="http://api.jquery.com/jQuery.browser/#jQuery.browser.version2"&gt;http://api.jquery.com/jQuery.browser/#jQuery.browser.version2&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.quirksmode.org/js/detect.html"&gt;http://www.quirksmode.org/js/detect.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;INFO:&lt;br /&gt;&lt;a href="http://www.nczonline.net/blog/2010/01/12/history-of-the-user-agent-string/"&gt;http://www.nczonline.net/blog/2010/01/12/history-of-the-user-agent-string/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you know any other resources that can help please post in comments. &lt;br /&gt;I will update this post as soon as I have some news on the subject.&lt;br /&gt;&lt;br /&gt;Thank you,&lt;br /&gt;Maxim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-1152983970696586973?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/1152983970696586973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/04/in-working-for-automatic-user-agent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/1152983970696586973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/1152983970696586973'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/04/in-working-for-automatic-user-agent.html' title='In the working for automatic User Agent Detecting algorithem'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-8364777735024135849</id><published>2010-01-20T10:47:00.002+02:00</published><updated>2010-01-20T10:48:22.368+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='it'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Resetting cached password of Subclipse</title><content type='html'>&lt;i&gt;I was asked to document a FAQ about Subclipse and cached passwords (my turn to play with the IT hat!). Here is the email (kept here for future reference).&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hello Friends,&lt;br /&gt;&lt;br /&gt;Eclipse subversion plugin (Subclipse) will cache the username &amp; password of the last user that did a successful commit with your eclipse installation. &lt;br /&gt;This can be problematic if this user is not you, it turns out that until further notice all your svn commits will be under different username.&lt;br /&gt;&lt;br /&gt;To resolve this issue, delete the following 2 folders:&lt;br /&gt;rm -rf /opt/eclipse3.3/configuration/org.eclipse.core.runtime/.keyring&lt;br /&gt;rm -rf ~/.subversion/&lt;br /&gt;Then restart eclipse.&lt;br /&gt;&lt;br /&gt;An alternative solution would be to kindly ask the busy IT department to change the svn password of the user under which your commits are being executed, then on first commit attempt Eclipse should prompt your for username &amp; password, which will allow you to input your information.&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://nlp.cs.byu.edu/~rah67/wordpress/?p=4"&gt;http://nlp.cs.byu.edu/~rah67/wordpress/?p=4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Maxim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-8364777735024135849?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/8364777735024135849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/01/resetting-cached-password-of-subclipse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8364777735024135849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8364777735024135849'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/01/resetting-cached-password-of-subclipse.html' title='Resetting cached password of Subclipse'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-701014062766510793</id><published>2010-01-17T18:45:00.001+02:00</published><updated>2010-01-17T18:46:04.095+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='simple-math'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><title type='text'>Running Average calculation implementation in Java</title><content type='html'>Quick blog and store note:&lt;br /&gt;&lt;br /&gt;Here is a code to calculate average series of length N without the problem of overflow that naive average calculation could face.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;/**&lt;br /&gt;* Copyright (c) 2010, Maxim Veksler &lt;maxim.veksler@gmail-NO-SPAM-.com&gt;&lt;br /&gt;* All rights reserved.&lt;br /&gt;*&lt;br /&gt;* Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;* are permitted provided that the following conditions are met: &lt;br /&gt;* &lt;br /&gt;* Redistributions of source code must retain the above copyright notice, this list&lt;br /&gt;* of conditions and the following disclaimer.&lt;br /&gt;* &lt;br /&gt;* Redistributions in binary form must reproduce the above copyright notice, &lt;br /&gt;* this list of conditions and the following disclaimer in the documentation&lt;br /&gt;* and/or other materials provided with the distribution. Neither the name&lt;br /&gt;* of the http://bytecoded.blogspot.com/ nor the names of its contributors&lt;br /&gt;* may be used to endorse or promote products derived from this software &lt;br /&gt;* without specific prior written permission.&lt;br /&gt;* &lt;br /&gt;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"&lt;br /&gt;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&lt;br /&gt;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE&lt;br /&gt;* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR&lt;br /&gt;* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF&lt;br /&gt;* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS&lt;br /&gt;* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN&lt;br /&gt;* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)&lt;br /&gt;* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF&lt;br /&gt;* THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Calculate average of arbitrary length series of doubles, running average ensures &lt;br /&gt;* result won't overflow.&lt;br /&gt;* &lt;br /&gt;* Algorithm: CELLCOUNT represents number of cells calculated so far. &lt;br /&gt;* For each : cell&lt;br /&gt;*  avg =  ((CELLCOUNT-1) * avg) + ((1/CELLCOUNT) * avg)&lt;br /&gt;* &lt;br /&gt;* @param series vararg list of parameters (array of doubles).&lt;br /&gt;* @return Average calculated from supplied series.&lt;br /&gt;*/&lt;br /&gt;public static double movingAverage(double... series) {&lt;br /&gt;if(series.length &lt; 1) {&lt;br /&gt;   return 0;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  double avg = series[0];&lt;br /&gt;  for(int i = 1; i &lt; series.length; i++) {&lt;br /&gt;   avg = (avg * ((double)i/(i+1))) + (series[i] * ((double)1/(i+1)));&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  return avg;&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-701014062766510793?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/701014062766510793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2010/01/running-average-calculation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/701014062766510793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/701014062766510793'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2010/01/running-average-calculation.html' title='Running Average calculation implementation in Java'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-7871325691867921914</id><published>2009-12-15T13:59:00.007+02:00</published><updated>2009-12-26T14:21:41.446+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jasper-reports'/><category scheme='http://www.blogger.com/atom/ns#' term='demo'/><category scheme='http://www.blogger.com/atom/ns#' term='guide'/><title type='text'>Jasper Reports - Subreport usage demonstration</title><content type='html'>&lt;h5&gt;This post is part of &lt;a href="http://bytecoded.blogspot.com/2009/12/jasper-reports-demo-files-index.html"&gt;Jasper Reports demo documentation project&lt;/a&gt;, please read that post for information on downloading the discussed demo files&lt;/h5&gt;&lt;h4&gt;jasperreports-3.7.0/demo/samples/subreport&lt;/h4&gt;This demonstration will teach you how to reuse sub-reports for enhancing report visual layout. Subreports among other things allow you to&amp;nbsp;achieve&amp;nbsp;high level of data presentation complexity with&amp;nbsp;relatively&amp;nbsp;small overhead.&lt;br /&gt;&lt;br /&gt;a &lt;b&gt;Subreport&lt;/b&gt; in Jasper terminology is single jrxml report file which is designed to be included in a master report, the master report should pass parameters to the subreport (For ex. rowId or street address) which are accessed by the subreport using &lt;i&gt;$P{"parameterName"}&lt;/i&gt; notation. Optional feature for subreport is return parameters which allow passing information from calculations done within the subreport back to the master report, under the hood these are variables which are defined in the master report and passed to the subreport element (we will see an example of this later in the post).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Lets start with the basics setup required to get the report demo running:&lt;br /&gt;&lt;br /&gt;First you will need to &lt;a href="http://bytecoded.blogspot.com/2009/12/jasper-reports-hsqldb-database-startup.html"&gt;start the hsqldb database&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Next open all 3 reports in iReports.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MasterReport.jrxml&lt;/li&gt;&lt;li&gt;ProductReport.jrxml&lt;/li&gt;&lt;li&gt;AddressReport.jrxml &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Test the report is working:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In iReports, assuming you followed the hsqlsdb setup guide you should select "jdbc:hsqldb:hsql://localhost" as your datasource.&lt;/li&gt;&lt;li&gt;Make sure you have focus on the MasterReport tab&lt;/li&gt;&lt;li&gt;Now click "Preview"&lt;/li&gt;&lt;ol&gt;&lt;li&gt;In the popup windows select "Use Default"&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;This should bring a &lt;b&gt;semi-working&lt;/b&gt; report that looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TlHOdIeMDOA/SydN57C28nI/AAAAAAAAAQw/lEQhEMwOv5A/s1600-h/report.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_TlHOdIeMDOA/SydN57C28nI/AAAAAAAAAQw/lEQhEMwOv5A/s320/report.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;To configure a fully functional we will need to do some adjustment steps, as we are operating the report from iReport instead from Java code.&lt;br /&gt;&lt;br /&gt;MasterReport has has a parameter called &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProductsSubreport&lt;/span&gt; of type &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;net.sf.jasperreports.engine.JasperReport &lt;/span&gt;this parameter can be used in production environment to dynamically supply the subreport &lt;b&gt;Class Instance&lt;/b&gt; that will be used by one of this subreport elements (more on this later). For now, lets change this to supply a fixed sub report element so that we can preview the full report in iReports as Jasper team designed it.&lt;br /&gt;&lt;br /&gt;Locate in iReports the element's:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;MasterReport -&amp;gt; Details 1 -&amp;gt; $P{ProductsSubreport}&lt;/span&gt; then set the following fields:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Subreport Expression = "ProductReport.jasper"&lt;/li&gt;&lt;li&gt;Expression Class = java.lang.String&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;MasterReport -&amp;gt; Parameters -&amp;gt; ProductsSubreport&lt;/span&gt; then set the following fields:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Use as a prompt = [ ] (unselected)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now if you try to preview the report again the following will be shown:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_TlHOdIeMDOA/SydUjTBn4TI/AAAAAAAAAQ4/skhunZVeNNc/s1600-h/report2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_TlHOdIeMDOA/SydUjTBn4TI/AAAAAAAAAQ4/skhunZVeNNc/s320/report2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;b&gt;Good!&lt;/b&gt; The report is fully operation. Lets start analyzing.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h4&gt;Understanding Report logical Structure&lt;br /&gt;&lt;/h4&gt;This report prints product orders grouped by city. The report layout is as following:&lt;br /&gt;&lt;br /&gt;== Report Title =&lt;br /&gt;&amp;nbsp;Heading + Total number of orders&lt;br /&gt;== Page Title == &lt;br /&gt;Page Heading&lt;br /&gt;== Details == &lt;br /&gt;= First page =&lt;br /&gt;City name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;COUNTER&lt;/b&gt;: Number of address ordered in this city&lt;br /&gt;= Next n pages =&lt;br /&gt;City name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cont&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then 2 lists order side by side displaying:&lt;br /&gt;First list =&amp;nbsp; Products ordered by people in current city&lt;br /&gt;Second list = Address that made orders in current city&lt;br /&gt;&lt;br /&gt;== Page Footer ==&lt;br /&gt;Page X out of XXX &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Understanding Report JRXML structure&lt;/h4&gt;&lt;h5&gt;MasterReport.jrxml&lt;/h5&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Master Report :: Query&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The main report is based on the following SQL query: &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT City FROM Address GROUP BY City ORDER BY City&lt;/span&gt; which should self explentionary.&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Master Report -&amp;gt; Title&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;This section contains static text and a graphical horizontal bar.&lt;br /&gt;&lt;br /&gt;Pay attention to the Text Field that as part of his expression uses the dynamically calculated variable &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$V{ProductTotalPrice}&lt;/span&gt; this variable is returned from the sub reports called during report filling phase and the results are summarized by the engine. More on this later.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Master Report -&amp;gt; Page Header&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Nothing special here. Static text that will be printed at the start of each page.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Master Report -&amp;gt; Details 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;The heart of the report.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;It is important to understand that a details band can grow beyond single page size, Jasper has special treatment for these situation via settings which can be set on each element as we shall see next:&lt;br /&gt;&lt;br /&gt;On the first page we want to print &lt;i&gt;"CityName"&amp;nbsp; COUNTER Addresses&lt;/i&gt;, on the following pages for the same city OTOH all we want to print is  &lt;i&gt;"CityName"&amp;nbsp; cont&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The idea is that if a city band grows to several pages we will reprint the "CityName" and the text "Cont"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;u&gt;TextField&lt;/u&gt; $F{City}&lt;/span&gt; has the setting &lt;b&gt;Print Repeated Values&lt;/b&gt; and &lt;b&gt;Print When Details Overflows&lt;/b&gt; which causes it repeat on each page, even when the band for current city grows beyond 1 page size.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;u&gt;TextField&lt;/u&gt; &lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$V{CityAddressCount} + " addresses"&lt;/span&gt; has the setting &lt;b&gt;Print Repeated Values&lt;/b&gt; which will allow this field to be printed even if 2 cities have the same number of addresses but note this &lt;b&gt;Print When Details Overflows&lt;/b&gt; is turned off which causes this text to be printed only on the first page of the band !&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;u&gt;Label&lt;/u&gt; (continued)&lt;/span&gt; has the setting &lt;b&gt;Print Repeated Values&lt;/b&gt; turned off and &lt;b&gt;Print When Details Overflows&lt;/b&gt; enabled. This cause this label to be printed only on overflowed bands (meaning only on 2nd pages and following...).&lt;br /&gt;&lt;br /&gt;&lt;u style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Subreport&lt;/u&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; $P{ProductsSubreport}&lt;/span&gt; is the embedding of the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProductReport&lt;/span&gt; subreport. Note this report gets the Database connection from the MasterReport, we also pass a parameter to this report &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;City&lt;/span&gt; &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;= $F{City}&lt;/span&gt;. This report returns a variable, the way this is implement in Jasper Reports is as following: We define a variable in the master report &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProductTotalPrice&lt;/span&gt;, then we pass this variable to the subreport which sets values into this variable. Then, after the subreport evaluation has ended in the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;MasterReport&lt;/span&gt; we can use this variables value. In the present context we use this method to calculate a summary (TOTAL) of the price of all the products being evaluated by the subreport. Note that as part of the definition of the variable on the subreport element we configure &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Calculation Type = Sum&lt;/span&gt; this allows the engine to do the summary of this variable (which is passed to many subreport's - A subreport is evaluated for each city). See Variables section for another note on the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProductTotalPrice &lt;/span&gt;variable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Master Report -&amp;gt; Variables&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProductTotalPrice&lt;/span&gt; this variable is used by the MasterReport to display the sum of the price of all products that have been evaluated by the subreport &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProductReport &lt;/span&gt;note this variable has the property Calculation = System meaning that it is being manipulated separately (not by the engine). This is actually a little hack (IMHO) because we do sum it using the engine only we do it on the &lt;u style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Subreport&lt;/u&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; $P{ProductsSubreport} &lt;/span&gt;variable configuration properties. Just in case you wondered: Yes! it works.&lt;br /&gt;&lt;br /&gt;&lt;h5&gt;ProductReport.jrxml&lt;/h5&gt;To be continued...&lt;br /&gt;&lt;h5&gt;AddressReport.jrxml&lt;/h5&gt;To be continued...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-7871325691867921914?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/7871325691867921914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/12/jasperreports-370demosamplessubreport.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/7871325691867921914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/7871325691867921914'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/12/jasperreports-370demosamplessubreport.html' title='Jasper Reports - Subreport usage demonstration'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TlHOdIeMDOA/SydN57C28nI/AAAAAAAAAQw/lEQhEMwOv5A/s72-c/report.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-5181854244139955081</id><published>2009-12-14T18:44:00.019+02:00</published><updated>2009-12-26T14:25:09.917+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jasper-reports'/><category scheme='http://www.blogger.com/atom/ns#' term='guide'/><category scheme='http://www.blogger.com/atom/ns#' term='intro'/><title type='text'>Jasper Reports hsqldb database setup</title><content type='html'>&lt;h5&gt;This post is part of &lt;a href="http://bytecoded.blogspot.com/2009/12/jasper-reports-demo-files-index.html"&gt;Jasper Reports demo documentation project&lt;/a&gt;, please read that post for information on downloading the discussed demo files&lt;/h5&gt;Jasper Report distribution comes with a sample database populated with data which proves to be as useful as it can be for running the supplied demo reports / testing concepts before implementing in production environments.&lt;br /&gt;&lt;br /&gt;To use this database you will need to&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Have it up and running&lt;/li&gt;&lt;li&gt;Configure the connection in iReports&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;On a linux box this is straight forward as explained below (Win/OSX and others should have similar guide lines).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Have HSqlDB it up and running&lt;/h4&gt;&lt;i&gt;&lt;span style="font-size: x-small;"&gt;// Demonstrated for iReports, JasperReports v3.7.0&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Open up a terminal windows and issue the following commands:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$ cd JasperReports/jasperreports-3.7.0/demo/hsqldb/&lt;br /&gt;$ ant&lt;/code&gt; &lt;br /&gt;&lt;br /&gt;You will see output similar to this&lt;br /&gt;&lt;pre&gt;Buildfile: build.xml&lt;br /&gt;&lt;br /&gt;runServer:&lt;br /&gt;[java] [Server@15c7850]: [Thread[main,5,main]]: checkRunning(false) entered&lt;br /&gt;[java] [Server@15c7850]: [Thread[main,5,main]]: checkRunning(false) exited&lt;br /&gt;[java] [Server@15c7850]: Startup sequence initiated from main() method&lt;br /&gt;[java] [Server@15c7850]: Loaded properties from [/home/maximv/Desktop/JasperReports/jasperreports-3.7.0/demo/hsqldb/server.properties]&lt;br /&gt;[java] [Server@15c7850]: Initiating startup sequence...&lt;br /&gt;[java] [Server@15c7850]: Server socket opened successfully in 4 ms.&lt;br /&gt;[java] [Server@15c7850]: Database [index=0, id=0, db=file:test, alias=] opened sucessfully in 607 ms.&lt;br /&gt;[java] [Server@15c7850]: Startup sequence completed in 612 ms.&lt;br /&gt;[java] [Server@15c7850]: 2009-12-14 18:32:33.542 HSQLDB server 1.8.0 is online&lt;br /&gt;[java] [Server@15c7850]: To close normally, connect and execute SHUTDOWN SQL&lt;br /&gt;[java] [Server@15c7850]: From command line, use [Ctrl]+[C] to abort abruptly&lt;/pre&gt;&lt;br /&gt;That's it. Keep the terminal window open otherwise the DB will shutdown. The database can be accessed locally using the &lt;br /&gt;&lt;br /&gt;Path: &lt;code&gt;jdbc:hsqldb:hsql://localhost&lt;/code&gt; &lt;br /&gt;Username: &lt;b&gt;sa&lt;/b&gt;&lt;br /&gt;Password: "" (blank, no password).&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Configure the HSqlDB connection in iReports&lt;/h4&gt;&lt;br /&gt;&lt;div&gt;In iReports the setup is as follows:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Click the new data source connection button:&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_TlHOdIeMDOA/SyZ0exE_h3I/AAAAAAAAAQQ/t51T7ccBmG4/s400/14-12-2009+19-11-31.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click the new connection&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_TlHOdIeMDOA/SyZ12Z89BZI/AAAAAAAAAQY/sjLuQzqC-KE/s400/14-12-2009+19-19-26.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Configure connection to the hsqldb datasource&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_TlHOdIeMDOA/SyZ24qgb2GI/AAAAAAAAAQg/Olf_THv_PJo/s400/14-12-2009+19-19-00.png" /&gt;&lt;br /&gt;&lt;br /&gt;That is&lt;br /&gt;&lt;br /&gt;JDBC Driver = HSQLDB (server) (org.hsqldb.jdbcDriver)&lt;br /&gt;JDBC URL = jdbc:hsqldb:hsql://localhost&lt;br /&gt;&lt;br /&gt;Username = sa&lt;br /&gt;Password =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([V] Save password)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Test the connection is working.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After configuring the connection you should click the "Test" button, if everything goes well the following popup windows will confirm this.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_TlHOdIeMDOA/SyZ250FRbjI/AAAAAAAAAQo/NVwd7dLD06I/s400/14-12-2009+19-19-44.png" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-5181854244139955081?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/5181854244139955081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/12/jasper-reports-hsqldb-database-startup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/5181854244139955081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/5181854244139955081'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/12/jasper-reports-hsqldb-database-startup.html' title='Jasper Reports hsqldb database setup'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TlHOdIeMDOA/SyZ0exE_h3I/AAAAAAAAAQQ/t51T7ccBmG4/s72-c/14-12-2009+19-11-31.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-4493877571501999886</id><published>2009-12-14T18:14:00.011+02:00</published><updated>2009-12-26T14:06:42.013+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jasper-reports'/><category scheme='http://www.blogger.com/atom/ns#' term='free-software'/><category scheme='http://www.blogger.com/atom/ns#' term='guide'/><category scheme='http://www.blogger.com/atom/ns#' term='reporting'/><title type='text'>Jasper Reports demo documentation project</title><content type='html'>&lt;a href="http://jasperforge.org/"&gt;Jasper Reports&lt;/a&gt; is one of several well known and well established open source reporting frameworks.&lt;br /&gt;&lt;br /&gt;One thing it lacks badly is good documentation, I believe it's a safe claim that anything beyond the regular most basic report structure will throw you straight into googling, example files and forum posts. &lt;a href="http://jasperforge.org/projects/ireport"&gt;iReport &lt;/a&gt;will help, &lt;a href="http://www.jaspersoft.com/ultimate-guides"&gt;documentation&lt;/a&gt; will be somewhat helpful as well, but do be prepared for the moment when even these paths fail, that's when you will stand at the face of either commercial support or diving into the &lt;a href="http://jasperforge.org/projects/jasperreports/code"&gt;code&lt;/a&gt; of the engine.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Downloading the demo jrxml files&lt;/h4&gt;To help the community a little bit, I'm starting a little documentation project for the examples supplied with Jasper Reports source distribution which can be obtained by checking out the source code or by downloading the latest dist from &lt;a href="http://sourceforge.net/projects/jasperreports/"&gt;here&lt;/a&gt;. All this in the hope to lower the learning curve and allow easier adoption&amp;nbsp;by casual report dev folks.&lt;br /&gt;&lt;br /&gt;Several more source of information for Jasper Report Developers&lt;br /&gt;&lt;ul&gt;&lt;li&gt;J&lt;a href="http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/schema.reference.html"&gt;asperReports 3.7.0 - Schema Reference&lt;/a&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.themeswiki.org/Designing_reports_using_JasperReports_3.5"&gt;Designing reports using JasperReports 3.5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Generally speaking &lt;a href="http://stackoverflow.com/questions/tagged/jasper-reports"&gt;StackOverflow jasper-reports tag&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Jasper Reports Demo files Index&lt;/h4&gt;&lt;span style="font-size: x-small;"&gt;Written guides are hyper-linked - This is work in progress I will be editing this post as more guides are published.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;[maximv@mldev2 JasperReports]$ find jasperreports-3.7.0/demo/samples/ -maxdepth 1 -mindepth 1 -type d | sort&lt;/code&gt;&lt;ul&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/alterdesign&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/antcompile&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/barbecue&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/barcode4j&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/batchexport&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/beanshell&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/charts&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/chartthemes&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/crosstabs&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/csvdatasource&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/datasource&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/ejbql&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/fonts&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/genericelement&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/groovy&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/hibernate&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/horizontal&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/hyperlink&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/i18n&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/images&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/jasper&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/java1.5&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/javascript&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/jcharts&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/jchartscomponent&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/jexcelapi&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/jfreechart&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/landscape&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/list&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/markup&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/mondrian&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/nopagebreak&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/noreport&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/noxmldesign&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/openflashchart&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/pdfencrypt&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/poi-3.5&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/printservice&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/query&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/rotation&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/scriptlet&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/shapes&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/stretch&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/styledtext&lt;/li&gt;&lt;li&gt;&lt;a href="http://bytecoded.blogspot.com/2009/12/jasperreports-370demosamplessubreport.html"&gt;jasperreports-3.7.0/demo/samples/subreport&lt;/a&gt;&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/table&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/tableofcontents&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/templates&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/text&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/unicode&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/virtualizer&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/webapp&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/xlsdatasource&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/xlsformula&lt;/li&gt;&lt;li&gt;jasperreports-3.7.0/demo/samples/xmldatasource&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-4493877571501999886?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/4493877571501999886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/12/jasper-reports-demo-files-index.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/4493877571501999886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/4493877571501999886'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/12/jasper-reports-demo-files-index.html' title='Jasper Reports demo documentation project'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-4997105070456478932</id><published>2009-01-31T13:55:00.008+02:00</published><updated>2009-01-31T17:56:56.820+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='template'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><category scheme='http://www.blogger.com/atom/ns#' term='blogspot'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Blog Template Hacking</title><content type='html'>I will probably be hacking the blog template from time to time, you can find the source of it hosted at &lt;a href="http://code.google.com/p/bytecoded-blooger-com/source/browse/trunk/blogTemplate/template-566351192911506928.xml.xml"&gt;this google code repository&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For those few that are not familiar with concept of &lt;a href="http://en.wikipedia.org/wiki/Revision_control"&gt;Revision Control&lt;/a&gt; I will describe briefly why I choose to use it here, which should also explain the general idea behind the concept.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I will be hacking the template of the blog, this means I will be modifying the "code" of my blog, the reason I want to do this is simple: It affects the way you see it. This "code" is parsed by blogger backend server and rendered into HTML which is later parsed by your browser and displayed to your eyes (which by the way goes another parsing and interpretation by your brain before you can actually "see"/ "read" my blog). Parsing is the process of "understanding" a known format.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, due to the known fact that there is no software without bugs. Hacking surly means introducing bugs, considering the fact that I've never edited blogger templates before- The bug factor is even higher. Further more, bugs are here forever or as the saying goes "To err is human, to fix it divine" (A remix of Alexander Pope famous quote "To err is human, to forgive divine" by your humble).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To tackle this bug fixing process in a more profound process, one of the best techniques is going back step by step attempting to isolate what exactly caused the wrong behavior (the bug). This is where revision control system comes in- It allows you to retrieve older versions of the file, further more it allows you to display a difference between 2 versions of the same file in an easily accessible interface. This fits into the previously introduced metaphor of bug tackling: start from something that worked, search revision by revision until you find what broke it, understand why it's broken, fix the problem, ensure the fix works. Some folks forgot the import step of Learn from the error and think how to avoid it next time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can open your own Google code repository at the following link &lt;a href="http://code.google.com/"&gt;Google Code&lt;/a&gt;, as for document revisioning, you can do the same thing using &lt;a href="http://docs.google.com/"&gt;Google Docs&lt;/a&gt; which allows out of the box "History" of your document modifications.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-4997105070456478932?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/4997105070456478932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/01/blog-template-hacking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/4997105070456478932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/4997105070456478932'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/01/blog-template-hacking.html' title='Blog Template Hacking'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-3931534951340591792</id><published>2009-01-29T01:43:00.017+02:00</published><updated>2009-01-31T21:44:47.510+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='review'/><category scheme='http://www.blogger.com/atom/ns#' term='bytecode'/><category scheme='http://www.blogger.com/atom/ns#' term='101'/><title type='text'>TheServerSide bytecode article summary</title><content type='html'>Lets summarize what can be learned from the really brilliant TheServerSide article "&lt;a href="http://www.theserverside.com/tt/articles/article.tss?l=GuideJavaBytecode"&gt;The working developer's Guide to Java Bytecode&lt;/a&gt;"&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The JVM is open to host different languages among them &lt;a href="http://jruby.codehaus.org/"&gt;JRuby&lt;/a&gt;, &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; and &lt;a href="http://www.jython.org/"&gt;Jython&lt;/a&gt; all these translate to JVM bytecode for runtime. &lt;a href="http://java.sun.com/"&gt;Java&lt;/a&gt; is translated in exactly the same process to bytecode using&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;javac&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Bytecode is the assembly language of the JVM, you might as well think of the JVM as a globally available &lt;a href="http://en.wikipedia.org/wiki/Instruction_set"&gt;instruction set&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The translation of bytecode to human readable form is encouraged by Sun. Fact is Sun provides a tool called &lt;b&gt;javap&lt;/b&gt; that allows you to do just that in an easily accessible way.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Bytecode works by calling instructions with their relevant data, for example a reference to a memory location that contains a string. What's interesting about this idea is that methods are also called by string reference- so for example if your default code is designed to call a method by the instruction &lt;i&gt;invokevirtual #4&lt;/i&gt; you could very replace that with&lt;i&gt; invokevirtual #7&lt;/i&gt; at runtime, this opens a huge range of possibilities for the application.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Inside the JVM the &lt;a href="http://en.wikipedia.org/wiki/Stack_%28data_structure%29"&gt;stack&lt;/a&gt; is divided into slots, each slot size is 4bytes (32bits).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The size of a bytecode instruction is 1 byte. Which makes this the simplest assembly language in the world. In fact the grand total of bytecode instructions existing is 224!&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The method by which the JVM passes data between instructions is by putting and popping data into the stack. The calling context, before instructing the JVM to execute a bytecode instruction loads data into the stack, the instruction in turn once called pops data out of the stack. The amount of loaded data by the caller must match the amount that would be popped otherwise we have a &lt;a href="http://en.wikipedia.org/wiki/Buffer_overflow"&gt;Buffer Overflow&lt;/a&gt;, something that does not exist in the JVM (As far as I know).&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've just covered the first section of the article, you are encouraged to read the whole thing. Please by all means don't retain yourself from commenting with ideas and requests regarding additional covering you would like to read. Also, I should mention that people wishing to participate in the writing of this blog are welcome to do.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please contact me at maxim.veksler@gmail.com for further discussion.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-3931534951340591792?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/3931534951340591792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/01/work-in-progress-lets-summarize-what.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/3931534951340591792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/3931534951340591792'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/01/work-in-progress-lets-summarize-what.html' title='TheServerSide bytecode article summary'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-8938895409113187150</id><published>2009-01-25T01:55:00.006+02:00</published><updated>2009-01-31T21:43:47.004+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reference'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>Bytecode Learning Path</title><content type='html'>Continuing with the learning path, A good knowledge basis must be built.&lt;br /&gt;&lt;br /&gt;Lets start with a few relevant reading material :&lt;div&gt;&lt;ul&gt;&lt;li&gt;First wikipedia article explaining what &lt;a href="http://en.wikipedia.org/wiki/Java_bytecode"&gt;java bytecode is all about&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;The actual &lt;a href="http://java.sun.com/docs/books/jvms/"&gt;specification of Java bytecode&lt;/a&gt;, kindly engineered by Sun.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.theserverside.com/tt/articles/article.tss?l=GuideJavaBytecode"&gt;The working developer's Guide to Java Bytecode&lt;/a&gt;, an article by TheServerSide.&lt;/li&gt;&lt;li&gt;IBM article discussing &lt;a href="http://www-128.ibm.com/developerworks/ibm/library/it-haggar_bytecode/"&gt;Java byte and why you need it&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-09-1996/jw-09-bytecodes.html"&gt;Bytecode Basics&lt;/a&gt; the article at JavaWorld that was the trigger for my passion.&lt;/li&gt;&lt;li&gt;A &lt;a href="http://www.infoq.com/JVMLanguageSummit"&gt;JVM Language Summit&lt;/a&gt; collection of presentations from InfoQ.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Continuing with some books that cover this topic from different angles. I hope that in due time I would be able to lay a better review about them... after I read them.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Inside-Java-Virtual-Machine-Venners/dp/0071350934"&gt;Inside The Java Virtual Machine&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Programming-Java-TM-Virtual-Machine/dp/0201309726/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1232881883&amp;amp;sr=1-1"&gt;Programming for the Java(TM) Virtual Machine&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Virtual-Machines-Iain-D-Craig/dp/1852339691/ref=sr_1_6?ie=UTF8&amp;amp;s=books&amp;amp;qid=1232881883&amp;amp;sr=1-6"&gt;Virtual Machines&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Java-Virtual-Machine-Jon-Meyer/dp/1565921941"&gt;Java Virtual Machine (Java Series)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Decompiling-Java-Godfrey-Nolan/dp/1590592654/ref=pd_rhf_shvl_4"&gt;Decompiling Java (Hardcover)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Covert-Java-Techniques-Decompiling-Engineering/dp/0672326388/ref=pd_rhf_shvl_title"&gt;Covert Java: Techniques for Decompiling, Patching, and Reverse Engineering (Paperback)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And here are some projects that deal with Java bytecode manipulation&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://asm.objectweb.org/"&gt;http://asm.objectweb.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.csg.is.titech.ac.jp/%7Echiba/javassist/"&gt;http://www.csg.is.titech.ac.jp/~chiba/javassist/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://jakarta.apache.org/bcel/"&gt;http://jakarta.apache.org/bcel/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://jasmin.sourceforge.net/"&gt;http://jasmin.sourceforge.net/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;These should give you a good starting point in exploring the Byte coded wonders of the JVM. Welcome to the world of "&lt;a href="http://xkcd.org/378/"&gt;Real Programmers&lt;/a&gt;".&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Last but not least, a link to some more tools and related artifacts for folks looking to toy with Bytecode &lt;a href="http://www.artima.com/insidejvm/resources/index.html"&gt;http://www.artima.com/insidejvm/resources/index.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-8938895409113187150?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/8938895409113187150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/01/continuing-with-learning-path-good.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8938895409113187150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/8938895409113187150'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/01/continuing-with-learning-path-good.html' title='Bytecode Learning Path'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-566351192911506928.post-503279412019611620</id><published>2009-01-25T01:40:00.002+02:00</published><updated>2009-12-19T20:00:11.066+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='intro'/><title type='text'>Java Byte Code Assembly</title><content type='html'>I have decided to learn how to write Java bytecode, this issue fascinates me.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;I think it's amazing to be able to understand what goes under the hood of the code, this will allow me to see a much bigger picture of the Java world. Also, with knowledge comes power - Being able to read assembly means being able to write it... and that is all I agree to say about this. For more information ask &lt;a href="http://phrack.org/"&gt;phrack.org&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This blog will document and hopefully share with you my dear reader interesting ideas, projects and hacks I learn along the way. &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy, have fun and be nice!&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Maxim Veksler.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/566351192911506928-503279412019611620?l=bytecoded.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bytecoded.blogspot.com/feeds/503279412019611620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bytecoded.blogspot.com/2009/01/java-byte-code-assembly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/503279412019611620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/566351192911506928/posts/default/503279412019611620'/><link rel='alternate' type='text/html' href='http://bytecoded.blogspot.com/2009/01/java-byte-code-assembly.html' title='Java Byte Code Assembly'/><author><name>Maxim Veksler</name><uri>http://www.blogger.com/profile/12287653867923449024</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/144/337060978_92ba98f7be_m.jpg'/></author><thr:total>0</thr:total></entry></feed>
