tag:blogger.com,1999:blog-81709928452024813942019-02-14T00:59:19.314-08:00Huikau?... finding time to write something useful is nontrivial ...Mike McKinneynoreply@blogger.comBlogger45125tag:blogger.com,1999:blog-8170992845202481394.post-46494700089337262932012-03-29T18:44:00.000-07:002012-03-29T18:44:11.339-07:00As the site title says...let my VPS go... backed everything up and kinda missed some of the content I had.&nbsp; so I stuck it on blogger.&nbsp; busy busy busy, but had to take time to go through the old stuff.&nbsp; memories...Mike McKinneynoreply@blogger.com4tag:blogger.com,1999:blog-8170992845202481394.post-34998308216597142532010-03-15T04:56:00.000-07:002012-03-29T17:51:00.275-07:00New opportunityAs anyone reading this may already know... I left Platinum Solutions for a position with a company called Solutions Made Simple, Inc. based in Reston, VA. I'm moving my family away from the beach which makes us sad, but we are moving into an area we are very familiar with and are looking at this as an adventure!<br/><br/>I had a great 5 year run with Platinum and met some great people along the way. Hoping to create more lasting relationships with SMSi and their clients and am looking forward to some very challenging work ahead!Mike McKinneynoreply@blogger.com2tag:blogger.com,1999:blog-8170992845202481394.post-4277144708283792412009-11-23T05:03:00.000-08:002012-03-29T17:51:00.284-07:00Web Services in Seconds (SOAP/REST)Don't blink...<br/><br/>1. open netbeans...<br/><br/><img class="alignnone" title="netbeans start" src="http://pages.huikau.com/nb_start.bmp" alt="" width="384" height="246" /><br/><br/>2. create a new Java Web Project<br/><br/><img class="alignnone" title="create project" src="http://pages.huikau.com/create_proj.jpg" alt="" width="384" height="268" /><br/><br/>3. create a new Web Service<br/><br/><img class="alignnone" title="create service" src="http://pages.huikau.com/create_web_service.bmp" alt="" width="382" height="66" /><br/><br/><img class="alignnone" title="service" src="http://pages.huikau.com/service.jpg" alt="" width="384" height="298" /><br/><br/>4. specify the implementation details of your new Web Service<br/><br/><img class="alignnone" title="implementation" src="http://pages.huikau.com/impl.bmp" alt="" width="368" height="344" /><br/><br/>5. deploy it!<br/><br/><img class="alignnone" title="deploy" src="http://pages.huikau.com/deploy.bmp" alt="" width="254" height="158" /><br/><br/>6. go see your newly created Web Service in action!<br/><br/><a href="http://localhost:8080/MyTest/TimeService?wsdl">http://localhost:8080/MyTest/TimeService?wsdl</a><br/><br/>7. now to support REST too!<br/><br/><img class="alignnone" title="generate" src="http://pages.huikau.com/generate.bmp" alt="" width="317" height="274" /><br/><br/>8. test your newly created REST service!<br/><br/><img class="alignnone" title="test rest" src="http://pages.huikau.com/test_rest.bmp" alt="" width="346" height="184" /><br/><br/><img class="alignnone" title="rest tool" src="http://pages.huikau.com/rest_tool.jpg" alt="" width="384" height="248" /><br/><br/>Or just hit:<br/><br/><a href="http://localhost:8080/MyTest/resources/timeserviceport/gettime/">http://localhost:8080/MyTest/resources/timeserviceport/gettime/<br/></a><br/><br/>That's it, hope you didn't blink...Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-6114110498650704732009-11-23T01:53:00.000-08:002012-03-29T17:51:00.293-07:00Groovy in ActionI started my career with "dynamic languages" (we called them scripting languages then). I enjoy getting things done quickly with scripting languages, the power it gives you and the freedom to concentrate on the problem domain and not fight with the platform. With all the new languages that are available on the JVM alone, I'm having a lot of fun getting back to my roots. To this point I've mostly stuck to Ruby (JRuby) as I really like the syntax of the Ruby language. I've been aware of Groovy for quite some time... hearing Scott Davis and Andy Glover singing it's praises. But have just not given it enough attention... until recently.<br/><br/>I've been reading the <a href="http://www.amazon.com/Groovy-Action-Dierk-Koenig/dp/1932394842/ref=sr_1_1">Groovy in Action</a> book from Manning. What a great title to get started with. When I get a tech book, I want to make sure it will pass the test of time... meaning: I don't want to read through it and then have to sell it or throw it away immediately due to it's uselessness. This book has a key component to it that makes it worth the money... the logical flow and organization of the book makes it perfect to work as a reference manual later on. If you are like me, you don't exactly remember EVERYTHING you read... reference abilities are VERY important to me.<br/><br/>With features like "FOR THE GEEKS", the layout stays interesting (as interesting as a technical book can be anyway... :) ) I also appreciate the effort taken not to go too far into Grails. Grails is very important to the Groovy language, but not everything. It's touched on in the back of the book, but just enough to give you an idea of it's potential benefit to your arsenal.Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-22003833202539834782009-05-31T17:05:00.000-07:002012-04-26T19:25:29.712-07:00Google App Engine - JVM support<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-ZEg7t4HVrho/T5oDUqQKIiI/AAAAAAAAAlw/oHMwCzX3-Mw/s1600/appengine.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="http://3.bp.blogspot.com/-ZEg7t4HVrho/T5oDUqQKIiI/AAAAAAAAAlw/oHMwCzX3-Mw/s200/appengine.png" width="200" /></a></div>So of course most have heard <a href="http://code.google.com/appengine/" target="_blank">Google App Engine</a> now supports the <a href="http://code.google.com/appengine/docs/java/overview.html" target="_blank">JVM</a>... and in doing that they have not only gone from just supporting Python, they now support Java and most of the other languages written to run on the JVM.<br /><br /><a href="http://3.bp.blogspot.com/-2Sh8_lEQRo8/T5oDaSR6-EI/AAAAAAAAAl4/f3rx31-5HB8/s1600/sinatra.jpeg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://3.bp.blogspot.com/-2Sh8_lEQRo8/T5oDaSR6-EI/AAAAAAAAAl4/f3rx31-5HB8/s1600/sinatra.jpeg" /></a>I find it interesting the first app I built for GAE with the new JVM support was simple <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> app using <a href="http://jruby.org/" target="_blank">JRuby</a>.&nbsp; Like many other alternative JVM language implementers, the JRuby team leaped into action to make sure their stuff worked on GAE.&nbsp; I have to admit I was amazed how things just seemed to work.&nbsp; With some help from Ola Bini's <a href="http://olabini.com/blog/2009/04/jruby-on-rails-on-google-app-engine/" target="_blank">post</a> (for <a href="http://github.com/olabini/bumble/tree/master" target="_blank">Bumble</a>), I was able to build a <a href="http://app.huikau.com/" target="_blank">simple application</a> in no time at all.<br /><br /><a href="http://caucho.com/" target="_blank"><img alt="Coucho" class="alignleft" height="63" src="http://pages.huikau.com/coucho.png" style="float: left; margin: 5px;" width="108" /></a>Recently I was asked to look into implementation options for a project who's resources seem to have a skill set based in <a href="http://php.net/" target="_blank">PHP</a>.&nbsp; Most of our work is based in the JVM so I went back to <a href="http://caucho.com/resin/doc/quercus.xtp" target="_blank">Caucho's Quercus PHP</a> support for the JVM.&nbsp; Based on a recommendation from the Twitterverse I started looking into the CodeIgniter PHP web framework as well.&nbsp; This project seems to have a some momentum, the documentation at first glance appears up-to-snuff and video demonstrations are always a plus!<a href="http://codeigniter.com/" target="_blank"><img alt="" class="alignright" height="78" src="http://codeigniter.com/user_guide/images/ci_logo_flame.jpg" style="float: right; margin: 5px;" width="71" /></a><br /><br />After playing around with <a href="http://codeigniter.com/" target="_blank">CodeIgniter </a>for a while running under oucho's Resin server, I figured someone had already run this framework on GAE... and of course someone has.&nbsp; Caucho released a <a href="http://blog.caucho.com/?p=196" target="_blank">blog post</a> about Quercus running PHP on GAE and <a href="http://fillanocode.appspot.com/" target="_blank">this application</a> seems to be proof of CodeIgniter on GAE.<br /><br />Google had a ton of folks crying out to get their favorite language supported on GAE, Java was high on that list I'm sure.&nbsp; But in supporting the JVM, Google has opened their App Engine cloud based platform to a miriad of developers to play around on.&nbsp; Nice move Google.Mike McKinneynoreply@blogger.com2tag:blogger.com,1999:blog-8170992845202481394.post-34438394310254214842009-01-08T16:04:00.000-08:002012-03-29T17:51:00.314-07:00Pick your battlesRandom: Had a conversation today about when the right time to push for the things you want at work... in this case tools. There is definitely a right and wrong time. In this case, some of the push-back is due to the many deadlines hanging over everyone's head... and then again some may be posturing. Requesting new tools to be installed/purchased/etc. during a period of stress at any level is futile. The best advice I could give was to get things done first and document the different times during the push that this new tool could have come in handy. After a "big win" or deployment, I'm not sure he'll have the same resistence to the tools he wants.Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-21599858282692401792008-12-09T02:45:00.000-08:002012-03-29T17:51:00.332-07:00New Ruby Shootout 12/08Antonio Cangiano has released another <a href="http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008/">Ruby Shootout</a> which are always fun to check out. Looks like Ruby 1.9 is leading the pack with JRuby 1.1.6RC1 close behind. Some of the JRuby tests failed which I'm sure pissed Charlie off!<br/><p style="text-align: center;"><a href="http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008/"><img class="aligncenter" src="http://antoniocangiano.com/images/shootout3/chart_total_time_small.png" alt="" width="350" height="230" /></a></p>Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-10898117818277712832008-12-05T04:54:00.000-08:002018-01-17T11:19:47.637-08:00JRuby vs. Java speed (re: Stochastic Simulation with SSJ)Just read Ali Rizvi's <a href="http://saaridev.wordpress.com/2008/11/15/jruby-stochastic-simulation-with-ssj/" target="_blank">blog post</a> about "JRuby: Stochastic Simulation with SSJ" and decided to take a look at the implementation real quick... of course the Java version will be much faster, but the numbers given seemed a little strange.&nbsp; After setting up the environment and running the tests, I saw the major slowdown as expected, then I decided to take a look at the Ruby code to see if I could speed things up a little.&nbsp; This was done rather quickly, if you have better result... please share!<br /><br />First, the Java version:<br /><pre><code class="css">real 0m7.960s<br />user 0m7.839s<br />sys 0m0.056s</code></pre><br />The JRuby version took too long to run (I'm pressed for time) so I added a few options to the runtime:<br /><pre><code class="css"><br /><br />jruby -J-Djruby.compile.fastest=true --server collision.rb<br /><br />real 3m55.834s<br /><br />user 3m53.684s<br /><br />sys 0m2.355s<br /><br /></code></pre><br /><br />Not as bad as reported by the blog ref'd above... but still pretty bad. I had a hunch the loops were what was killing the time and made the following changes to the collision.rb file:<br /><pre><code class="ruby"><br /><br />@k.times { |i| @used[i] = false}<br /><br />changed to:<br /><br />@used.fill(false)<br /><br /></code></pre><br /><br />That brought the time down a bit:<br /><br /><pre><code class="css"><br /><br />real 1m1.430s<br /><br />user 1m1.344s<br /><br />sys 0m0.538s<br /><br /></code></pre><br /><br />It would seem loops are a sore spot. (kinda expected? the loop for setting happens in the Java impl) Decided to make one last change to see what happened. I condensed the "generate_c" method back into "simulate_runs" method to get the loops in one place. Some (not much) benefit was shown in my tests:<br /><br /><pre><code class="css"><br /><br />real 0m59.081s<br /><br />user 0m59.027s<br /><br />sys 0m0.502s<br /><br /></code></pre><br /><br />CONCLUSION: Yes, straight java is faster. Yes, there are ways to tune your Ruby to make things a bit more efficient. Yes, I'm sure there are other ways to make this run faster. I think prototyping this sort of thing in JRuby is just fine... then when you need more perf (if this stuff will be called from say a JRuby on Rails app) you can code it up in Java (Collision.java) and just call that from JRuby layer.<br /><br />Here is the final collision.rb I ended up with :<br /><pre><code class="ruby"><br /><br />require 'java'<br /><br />require 'ssj.jar'<br /><br /><br /><br />import 'umontreal.iro.lecuyer.rng.RandomStream'<br />import 'umontreal.iro.lecuyer.stat.Tally'<br />import 'umontreal.iro.lecuyer.rng.MRG32k3a'<br /><br />class Collision<br /> def initialize(k, m)<br /> @k = k<br /> @m = m<br /> @lambda = m * m / (2.0 * k)<br /> @used = Array.new(k, false)<br /> end<br /><br /><br />def simulate_runs(n, stream, stat_c)<br /><br />stat_c.init<br /><br />n.times do<br /><br />c = 0<br /><br />@used.fill(false)<br /><br />@m.times do<br /><br />loc = stream.nextInt(0, @k-1)<br /><br />if @used[loc]<br /><br />c += 1<br /><br />else<br /><br />@used[loc] = true<br /><br />end<br /><br />end<br /><br />stat_c.add(c)<br /><br />end<br /><br />stat_c.setConfidenceIntervalStudent()<br /><br />puts stat_c.report(0.95, 3)<br /><br />puts " Theoretical mean: #{@lambda} "<br /><br />end<br /><br /><br /><br />def self.run<br /><br />stat_c = Tally.new("Statistics on collision")<br /><br />col = Collision.new(10000,500)<br /><br />col.simulate_runs(100000, MRG32k3a.new, stat_c)<br /><br />end<br /><br /><br /><br />end<br /><br /><br /><br />Collision.run<br /><br /></code></pre>Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-7620292265269302102008-12-04T22:52:00.000-08:002012-03-29T17:51:00.351-07:00JRuby getting lots of attention latelyOf course while I'm away, toiling on projects using Spring/Hibernate, JBoss/EJB3/GWT things with the JRuby world get really exciting. New versions of JRuby are rolling out everytime you turn around and the gems and projects that run on jruby are getting refreshed daily it seems. Here are just some of the highlights I've seen fly by...<br/><ul><br/> <li><a href="http://jruby.codehaus.org/">JRuby 1.1.6RC1</a> released (final due next week)</li><br/> <li><a href="http://rubyforge.org/projects/glassfishgem/">Glassfish gem 0.9.1</a> released (with latest Glassfish v3 server inside)</li><br/> <li><a href="http://weblog.rubyonrails.org/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs">Rails 2.2 released</a> and JRuby mentioned right there in the title... wasn't long ago when the jruby team was fighting to get Rails even run on it's implementation.</li><br/> <li><a href="http://fuzzypanic.blogspot.com/2008/12/trisano-perf-notes-jruby-postgres.html">Mike Herrick and his team</a> are seeing incremental performance improvements for jruby releases...</li><br/></ul><br/>Hopefully I'll get some time of the holidays to dust off some of my (now old) projects and give them a whirl with all the new hotness... I'd love to do some more benchmarks and see if the thread-safety of Rails does anything to improve things on jruby outright. Of course, I'll post results if I can get around to it.<br/><br/>For a sort of realtime look at what folks are doing with jruby:<br/><ul><br/> <li><a href="http://search.twitter.com/search?q=jruby">http://search.twitter.com/search?q=jruby</a></li><br/></ul>Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-783190911867928902008-09-09T17:09:00.000-07:002012-03-29T17:51:00.367-07:00So where is Pogo?I just remembered a while back AT&amp;T was looking to get into the browser market with Pogo. Some of the features look interesting... but where is it?<br/><p style="text-align: center;"><a href="http://www.pogobrowser.com/demo.html"><img class="aligncenter" style="vertical-align: middle;" src="http://pages.huikau.com/pogo1.png" alt="" width="441" height="206" /></a></p><br/><p style="text-align: center;"></p><br/><p style="text-align: center;"><a href="http://www.pogobrowser.com/demo.html"><img src="http://pages.huikau.com/pogo2.png" alt="" width="436" height="185" /></a></p>Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-83947237810341213682008-09-02T16:02:00.000-07:002012-03-29T17:51:00.375-07:00Taking a look through Google Chrome's eyesGoogle just released their new browser on the windows world... figured I'd give it a shot.<br/><p style="text-align: center;"><img class="aligncenter" src="http://www.google.com/chrome/intl/en/images/dlpage_lg.jpg" alt="google chrome" width="440" height="359" /></p><br/><p style="text-align: center;"><a title="Chrome me!" href="http://www.google.com/chrome/">Google Chrome</a></p><br/>Have already found and reported a few minor issues... some javascript horking. In all, I dig the UI. Could maybe use a "manage bookmarks" feature. Maybe it's in here somewhere. <br/><br/>(NOTE: posting this from chrome right now... found another JS issue.)Mike McKinneynoreply@blogger.com1tag:blogger.com,1999:blog-8170992845202481394.post-32243769804039709302008-07-17T21:53:00.000-07:002012-03-29T17:51:00.386-07:00Interesting... that is allJust read <a href="http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/">this post</a>...<br/><br/>Just saying... it's interesting. Seems to be a lot of the benchmarking bug going around these days.Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-13845392404121813882008-07-03T18:21:00.000-07:002012-03-29T17:51:00.393-07:00JRuby slowdown from Rails 2.0.2 to 2.1.0Before you decide to bring your current <a href="http://jruby.org">JRuby</a> on <a href="http://rubyonrails.com">Rails</a> app to the latest 2.1.0 version... you may want to take a look at the performance. I was running the console benchmark from <a href="http://blog.huikau.com/2008/04/29/some-rails-perf-numbers-on-jruby-111/">this blog post</a> with jruby trunk and saw some numbers I wasn't expecting:<br/>[sourcecode language="ruby"]<br/>in console: 6.times {puts Benchmark.measure {10000.times {Person.find :first}}.total}<br/>4.47 : jruby 1.1.2 & rails 2.0.2 (jdbc) (best out of 6 runs)<br/>5.43 : jruby 1.1.2 & rails 2.1.0 (jdbc)<br/>4.12 : jruby 1.1.3 (trunk) & rails 2.0.2 (jdbc)<br/>5.06 : jruby 1.1.3 (trunk) & rails 2.1.0 (jdbc)<br/>[/sourcecode]<br/><br/>JRuby trunk IS faster than 1.1.2 as expected, but JRuby overall is experiencing a (pretty significant) slowdown when running Rails 2.1.0.<br/><br/>Hopefully finding the culprit for this slowdown will open the floodgates for improving JRuby on Rails performance.Mike McKinneynoreply@blogger.com8tag:blogger.com,1999:blog-8170992845202481394.post-83032624088843545122008-05-30T07:00:00.000-07:002012-03-29T17:51:00.411-07:00Loss of internet connection...When you have to write something like this (on mac), things are bad mmmmkay?<br/><br/>[sourcecode language="ruby"]<br/>loop do<br/> if system('curl -m 2 http://google.com')<br/> system("say \"Mike! Cox Communications has finally fixed the lines, we're back in business!\"")<br/> end<br/> sleep(30)<br/>end<br/>[/sourcecode]Mike McKinneynoreply@blogger.com1tag:blogger.com,1999:blog-8170992845202481394.post-4716008093066859382008-05-27T07:03:00.000-07:002012-03-29T17:51:00.418-07:00Syntactic Sugar...Was reading <a href="http://www.railsenvy.com/2008/5/27/groovy-sugar-railsconf">this post</a> about Groovy syntactic sugar... closures and ++ operator are nice... but you could open up Hash and Array to get the other stuff.<br/><br/>[sourcecode language="ruby"]<br/># working with hashes<br/>class Hash<br/> def method_missing(name, *args)<br/> fetch(name) if has_key?(name) or nil<br/> end<br/>end<br/>user = {:save => true, :destroy => false}<br/>puts "--hashes"<br/>puts "save? : #{user.save}"<br/>puts "destroy? : #{user.destroy}"<br/><br/># working with arrays<br/>class Array<br/> def method_missing(name, *args)<br/> collect {|i| i.send(name)}<br/> end<br/>end<br/>puts "--upcase"<br/>puts ["Mike", "McKinney"].upcase<br/><br/># fetching attributes of arrays<br/>name1 = {:first_name => "Mike", :last_name => "McKinney"}<br/>name2 = {:first_name => "Bo", :last_name => "Diddley"}<br/>names = [name1, name2]<br/><br/>puts "--first names "<br/>puts names.first_name<br/>puts "--last names "<br/>puts names.last_name<br/>puts "--middle names "<br/>puts names.middle_name<br/>[/sourcecode]<br/><br/>Of course you would want to look a little closer at the implications this type of patch would have on your code, but it's sure nice how flexible ruby can be.Mike McKinneynoreply@blogger.com1tag:blogger.com,1999:blog-8170992845202481394.post-77221043499976017682008-05-13T07:03:00.000-07:002012-03-29T17:51:00.426-07:00JavaOne '08 - Script Bowl apps for JRuby releasedThis year's JavaOne had an interesting competition... the <a href="http://java.sun.com/javaone/sf/2008/articles/scripting.jsp">Script Bowl</a>. Pitting 4 different languages (<a href="http://groovy.codehaus.org/">Groovy</a>, <a href="http://www.scala-lang.org/">Scala</a>, <a href="http://www.jython.org">Jython </a>&amp; <a href="http://jruby.codehaus.org/">JRuby</a>) on the JVM against each other in three different categories. (Rich Client Application, Web Application and an Open event) Check the results here on <a href="http://weblogs.java.net/blog/rags/archive/2008/05/the_script_bowl.html">Rags' blog</a>.<br/><br/>Headius just posted the <a href="http://dist.codehaus.org/jruby/talks/Script%20Bowl%202008/" title="JRuby Script Bowl artifacts">JRuby Script Bowl artifacts</a> for your viewing pleasure. Anyone know if the other languages have posted their apps/code?Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-50579868842424576722008-05-05T18:04:00.000-07:002012-03-29T17:51:00.433-07:00Re: RSS Feeds for SubversionI was reading a friend's blog post about <a href="http://mattharrah.com/blog/software-development/rss-feeds-for-subversion/" title="RSS Feeds for Subversion">RSS feeds for Subversion</a> repositories earlier... he couldn't find anything that was not written in a scripting language which he has no access to in his environment... he needed a Java based solution. He solved his problem with a war. I came back to this after dinner (and a few glasses of wine) and decided to show him another way to solve this problem on the JVM... (you knew it was coming Matt.)<br/><br/>Assuming you already have JRuby setup (<a href="http://wiki.jruby.org/wiki/Getting_Started" title="JRuby Getting Started">of course you do</a>), we'll do the following to get the one gem we'll need:<br/>[sourcecode language="css"]<br/>> jruby -S gem install rscm<br/>[/sourcecode]<br/><br/>The <a href="http://rscm.rubyforge.org/" title="http://rscm.rubyforge.org/">RSCM</a> (Ruby Source Code Management) gem provides a nice interface to SVN, CVS, ClearCase, StarTeam, etc. and since it's written in pure Ruby, it runs just fine on the JVM.<br/><br/>Then download this <a href="http://pages.huikau.com/server.rb" title="server.rb">file</a>. Not much to it, 106 lines and 45 of that is the template for creating the rss xml doc.<br/><br/>Command line has a few options, here's an example:<br/>[sourcecode language="css"]<br/>> jruby -J-server server.rb -p 8080 -m svnlog<br/>or just get help<br/>> jruby server --help<br/><br/>-p, --port=3003 Which port do you want the server to listen on.<br/>-m, --mount-point=svnrss http://<your server>/<mount-point><br/>-h, --help Show help (this).<br/>[/sourcecode]<br/><br/>Point your RSS reader @ the following: <a href="http://localhost:8080/svnlog?url=http://svn.codehaus.org/jruby/trunk/&amp;num_revs=15">http://localhost:8080/svnlog?url=http://svn.codehaus.org/jruby/trunk/&amp;num_revs=15</a> and here's what you get:<br/><p align="center"><a href="http://pages.huikau.com/SVN_RSS_feed.png"><img src="http://pages.huikau.com/SVN_RSS_feed.png" alt="SVN RSS Feed" border="0" height="50%" width="50%" /></a></p><br/><p align="center">(Firefox 3 beta)</p><br/>Nice, think I'll actually use this.Mike McKinneynoreply@blogger.com4tag:blogger.com,1999:blog-8170992845202481394.post-41218546206477729872008-05-01T07:20:00.000-07:002012-03-29T17:51:00.440-07:00Some Rails perf numbers on JRuby 1.1.1 part 2 (Linux, JDK 6)After <a href="http://blog.huikau.com/2008/04/29/some-rails-perf-numbers-on-jruby-111/" title="Some Rails perf numbers on JRuby 1.1.1">this post</a>, I got a lot of suggestions to re-run the benchmarks using JDK 6. I'll let you read the previous post to see what exactly I did... here's what the runtime looks like for this run:<br/><ul><br/> <li>Ubuntu 7.10 / Dell Latitude D830</li><br/> <li>Ruby 1.8.6</li><br/> <li>JRuby 1.1.1</li><br/> <li>JDK 1.6.0_03</li><br/></ul><br/>*NOTE: could not run benchmarks without jdbc drivers (jdbcmysql adapter) due to <a href="http://jira.codehaus.org/browse/JRUBY-2303" title="http://jira.codehaus.org/browse/JRUBY-2303">JRUBY-2303</a><br/><br/>First the Rails console benchmark numbers:<br/><p style="text-align: center"><img src="http://pages.huikau.com/jruby_rails_perf_linux_console.png" alt="Rails console numbers" border="0" /></p><br/>[sourcecode language="css"]<br/>5.15 seconds - Ruby console<br/>2.41 seconds - JRuby console (jdbc)<br/>[/sourcecode]<br/><br/>(side-note: re-running the console test with JDK 5 on same machine, best out of 6 runs: 3.31 seconds)<br/><br/>Next the Web Server numbers: (numbers in parens are the number of benchmark runs)<br/><p align="center"><img src="http://pages.huikau.com/jruby_rails_perf_linux_ab.png" alt="Rails ab numbers" border="0" height="320" width="450" /></p><br/>[sourcecode language="css"]<br/>272.84 Mongrel (6)<br/>257.02 GlassFish (40)<br/>235.17 Mongrel (jruby/jdbc) (20)<br/>188.12 Glassfish (-n 2, 20)<br/>179.76 Mongrel (jruby/jdbc) (10)<br/>168.52 Glassfish (6)<br/>161.12 Mongrel (jruby/jdbc) (6)<br/>151.04 Glassfish (-n 2, 6)<br/>131.89 Tomcat 6 (30)<br/>105.72 Tomcat 6 (6)<br/>[/sourcecode]<br/><br/>The console numbers show JDK 6 really kicking in... contrast that with the numbers for actually serving the Rails app and you can see there is still some work to be done to make Ruby on Rails serve faster on the JVM.<br/><br/>Again, not very scientific, just something to show where things stand for now. If you have better benchmarks, please link to them from the comments section below.Mike McKinneynoreply@blogger.com0tag:blogger.com,1999:blog-8170992845202481394.post-22537250087610908622008-04-28T18:01:00.000-07:002012-03-29T17:51:00.449-07:00Some Rails perf numbers on JRuby 1.1.1<strong>UPDATE:</strong> Next up will be the same benchmarks using Java 6 on ubuntu.<br/><br/>Just before <a href="http://jruby.org" title="JRuby.org">JRuby 1.1.1</a> was released, I was surfing around and found <a href="http://blog.hungrymachine.com/2007/11/3/jruby-looking-better-every-day" title="Hungry Machine">this post</a> which shows JRuby running basic <a href="http://rubyonrails.org" title="Ruby on Rails">Rails</a> bench tests slower than <a href="http://ruby-lang.org" title="Ruby">MRI</a>. I wondered what those numbers would look like now, so I got to testing.<br/><br/>I started by downloading the latest binary release of JRuby <a href="http://dist.codehaus.org/jruby/" title="download JRuby today!">here</a>.<br/><br/>I setup a Rails app following the theme mentioned by the blog post above, then ran the console benchmark 6 times with each runtime and list the lowest time below:<br/>[sourcecode language='css']<br/>jruby -J-server script/console production<br/>>> Benchmark.measure {10000.times {Person.find :first}}.total<br/>=> 10.352999925613403<br/><br/>ruby script/console production<br/>>> Benchmark.measure {10000.times {Person.find :first}}.total<br/>=> 4.98<br/>[/sourcecode]<br/><br/>Now I wanted to see if the ActiveRecord-JDBC drivers would help the situation:<br/>[sourcecode language='css']<br/>jruby -S gem install activerecord-jdbcmysql-adapter<br/>vi config/database.yml ("mysql" -> "jdbcmysql")<br/><br/>jruby -J-server script/console production<br/>>> Benchmark.measure {10000.times {Person.find :first}}.total<br/>=> 4.134999990463257<br/>[/sourcecode]<br/><p align="center"> <img src="http://pages.huikau.com/JRuby_console_graph.png" alt="console results" border="0" /></p><br/>Sped things up quite a bit... Now for Mongrel:<br/>[sourcecode language='css']<br/>> mongrel_rails start -e production<br/>Requests per second: 202.27 [#/sec] (mean)<br/><br/>jruby -S gem install mongrel<br/>jruby -J-server -S mongrel_rails start -e production<br/>Requests per second: 96.47 [#/sec] (mean)<br/><br/># now with adapter: jdbcmysql about the same... got a bit faster after warm-up<br/>Requests per second: 120.05 [#/sec] (mean)<br/>[/sourcecode]<br/><br/>MRI's Mongrel beats JRuby version even after a little warm-up period. I also wanted to see what GlassFish would do :<br/>[sourcecode language='css']<br/>jruby -S gem install glassfish<br/><br/>jruby -S glassfish_rails start ../person_test/<br/>Requests per second: 132.93 [#/sec] (mean)<br/><br/># now with jdbcmysql adapter<br/>jruby -S glassfish_rails start ../person_test/<br/>Requests per second: 139.96 [#/sec] (mean)<br/>[/sourcecode]<br/><br/>Just goofing around, I used an experimental setting to see what would happen. I repeated the benchmark for some time and you can then really start seeing the JVM 'harden' the execution path... I'm sure the tests above may have benefited in the same way had I let them run but here are the numbers of a glassfish_rails server with 2 Rails instances (probably ran the benchmark about 10-15 times?)<br/>[sourcecode language='css']<br/>jruby -J-server -J-Djruby.compile.fastest=true -S glassfish_rails start -n 2 ../person_test/<br/>Requests per second: 211.64 [#/sec] (mean)<br/>[/sourcecode]<br/><br/>I also wanted to see some numbers for <a href="http://tomcat.apache.org/tomcat-6.0-doc/index.html">Tomcat 6</a>, a war'd Rails app using <a href="http://caldersphere.rubyforge.org/warbler/">Warbler</a>. The numbers were not at all what I was expecting... even though I know things out of the box are not tuned for this type of deployment. The best numbers I could get were:<br/>[sourcecode language='css']<br/>Requests per second: 67.68 [#/sec] (mean)<br/>[/sourcecode]<br/><p align="center"><img src="http://pages.huikau.com/JRuby_Rails_perf_graph.png" alt="Rails perf chart" border="0" height="320" width="450" /></p><br/>So what does this tell me? JRuby is getting faster each release. There is more work to be done to make JRuby on Rails apps faster. GlassFish is a very easy way to deploy JRoR apps. And last, I am definitely doing something wrong with my war'd depoyment!<br/><br/>I could not find much else in the way of JRuby on Rails benchmarks... if you know of any, please link in comments!<br/><br/>P.S.<br/>All these benchmarks were run on a MacBook 2GHz Core Duo with 1GB mem., Java 5, JRuby 1.1.1, Ruby 1.8.6, Ruby on Rails 2.0.2, MySQL 5.0.27.Mike McKinneynoreply@blogger.com6tag:blogger.com,1999:blog-8170992845202481394.post-49995479244603216452008-04-28T16:18:00.000-07:002012-03-29T17:51:00.458-07:00Aloha Color Theme for NetBeans 6.1*<strong>UPDATE:</strong> T<span>he Aloha theme is included in the <strong>Extra Ruby Themes</strong> module<br/>for NetBeans.</span><br/><br/>Finally... (sorry for the wait) The Aloha Color Theme for NB 6.1 is available for download.<br/><br/>The original version for 6.0 (<a href="http://blog.huikau.com/2008/01/25/aloha-color-theme-for-netbeans-6/">here</a>) had issues coming over. If you have not updated yet, you will want to with <a href="http://www.netbeans.org/community/releases/61/index.html">this list</a> of features.<br/><p align="center"><strong>Aloha Color Theme for NetBeans</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_ruby_61.png" target="_blank"><img src="http://pages.huikau.com/Aloha_ruby_61.png" border="0" alt="Aloha Look" width="50%" height="50%" /></a></p><br/><p align="center"><strong>Ruby</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_xml_61.png" target="_blank"><img src="http://pages.huikau.com/Aloha_xml_61.png" border="0" alt="xml" width="50%" height="50%" /></a></p><br/><p align="center"><strong>XML</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_c_61.png" target="_blank"><img src="http://pages.huikau.com/Aloha_c_61.png" border="0" alt="" width="50%" height="50%" /></a></p><br/><p align="center"><strong>C</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_java_61.png" target="_blank"><img src="http://pages.huikau.com/Aloha_java_61.png" border="0" alt="" width="50%" height="50%" /></a></p><br/><p align="center"><strong>Java</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_js_61.png" target="_blank"><img src="http://pages.huikau.com/Aloha_js_61.png" border="0" alt="" width="50%" height="50%" /></a></p><br/><p align="center"><strong>JavaScript</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_css_61.png" target="_blank"><img src="http://pages.huikau.com/Aloha_css_61.png" border="0" alt="" width="50%" height="50%" /></a></p><br/><p align="center"><strong>CSS</strong></p><br/><p align="center"><img src="http://pages.huikau.com/netbeans.png" border="0" alt="NetBeans" width="32" height="32" align="middle" /><a title="AlohaTheme.nbm" href="http://pages.huikau.com/AlohaTheme.nbm"> Download the NBM here. </a><img src="http://pages.huikau.com/netbeans.png" border="0" alt="NetBeans" width="32" height="32" align="middle" /></p><br/><p align="left">After the download, open NetBeans and go to Tools &gt; Plugins. In the Download tab, add the AlohaTheme.nbm and install. To use it, just select it from the Fonts &amp; Colors profile "Aloha."</p><br/><br/>You will want to go change the "Diff" colors which are not included in the theme (not yet anyway). Color of Added Text: Black, Color of Changed Text: Dark Grey.Mike McKinneynoreply@blogger.com29tag:blogger.com,1999:blog-8170992845202481394.post-64744888586503025242008-04-21T04:50:00.000-07:002012-03-29T17:51:00.465-07:00JRuby 1.1.1 to be released today!2 short weeks after the JRuby team released version 1.1 we'll see the next release some time today. Version 1.1.1 resolves 41 issues and focuses on stability, performance and compatibility according to <a href="http://headius.blogspot.com/" title="Charles Nutter">Charles Nutter.</a><br/><br/>Issues still exist with JRuby on GCJ and possibly on IBM's JVM 5. Anyone using these platforms is encouraged to submit bugs or possibly fixes.<br/><br/>The pace on this project is truly amazing... I plan to write-up a few posts about a recent project I worked on which used JRuby and Rails to speed development, exciting times my friends!Mike McKinneynoreply@blogger.com1tag:blogger.com,1999:blog-8170992845202481394.post-15798865868688151622008-02-04T15:16:00.000-08:002012-03-29T17:51:00.471-07:00Project PEA - test coverage with a magnifying glass<a href="http://mattharrah.com/blog" title="http://mattharrah.com/blog">Matt Harrah</a> recently wrote about his new toy: <a href="http://pea-coverage.sourceforge.net/" title="http://pea-coverage.sourceforge.net/">Project PEA</a>. This thing is like test coverage reporting with a magnifying glass. Matt, <a href="http://javarant.com" title="http://javarant.com">Jeff Richley</a> and I have had conversations in the past about the topic and the way test coverage reporting tools can give you a false sense of security.<br/><p align="center"><a href="http://pea-coverage.sourceforge.net/" title="http://pea-coverage.sourceforge.net/"><img src="http://pages.huikau.com/project_pea.png" alt="Project Pea" border="0" height="50%" width="50%" /></a></p><br/> The idea is to find the spots in your test coverage that may be 'accidental' having been buried beneath too many layers to be effective. (hence the <a href="http://en.wikipedia.org/wiki/The_Princess_and_the_Pea" title="http://en.wikipedia.org/wiki/The_Princess_and_the_Pea">name of the project</a>.)<br/><br/>If you work in an environment with test coverage requirements, you may want to take a closer look at Project PEA.Mike McKinneynoreply@blogger.com1tag:blogger.com,1999:blog-8170992845202481394.post-85513775818437017752008-01-25T02:07:00.000-08:002012-03-29T17:51:00.478-07:00Aloha Color Theme for NetBeans 6<strong>UPDATE:</strong> T<span>he Aloha theme is included in the <strong>Extra Ruby Themes</strong> module<br/>for NetBeans.</span><br/><br/><strong>UPDATE:</strong> Go get the new version for NB 6.1 <a title="NB 6.1 compatible theme..." href="http://blog.huikau.com/2008/04/28/aloha-color-theme-for-netbeans-61/">here</a>.<br/><br/><strong>UPDATE:</strong> I've started looking into updating the theme for NB 6.1 (due out in a few days) I'll create a new post and link to the download once it's complete. Thanks for your patience.<br/><br/>I've been giving <a title="NetBeans 6" href="http://netbeans.org">NetBeans 6</a> a try lately and I'm enjoying it very much... but I really like the color themes available for <a title="TextMate" href="http://macromates.com/">TextMate</a>. I'm not a big fan of the defaults and I wanted something different... so I started looking. The <a title="Ruby Dark Pastels" href="http://nullcreations.net/entry/dark-netbeans-theme">Ruby Dark Pastels</a> theme by Jerrett Taylor comes with a plugin download, I found this theme called <a title="Fade to Grey" href="http://ibrasten.com/articles/2007/10/24/fadetogrey-netbeans-textmate-themes">Fade to Grey</a> by Brasten Sager and then I stumbled upon this <a title="theme" href="http://www.carmelyne.com/2007/10/12/netbeans-theme">color theme</a> by Carmelyne Thompson. The theme Carmelyne created was what I was looking for with a few tweaks. And since I do work with a lot of different file types, I wanted to make sure most if not all the file types held the color theme. So after a few tweaks and writing something to help me create my NetBeans Module file... here are the results:<br/><p align="center"><strong>Aloha Color Theme for NetBeans</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_ruby.png" target="_blank"><img src="http://pages.huikau.com/Aloha_ruby.png" border="0" alt="Aloha Look" width="50%" height="50%" /></a></p><br/><p align="center"><strong>Ruby</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_xml.png" target="_blank"><img src="http://pages.huikau.com/Aloha_xml.png" border="0" alt="xml" width="50%" height="50%" /></a></p><br/><p align="center"><strong>XML</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_c.png" target="_blank"><img src="http://pages.huikau.com/Aloha_c.png" border="0" alt="" width="50%" height="50%" /></a></p><br/><p align="center"><strong>C</strong></p><br/><p align="center"><a href="http://pages.huikau.com/Aloha_java.png" target="_blank"><img src="http://pages.huikau.com/Aloha_java.png" border="0" alt="" width="50%" height="50%" /></a></p><br/><p align="center"><strong>Java</strong></p><br/><p align="center"><img src="http://pages.huikau.com/netbeans.png" border="0" alt="NetBeans" width="32" height="32" align="middle" /><a title="Go get NB 6.1 and use this theme instead!" href="http://blog.huikau.com/2008/04/28/aloha-color-theme-for-netbeans-61/"> Go get NB 6.1 and use the theme on this page instead!!! </a><img src="http://pages.huikau.com/netbeans.png" border="0" alt="NetBeans" width="32" height="32" align="middle" /></p><br/><p align="left">After the download, open NetBeans and go to Tools &gt; Plugins. In the Download tab, add the AlohaTheme.nbm and install. To use it, just select it from the Fonts &amp; Colors profile "Aloha."</p><br/><p align="left">I can't get the CSS to stop painting the keywords neon blue and it can be a little hard on the eyes... if anyone knows how to fix this, please let me know.</p>Mike McKinneynoreply@blogger.com27tag:blogger.com,1999:blog-8170992845202481394.post-41292786338846076592008-01-24T14:14:00.000-08:002012-03-29T17:51:00.485-07:00Small, portable http proxy for windowsThis is a short one, mostly so I don't forget where to find this tool later.<br/><br/>I needed to monitor some SOAP traffic and do some debugging... just wanted something small, won't take over my work laptop (Win XP) and just show me the HTTP messages raw. Enter <a href="http://www.pocketsoap.com/tcptrace/" title="http://www.pocketsoap.com/tcptrace/" target="_blank">TcpTrace</a>, a small footprint http proxy that comes in handy when you need to do some troubleshooting at that level. Great for junior folks to actually learn something about HTTP protocol and for sticking on your thumb drive and taking with you.<br/><br/>This tool is for windows only, there are plenty for *nix out there... what's your favorite?Mike McKinneynoreply@blogger.com1tag:blogger.com,1999:blog-8170992845202481394.post-47439755375891726452008-01-09T06:30:00.000-08:002012-03-29T17:51:00.493-07:00JRuby / Ruby Continuous Integration with Hudson<a href="https://hudson.dev.java.net/">Hudson</a> is a great tool for your continuous integration needs. It's very easy to setup and can run/monitor multiple types of tasks. Some have used it for <a href="http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html">Python</a> and this blog entry will show you how to get Hudson setup quickly for running your Ruby or JRuby tests. (including reporting)<br/><br/>(This step-by-step is assuming you have Java installed on the machine you are using.)<br/><br/>First we'll need to download Hudson <a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=2761">here</a> and start our Hudson instance: (just grab the latest stable release)<br/>[sourcecode language='css']<br/>java -jar hudson.war<br/>[/sourcecode]<br/>(see Hudson site for other deployment options.)<br/><br/>Next, grab the <a href="http://caldersphere.rubyforge.org/ci_reporter/">CI::Reporter</a> gem we'll need for test results xml formatting :<br/>[sourcecode language='css']<br/>gem install -y ci_reporter<br/>OR for JRuby<br/>jruby -S gem install -y ci_reporter<br/>[/sourcecode]<br/><br/><u>UPDATE</u>: Make sure you insert the following lines in your Rakefile:<br/>[sourcecode language='ruby']<br/>require rubygems<br/>gem ci_reporter<br/>require ci/reporter/rake/test_unit<br/>[/sourcecode]<br/><br/>Hit your running Hudson instance: http://localhost:8080/ and configure a new build by clicking the "New Job" link. Enter the name of your build and select the "Build a free-style software project" (click OK.)<br/><br/>Configure your SCM data, then scroll down to the "Build" section and select either "Execute Windows batch command" (windows) or "Execute shell" (*nix). This is where we'll call our <strong>'rake test'</strong> task using the CI::Reporter gem and specifying a spot for the report XMLs to live:<br/>[sourcecode language='css']<br/>/<your_path>/rake ci:setup:testunit test CI_REPORTS=results<br/>OR for JRuby<br/>/<your_path>/jruby -S rake ci:setup:testunit test CI_REPORTS=results<br/>[/sourcecode]<br/><br/><u>UPDATE</u>: When using <a href="http://subversion.tigris.org/">Subversion</a>, it will check things out into a sub directory of your "workspace" (found ~&lt;user running hudson&gt;/.hudson/jobs/&lt;your job name&gt;/workspace) If you are checking out 'trunk' and don't specify a different name for the directory, your shell execution settings should look like this:<br/>(be sure to know how your SCM works before applying the following)<br/>[sourcecode language='ruby']<br/>cd trunk<br/>/<your_path>/rake ci:setup:testunit test CI_REPORTS=results<br/>[/sourcecode]<br/><br/>This will setup the CI::Reporter and place the XMLs in the "results" directory for us.<br/><br/>We are almost done, now under the "Post-build Actions" section, check the "Publish JUnit test result report" box and enter the following in the "Test report XMLs" field:<br/>[sourcecode language='css']<br/>results/*.xml<br/>[/sourcecode]<br/><br/>Now click Save and go test it out... Select your newly created job from the Dashboard.<br/><br/>Click the "Build Now" link... done. After a few builds you should see a graph on the job's main page that looks like this:<br/><center><img src="http://pages.huikau.com/graph_hudson.bmp" /></center><br/><br/>If you have a failure, you can drill down by clicking the "Test Result" link on an individual build's page.<br/><br/><center><img src="http://pages.huikau.com/test_fail_hudson.bmp" /></center><br/><br/>Clicking on an individual failed test's name will show you the output from that failure<br/><br/><center><img src="http://pages.huikau.com/failure_hudson.jpg" height="90%" width="90%" /></center><br/><br/>That's all it takes, pretty simple and works like a charm. Now you can go back and play with the other settings Hudson has, triggers, scheduling, job artifacts, notifications... you could even have a job that prepares a build by generating all your static content so your server doesn't have to take the initial hit after startup. (web projects)<br/><br/>If interested, there is a way to create <a href="http://hudson.gotdns.com/wiki/display/HUDSON/Extend+Hudson">plugins for Hudson</a>.Mike McKinneynoreply@blogger.com12