Sunday, 30 November 2008

The week in review - 2008-48

I've installed Ubuntu 8.10 on my Dell 1525. I had 8.04 and I could have upgraded but I like having a clean install, and because with Linux its so easy! When I'm done I'll share my backup and re-install scripts via google-code. I've got /home on a separate partition so the installation really just means running the installer from CD, and then re-installing all of my favourite software. This is just one place where Linux is nifty - all the software is in a repository and installing it can be done from the command line so it can be scripted. And you get the latest versions automatically. No 'download and run setup.exe and click through the wizards'.

I'm happy to report that suspend and resume is almost instant - even when disconnected from the network. I haven't installed any extra software yet, so we'll see if it regresses when I have the full compliment of wares (with 8.04 and all of my added software, resuming took ages when disconnected from the network). Unluckily, volume is still only audible above 50%, and I'm not having much luck with the microphone (required for skype).

Unfortunately Memokeys doesn't doesn't paste straight into DOS windows - you have to first push your key sequence to get the text into the clipboard, then right mouse click in the dos window to paste. Sooo close. Works as expected in text editors though (I only really wanted it for dos commands though).

Theres an interesting post about java packaging here. I hear what he is saying and it makes sense, but I think I've always worked in shops that package by type. What do you do?

I'm happy to see Netbeans 6.5 supports PHP and Python. This means in addition to using Netbeans for my Grails/Groovy/Java work I can now use it for Wordpress and Google App Engine applications.

I just noticed you can use WinSCP from the command line. I've never needed to do this before, but next time I'm using windows I can script uploading sites.

One of my favourite pet-peeves with commercial application servers is the restriction of the JVM. If I was using Tomcat or Glassfish I'd be using the very latest version of the JVM. But when running a commerical application server you always come up against the "Thats not a supported configuration" argument - and therefore it is vetoed.

Apt-get is so cool. I've exceeded my bandwidth quota for this month so I'm throttled to a trickle - so apt-get is taking hours to complete downloads. But, I've been suspending and resuming during this process, and apt-get hasn't missed a beat. It just carries on like nothing happened! No broken connections, no re-tries. Suspend and resume is still working like it should (I've got mysql and mythtv-frontend installed now).

I'm using jQuery these days, and I wanted to display a spinner during ajax requests. I found the answer here.

I was using the jquery.ui.Dialog too, and found that when I closed the dialog I couldn't reopen it. The answer was here - you should only initialize it once with .dialog(options), and then use "open" to show it.

When new developers join a team, I always see them get given their predecessors machine, with all of their old files on it. What should be happening here is that IT support should re-image the machine with the Operating System, and then the development team reinstalls the required development tools. Thus the user gets a new machine that is clean and consistent with the others. Ideally, power uses should get the latest machines and this is a good oppourtunity to upgrade power users and pass the older machines on to non power users.

Hopefully installing the development tools is a one-click process (such as unzipping a zip file). I created ToolInstaller as a simple solution to installing preconfigured software, but unfortunately this is another one of my products that no-one uses!

For the first time I came across a requirement to run a java program and detect success or failure. This is easily done from a script if the program in question uses System.exit() correctly (so you can use %ERRORLEVEL% in DOS and $? in Unix to read the exit code). The problem is, the program doesn't use System.exit() properly and even worse, its a commercial closed-source product!

This is how it works:

[sourcecode language="java"]
public class ReturnCode {
public static void main(String[] args) {
System.out.println("Return code test");

Now in your bat file:

java -cp classes ReturnCode

Working with ArcGIS 9.3 is much more fun than 9.2. The javascript and REST APIs make working with the map a lot eaiser. ArcSDE 9.3sp1 has been released : release notes.

I'm using the Geodatabase Designer extension for ArcCatalog to export a database as XML. We can put this in Subversion for version control and import this file to create our feature classes whenever we create a new environment. Unfortunately we need to use ArcCatalog to do the import. It would be good if we could script the import so it could be fully automated. Note, we also manually register as versioned with move edits to base.

With text fields in feature classes if you specify a length greater than 255 you'll end up with column type of NCLOB and a max length of 2147483647. This affected a query which was trying to order by the NCLOB column - apparently this isn't good (ORA-00932: inconsistent datatypes: expected - got NCLOB). Keeping the length less than equal to 255 results in an NVARCHAR2 column which is okay.


Monday, 24 November 2008

The week in review - 2008-47

It is a good time for releases:

Looking around the train platform today I wondered when telecommuting is going to make a significant impact. Everyone needs to be somewhere else - and that puts a lot of strain on the public transport infrastructure. I've had few jobs I couldn't have done from home effectively with decent video, voice and remote control software. Being in an office *would* be far superior if teams were effective, but from my experience most of them are dysfunctional. I think part of the problem here is that managers measure productivity by the time spent at your desk, not by your actual achievements.

Know any companies that have effective management, well run teams, good career path and its fun to work? Let me know, because I'm always looking.

I was just listening to an episode of Agile Toolkit and it just makes agile seem like a whole different world. I'd love to spend some time at some of these companies that are *really* doing agile development. I've encountered companies that pretend/claim they do it by:

  1. having meetings in which you cannot sit down

  2. using junit

  3. use the jargon (iteration/pairing etc)

  4. pair when there is a problem

In this podcast, they mention some of the reasons why agile doesn't get implemented properly and as a result fails.

Here are some interesting tips for MS Windows users. Notice the recommedation to use FireFox and VLC media player - these get my thumbs up. MemoKeys is something I've been looking for recently - I've been looking for some software that lets me store text snippets (sql, command lines etc) and paste them with a key stroke. Thanks Ruchir! Unfortunately I can't install it at work because the PCs here are configured to stop any set.exe installers running - thanks security. Security sooo good its hard to get your work done.

I like to do small pieces of work and commit often. But when tests take a long time to run you get put off doing this quickly - running lengthy tests frequently means you take a nose dive in productivity. So you start taking risks and commiting more code less frequently - and end up with a mess. Whats the answer? Don't create long running tests. Do more UNIT testing, and separate your integration tests out into a separate test suite. Unit tests that don't hit the database are fast.

I used to think it was okay to put a continuous integration server on any old PC - but now I'm thinking I want pretty fast feedback after commits. So I'd rather have it on decent performing hardware so I can know when something goes wrong minutes after the commit. And, after commiting a fix, I want to trigger a build and have the answer NOW. Not in 10 minutes. So, CI on fast hardware = GOOD.

I haven't been doing much coding at home lately, so when I do, I need to be careful to leave my 'heavy lifting' JSF attitude at work and switch into a more 'spritely' Grails attitude. Point in case, I recently typed this into a grails controller:
[sourcecode language="java"]
def id = request.getParameter('id')
def book = Book.get(Integer.valueOf(id)) // but what if id is null?
It was then I thought I'd better do some null checking - and the little light bulb went on - this was getting too hard! So I replaced it with:
[sourcecode language="java"]
def book=Book.get(
And thats all I needed. No null checking, no type conversion. Sweet, I love the productivity of Groovy and Grails! I would have thought the 'Enterprise' would have been the first to adopt such productivity - after all they want to lower costs and produce more! What is stopping them? Why does 'Enterprise' = HEAVY LIFTING?

Monday, 17 November 2008

The week in review - 2008-46

Something was using a port on my windows machine and consequently I couldn't run one of our applications - I came across this article which shows how to identify what application is using a port. This was extremely quick and useful and let me know which processes to kill via task manager. It worked without having to install any software.

Working with the ArcGIS Server 9.3 javascript REST apis is a breeze compared to the 9.2 JSF components. The Javascript API makes working with ArcGIS a simple Javascript exercise without huge proprietary knowledge required. To get started, you'll want to check out these resources:

Wow, SpringSource has acquired G2One! If I thought I wanted to work for SpringSource before, this doubles that feeling! Spring, Groovy and Grails has made Java development more enjoyable for me, and a heck of a lot more productive.

If you haven't seen StackOverflow yet, head over there and have a look. I like it a lot. This isn't a normal question and answer forum - see the about and FAQ sections for more information.

Another great product is Bamboo. When I first heard about it I didn't understand the need for ANOTHER continuous integration server, but now I've seen it I love it. As with all Atlassian products it is very well presented and feature complete. You can see it in action here.

I'd be quite happy to never see OC4J again. Its complete lack of IDE support has a few knock on consequences that make developing a chore at the moment. We have to run JDeveloper purely so we can edit JSPs in-place. I'm trying JavaRebel to avoid restarting for every code change, but its still a pain.

Likewise with Websphere - I still know people trapped in JDK1.4 land because they are running Websphere. The language and performance advantages of JDK 5 & 6 mean you shouldn't be running anything than JDK6! If you feel you can't migrate to JDK 6 then find out why and remove that obstacle! (How long did it take Websphere to come out with JDK5 support?)

Binary configuration files used by proprietary software which contain information such as database connection details are also a pet peeve. ArcMap MXD files are one such culprit. How am I supposed to generate configurations for different environments? At the moment I have to do it manually by copying the file, opening it, and then changing the connection details for each layer. Takes the 'automatic' out of 'automatic deployment'. I'm also having big fights trying to script the creation of feature classes and layers with the SDE. I can register point classes but I can't visualise them with SDE9.2. I'm hoping 9.3 will work...

Glasshfish v3 Prelude has been launched. I've heard good things about Glassfish, and its something I'd like to play with. I'm very keen to keep up with the latest JDK and JEE releases, an this is exactly what Glassfish does. Notice that this release offers a preview of JEE6, including JSF2.0. Even more noteworthy might be the Rapid Deployment Technology which allows you to 'edit code, save and immediately refresh browser with no loss of application state'. I'm running Netbeans 6.5 at home, so I'll have to try this out!

Apparently spam levels dropped significantly when a major spam ISP was taken offline. But it won't stay that way for long... I wonder why it isn't easier and quicker to detect them and taken them offline?

Wow, USB3 is going to be fast, but it won't be here until 2010!

For some interesting observations about software development, see Frequently Forgotten Fundamental Facts about Software Engineering. There in black and white are some observations we see every day, but might not consider formally.

Saturday, 8 November 2008

The week in review - 2008-45

When Firefox 3 came out, I remember reading a lot of fuss about the AwesomeBar - a lot of people complained about it. Well, I loved it when I first saw it, and I still love it. Occasionally I have to fire up IE6 to check some rendering and thats when I really notice how much I like the awesome bar.

Last week I mentioned disk performance and my attention has just been brought to this posting about kitting a developer machine out with SSD for great performance gains. The author compares several different machines and concludes that SSD is the way forward. Looking on the Dell site, it looks like 64GB SSD would add AUD$1000 - a bit rich for me, and for some reason you can't have both a hard disk and SSD. I'd be interested to know why, because it would be nice to combine cheap mass storage (7200 rpm hard disk) and expensive small fast storage.

On my personal projects it has become obvious that it isn't just about one language anymore (java, groovy, python, javascript etc). It also seems that with javascript libraries its not just about one library either. I'm currently using Prototype, Dojo, and jQuery in one application. If I spent enough time on it, I could probably drop one of them, but at the moment its not worth the investment.

New CPUs from Intel feature 4 cores and hyperthreading is back (and supposedly energy efficient) giving you 8 virtual cores!

I've just found This looks like a great resource for those little pieces of code you need now and then. I'm particularly interested in the linux section - subscribing to the RSS feed might be a good way to learn new tricks!

I've been spoilt working on my personal projects using Grails and AppEngine. Back in the corporate world, restarting the app server after the smallest change in compiled code and waiting for JSPs to recompile seems unreasonable. In JSF, Facelets is the way to go, but I'll have to wait for a while before we can switch JSP to Facelets. To get around restarting the application server, JavaRebel might be an option. Anything that lets me build the application quicker would be welcome, and since I doubt I've got enough influence to make the switch to grails I'll have to investigate these options.

Doing most of my work offline (while travelling to/from the office) I appreciate offline documentation. Imagine how happy I was to find out about these cheatsheets.

What happened to ? It used to be a site encouraging users to upgrade to the latest browsers, but now it redirects to a Microsoft site to download IE: Is this because of their campaign against IE6?

I was surprised to find that some companies block the SVN propfind requests. To check out from a remote repository you need to configure your svn tool with the proxy details, and use an HTTPS url since the firewall can't read encrypted packets. This makes it a bit difficult to check out opensource projects - looking at other projects code is a good way to learn so I'm surprised companies are this pedantic with firewalls/proxies. Unfortunately Google Code repositories only allow anonymous access over HTTP - but the Jakarta projects have an HTTPS url which doesn't require a username and password to read from (i.e. Or, failing that you could attach the source jars from a maven repository in your IDE (i.e Note, the Netbeans maven plugin makes this easy.

Monday, 3 November 2008

The week in review - 2008-44

I was happy to see 'Compile on Save' added to Netbeans. This is a feature I've always appreciated in Eclipse, its always worked and always made for a good experience. This was one of the top items preventing me from moving away from Eclipse. I want to play with it in Netbeans, and see if it measures up.

Speaking of Netbeans, the Maven plugin is awesome! It makes it easy to add a dependency to your project, through an easy to use autocompleteing dialog. With so many Java libraries around, this is the way we should have always been doing dependency management. The linked article doesn't really show how to add libraries, but try right clicking on the 'lib' directory in your project. Notice you can also download all javadoc and sources for your dependencies. So easy!!

I'm enjoying using Netbeans 6.5 for Grails development now. I haven't explored the functionality all that much, but using just the basics is effective. Hopefully this support will grow quickly. Netbeans 6.5 is now available as a release candidate.

I really would like to just start buying books as PDFs - to save space (on the bookshelf) and weight (while travelling) and trees. But what do I read them on? At the moment I'd have to use my laptop - overkill really - it gets heavy fast. I would expect that the Amazon Kindle would be ideal, but at USD 359 its a bit rich. You can buy entry level laptops for that price, and an ASUS EEE would cost less. But how comfortable is it to read on an EEE (1.1kg with a 10inch screen)?

I was disappointed to see that the Sun Tech Days conference is not coming to Australia this year. I went to the 2008 event and although I probably wouldn't be able to take time off for it in 2009 I'd like to think these kind of events are available to us.

I'm continually surprised by how bad at multitasking current multi-core computers are. If I kick off a build or launch an application, my computer is generally too unresponsive to do anything else with. I may be able to browse the web, but I can't do much more. I assume the problem here is being disk bound - I'm running windows XP on a dual core machine - Windows seems to aggressively swap to disk, even when you have lots of RAM. Perhaps RAID would help? I run Linux exclusively at home, so I'll have to compare performance for similar tasks. That'll be a bit harder, because at home I generally run lighter weight tasks than at work (smaller projects and lighter technologies i.e. Grails, Python).

I've been getting frustrated lately by the slowness of my computer at work. Its running Windows XP, and starting/restarting/reloading Intellij IDEA is a coffee break. I came across this article, and in the comments it is mentioned that an EXT filesystem would perform better than NTFS - I wonder if this would give me the boost I need?

Ubuntu 8.10 is here - I've been using 8.04 on my Dell 1525 since it came out, but have been a little inconvenienced by the odd quirk - such as intermittent failure of suspend/resume/hibernate. Sometimes after resuming it immediately hibernates. Sometimes it fails to suspend. And resuming takes an aweful long time if I'm not connected to the network. Not enough to make me switch OSes, but hopefully it will continue to get better and better.