tag:blogger.com,1999:blog-49563956161275312082024-03-07T04:14:13.953-05:00Calamari DynastyI write about code, because I'm a code monkey.jimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-4956395616127531208.post-64818110029603447422006-12-21T04:16:00.000-05:002006-12-21T04:18:54.988-05:00Site has MovedI'm sorry for the inconvenience, but I've decided to migrate away from blogger.com.<br /><br />My new site is <a href="http://jimbojw.com/wiki/index.php?title=Blog">jimbojw.com</a><br /><br />Thanks in advance for your patients during this time of transition.<br /><br />-- Jimjimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com3tag:blogger.com,1999:blog-4956395616127531208.post-37603863627258953762006-10-21T22:50:00.000-05:002006-12-21T04:09:22.762-05:00Simply Explained - Oracle Application Server 10g ClusteringI'm sorry for the inconvenience, but <a href="http://jimbojw.com/wiki/index.php?title=Oracle_Application_Server_10g_Clustering">this content has moved.</a> -- Jimjimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com0tag:blogger.com,1999:blog-4956395616127531208.post-86143974057228560592006-10-18T21:50:00.000-05:002006-10-21T12:36:08.597-05:00Clearing the Air - More Languages that SuckIn response to criticism of a previous article on <a href="http://jimbojw.blogspot.com/2006/10/clearing-air-languages-that-suck_12.html">languages that suck</a>, this new study aims to put the issue to rest - establishing definitively which programming languages suck the most, accounting for relative popularity among other factors.<br /><br />Turns out (despite previous reports) that Perl <i>does not suck the most</i>, JavaScript does. Also, Ruby is by far the hackiest language on the planet ... keep reading to see why.<br /><br /><span style="font-weight:bold">Methodology</span><br /><br />As in the first study, all data were collected from search results retrieved via Google's <a href="http://www.google.com/codesearch">Code Search</a>. For each target language, three pieces of information were initially gathered: <br /><br /><span style="font-style:italic">Total Files</span><br /><blockquote>An approximation of the language's footprint in Google's database (and thus its popularity). Determined by one of the following queries: <tt>lang:<language-name></tt>, <tt>lang:"<language-name>"</tt>, or <tt>file:.*\.ext</tt> where <tt>ext</tt> is the file extension of that language's source code files.</blockquote><br /><span style="font-style:italic">Hacks</span><br /><blockquote>Measure of a languages hackiness. Determined by one of the following: <tt>lang:<language-name> hack</tt> or <tt>lang:"<language-name>" hack</tt></blockquote><br /><span style="font-style:italic">Sucks</span><br /><blockquote>Measure of a languages suckiness. Determined by one of the following:<tt>lang:<language-name> sucks</tt> or <tt>lang:"<language-name>" sucks</tt></blockquote><br />When choosing between two queries, the one with the larger number of hits is kept. For example, there are approximately 4.4 million hits for <tt>lang:c</tt>, and 4.53 million hits for <tt>lang:"c"</tt>. In this case, the latter number is retained.<br /> <br /><span style="font-weight:bold">Collected Data</span><br /><br /><span style="font-style:italic">Popular Languages:</span><br /><br /><table class="datatable"><tr><th>Language</th><th>Total Files</th><th>Hacks</th><th>Sucks</th></tr><tr><td>C</td><td>4,530,000</td><td>224,000</td><td>11,300</td></tr><tr><td>C++</td><td>847,000</td><td>* 2,700</td><td>3,000</td></tr><tr><td>C#</td><td>120,000</td><td>2,000</td><td>50</td></tr><tr><td>Fortran</td><td>115,000</td><td>400</td><td>20</td></tr><tr><td>Java</td><td>830,000</td><td>10,400</td><td>500</td></tr><tr><td>JavaScript</td><td>* 22,700</td><td>600</td><td>100</td></tr><tr><td>Lisp</td><td>* 36,000</td><td>600</td><td>100</td></tr><tr><td>Perl</td><td>208,000</td><td>14,200</td><td>400</td></tr><tr><td>PHP</td><td>580,000</td><td>14,200</td><td>300</td></tr><tr><td>Python</td><td>326,000</td><td>400</td><td>300</td></tr><tr><td>Ruby</td><td>15,600</td><td>2,000</td><td>50</td></tr><tr><td>Shell</td><td>80,600</td><td>4,000</td><td>50</td></tr><tr><td>Visual Basic</td><td>* 29,900</td><td>400</td><td>50</td></tr></table><br /><br /><span style="font-style:italic">Unpopular Languages:</span><br /><br />Each of these languages have a footprint of less than 1,000 total files. These statistically insignificant outliers will not be considered during subsequent analysis.<br /><br /><table class="datatable"><tr><th>Language</th><th>Total Files</th><th>Hacks</th><th>Sucks</th></tr><tr><td>ADA</td><td>100</td><td>50</td><td>0</td></tr><tr><td>COBOL</td><td>150</td><td>0</td><td>0</td></tr><tr><td>Pascal</td><td>* 600</td><td>100</td><td>3</td></tr><tr><td>SmallTalk</td><td>* 400</td><td>100</td><td>6</td></tr></table><br /><br />* Values for starred entries were collected as follows: <ul><li>C++ Hacks: This value is a composite of three queries each starting with <tt>lang:"c++"</tt> - <tt>little\shack</tt> (300), <tt>dirty\shack</tt> (400), and <tt>ugly\shack</tt> (2,000).</li><li>JavaScript: Searching for <tt>lang:"javascript"</tt> returns only 200 results, while <tt>lang:"javascript" div</tt> returns 22,700.</li><li>Lisp file count: Like JS, to get a reasonable count, used <tt>lang:"lisp" off</tt> instead of <tt>lang:"lisp"</tt> (only 400).</li><li>Pascal: <tt>lang:pascal</tt> has only 300 hits, while <tt>lang:pascal const</tt> has 300.</li><li>SmallTalk: <tt>lang:smalltalk</tt> has only 100 hits, while <tt>lang:smalltalk dir</tt> has 400.</li><li>Visual Basic: <tt>lang:basic</tt> has only 400 hits while <tt>lang:basic def</tt> has 29,900 hits.</li></ul><br /><span style="font-weight:bold">Inferred Data</span><br /><br />To analyze this data, the following metrics are helpful: <br /><br /><span style="font-style:italic">Hack Ratio</span><br /><blockquote>The number of "hack" results multiplied by 1,000 and divided by the total number of files.</blockquote><br /><span style="font-style:italic">Suck Ratio</span><br /><blockquote>The number of "sucks" results multiplied by 1,000 and divided by the total number of files.</blockquote><br />For example, the Hack Ratio of PHP is 14,200 * 1,000 / 580,000 = 24.48.<br /><br /><span style="font-style:italic">Languages Sorted by Hack Ratio</span><br /><br /><table class="datatable"><tr><th>Rank</th><th>Language</th><th>Hack Ratio</th></tr><tr><td>1</td><td>Ruby</td><td>128.21</td></tr><tr><td>2</td><td>Perl</td><td>68.27</td></tr><tr><td>3</td><td>Shell</td><td>49.63</td></tr><tr><td>4</td><td>C</td><td>49.45</td></tr><tr><td>5</td><td>JavaScript</td><td>26.43</td></tr><tr><td>6</td><td>PHP</td><td>24.48</td></tr><tr><td>7</td><td>C#</td><td>16.67</td></tr><tr><td>8</td><td>Lisp</td><td>16.67</td></tr><tr><td>9</td><td>Visual Basic</td><td>13.38</td></tr><tr><td>10</td><td>Java</td><td>12.53</td></tr><tr><td>11</td><td>Fortran</td><td>3.48</td></tr><tr><td>12</td><td>C++</td><td>3.19</td></tr><tr><td>13</td><td>Python</td><td>1.23</td></tr></table><br /><br /><span style="font-style:italic">Languages Sorted by Suck Ratio</span><br /><br /><table class="datatable"><tr><th>Rank</th><th>Language</th><th>Suck Ratio</th></tr><tr><td>1</td><td>JavaScript</td><td>4.41</td></tr><tr><td>2</td><td>C++</td><td>3.54</td></tr><tr><td>3</td><td>Ruby</td><td>3.21</td></tr><tr><td>4</td><td>Lisp</td><td>2.78</td></tr><tr><td>5</td><td>C</td><td>2.49</td></tr><tr><td>6</td><td>Perl</td><td>1.92</td></tr><tr><td>7</td><td>Visual Basic</td><td>1.67</td></tr><tr><td>8</td><td>Python</td><td>0.92</td></tr><tr><td>9</td><td>Shell</td><td>0.62</td></tr><tr><td>10</td><td>Java</td><td>0.6</td></tr><tr><td>11</td><td>PHP</td><td>0.52</td></tr><tr><td>12</td><td>C#</td><td>0.42</td></tr><tr><td>13</td><td>Fortran</td><td>0.17</td></tr></table><br /><br /><span style="font-weight:bold">Analysis</span><br /><br />Graphing Suck Ratio as a function of Hack Ratio gives us an estimate of the value of hackiness as a measure of suckiness in a language (click for larger image).<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6344/605028761734317/1600/hackiness-suckiness-relationship-labels.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/6344/605028761734317/400/hackiness-suckiness-relationship-labels.png" alt="" border="0" /></a> Clearly there is generally a positive trend between the two metrics. Languages with higher Hack Ratios tend to also have higher Suck Ratios.<br /><br />This means one can expect a language with a low Hack Ratio to tend not to suck, and likewise, a language with a low Suck Ratio will probably require fewer hacks.<br /><br />However, as the ratios increase, the strength of the relationship decreases. This leads to notable exceptions such as C++, which has a high Suck Ratio, but comparitively low Hack Ratio.<br /><br /><span style="font-weight:bold">Conclusions</span><br /><br />It would seem that the foregone conclusions in the previous study were premature. With a Suck Ratio of 4.41, JavaScript is over twice as sucky as Perl, which has a Suck Ratio of just 1.92.<br /><br />According to these findings, Ruby is the hackiest language of all, with a Hack Ratio of 128.21. In fact, it's nearly twice as hacky as its nearest competitor, Perl (with a Hack Ratio of just 68.27).<br /><br />There's clearly a need for more research in this area, as the field of "statistical inference of the relative virtues of programming languages" is still in its infancy.<br /><br /><a href="http://www.dzone.com/links/clearing_the_air_more_languages_that_suck.html">dzone this article</a>jimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com12tag:blogger.com,1999:blog-4956395616127531208.post-67439702642912327032006-10-14T19:36:00.000-05:002006-12-21T04:10:25.001-05:00Mano a Mano - Notepad++ vs TextpadI'm sorry for the inconvenience, but <a href="http://jimbojw.com/wiki/index.php?title=NPP_vs_Textpad">this content has moved.</a> -- Jimjimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com2tag:blogger.com,1999:blog-4956395616127531208.post-6679124837314674992006-10-13T01:54:00.000-05:002006-10-13T12:03:22.405-05:00Innovations - Google Code Search AutocompleteGoogle's new <a href="http://www.google.com/codesearch">Code Search</a> is all the rage these days. Here I present Google Code Search Autocomplete - my contribution to this already great service.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6344/605028761734317/1600/gcautocomplete-demo.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/6344/605028761734317/400/gcautocomplete-demo.png" alt="" border="0" /></a><br />Think of it as adding functionality similar to what <a href="http://www.google.com/webhp?complete=1&hl=en">Google Suggest</a> adds to the normal Google search.<br /><br /><span style="font-weight:bold">Download</span><br /><br />To get the autocompleter, you must: <ol><li>Install the latest versions of <a href="">Firefox</a> and <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> (if you haven't already)</li><li>Once in Firefox, navigate to the <span style="font-weight:bold"><a href="http://userscripts.org/scripts/source/5948.user.js">Google Code Search Autocomplete Userscript</a></span></li><li>Install it as you would any userscript by clicking the "Install" button in the upper right-hand corner of the screen.</li></ol> Once it's installed, head on over to Google's Code Search and give it a try.<br /><br />Start typing in the search box to see the drop-down list of suggestions.<br /><br /><span style="font-weight:bold">Developer Notes</span><br /><br />This script does its dirty work by issuing an Ajax query behind the scenes for whatever you've typed so far plus the string "\w*". So if you had typed "google", the Ajax call would query for "google\w*". For readers unfamiliar with regular expressions, this basically means "google*" where * can be any number of "word" characters (A-Z, a-z and _).<br /><br />The resulting page is then parsed for all instances of <tt><b></tt> tags with <tt>class="hl"</tt>. These contain the query matches. Once collected, terms are then sorted and displayed to the user via the drop-down div below the search field.<br /><br />Due to these design constraints, some of the script's behavior may seem strange at first. For example you may get only a handful of hits for "goo", but many for "google". This has to do with the number of redundant hits returned during the transparent Ajax request. The more reduntent matches there are, the fewer drop-down options there will be.<br /><br />Also, since an entire page request is being made behind the scenes, the drop-down may feel slow to update. Especially if you're on a slower connection.<br /><br /><span style="font-weight:bold">Summary</span><br /><br />This article builds on concepts developed in a <a href="http://jimbojw.blogspot.com/2006/10/killer-combos-greasemonkey.html">previous blog entry</a>, in which I describe the process of incorporating the Scriptaculous library into Greasemonkey userscripts. Check it out if you'd like to learn more about the underlying mechanics of this script.<br /><br />I hope you've found this useful or interesting. Drop me a line and let me know what you think!<br /><br /><a href="http://digg.com/software/Google_Mashup_Google_Code_Search_Google_Suggest_Web_2_0_Goodness">digg this article</a>jimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com2tag:blogger.com,1999:blog-4956395616127531208.post-41556321899506485042006-10-12T14:05:00.000-05:002006-10-19T02:33:04.293-05:00Clearing the Air - Languages that Suck<blockquote style="font-size:small"><span style="font-weight:bold;color:red;font-size:small">New!</span> Check out the follow-up article <a href="http://jimbojw.blogspot.com/2006/10/clearing-air-more-languages-that-suck.html">More Languages that Suck</a>.</blockquote> Everyone knows that programming languages suck, but which sucks the most?<br /><br />I have conducted a scientific study to answer this question, and humbly present my findings below.<br /><br /><span style="font-weight:bold">Methodology</span><br /><br />All data for this report were collected from search results done through <a href="http://www.google.com/codesearch">Google's Code Search</a>, by searching for the phrase "<language> sucks" (without quotes) where <language> was one of these 10: C, C++, Java, JavaScript, Visual Basic, Python, Ruby, Perl, PHP and Lisp.<br /><br />Occasionally, two similar searches would turn up different numbers of hits. For example, "C sucks" results in 35,900 hits while "c sucks" results in 49,600 hits. Where this is the case, the query with the greater number of hits is kept.<br /><br /><span style="font-weight:bold">Results</span><br /><br />The results seem to confirm conventional wisdom: Perl sucks the most, Ruby sucks least and all other languages fall somewhere in between.<br /><br />It was surprising however to find that Visual Basic sucks less than JavaScript - I'd have thought it would be the other way around.<br /><br /><table class="datatable"><tr><th>Rank</th><th>Language</th><th>Query</th><th>Hits</th></tr><tr><td>1</td><td>Perl</td><td>perl sucks</td><td>58,900</td></tr><tr><td>2</td><td>C</td><td>c sucks</td><td>49,600</td></tr><tr><td>3</td><td>C++</td><td>c++ sucks</td><td>39,900</td></tr><tr><td>4</td><td>Java</td><td>java sucks</td><td>27,900</td></tr><tr><td>5</td><td>Lisp</td><td>Lisp sucks</td><td>19,100</td></tr><tr><td>6</td><td>JavaScript</td><td>JS sucks</td><td>13,400</td></tr><tr><td>7</td><td>Visual Basic</td><td>VB sucks</td><td>8,000</td></tr><tr><td>8</td><td>PHP</td><td>php sucks</td><td>3,000</td></tr><tr><td>9</td><td>Python</td><td>python sucks</td><td>2,000</td></tr><tr><td>10</td><td>Ruby</td><td>ruby sucks</td><td>500</td></tr></table><br /><br />Here's a graph of the above data (click to view larger version):<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6344/605028761734317/1600/languages-that-suck.0.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/6344/605028761734317/400/languages-that-suck.0.png" alt="" border="0" /></a><br /><span style="font-weight:bold">Operating Systems That Suck</span><br /><br />Out of curiosity, I also tested for operating systems which suck. Again conventional wisdom proved correct: although Windows, Mac and Linux all suck, Windows definitely sucks the most.<br /><br /><table class="datatable"><tr><th>Rank</th><th>Language</th><th>Query</th><th>Hits</th></tr><tr><td>1</td><td>Windows</td><td>windows sucks</td><td>60,000</td></tr><tr><td>2</td><td>Mac</td><td>mac sucks</td><td>58,200</td></tr><tr><td>3</td><td>Linux</td><td>linux sucks</td><td>49,600</td></tr></table><br /><br /><span style="font-weight:bold">Honorable Mentions</span><br /><br />Surprisingly, a search for "C# sucks" returns <a href="http://www.google.com/codesearch?hl=en&lr=&q=%22C%23+sucks%22&btnG=Search">only one result</a>. I took this to be a statisitically insignificant outlier, suggesting that either C# sucks so badly that nobody uses it, or that those who do use it dare not openly challange the .NET regime.<br /><br />Also, searching for files with COBOL's file extension (.CBL) reveals about 100 hits. Unsurprisingly, the query "cobol sucks" (no quotes) also has about 100 hits. I leave it as an excersize to the reader to interpret this result.<br /><br /><span style="font-weight:bold">Conclusion</span><br /><br />All programming languages suck, some just suck more than others. Thank you.<br /><br />(If you liked that, <a href="http://jimbojw.blogspot.com/2006/10/clearing-air-more-languages-that-suck.html">keep reading...</a>)<br /><br /><a href="http://digg.com/programming/Languages_that_Suck">digg this article</a>, <a href="http://www.dzone.com/rsslinks/clearing_the_air_languages_that_suck.html">dzone this article</a>jimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com14tag:blogger.com,1999:blog-4956395616127531208.post-42394825069653906362006-10-08T23:02:00.002-05:002006-12-21T04:11:21.697-05:00Killer Combos - Greasemonkey & ScriptaculousI'm sorry for the inconvenience, but <a href="http://jimbojw.com/wiki/index.php?title=Injecting_Scriptaculous_via_Greasemonkey">this content has moved.</a> -- Jimjimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com0tag:blogger.com,1999:blog-4956395616127531208.post-36772854675262774542006-10-08T22:58:00.000-05:002006-12-21T04:12:09.467-05:00Cool Tools - Tamper DataI'm sorry for the inconvenience, but <a href="http://jimbojw.com/wiki/index.php?title=Tamper_Data">this content has moved.</a> -- Jimjimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com1tag:blogger.com,1999:blog-4956395616127531208.post-44150289998051795522006-10-07T21:50:00.000-05:002006-12-21T04:13:00.679-05:00Cool Tools - IBM Page DetailerI'm sorry for the inconvenience, but <a href="http://jimbojw.com/wiki/index.php?title=IBM_Page_Detailer">this content has moved.</a> -- Jimjimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com0tag:blogger.com,1999:blog-4956395616127531208.post-26078652942653613872006-10-04T21:42:00.000-05:002006-10-04T22:25:39.939-05:00Must Have Software - OpenGrokIf you're a <a href="http://www.jonathancoulton.com/2006/04/14/thing-a-week-29-code-monkey/">code monkey</a> like me, then you've probably had to search through a source tree at one time or another - whether you're just a cog, or the whole machine.<br /><br />Enter <a href="http://www.opensolaris.org/os/project/opengrok/">OpenGrok</a> the "wicked fast source code browser".<br /><br />From the project site:<br /><blockquote></blockquote><blockquote>OpenGrok is a fast and usable source code search and cross reference engine. It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like SCCS, RCS, CVS and Subversion. In other words it lets you grok (profoundly understand) the open source, hence the name OpenGrok. It is written in Java.</blockquote>To see it in action:<br /><ol><li>Visit the <a href="http://cvs.opensolaris.org/source/">OpenSolaris Source Browser</a><br /></li><li>Search for "grok" via the Full Search field.</li><li>Watch your results come back lightning fast!<br /></li></ol><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/6344/605028761734317/1600/opengrok-screenshot.1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/6344/605028761734317/320/opengrok-screenshot.1.png" alt="" border="0" /></a><br />Here's how it works: First you set loose OpenGrok's indexer on your codebase. This can take anywhere from a few minutes to several hours depending on code volume. When finished, you configure your WAR to point at the index and fire it up on your favorite J2EEish container (Tomcat worked great for me).<br /><br />Here are some more features of OpenGrok:<br /><ul><li>Syntax Highlighting - Source code for recognized languages is syntax highlighted for ease of viewing.</li><li>Source Browsing - It's easy to walk up and down the directory structure of your code via /xref.<br /></li><li>Project Descriptions - In the search results, notice the <span style="font-style: italic;"><span style="color: rgb(0, 153, 0);">green italicized</span> </span>text next to the project names. These descriptions are configured via an optional CSV file.<br /></li><li>Line Number Links - On the right hand side in the search results, line links take you directly to the matching line of the source code file.</li></ul>If you or your organization have any appreciable amount of source code, OpenGrok will make you more effective at finding the information you require.<br /><br />There are a few very desirable pieces missing from OpenGrok at present, which I hope to provide in future posts. Stay tuned.jimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com1tag:blogger.com,1999:blog-4956395616127531208.post-2246895198501567192006-10-03T21:56:00.000-05:002006-10-03T22:24:33.957-05:00PrologueNo one will ever read this - or at least, no one will find it interesting. Nevertheless I am compelled to write. The blank page is a formidable foe, one which I am determined to overcome. But with what? Who knows.<br /><br />No matter. Words will find their place, as all things eventually do. Wo bu zhi dao.jimbojwhttp://www.blogger.com/profile/01150872829875618738noreply@blogger.com0