<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Werx Limited &#187; java</title> <atom:link href="http://werxltd.com/wp/category/software-development/java-software-development/feed/" rel="self" type="application/rss+xml" /><link>http://werxltd.com/wp</link> <description>We make IT work.</description> <lastBuildDate>Mon, 23 Jan 2012 23:03:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>A Java String permutations utility</title><link>http://werxltd.com/wp/2011/05/09/a-java-string-permutations-utility/</link> <comments>http://werxltd.com/wp/2011/05/09/a-java-string-permutations-utility/#comments</comments> <pubDate>Tue, 10 May 2011 03:21:31 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[permutation]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=956</guid> <description><![CDATA[On a recent project I need to find all the possible permutations of a given URL. Stripping off subdomains, paths, and query parameters. Here is the first part of the solution. A method which takes a string and strips it down based on a given divider in a given direction at a given interval. Here&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>On a recent project I need to find all the possible permutations of a given URL. Stripping off subdomains, paths, and query parameters. Here is the first part of the solution. A method which takes a string and strips it down based on a given divider in a given direction at a given interval.</p><p>Here&#8217;s the code:</p><pre  class="brush:java">
private static String[] getPermutations(String whole, String divider, int lim, int dir) {
	   String[] chunks = whole.split((divider.matches("\\.") ? "\\" : "")+divider);
	   System.out.println("chunks.length: "+chunks.length);

	   if(chunks.length <= lim) {
		   System.out.println("return whole: "+whole);
		   return new String[]{whole};
	   }

	   String[] permutations = new String[chunks.length-lim];

	   if(dir == 1) {
		   	permutations[0] = whole;
   		    System.out.println("permutations[0]: "+permutations[0]);
			for(int i = 1; i < chunks.length-lim; i++) {
			   String permutation = "";
			   for(int o = i; o < chunks.length; o++) {
				   permutation += (o == i ? "" : divider) + chunks[o];
			   }
			   permutations[i] = permutation;
			   System.out.println("permutations["+i+"]: "+permutations[i]);
			}
	   } else if(dir == -1) {
		   for(int i = 0; i < chunks.length-lim; i++) {
			   String permutation = "";
	 		   for(int o = 0; o < chunks.length-i; o++) {
				   permutation += (o == 0 ? "" : divider) + chunks[o];
			   }
			   permutations[i] = permutation;
			   System.out.println("permutations["+i+"]: "+permutations[i]);
			}
	   }

	   return permutations;
   }
</pre><p>Here is an example of it being used.</p><p>Input:</p><pre  class="brush:java">
      getPermutations("com",".",1, 1);
      getPermutations("google.com",".",1, 1);
      getPermutations("a.b.c.d.e.cool.google.com",".",1, 1);
      getPermutations("/path/asdf/a/b/c/d/e/f","/",0, -1);
      getPermutations("a=b&#038;c=d&#038;e=f","&#038;",0, -1);
</pre><p>Output:</p><pre  class="brush:bash">
$ javac Runme.java &#038;&#038; java Runme
chunks.length: 1
return whole: com
chunks.length: 2
permutations[0]: google.com
chunks.length: 8
permutations[0]: a.b.c.d.e.cool.google.com
permutations[1]: b.c.d.e.cool.google.com
permutations[2]: c.d.e.cool.google.com
permutations[3]: d.e.cool.google.com
permutations[4]: e.cool.google.com
permutations[5]: cool.google.com
permutations[6]: google.com
chunks.length: 9
permutations[0]: /path/asdf/a/b/c/d/e/f
permutations[1]: /path/asdf/a/b/c/d/e
permutations[2]: /path/asdf/a/b/c/d
permutations[3]: /path/asdf/a/b/c
permutations[4]: /path/asdf/a/b
permutations[5]: /path/asdf/a
permutations[6]: /path/asdf
permutations[7]: /path
permutations[8]:
chunks.length: 3
permutations[0]: a=b&#038;c=d&#038;e=f
permutations[1]: a=b&#038;c=d
permutations[2]: a=b
</pre><p>Next I'll need to combine the URL components to get a list of valid URLs..</p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;count=none&amp;text=A%20Java%20String%20permutations%20utility" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;count=none&amp;text=A%20Java%20String%20permutations%20utility" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;linkname=A%20Java%20String%20permutations%20utility" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F05%2F09%2Fa-java-string-permutations-utility%2F&amp;title=A%20Java%20String%20permutations%20utility" id="wpa2a_2">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2011/05/09/a-java-string-permutations-utility/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Introducing jpoxy, the simple json-rpc implementation for Java</title><link>http://werxltd.com/wp/2011/03/19/introducing-jpoxy-the-simple-json-rpc-implementation-for-java/</link> <comments>http://werxltd.com/wp/2011/03/19/introducing-jpoxy-the-simple-json-rpc-implementation-for-java/#comments</comments> <pubDate>Sat, 19 Mar 2011 17:24:03 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[glue]]></category> <category><![CDATA[jpoxy]]></category> <category><![CDATA[json]]></category> <category><![CDATA[json-rpc]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=917</guid> <description><![CDATA[werx-jsonrpc has been renamed to jpoxy (hosted on Google Code). But the project name isn&#8217;t the only thing that&#8217;s changed. Based on some excellent feedback I&#8217;ve made the following changes: The project is now thread-safe. I&#8217;ve removed request and response as global objects and, instead, made sure they get passed along the request chain. This [...]]]></description> <content:encoded><![CDATA[<p>werx-jsonrpc has been renamed to <a
href="http://code.google.com/p/jpoxy/">jpoxy</a> (hosted on Google Code). But the project name isn&#8217;t the only thing that&#8217;s changed. Based on some excellent feedback I&#8217;ve made the following changes:</p><ul><li>The project is now thread-safe. I&#8217;ve removed request and response as global objects and, instead, made sure they get passed along the request chain.</li><li>This means the events for request and response have been taken out (which, I&#8217;ve been informed, I didn&#8217;t make a big enough deal about last time). The only event that you will get now is the init complete event which will provide your application a copy of the servlet configuration.</li><li>You can still access the request object (and, subsequently, the session object) by accepting a single HashMap parameter in your method.</li><li>A new annotation has been added, @Jpoxy(enabled = false), which allows you to tell the framework not to expose a method if it is public. This means you can mark all your internal event listener code so they aren&#8217;t exposed to the public.</li><li>You can now expose methods which accept a complex Java object. This means you can expose a method which accepts, say, a User object and the framework will use <a
href="http://jackson.codehaus.org/">Jackson</a> to marshal the parameters you provide into that object.</li></ul><p>We also now have a <a
href="http://groups.google.com/group/jpoxy">Google group</a>! So if you have any questions or comments we would love to hear from you.</p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;count=none&amp;text=Introducing%20jpoxy%2C%20the%20simple%20json-rpc%20implementation%20for%20Java" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;count=none&amp;text=Introducing%20jpoxy%2C%20the%20simple%20json-rpc%20implementation%20for%20Java" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;linkname=Introducing%20jpoxy%2C%20the%20simple%20json-rpc%20implementation%20for%20Java" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F03%2F19%2Fintroducing-jpoxy-the-simple-json-rpc-implementation-for-java%2F&amp;title=Introducing%20jpoxy%2C%20the%20simple%20json-rpc%20implementation%20for%20Java" id="wpa2a_4">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2011/03/19/introducing-jpoxy-the-simple-json-rpc-implementation-for-java/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fred Brooks on the promise of object oriented programming</title><link>http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/</link> <comments>http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/#comments</comments> <pubDate>Tue, 12 Oct 2010 12:00:26 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[c++]]></category> <category><![CDATA[general]]></category> <category><![CDATA[it industry]]></category> <category><![CDATA[java]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[php]]></category> <category><![CDATA[python]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[fred brooks]]></category> <category><![CDATA[no silver bullet]]></category> <category><![CDATA[object oriented]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=698</guid> <description><![CDATA[One view of object-oriented programming is that it is a discipline that enforces modularity and clean interfaces. A second view emphasizes encapsulation, the fact that one cannot see, much less design, the inner structure of the pieces. Another view emphasizes inheritance, with its concomitant hierarchical structure of classes, with virtual functions. Yet another view emphasizes strong abstract data-typing, with [...]]]></description> <content:encoded><![CDATA[<blockquote><p>One view of object-oriented programming is that it is a discipline that enforces modularity and clean interfaces. A second view emphasizes encapsulation, the fact that one cannot see, much less design, the inner structure of the pieces. Another view emphasizes inheritance, with its concomitant hierarchical structure of classes, with virtual functions. Yet another view emphasizes strong abstract data-typing, with its assurance that a particular data-type will be manipulated only by operations proper to it.</p><p>Now any of these disciplines can be had without taking the whole Smalltalk or C++ package—many of them predated object-oriented technology. The attractiveness of object-oriented approach is that of a multivitamin pill: in one fell swoop (that is, programmer retraining), one gets them all. It is a very promising concept.</p><p>Why has object-oriented technique grown slowly? In the nine years since &#8220;NSB,&#8221; the expectancy has steadily grown. Why has growth been slow? Theories abound. James Coggins, author for four years of the column, &#8220;The Best of comp.lang.c++ &#8221; in The C++ Report, offers this explanation:</p><blockquote><p>The problem is that programmers in O-O have been experimenting in incestuous applications and aiming low in abstraction, instead of high. For example, they have been building classes such as linked-list or set instead of classes such as user-interface or radiation beam or finite-element model. Unfortunately the self-same strong type checking in C++ that helps programmers to avoid errors also makes it hard to build big things out of little ones.</p></blockquote><p>He goes back to the basic software problem, and argues that one way to address unmet software needs is to increase the size of the intelligent workforce by enabling and coopting our clients. This argues for top-down design:</p><blockquote><p>we design large-grained classes that address concepts our clients are already working with, they can understand and question the design as it grows, and they can cooperate in the design of test cases. My ophthalmology collaborators don&#8217;t care about stacks; they do care about Legendre polynomial shape descriptions of corneas. Small encapsulations yield small benefits.</p></blockquote><p>David Parnas, whose paper was one of the origins of object-oriented concepts, sees the matter differently. He writes me:</p><blockquote><p>The answer is simple. It is because [O-O] has been tied to a variety of complex languages. Instead of teaching people that O-O is a type of design, and giving them design principles, people have taught that O-O is the use of a particular tool. We can write good or bad programs with any tool. Unless we teach people how to design, the languages matter very little. The result is that people do bad designs with these languages and get very little value from them. If the value is small, it won&#8217;t catch on.</p></blockquote><p><em>-Fred Brooks, The Mythical Man-Month, pg. 220</em></p></blockquote><div
class="betterrelated"><p><strong>Related content:</strong></p><ol><li> <a
href="http://werxltd.com/wp/2011/02/28/fun-with-heatmaps/" title="Permanent link to Fun with heatmaps">Fun with heatmaps</a></li><li> <a
href="http://werxltd.com/wp/2010/09/27/mcafee-secure-url-shortener-firefox-add-on/" title="Permanent link to McAfee Secure URL Shortener Firefox Add-on">McAfee Secure URL Shortener Firefox Add-on</a></li><li> <a
href="http://werxltd.com/wp/2010/04/29/hiphop-for-php/" title="Permanent link to HipHop for PHP">HipHop for PHP</a></li><li> <a
href="http://werxltd.com/wp/2009/08/26/getting-starte-with-hadoop-and-mapreduce/" title="Permanent link to Getting started with Hadoop and MapReduce">Getting started with Hadoop and MapReduce</a></li><li> <a
href="http://werxltd.com/wp/2010/08/26/why-programming-is-fun/" title="Permanent link to Why programming is fun">Why programming is fun</a></li><li> <a
href="http://werxltd.com/wp/2010/09/22/mcafee-url-shortener-chrome-extension/" title="Permanent link to McAfee URL Shortener Chrome Extension">McAfee URL Shortener Chrome Extension</a></li><li> <a
href="http://werxltd.com/wp/2010/11/04/javascript-performance/" title="Permanent link to Javascript performance">Javascript performance</a></li><li> <a
href="http://werxltd.com/wp/2009/06/29/cloud-computing-101/" title="Permanent link to Cloud computing 101">Cloud computing 101</a></li><li> <a
href="http://werxltd.com/wp/2009/09/04/quick-and-dirty-image-sorting-script/" title="Permanent link to Quick and dirty image sorting script">Quick and dirty image sorting script</a></li><li> <a
href="http://werxltd.com/wp/2009/12/01/hacking-your-router-for-effective-internet-monitoring/" title="Permanent link to Hacking your router for effective internet monitoring">Hacking your router for effective internet monitoring</a></li></ol><a
class="thanks" style="font-size: smaller; text-decoration: none;" title="Related content found by the Better Related Posts plugin" href="http://www.nkuttler.de/wordpress-plugin/wordpress-related-posts-plugin/">Better Related Posts Plugin</a></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;count=none&amp;text=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;count=none&amp;text=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;linkname=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F10%2F12%2Ffred-brooks-on-the-promise-of-object-oriented-programming%2F&amp;title=Fred%20Brooks%20on%20the%20promise%20of%20object%20oriented%20programming" id="wpa2a_6">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/10/12/fred-brooks-on-the-promise-of-object-oriented-programming/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Simple JSON-RPC updated to 1.0.0</title><link>http://werxltd.com/wp/2010/08/10/simple-json-rpc-updated-to-1-0-0/</link> <comments>http://werxltd.com/wp/2010/08/10/simple-json-rpc-updated-to-1-0-0/#comments</comments> <pubDate>Tue, 10 Aug 2010 12:00:14 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[java rpc]]></category> <category><![CDATA[json-rpc]]></category> <category><![CDATA[rpc]]></category> <category><![CDATA[simple json-rpc]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=643</guid> <description><![CDATA[Simple JSON-RPC has been updated to 1.0.0. This new version includes a brand new event messaging system making it possible for classes to react to events generated by the Simple JSON-RPC framework. Through simple event messaging, your RPC classes are now able to react to and even interact with servlet configuration, context, request, and response [...]]]></description> <content:encoded><![CDATA[<p>Simple JSON-RPC has been updated to 1.0.0. This new version includes a brand new event messaging system making it possible for classes to react to events generated by the Simple JSON-RPC framework.</p><p>Through simple event messaging, your RPC classes are now able to react to and even interact with servlet <a
href="http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/api/javax/servlet/ServletConfig.html">configuration</a>, <a
href="http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/api/javax/servlet/ServletContext.html">context</a>, <a
href="http://download.oracle.com/docs/cd/E17802_01/products/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html">request</a>, and <a
href="http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/api/javax/servlet/http/HttpServletResponse.html">response</a> objects. To use this facility your class needs to extend the new <a
href="http://werxltd.com/docs/jsonrpc/com/werxltd/jsonrpc/events/JSONRPCEventListener.html">JSONRPCEventListener</a> interface and implement the messageReceived method, accepting one argument of the <a
href="http://werxltd.com/docs/jsonrpc/com/werxltd/jsonrpc/events/JSONRPCMessageEvent.html">JSONRPCMessageEvent</a> type.</p><p>Here is an example of how a class could implement a Simple JSON-RPC event listener:</p><pre class="brush:java">public void messageReceived(JSONRPCMessageEvent me) {
	switch(me.message().getCode()) {
		case JSONRPCMessage.INIT:
			config = me.message().getServletConfig();
		break;
		case JSONRPCMessage.BEFOREREQUEST:
			request = me.message().getRequest();
			session = request.getSession(true);
		break;
		case JSONRPCMessage.BEFORERESPONSE:
			response = me.message().getHttpResponse();
			response.setContentType("text/html");
		break;
		case JSONRPCMessage.AFTERRESPONSE:
			lastresponse = me.message().getRPCResponse();
		break;
	}
}</pre><p>This new feature should also make it easier to implement solutions that use <a
href="http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Session-Tracking.html">sessions</a>. This should also make it possible for classes to react to the output of other classes, including errors.</p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;count=none&amp;text=Simple%20JSON-RPC%20updated%20to%201.0.0" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;count=none&amp;text=Simple%20JSON-RPC%20updated%20to%201.0.0" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;linkname=Simple%20JSON-RPC%20updated%20to%201.0.0" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F08%2F10%2Fsimple-json-rpc-updated-to-1-0-0%2F&amp;title=Simple%20JSON-RPC%20updated%20to%201.0.0" id="wpa2a_8">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/08/10/simple-json-rpc-updated-to-1-0-0/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>HBase JSON-RPC Bridge updated, allows scanning</title><link>http://werxltd.com/wp/2010/07/27/hbase-json-rpc-bridge-updated-allows-scanning/</link> <comments>http://werxltd.com/wp/2010/07/27/hbase-json-rpc-bridge-updated-allows-scanning/#comments</comments> <pubDate>Tue, 27 Jul 2010 18:05:04 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[bigdata]]></category> <category><![CDATA[bigtable]]></category> <category><![CDATA[json]]></category> <category><![CDATA[jsonrpc]]></category> <category><![CDATA[mapreduce]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=632</guid> <description><![CDATA[The HBase JSON-RPC bridge has been updated to allow scanning on non-key columns. Now, passing a filter parameter creates a scanner using a RegexStringComparator. Results are returned in 100 block chunks until null is returned, in which case the ResultScanner is closed Here is an example query that is now possible: http://localhost:8080/hbasebridge/rpc?debug=true&#38;data={"method":"lookup","params":{"table":"hbasetable","filter":"searchstring"}} No related content [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://code.google.com/p/hbasebridge/">HBase JSON-RPC bridge</a> has been updated to allow scanning on non-key columns. Now, passing a filter parameter creates a scanner using a <a
href="http://hbase.apache.org/docs/r0.20.5/api/org/apache/hadoop/hbase/filter/RegexStringComparator.html">RegexStringComparator</a>. <a
href="http://hbase.apache.org/docs/r0.20.5/api/org/apache/hadoop/hbase/client/Result.html">Result</a>s are returned in 100 block chunks until null is returned, in which case the <a
href="http://hbase.apache.org/docs/r0.20.4/api/org/apache/hadoop/hbase/client/ResultScanner.html">ResultScanner</a> is closed</p><p>Here is an example query that is now possible:</p><pre>http://localhost:8080/hbasebridge/rpc?debug=true&amp;data={"method":"lookup","params":{"table":"hbasetable","filter":"searchstring"}}</pre><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;count=none&amp;text=HBase%20JSON-RPC%20Bridge%20updated%2C%20allows%20scanning" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;count=none&amp;text=HBase%20JSON-RPC%20Bridge%20updated%2C%20allows%20scanning" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;linkname=HBase%20JSON-RPC%20Bridge%20updated%2C%20allows%20scanning" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F07%2F27%2Fhbase-json-rpc-bridge-updated-allows-scanning%2F&amp;title=HBase%20JSON-RPC%20Bridge%20updated%2C%20allows%20scanning" id="wpa2a_10">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/07/27/hbase-json-rpc-bridge-updated-allows-scanning/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Bible Flashcards for Android 2.0</title><link>http://werxltd.com/wp/2010/06/28/bible-flashcards-for-android-2-0/</link> <comments>http://werxltd.com/wp/2010/06/28/bible-flashcards-for-android-2-0/#comments</comments> <pubDate>Mon, 28 Jun 2010 12:00:45 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[android]]></category> <category><![CDATA[general]]></category> <category><![CDATA[java]]></category> <category><![CDATA[bible flashcards]]></category> <category><![CDATA[new release]]></category> <category><![CDATA[update]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=619</guid> <description><![CDATA[It&#8217;s been a while since I released Bible Flashcards version 1.0. Long enough in fact that I started getting emails asking whether I intended on updating past the 1.1.4 release. Well I am proud to announce version 2.0 which includes a lot of requested features and a lot of bug-fixes and improvements. For this release [...]]]></description> <content:encoded><![CDATA[<p>It&#8217;s been a while since I released Bible Flashcards version 1.0. Long enough in fact that I started getting emails asking whether I intended on updating past the 1.1.4 release.</p><p>Well I am proud to announce version 2.0 which includes a lot of requested features and a lot of bug-fixes and improvements. For this release I decided to take my time and re-factor the way various screens interacted, making them more modular and self-contained which should translate into fewer force closes. I also <a
href="http://developer.android.com/guide/developing/tools/monkey.html">unleased the monkey</a> on my app which helped me improve my code even more.</p><p>So without further ado here are the major features included in this release:</p><ul><li>Ability to mark cards learned/unlearned</li><li>Ability to choose a random card</li><li>Cards now cycle so that if you are on card 1 and you attempt to go backwards, you are taken to the last card. Likewise if you are on the last card and you attempt to go forwards you are taken to the first card.</li><li>Menus also cycle so that if you hit the back button you will go from the active card view to the lesson chooser to the lesson set chooser and back to the card view.</li><li>Preferences to control settings such as card text size, whether to display learned cards, and a button to remove all learned cards from the internal database.</li></ul><p>Some interface items had to be chopped to make room for these improvements. So if you are wondering where the next/back buttons are, they have been removed in favor of the more intuitive gesture controls. Swipe right for next card and left for previous card. Tapping the card flips it over.</p><p>I also want to give a special thanks to everyone who contacted me with words of encouragement and everyone who brought to my attention things that were broken and things that could be improved upon.</p><p>This release also includes a new lesson set, RossWords, which is being put together by  Samuel Rogers as he takes Hebrew this year. If anyone else is feeling generous  and would like to help out, feel free to contact me about a lesson set that you could help me improve upon or create as Samuel is doing.</p><p>Here are some screen shots from the new version:<br
/> <a
href="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards1.png?9d7bd4"><img
class="alignleft size-medium wp-image-620" style="margin: 5px;" title="bibleflashcards1" src="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards1-200x300.png?9d7bd4" alt="" width="200" height="300" /></a><a
href="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards3.png?9d7bd4"><img
class="alignleft size-medium wp-image-623" style="margin: 5px;" title="bibleflashcards3" src="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards3-168x300.png?9d7bd4" alt="" width="168" height="300" /></a><a
href="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards2.png?9d7bd4"><img
class="alignleft size-medium wp-image-622" style="margin: 5px;" title="bibleflashcards2" src="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards2-200x300.png?9d7bd4" alt="" width="200" height="300" /></a><a
href="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards4.png?9d7bd4"><img
class="alignleft size-medium wp-image-624" style="margin: 5px;" title="bibleflashcards4" src="http://werxltd.com/wp/wp-content/uploads/2010/06/bibleflashcards4-168x300.png?9d7bd4" alt="" width="168" height="300" /></a></p><p>And as usual, you can find Bible Flashcards in the Android Marketplace by searching for &#8220;Bible Flashcards&#8221; or by scanning the barcode below:<br
/> <img
src="http://werxltd.com/wp/wp-content/plugins/wp-qrencoder/qr_img.php?d=http://market.android.com/search?q=pname:com.werxltd.bibleflash&#038;t=other&#038;s=4&#038;s=M" /></p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;count=none&amp;text=Bible%20Flashcards%20for%20Android%202.0" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;count=none&amp;text=Bible%20Flashcards%20for%20Android%202.0" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;linkname=Bible%20Flashcards%20for%20Android%202.0" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F28%2Fbible-flashcards-for-android-2-0%2F&amp;title=Bible%20Flashcards%20for%20Android%202.0" id="wpa2a_12">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/06/28/bible-flashcards-for-android-2-0/feed/</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>Simple JSON-RPC updated to 0.9.7</title><link>http://werxltd.com/wp/2010/06/01/simple-json-rpc-updated-to-0-9-7/</link> <comments>http://werxltd.com/wp/2010/06/01/simple-json-rpc-updated-to-0-9-7/#comments</comments> <pubDate>Tue, 01 Jun 2010 12:00:19 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[framework]]></category> <category><![CDATA[json-rpc]]></category> <category><![CDATA[rpc]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=604</guid> <description><![CDATA[Simple JSON-RPC has been updated to 0.9.7. This new version includes the ability to enable using full class names rather than simple method names. This makes using multiple classes with the same public method names possible. To enable this functionality simply add an init-param to your web.xml file like: &#60;init-param&#62; &#60;param-name&#62;use_full_classname&#60;/param-name&#62; &#60;param-value&#62;true&#60;/param-value&#62; &#60;/init-param&#62; With this [...]]]></description> <content:encoded><![CDATA[<p>Simple JSON-RPC has been updated to 0.9.7. This new version includes the ability to enable using full class names rather than simple method names. This makes using multiple classes with the same public method names possible.</p><p>To enable this functionality simply add an <a
href="http://www.factorypattern.com/storing-parameters-in-webxml-context-param-init-param/">init-param</a> to your <a
href="http://en.wikipedia.org/wiki/WAR_(Sun_file_format)">web.xml</a> file like:</p><pre class="brush:xml">
&lt;init-param&gt;
	&lt;param-name&gt;use_full_classname&lt;/param-name&gt;
	&lt;param-value&gt;true&lt;/param-value&gt;
&lt;/init-param&gt;
</pre><p>With this feature enabled, you then call methods via their full classname + method name separated by a dot (this nomenclature is for both static as well as non-static methods, the framework handles the particulars in the back-end).</p><p>Special thanks to Stephan of <a
href="http://www.crosspollinate.org/">Cross Pollinate</a> for suggesting this improvement!</p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;count=none&amp;text=Simple%20JSON-RPC%20updated%20to%200.9.7" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;count=none&amp;text=Simple%20JSON-RPC%20updated%20to%200.9.7" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;linkname=Simple%20JSON-RPC%20updated%20to%200.9.7" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F06%2F01%2Fsimple-json-rpc-updated-to-0-9-7%2F&amp;title=Simple%20JSON-RPC%20updated%20to%200.9.7" id="wpa2a_14">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/06/01/simple-json-rpc-updated-to-0-9-7/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Bible Flashcards for Android 1.0</title><link>http://werxltd.com/wp/2010/05/20/bible-flashcards-for-android-1-0/</link> <comments>http://werxltd.com/wp/2010/05/20/bible-flashcards-for-android-1-0/#comments</comments> <pubDate>Thu, 20 May 2010 12:00:56 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[android]]></category> <category><![CDATA[bible]]></category> <category><![CDATA[educational]]></category> <category><![CDATA[flashcard]]></category> <category><![CDATA[greek]]></category> <category><![CDATA[hebrew]]></category> <category><![CDATA[sqlite]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=595</guid> <description><![CDATA[Bible Flashcards is an Android application based on the data files provided by the Crosswire Bible Society&#8216;s Flashcard application. It contains flashcards for both Greek and Hebrew along with appropriate fonts for proper display. I&#8217;ve also included an additional lesson set titled &#8220;greekBasics&#8221; which includes flashcards for the Greek alphabet. Here are some screenshots: You [...]]]></description> <content:encoded><![CDATA[<p>Bible Flashcards is an Android application based on the data files provided by the <a
href="http://www.crosswire.org">Crosswire Bible Society</a>&#8216;s <a
href="http://www.crosswire.org/flashcards/">Flashcard application</a>. It contains flashcards for both Greek and Hebrew along with appropriate fonts for proper display.</p><p>I&#8217;ve also included an additional lesson set titled &#8220;greekBasics&#8221; which includes flashcards for the Greek alphabet.</p><p>Here are some screenshots:</p><div
style="float: left;"><img
class="alignleft size-medium wp-image-594" style="margin-left: 5px; margin-right: 5px;" title="lessonset_chooser" src="http://werxltd.com/wp/wp-content/uploads/2010/05/lessonset_chooser-168x300.png?9d7bd4" alt="" width="168" height="300" /><img
class="alignleft size-medium wp-image-593" style="margin-left: 5px; margin-right: 5px;" title="lesson_chooser" src="http://werxltd.com/wp/wp-content/uploads/2010/05/lesson_chooser-168x300.png?9d7bd4" alt="" width="168" height="300" /><img
class="alignleft size-medium wp-image-590" style="margin-left: 5px; margin-right: 5px;" title="card_front_vertical" src="http://werxltd.com/wp/wp-content/uploads/2010/05/card_front_vertical-168x300.png?9d7bd4" alt="" width="168" height="300" /><img
class="alignleft size-medium wp-image-589" style="margin-left: 5px; margin-right: 5px;" title="card_back_vertical" src="http://werxltd.com/wp/wp-content/uploads/2010/05/card_back_vertical-168x300.png?9d7bd4" alt="" width="168" height="300" /></div><div
style="clear: both;">You can find Bible Flashcards in the Android app Market by entering &#8220;Bible Flashcards&#8221; or by scanning the barcode below:<br
/> <img
src="http://werxltd.com/wp/wp-content/plugins/wp-qrencoder/qr_img.php?d=http://market.android.com/search?q=pname:com.werxltd.bibleflash&#038;t=other&#038;s=4&#038;s=M" /></p><p>Additionally, if you are interested in helping out with new lessons or if you would like to provide feedback, please feel free to email me.</p></div><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;count=none&amp;text=Bible%20Flashcards%20for%20Android%201.0" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;count=none&amp;text=Bible%20Flashcards%20for%20Android%201.0" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;linkname=Bible%20Flashcards%20for%20Android%201.0" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F20%2Fbible-flashcards-for-android-1-0%2F&amp;title=Bible%20Flashcards%20for%20Android%201.0" id="wpa2a_16">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/05/20/bible-flashcards-for-android-1-0/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Learning Languages: Java</title><link>http://werxltd.com/wp/2010/05/18/learning-languages-java/</link> <comments>http://werxltd.com/wp/2010/05/18/learning-languages-java/#comments</comments> <pubDate>Tue, 18 May 2010 12:00:56 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[software development]]></category> <category><![CDATA[beginner]]></category> <category><![CDATA[enviroment]]></category> <category><![CDATA[ide]]></category> <category><![CDATA[tutorial]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=532</guid> <description><![CDATA[The first thing you&#8217;ll need to consider is the development environment you want to use primarily. This is important as it will have an impact on how you run through tutorials and examples later on. Environments can be broken down into two broad categories; command-line or a visual IDE. Both have their merits and you&#8217;ll [...]]]></description> <content:encoded><![CDATA[<p>The first thing you&#8217;ll need to consider is the development environment you want to use primarily. This is important as it will have an impact on how you run through tutorials and examples later on.</p><p>Environments can be broken down into two broad categories; command-line or a <a
href="http://en.wikipedia.org/wiki/Integrated_development_environment">visual IDE</a>. Both have their merits and you&#8217;ll eventually need to be familiar with both (especially if you expect to be releasing production code or participating in any well-maintained development environment).</p><p>The most common command-line environments are <a
href="http://maven.apache.org/">Maven</a> and <a
href="http://ant.apache.org/ivy/">Ivy</a>. Both come with a somewhat steep learning curve (which, unfortunately is unavoidable) but both are well worth investigating as they are both very common in production environments.</p><p>Starting out, however, you&#8217;ll most likely find that using a visual IDE will help you get right down to learning and compiling example code fairly quickly.</p><p>There are several common IDEs; <a
href="http://www.jetbrains.com/idea/">IntelliJ</a>, <a
href="http://netbeans.org/">NetBeans</a>, and <a
href="http://www.eclipse.org">Eclipse</a> are all great ones that I&#8217;ve seen used in production. My favorite hands-down is Eclipse, especially since it also has configurations to help you develop in other languages such as <a
href="http://www.aptana.org/">PHP (Aptana)</a> and <a
href="http://www.eclipse.org/cdt/">C/C++</a>.</p><p>For general basics and a broad overview of Java; I would recommend you take a look at <a
href="http://www.javabeginner.com/">the Java Beginner site</a>.</p><p>There&#8217;s also several handy video tutorials (mostly using Eclipse) on YouTube such as this one:<br
/> <object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param
name="allowFullScreen" value="true" /><param
name="allowscriptaccess" value="always" /><param
name="src" value="http://www.youtube.com/v/UGmhks4K13g&amp;hl=en_US&amp;fs=1&amp;" /><param
name="allowfullscreen" value="true" /><embed
type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/UGmhks4K13g&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p><p>Once you get the basics down, I&#8217;ve found that working on a full project helps. A great place to start would be to help our with an existing open-source project like <a
href="http://www.crosswire.org/jsword/">JSword</a>.</p><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;count=none&amp;text=Learning%20Languages%3A%20Java" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;count=none&amp;text=Learning%20Languages%3A%20Java" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;linkname=Learning%20Languages%3A%20Java" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F18%2Flearning-languages-java%2F&amp;title=Learning%20Languages%3A%20Java" id="wpa2a_18">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/05/18/learning-languages-java/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Javascript implementation of Java&#8217;s String.hashCode() method</title><link>http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/</link> <comments>http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/#comments</comments> <pubDate>Thu, 13 May 2010 12:00:14 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[hashcode]]></category> <category><![CDATA[prototype]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=581</guid> <description><![CDATA[Here is a direct replacement for Java&#8217;s String.hashCode() method implemented in Javascript. I wrote this function to fulfill a requirement at work. Apparently, the back-end engineers thought hashCode() was a standard function. One of the hurdles for this project was not only figuring out how to translate the mathematical formula used in Java to generate [...]]]></description> <content:encoded><![CDATA[<p>Here is a direct replacement for Java&#8217;s <a
href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#hashCode()">String.hashCode()</a> method implemented in Javascript.</p><p>I wrote this function to fulfill a requirement at work. Apparently, the back-end engineers thought hashCode() was a standard function. One of the hurdles for this project was not only figuring out how to translate the mathematical formula used in Java to generate hashCode()&#8217;s but also how to force Javascript to use 32bit integer math (no small feat).</p><p>Fortunately, I <a
href="http://www.hunlock.com/blogs/The_Complete_Javascript_Number_Reference">discovered that Java supports bitwise operators</a> which are constrained to 32bit integer math.</p><p>So here&#8217;s the resulting String prototype in Javascript. With this prototype you can simply call .hashCode() on any string, ie. &#8220;some string&#8221;.hashCode(), and receive a numerical hash code (more specifically, a Java equivalent) such as 1395333309.</p><pre class="brush:javascript">
String.prototype.hashCode = function(){
	var hash = 0;
	if (this.length == 0) return hash;
	for (i = 0; i < this.length; i++) {
		char = this.charCodeAt(i);
		hash = ((hash<<5)-hash)+char;
		hash = hash & hash; // Convert to 32bit integer
	}
	return hash;
}
</pre><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;count=none&amp;text=Javascript%20implementation%20of%20Java%26%238217%3Bs%20String.hashCode%28%29%20method" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;count=none&amp;text=Javascript%20implementation%20of%20Java%26%238217%3Bs%20String.hashCode%28%29%20method" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;linkname=Javascript%20implementation%20of%20Java%26%238217%3Bs%20String.hashCode%28%29%20method" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2010%2F05%2F13%2Fjavascript-implementation-of-javas-string-hashcode-method%2F&amp;title=Javascript%20implementation%20of%20Java%26%238217%3Bs%20String.hashCode%28%29%20method" id="wpa2a_20">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 1/66 queries in 0.646 seconds using apc
Object Caching 1110/1289 objects using apc

Served from: werxltd.com @ 2012-02-08 13:01:04 -->
