Mac OS X on Virtual Box (Beta)

This looks very promising: http://hackaday.com/2010/05/03/virtualbox-beta-runs-mac-os-x/

Hopefully VMWare won’t be far behind, since this would simplify testing software on various versions of Mac OS X.

Java Code Coverage

I haven’t done an exhaustive analysis by any stretch of the imagination, but after trying out EMMA – http://emma.sourceforge.net/ and Cobertura – http://cobertura.sourceforge.net/index.html

The clear winner is Cobertura for the following reasons:

  • Ant targets are easier to use and don’t generate errors in Intellij (a minor thing but highly annoying)
  • It is much easier to exclude test classes
  • The output generated is vastly superior if not more voluminous
  • Better but still sparse documentation

Sun’s Java VisualVM

VisualVM is an interesting tool, and the fact you don’t have to instrument your applications to use it is rather nice. Real-time monitoring of you application is very nice and the ability to take snapshots or heap dumps is also very useful, but their heap analysis tool needs some work.

Compared to some other heap analysis tools I’ve used VisualVM needs a lot of work. Having said that being able to take heap dumps as you manipulate a system in real-time is very useful, and then using another analysis tool seems like the best option (note I haven’t tried using another analyzer with visualVM’s heap dump.)

Diving into Solid State Disk

Now that second generation disks are coming out and the prices are getting reasonable (or with that of the 10,000 RPM disks) I thought it was time to give them a try.

I’m impressed:

  • very fast – reads are frightening
  • small – but it’s hard to find 2.5″ to 3.5″ mounting brackets
  • cool – no heat this is great for cramped cases
  • clean – no exposed circuits, unlike a regular hard disk
  • quiet – obviously but very welcome
  • would fit the Mac Mini very nicely

The unit I have is an OCZ Vertex 120GB, which is sufficient space for my purposes. I dropped it into my Franken Mac and ran XBench so I could get some performance numbers with a common base, please note that these numbers were taken after a fresh install so the disk has not yet been heavily fragmented. I would also note that this isn’t the Mac version of this drive, and as such I found the drive was very unstable with mysterious hangs and failures, but it did run long enough to get some good numbers. I now have the drive installed in a Gateway GT5676 as the primary boot disk for Fedora Core 11 and it has been rock solid and running vmware like a champ, but time will tell.

I found this article very helpful: http://www.pcper.com/article.php?aid=736

Now the numbers:
OCZ Vertex

Results	180.94
	System Info
		Xbench Version		1.3
		System Version		10.5.6 (9G2030)
		Physical RAM		4096 MB
		Model		Macmini3,1
		Drive Type		OCZ-VERTEX

	Disk Test	182.95
		Sequential	136.65
			Uncached Write	188.04	115.46 MB/sec [4K blocks]
			Uncached Write	176.88	100.08 MB/sec [256K blocks]
			Uncached Read	79.05	23.14 MB/sec [4K blocks]
			Uncached Read	176.96	88.94 MB/sec [256K blocks]
		Random	276.72
			Uncached Write	112.99	11.96 MB/sec [4K blocks]
			Uncached Write	307.32	98.38 MB/sec [256K blocks]
			Uncached Read	1544.06	10.94 MB/sec [4K blocks]
			Uncached Read	587.24	108.97 MB/sec [256K blocks]

Western Digital Velociraptor 10,000 RPM

Results	161.56
	System Info
		Xbench Version		1.3
		System Version		10.5.6 (9G2030)
		Physical RAM		4096 MB
		Model		Macmini3,1
		Drive Type		WDC WD3000BLFS-01YBU0
	Disk Test	93.41
		Sequential	143.22
			Uncached Write	190.65	117.06 MB/sec [4K blocks]
			Uncached Write	163.74	92.64 MB/sec [256K blocks]
			Uncached Read	81.75	23.92 MB/sec [4K blocks]
			Uncached Read	230.15	115.67 MB/sec [256K blocks]
		Random	69.31
			Uncached Write	25.02	2.65 MB/sec [4K blocks]
			Uncached Write	193.45	61.93 MB/sec [256K blocks]
			Uncached Read	125.65	0.89 MB/sec [4K blocks]
			Uncached Read	216.22	40.12 MB/sec [256K blocks]

Standard Mac 5400 RPM

Results	130.85
	System Info
		Xbench Version		1.3
		System Version		10.5.6 (9G2030)
		Physical RAM		4096 MB
		Model		Macmini3,1
		Drive Type		FUJITSU MHZ2120BH G1
	Disk Test	46.65
		Sequential	64.41
			Uncached Write	91.99	56.48 MB/sec [4K blocks]
			Uncached Write	90.47	51.19 MB/sec [256K blocks]
			Uncached Read	32.45	9.50 MB/sec [4K blocks]
			Uncached Read	106.86	53.71 MB/sec [256K blocks]
		Random	36.57
			Uncached Write	13.38	1.42 MB/sec [4K blocks]
			Uncached Write	92.49	29.61 MB/sec [256K blocks]
			Uncached Read	67.95	0.48 MB/sec [4K blocks]
			Uncached Read	109.77	20.37 MB/sec [256K blocks]

VMware 2.x on Fedora Core 11

VMware 2.0.1 on Core 11 won’t compile, but fortunately there’s a fix.

With a little googling, I found this thread: http://communities.vmware.com/message/1261181#1261181 and to save you (and me) the time you can download the following source:  http://www.saarlinux.de/blog/wp-content/uploads/2009/03/vmware-server-modules-2629tar.gz extract the the source into vmware-server-distrib/lib/modules/source/ and the run install.

Technical Details has moved…

As we’ve been slowly winding down BlogMatrix for sometime, I decided to move my own blogs to my own domain and server. Having access to everything allowed me to write a BlogMatrix to WordPress converter.

I also had the relevant addresses redirected to my server, so techdetails.blogmatrix.com -> techdetails.agwego.com, which posed an issue with respect to permalinks, so with a little WordPress hacking I was able to write a pseudo BlogMatrix to WordPress permalink converter so most links will now work as expected. I have a complete duplicate site setup at home replete with DNS for testing purposes.

I’m still getting use to WordPress but so far it’s not too bad.

My other blog http://dinner.agwego.com/

Frankenmac

I finally bit the bullet and bought my first Mac, but I didn’t want to go whole hog and buy the pro or iMac, so I went for the mini.  I was loath to use substandard hardware, so the 5400 RPM hard disk had to go, but what to do? I have seen a number of other mods, but most of them were very unsatisfactory since they modified the machine in such a way that could not easily be reversed, and I could buy a regular old 7200 RPM drive, but where’s the fun or performance in that. I settled on the Western Digital Velociraptor which weighs in at 300 GB and 10,000RPM, unfortunately the form-factor is slightly larger than a traditional laptop drive, so wedging it into the case wasn’t an option.

The hardest part of the whole build was sourcing the internal SATA to external eSATA cable which I got here:  http://www.cooldrives.com/esexcaitolex.html. I manufactured the mounting bracket myself, with wood and some good old chiseling. The rest of the work was reassembly and making sure the eSATA cable could be run outside the case properly without major disruption.

And of course the XBENCH numbers, overall I’m very happy with how everything worked out, and the really nice feature of the disk caddy is I can drop in the original disk for testing or any other disk if the need arises, the only other option I might consider is the dual drive disk caddy.

Larger disk numbers are better.

XBENCH 5400RPM:

Results	130.85
	System Info
		Xbench Version		1.3
		System Version		10.5.6 (9G2030)
		Physical RAM		4096 MB
		Model		Macmini3,1
		Drive Type		FUJITSU MHZ2120BH G1
...
	Disk Test	46.65
		Sequential	64.41
			Uncached Write	91.99	56.48 MB/sec [4K blocks]
			Uncached Write	90.47	51.19 MB/sec [256K blocks]
			Uncached Read	32.45	9.50 MB/sec [4K blocks]
			Uncached Read	106.86	53.71 MB/sec [256K blocks]
		Random	36.57
			Uncached Write	13.38	1.42 MB/sec [4K blocks]
			Uncached Write	92.49	29.61 MB/sec [256K blocks]
			Uncached Read	67.95	0.48 MB/sec [4K blocks]
			Uncached Read	109.77	20.37 MB/sec [256K blocks]

XBENCH 10,000RPM:

Results	161.56
	System Info
		Xbench Version		1.3
		System Version		10.5.6 (9G2030)
		Physical RAM		4096 MB
		Model		Macmini3,1
		Drive Type		WDC WD3000BLFS-01YBU0
...
	Disk Test	93.41
		Sequential	143.22
			Uncached Write	190.65	117.06 MB/sec [4K blocks]
			Uncached Write	163.74	92.64 MB/sec [256K blocks]
			Uncached Read	81.75	23.92 MB/sec [4K blocks]
			Uncached Read	230.15	115.67 MB/sec [256K blocks]
		Random	69.31
			Uncached Write	25.02	2.65 MB/sec [4K blocks]
			Uncached Write	193.45	61.93 MB/sec [256K blocks]
			Uncached Read	125.65	0.89 MB/sec [4K blocks]
			Uncached Read	216.22	40.12 MB/sec [256K blocks]

Sometimes you just have to try it

I was racking my brains out, trying to solve what seems to be a normal problem in Java, at least for swing/application developers.

How do I use new features in JDK 6 that are not available in JDK 5 but still have my application run when using a Java 5 runtime and also that everything will run seamlessly in Intellij? In particular, I’m referring to the JDK6 Desktop API for email, printing, browsing, …

I was fomenting all kinds of horrific scenarios, from conditional compilation, to manipulating the class loader to dynamically compiled code, all of them being rather distasteful.

In reality, the solution is so much simpler. I decided to just do it.

  1. Encapsulate the Desktop API in a wrapper class, called Desktop it exposes the needed functionality like email, browser, printing
  2. Compile with JDK 1.5 and Java 1.5 source flags.
  3. I ran it to see what would happen with Java 5
  4. The epiphany! NoClassDefinitionFound error, which can be simply caught and the set the desktop class to null.

Doing the above is kind of ugly and you have conditional checks for desktop == null in a few places, but is a good first start, since it worked. So how about using a factory, that works even better, the best part of using a factory is that there are no more conditional check for null in the code and also no exceptions are thrown.

Something that is easy to forget about Java is that the linking is deferred until execution. So compiling the code with JDK 1.5 as the target is no problem, since it won’t try to link the Java Desktop class, and the factory avoids the issue which I assume is a feature of the JIT, but I need to explore that a little more.

DB2 V9.5 (aka Viper) on Fedora 11 a Flop

I’ve installed the same version on core 10 with no problems, as a matter a fact it was a breeze, but “db2setup” hangs up with an odd error about the filesystem, which is funny since everything is on a virtual machine. So I’m downgrading to 10 for now, so I can make some progress. Websphincter 7 also installs very smoothly on core 10, not nearly as many hurdles as 6.1 on core 8.

Update: (thanks to the commenter)

I’m trying DB2 on 11 again, and this time things are going better, one thing I did this time that I didn’t do last time was to do a complete system update with “yum update” and surprisingly things started to work better (when I attempted the first install there were no significant updates). Once the mysterious error went I way I was presented with can’t find libstdc++.so.5, and these errors are generally easier to take care of. Unfortunately there appears to be no compat-libstdc++ in the yum repository so off to the web and RPM finder: http://www.rpmfind.net/linux/rpm2html/search.php?query=libstdc%2B%2B.so.5 things seem to be going better this time.

The graphical installer (db2setup) failed with the most useful error message: DBI1501E (An internal error was encountered) so I closed down the installer and went for the old command line (db2_install) which completes with some minor warnings, but otherwise is working fine.

IBM wins the award for most obsfucated documentation

I’m installing DB2 V9 on linux (Fedora) which isn’t too painful, but honestly IBM has the worst documentation and the post install steps for DB2 are a dogs breakfast. None of this includes trying to figure out what packages to download and install sheesh, IBM give us usable map please.