Archive for the ‘Technology’ Category
Speaking Gigs
I’m speaking: on Watir at the “2006 edition of Agile India“:. I was there last year and it was great fun. Hope to see you there, if you are in Bangalore.
Ive also uploaded the presentations of my sessions at FOSS.IN/2005 on my talks page .
Domain Languages
An interesting conversation came out of my Rails talk at LB/2004 — to many in the audience, it was apparent that Rails is moving towards creating its own domain language. This may probably be the largest benefit of using Ruby, more than just the ability to reflect, or create methods on the fly.
There may, however be flip side to it… people are more attuned to learning API’s and see domain languages as extra learning effort, whose benefit is not apparent to most. There was some discussion about “all these new keywords we have to learn”. This may have been accentuated by modern IDE’s, where code completion makes API explosion a non-event, as far as learning goes. Maybe we should wait for Jetbrain’s next product, and build a Rails editor on top of that!
Rails however continues to impress everybody who sees it, specially when you can demonstrate creating a complete app in 10 minutes.
LB/2004
Enjoyed my trip to LB/2004. Herewith, some thoughts.
Wietse Venema certainly was the highlight as far as I was concered. His talks were witty, informative, and insightful.
This year, I spent more time working the corridors and speaker’s lounge, and had some interesting conversations as a result.
Many people were seen ranting about the memory usage of modern Linux desktop frameworks. The memory usage of GNOME console seemed to be a rather favourite flogging horse! I heard many complains about having run XFCE on their laptops since they had only 256 MB memory, and thus couldnt run KDE even though they wanted to. To which, I present Exhibit A, my trusty old 700MHz PIII, with 256 MB RAM, running the latest KDE (3.3.1). On seeing Konsole start up instantly, many were convinced to try Arch
Other thoughts probably require separate entries. Slides at the usual place
Google Knows
Google Q & A : Another step towards a sentient borg? 🙂
Log4J Considered Harmful
The pretentiousness of the title is purely a reflection of a sleepless night, a day before go-live.
Whenever I have faced jar hell during java development, it’s always turned out to be due to Log4J; which is a shame, since log4j is, for good reason, the leader among Java logging tools. Having spent a few tense hours recently with this, I thought I should blog it for the benefit of other unwary souls out there!
So did you know that if you had multiple versions of log4j in you classpath, you are likely to get
java.lang.VerifyError: (class: org/apache/log4j/LogManager,
method: signature: ()V) Incompatible argument to function
at org.apache.log4j.Logger.getLogger(Logger.java:94)
This seems to be a reasonably common occurrence, but try telling that to the log4j developers.
And no, I havent found a solution, except forcibly remove the log4j dependency 🙁
RubLucene?
So it seems Brian McCallister and Don Coleman have been awarded a Ruby Codefest Grant to create Ruby bindings for Lucene. Cool!
I’d started on the gcj/SWIG path with the idea of doing Lucene, but found I needed to tackle a simpler task first to get to grips with SWIG– hence POI4R. I hope I’ll have some time to contribute to the Lucene effort as well.
Another java application that I hope to see wrapped to ruby is FOP. This one should be simpler than Lucene.
Wrapping Java to Ruby
So, java by far has the largest set of libraries and components out there. However, if Ruby is your favourite language, but you bemoaned the lack of libraries, bemoan no longer. Help is at hand…
Only if you wanted to write excel files from Ruby. I just checked in the POI Ruby Bindings , which allows you to create Excel files from Ruby.
Using a GCJ compiled, SWIG wrapped Ruby extension, this provides all Ruby users access to a large (and, might I say, great) Java library.
The inspiration for this project came from PyLucene, so thanks to the OSAF folks. Also thanks to Lyle Johnson for taking me over a small but crucial roadblock over at the SWIG lists.
Hieraki
Using an idea that is obvious only in retrospect , Hieraki is a cool new application that does a simple job well. Maybe using Rails has something to do with this.
Take a wiki, and constrain its structure into a hierarchy, and you have a perfect solution for maintaining technical documentation. You get the benefit of distributed editing, without having to strain to retain a semblance of structure to guide your reader. Highly recommended. Its a niche that is far from crowded, even though there are thousands of wiki implementations out there. While many of the proprietary document management solutions are moving in this direction, Hieraki is the only open source app that I know of in the ‘use a wiki to write a book’ space.
In true open source fashion, of course, some goodness has started to flow from external contributions – I’ve been motivated to submit a patch for creating XSL:FO: (from which you can generate PDF’s) here, while a system for fine grained access control has been submitted here.
Do you think this is cool?
irb(main):001:0> require 'release/poi4r'
=> true
irb(main):002:0> h=Poi4r::HSSFWorkbook.new
=> #
irb(main):003:0> s=h.createSheet("Sheet1")
=> #
irb(main):004:0> r=s.createRow(0)
=> #
irb(main):005:0> c=r.createCell(0)
=> #
irb(main):006:0> c.setCellValue(24)
=> nil
irb(main):007:0> c.getNumericCellValue()
=> 24.0
irb(main):008:0> c.setCellValue("blah")
=> nil
irb(main):009:0> c.getNumericCellValue()
RuntimeError: error calling poi
java.lang.NumberFormatException: You cannot get a numeric value from a String based cell
at org.apache.poi.hssf.usermodel.HSSFCell.getNumericCellValue() (...../release/poi4r.so)
at ruby_exec (/usr/lib/libruby.so.1.8.2)
at ruby_run (/usr/lib/libruby.so.1.8.2)
at main (Unknown Source)
at __libc_start_main (/lib/tls/libc-2.3.4.so)
at _start (Unknown Source)
from (irb):9:in `getNumericCellValue'
from (irb):9
irb(main):010:0> c.getStringCellValue()
=> "blah"
irb(main):011:0>
The exception should give you an idea of whats going on. Currently just a proof of concept. Real thing coming to a repository near you… any time now!
Closures etc
Martin Fowler provides an succinct summary of Closures with some fairly useful but simple examples. While trying to explain Closures or Higher Order Functions to Java or C developers, one quite often struggles to respond to “oh I can do that using function pointers and/or anonymous inner classes”.
Well, you can’t, not only because you need proper lexical scoping to have real fun, but also because the non-intrusiveness of defining them in the language is as important. However, some of these subtleties may be difficult to grasp without actually writing some code. So the next time you are explaining all this to a Java programmer, and are feeling too lazy to come up with real life examples, point them here.