Archive for June, 2008

On the bleeding edge

Case 1

We use JRuby with Mongrel and Derby, developing in Eclipse. We wrote many custom scripts to ease development, to start/stop servers, run rake scripts. We hack Mongrel because it couldn’t work with JRuby then. We patch ActiveRecord JDBC manually to make Derby behave correctly. Eclipse RadRails wouldn’t play well because we’re not using CRuby.

Few months after the release of our product, Aptana releases an Eclipse IDE with RadRails that completely supports JRuby, therefore run rake scripts, supports running the Rails app in Mongrel, and supports the Derby database.

Case 2 (today)

Deployment test of a new JRuby app on a new machine. During gem install we realize a new version of ActiveRecord 2.1 (from 2.0.2). Rake migration wouldn’t run after it because the SQL statement generated a “DEFAULT NULL NULL” in a CREATE TABLE statement.

Traced the code, found issue to be likely in activerecord-jdbc. Looked at JRuby Extras, and activerecord-jdbc-adapter had 0.8.1, release June 4, 2008 (today). Checked the SVN source, Nick Sieger checked in barely 6 hours ago at 5:19am to “Fix problem with AR 2.1 and Derby with ‘DEFAULT NULL NULL’ in column defs” (as per SVN commit comment).

Upgraded the gem from 0.8 to 0.8.1, but we got an “undefined method `true?’ for false:FalseClass” right at the line of Nick’s fix.

Filed my second JRuby (ActiveRecord) bug.

* We did force versions during gem install, but we didn’t expect the new version to screw up so much.


Testing private methods

Like many others in TDD, I have a dilemma with testing private methods. This “rather old” article sheds some options to do so. Since its so old, it is likely that current frameworks would have support of some form.

Remember also that such dilemmas may hint at a cohesiveness design problem.

Along the way, I stumbled onto this refactoring site.


Intel Core

Haven’t been following up on hardware. I’ve actually read these numerous times but keep forgetting. I needed to look up some PC specs today, so its now here for my own reference.

Intel Core is the series of Intel’s 32-bit dual-core processors. Intel Core Duo is the one with the dual core, and the Intel Core Solo is the one with dual core, but only one active. According to Wikipedia, it’s so that Intel can sell those with manufacturing defects on one core but not the other. Sounds logical to me, but can’t find supporting information elsewhere.

Intel Core 2 is the 64-bit series. So Intel Core 2 Duo means a 64-bit dual core processor, and Intel Core 2 Quad are the 64-bit quad cores.

On the other side, there was this (old) HyperThreading technology by Intel, which also have a “dual-core” impression because it shows up as 2 processors on XP. However its actually just one processor that simulates an additional one for doing useful work during otherwise idle cycles.

AMD’s naming is 64 means 64-bit, and X2 means dual core. So you have series like Athlon 64, Athlon 64 X2, Turion 64, Turion 64 X2.