Problems solved, error messages deciphered and other time saving tit bits mainly focused on Java web development with a mac.
Saturday, April 18, 2009
Plotting graphs on the Mac
I first tried Apples Numbers which is a part of iWork which chocked on the data and became impossibly slow to use. It also does not have many options regarding the presentation of the graph.
After a quick Google search I found gnuplot which can be installed using macports like this
: sudo port install gnuplot
However it would not start on my Leopard machine until I reinstalled X11 from here:
http://xquartz.macosforge.org/trac/wiki
after installing the latest X11 everything ran perfectly. It plotted my 100k points in a split second making Numbers look like the bloated eye candy that I have come to expect from iWork. The degree of flexibility is amazing and the ability to use standard unix file manipulation commands adds even more options. But I was a bit frustrated that I could not use transparency in the current version (4.2.4) and it was a pain in the ass to change the background colour; you need to set a command line property when you launch it.
Then I found Plot which seems to have a lot of the options that gnuplot has but all packaged up into a nice UI.
http://plot.micw.eu/
It was easy to change background colours and set transparency etc. I think this will be very useful in visualising my data points and creating some pretty graphs for documentation pages. It does not handle 3D graphs but that is not a problem for me.
The options in Plot are astounding - curve fitting, smoothing, many buttons that have complicated sounding names. It all makes me wonder why anyone would create such an elaborate program for free. Perhaps they make money from donations? Or perhaps they don't think about money quite as much as I do. Or maybe that is the reason that the last version was released over two years ago and has not reached 1.0 yet.
But good workMichael Wesemann of Berlin! The world is a slightly better place due to your free program.
Thursday, March 5, 2009
Thread dump in Jetty
"Unable to open socket file: target process not responding or HotSpot VM not loaded"
At last I had something to go on and found that jstack must be run as the same user as the java process - which in the case of Jetty as installed by the debian install files is "jetty"
sudo -u jetty jstack <your-pid>
worked a treat and so did
sudo -u jetty kill -QUIT <your-pid>
Monday, January 19, 2009
Debugging in Eclipse very slow
I hit a problem developing with App Engine which took me a long time to figure out. I have been flipping between projects so didn't really notice when GAE and GWT started so run so slowly. I have also been experimenting with JRebel and messing with JVM memory parameters. Well "suddenly" every started running really really slowly and App Engine would take around 10 minutes to start up and run my 6 async parallel queries. Was it the new version of App Engine Java introducing a concurrency problem? Was it that my local datastore local_db.bin was too big - holy shit its 10MB!
After a lot of kafuffle I finally removed all break points and viola! Every thing was lightening fast again! What a massive waste of time.
Actually I have just added a really nifty optimisation to Twig for when you are merging multiple parent queries (relation index entities) which is needed for Target Rooms geo search. It now asks each child query which entities it wants and gets rid of duplicates before sending off a single request for all of them. When any of the children needs more parent entities it asks this EntitySupplier for more which in turn asks all of the children again if they need any more.
It has speed up the geospatial search HUGELY! I only recently realised that the complex part of the query (searching 6 blocks of geospatial data in parallel and sorting it by price) was completing in about 50ms!!! The simple part (bulk get of the parent results) was taking between 200 and 1200ms to do 6 bulk gets. What a surprise. You can actually see in the Google App Engine Status page that some days each simple get (not even bulk get) can take like 500ms.
Now Twig combines all bulk gets for each child query into a single bulk get which has made a huge improvement.
Sunday, November 30, 2008
Firefox Radio Button Alignment
I can see that WebKit also has a lot more install for Safari users with gradients, masks and more. But my current version of Safari does not include these features yet.
But then I noticed that when I looked at my page on FireFox all the radio buttons seemed out of alignment and looked very messy. I wasted hours trying to figure out if my style sheet was the culprit. Then I noticed that even Google looked weird so it was not something I was doing to mess up the formatting:
Safari:
Internet Explorer:
Firefox:
Notice how the radio buttons seem to float above the text.
After a bit of experimenting with various alignment options I found that setting vertical-align: text-top made the alignment look OK in Safari and Firefox but terrible in IE.
For now I have given up on Firefox and just accept that its looks a bit shit.
Thursday, November 20, 2008
Copying music off an iPod
john@mini:~$ ll /Volumes/John\ Patterson’s\ iPod/
total 64
drwxr-xr-x 4 john staff 136B 30 May 19:55 Backup
drwxr-xr-x 2 john staff 68B 1 Jan 2000 Calendars
drwxr-xr-x 2 john staff 68B 1 Jan 2000 Contacts
-rw-r--r--@ 1 john staff 1.0K 16 Dec 2007 Desktop DB
-rw-r--r--@ 1 john staff 2B 16 Dec 2007 Desktop DF
drwxr-xr-x 3 john staff 102B 1 Jan 2000 Notes
drwxr-xr-x 6 john staff 204B 18 May 2008 Photos
drwxr-xr-x 2 john staff 68B 1 Jan 2000 Recordings
drwxr-xr-x@ 11 john staff 374B 16 Dec 2007 iPod_Control
Now we can see the iPod_Control directory that contains all the music
Simply copy the music onto your local disc:
john@mini:~$ cp -r /Volumes/John\ Patterson’s\ iPod/iPod_Control/Music/ /Volumes/External/Music/iPod
The folders are still hidden so you need to remove the hidden attribute like this
xattr -d com.apple.FinderInfo /Volumes/External/Music/iPod/F*
And when that is done drag the whole folder onto your iTunes icon and all the music files will be imported into your current library. If you have iTunes set up to keep your music folders organised it will rename the cryptically named music files and create correctly named folders for you. Neat.
Thursday, November 13, 2008
Watching BBC online overseas
Tuesday, November 4, 2008
Filtering resources in Eclipse
I filed a bug report on this issue 3 years ago! https://bugs.eclipse.org/bugs/show_bug.cgi?id=84988. Eclipse development seems to move slowly.
I found this plugin which claims to do what I want but I could not get it to work for me.
https://sourceforge.net/projects/eclipseresfltr/
Some people have posted about adding a "resource filter" to filter out files at a lower level
<extension point="org.eclipse.ui.ide.resourceFilters">
<filter selected="false" pattern="my-large-folder"></filter>
</extension>
However, this does NOT stop the resources from being scanned for updates for some reason. It just hides the folder from view but my machine was still pegged on close to 100% CPU.
Then I re-read one of the comments on my bug report above and finally solved the problem.
- Move the large folder outside your workspace.
- In the Package Explorer New -> File
- Enter the name of the large folder as the filename
- Click Advanced and check "Link to file in the filesystem"
- Enter /dev/null (on Mac OS X) and click finish
- Move the large folder back to your workspace.


