Stuff about software development, agile and testing

Tuesday, March 11, 2008

autotest for java

I just hacked out a java version of autotest plugin for eclipse (of course inspired by the ZenTest).

No more running JUnit tests manually, this plugin will detect code changes and run JUnit tests of that Java project. You can download and install this plugin from http://code.google.com/p/autotest4j/

Current version of plugin only runs with eclipse 3.3 and I need to do some clean up and fixes before I can checkin my source code. Watch out for some changes I am planning for next version.

Enjoy...

Wednesday, March 5, 2008

rss to json

Here is a nice yahoo pipe if you want to process rss feed from you web pages
rss to json

Monday, January 14, 2008

Scala: Surprise Part oNe

Ruby is a language of least surprises but I am not sure whether I can say that for Scala yet. I have already encountered some of them, here is one example

You can define method without '()'

def height: Int = 0 //This is a valid method

def width(): Int = 0 //This is valid too

Now you can invoke 'width' method with and without parenthesis but you cannot do that for height method.

SURPRISED


Update: The Scala convention is, use '()' for parameter less method if it has side effects otherwise don't

Thursday, December 13, 2007

scala book is out

Its now an open secret that Scala doesn't have good documentation/reference to help any developer to try their programming skills. But finally Scala book is out (pre-print edition) and I got my copy.

Thursday, November 29, 2007

jruby closure decompiled

Its quite interesting to look into the compiled class file generated by JRuby. Following is the sample java code generated for a closure (1.times { puts 'in closure' }) .

private static ByteList __18 = ByteList.create("in closure");
.....
.....
public IRubyObject closure0(ThreadContext threadcontext, IRubyObject irubyobject, IRubyObject airubyobject[])
{
Ruby ruby;
IRubyObject irubyobject1 = (ruby = threadcontext.getRuntime()).getNil();
DynamicScope dynamicscope = threadcontext.getCurrentScope();
IRubyObject _tmp = irubyobject1;
do
{
try
{
threadcontext.setPosition(__15);
return _17.call(threadcontext, irubyobject, RuntimeHelpers.constructObjectArray(ruby.newStringShared(__18)));
}
catch(org.jruby.exceptions.JumpException.RedoJump _ex) { }
} while(true);
}

RedoJump exception is used to simulate ruby redo

Tuesday, November 27, 2007

inpsect gem file

Playing around with RubyGems source code. So first thing I wanted to know is the gemspec.

Here is a small script to inspect any gem file

require 'yaml'
require 'rubygems/source_info_cache'

Gem::SourceInfoCache.cache
spec = Gem::SourceInfoCache.search('#{gem}')
p spec.to_yaml

You could also use Gem::SourceIndex to spec out locally installed gems

Sunday, November 11, 2007

My new X


Finally I got Leopard installed in my Mac..... :)

Labels