Archive for the ‘techdetails’ Category.

Assorted Windows Tricks

Most of these were scraped from reddit.com

Fuzz Tester First Release – Code Less, Test More

I’m happy to release the first version of Fuzz Tester a JUnit 4 compatible test runner. Fuzz Tester is a data-driven test runner.

You can download the first release 0.7.0 at Google Code: http://code.google.com/p/fuzztester this should be considered a beta release as I currently have some people reviewing the release, and I will hopefully get some good feedback to improve the project and documentation.

FuzzTester is a JUnit 4 test runner that allows you to manage your test data in files instead of in your test code, this simplifies your test code, and decreases the feedback loop between writing tests and running tests.

Code less, Test more.

iPad first thoughts

Having used my iPad now for a few months here are some of my observations, in no particular order…

  • Instant on, this is a killer feature if only the wifi synced as quickly as the iPad started
  • no cables or power during regular use
  • can perform a wide variety of simple tasks from the comfort of wherever, need I say more
  • A great device for the gym, easy to read e-books while working out on the stair master, treadmill, etc.
  • with the correct HDMI cable you can use it as a media player
  • My wife finds it easy to use and uses it regularly
  • Great for technical documentation, in particular PDF’s, also  dictionary searches in the application
  • A portable interactive manual great for working on mechanical things without having to have a full blown computer near by

The negatives, and there area few…

  • It could be lighter, but I expect that to be a future enhancement
  • The wifi sync’ing can be slow at times
  • typing in long passwords on all portable devices is highly annoying, this is true of every portable device
  • A little too easy to cheat on the crossword

Good News: iTunes 10 doesn’t break rTunes

As has been the case with previous major updates to iTunes which changed the com interface on windows and forced me to re-package rTunes with the lastest com interface, iTunes 10 didn’t change the com interface so all systems are go.

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.

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.

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.