Archive for the ‘IT Stuff’ Category

Great site – lifehacker.com

Friday, February 3rd, 2006

www.lifehacker.com. Bookmark it. Add it to your aggregator. Print out the URL, frame it, and put in on your bedside table (marginally behind the picture of your “Significant Other” – you don’t want to go too far….)

You get the idea… ;)

I can’t even recall how I found this site now – some random google or another, I think. But I’ve subscribed to the feed for the last few weeks and I’m hooked. What is it? Well, I think they describe it best:

Computers make us more productive. Yeah, right. Lifehacker recommends the downloads, web sites and shortcuts that actually save time. Don’t live to geek; geek to live.

In the last couple of weeks, they’ve posted short reviews and links to cute Firefox plugins and Mac OS X apps, links to stories on hybrid cars, and a number of really interesting links to stories on personal organisation and time management. So far, I’ve been seeing around 10 – 20 posts a day, of which I find at least 75% are worth the read.

Kind of ironic – despite their mission statement, I’ve just lost 5-10 minutes of my life each day to their website! Here’s hoping thats offset by the efficiencies I’ll no doubt gain….. :)

End of rave. We now return you to your regularly scheduled programming…

Yet another Eclipse / NetBeans comparison

Sunday, January 29th, 2006

A week or so ago, I downloaded NetBeans 5 RC2 specifically to play with the mobility pack, but figured I might as well explore its capabilities as a J2SE IDE.

For those of you who like their blog posts short and snappy – “Neat, some cool stuff in there, but I’ll be sticking with Eclipse for now”. For those who can handle a couple more paragraphs, read on…. :)

To start with, can I join the crowd and say “Matisse rocks!”? Matisse is the visual editor for Swing apps, and it is fantastic – in 90% of cases it does what you mean: you put an object right on the left border, and it figures that that object should be anchored to the left. You place one button next to another and it keeps them together and snaps them to be level. I played with Eclipse’s Visual Editor in a recent small project, and it has a ways to go to catch up to this.

But (and there’s always a “but”, right?), the killer for me was that “90% of cases” phrase – its the other 10% that comes back to bite you. For instance, I wanted to do a a little “cross” of buttons – and up, down, left and right, laid out in a diamond. After having been spoilt with the editor doing what I meant for the rest of the UI, I found it a bit jarring when I was doing “free form” component layout – buttons were slightly off, by a pixel or two and it kind of “looked” wrong.

There’s probably a hidden “layout in a cross” option I missed :) . And I could have added a panel, set it to GridBagLayout and done it that way (Matisse has good support for GridBag). And how often do you want to have buttons in a bizarre shape like that anyway? But it kind of broke the spell for me in a way. I’m a big believer of being “in the zone”, development-wise, and switching between IDE modes (code and visual) is a real context switch for your brain – to compensate, I think I need almost perfection from the Visual Editor. Matisse is soooooo close, but isn’t quite there for the fiddly cases. (How would I have liked Matisse to handle my peculiar layout requirement? I have no idea!).

Matisse is the big ticket item – the rest of the IDE is good, but not compelling from where I sit. There are some winners, though. I love the idea that the IDE is ant based – take your development directory, zip it up and give it to someone else, and they can compile, test, build, etc. Ant seems to be the one big constant across teams – it makes so much sense to have it as the backbone of your development processes. And the fact that a test folder is created when you start a new project is a little nicety, but a good one.

On the downside, on my machine (2 Ghz with a ridiculous 512Mb of RAM), NetBeans is noticeably more sluggish than Eclipse – maybe this is an SWT thing? (I hope not, I’m one of those Swing fans ;) ). And the plugin environment for Eclipse seems so much richer at the moment – I even have a VI plugin for my Eclipse for when I’ve been doing a lot of Unix work and keep on putting the letter “i” throughout my source code (you Unix guys will know what I mean)!

So, I’m staying with my Eclipse for now. It was certainly worthwhile to check out though, and I’m still planning to do my next little J2ME project with NetBeans – I’m keen to give that Mobility Pack a proper workout.

Developer.com article on Code Reviews

Thursday, January 26th, 2006

There’s a worthwhile article on code reviews at developer.com at the moment called Effective Code Reviews Without the Pain.

Its a quick read, and the title says it all. The article’s focus isn’t so much on what your code review should cover, but how your code review should be carried out – how to make what can feel like a very adversarial, negative process into a postive, learning process. There’s tips for both the code reviewer and reviewee, with points like “Avoid ‘Why’ questions” and “Remember that the code isn’t you”.

Good, common-sense stuff. Its rare to find a development area that doesn’t use code reviews nowadays (even if only intermittently! ;) ), so it should be worth a read for most developers.

Comment on Slate Article – “Keeping Secrets”

Wednesday, January 25th, 2006

I’ve just read an interesting article at Slate called “Keeping Secrets“, where the author, a Professor Tim Wu makes some interesting points:

  • We have to assume that the US Government (and others) will one day succeed at getting at Google’s search data (which includes semi-identifying information like a searcher’s IP address)
  • While this identifying information has some value in improving the quality of search, that does not outweigh the potential privacy implications
  • Seeing as there is little hope in reforming the Government’s attitude towards protecting freedom, the public should demand this protection from Google and ask them to stop storing the information.

(This isn’t a complete summary by any means – I encourage you to read the full article to get the complete context)

Its an interesting argument, but overall, I’m not convinced. The point that jars me the most is the last one, which he puts thusly:

Recent events suggest that relying on the present administration to protect such basic freedoms may be, shall we say, unpromising. Other governments are just as bad if not worse. That’s why the public’s demand must be of Google—not the state.

That really strikes me as back to front. Democratic Governments are our representatives. Their job is to represent us. If they are behaving in a way that goes against our wishes, then we get to fire them (come the next election). In this age of massive election campaigns, spin doctoring and presentation over substance, that concept may seem a little idealistic – nontheless, that is the principle on which most Western systems of government are based. (I happen to be an Australian, not an American, but the same principles apply).

I’m also not convinced of the argument that the disadvantages of storing the data outweigh the advantages. While Google (and the other search companies) are doing this purely out of self-interest, I’m the one who eventually benefits – I get to find what I’m looking for quicker and more efficiently, in an increasingly disorganised Internet. If you like, I’m trading – “you get to see where I’m going, in return for you providing me with better service”. And importantly, if I decide that I don’t wish to do that trade (some, or all of the time), there are third party services (anonymising proxies) that will let me keep my identity cloaked.

Just my idle thoughts on a pretty weighty topic….

First impressions of J2ME development with Netbeans and the Mobility Pack

Monday, January 23rd, 2006

With my recent interest in J2ME development, I found the time to download Netbeans and the J2ME Mobility pack. I have to say I’m quite impressed.

I’ve downloaded both version 4.1 and the 5.0 Release Candidate (RC2). One of the first things that impressed me is they both perform quite well on my (slightly …mature) laptop. Once things start up, its all quite snappy. I can find Eclipse a bit laggy at times. Of course I haven’t really put these tools through their paces yet with any advanced projects – this is really just a summary of my first inspection.

The big drawcard though (for me) is the Flow Design screen. Here’s a sample screenshot:

NetBeans J2ME Flow Design

Basically, this tool helps you set up the skeleton of your applications. You drag all the different screens onto your workspace, and connect them to illustrate program flow. For example, the default project comes with a “Hello World” program that has an exit option. The screenshot above shows me inserting an “Are you sure?” screen when a user chooses “exit”. So, the exit option now connects to the new screen which presents them with OK and Cancel options. Cancel directs you back to last screen and OK takes you to the “Exit” state. Took me 20 seconds.

This is a great idea for mobile development – compared to a Swing application, a mobile app is likely to have large number of different screens/forms that all interconnect due to the limited screen real estate. This feature really takes the drudge out of that.

You also have a Screen Designer for placing widgets (“Items”) on your screen. Also great, although not as ground breaking as you may think – J2ME’s layout capabilities are pretty simple, so there’s less advanced formatting required (or even possible!). Very handy nontheless.

Once you have your rough architecture sketched out, adding your code is pretty straightforward – the generated code is reasonably clean and well thought out. Versions 4.1 and 5.0 differ slightly in their approach as to how you integrate your custom code:

  • In version 4.1, the generated code is “locked” and uneditable. One of the forms allows you to insert some code in the generated sections (with which you might do a “callMyMethod()”). You can then go to the code view and fill out the implementation. This feels a bit limited, especially as the form doesn’t seem to be able to do intelligent auto-complete.
  • In version 5.0, the generated code is “kind of locked” ;) . You can’t change it, but you can add to it. So, you generate your code structure, open it up in the source view and add whatever behaviour you want.

(At least thats the way it appears after a 15 minute look, without reading any of the help doco!)

I think it all looks pretty cool. The biggest thing holding me back is that I’m an eclipse guy, so I’ve got a bit of a hurdle getting used to the new user interface, keyboard shortcuts, etc. But its compelling enough that I’m going to have go at using NetBeans as my J2ME development tool, while still keeping Eclipse as my normal Java IDE. I’ll keep you posted as to how I go…

Doxygen – Javadoc for the C++ brethren

Thursday, January 19th, 2006

Typically, I work in Java. When I’m not working Java, I’m working Perl. Sometimes I even do work in Prolog (no, really!). But once in a while I venture into the C++ world.

I’m not a fan. Having my classes split across multiple files. Having the parent class decide what I can and can’t subclass. Trying to decide whether the caller or callee has responsibility for deleting an object. That said, there is a Perl-ish “Theres More Than One Way To Do It” (TMTOWTDI) thats kind of nice.

But with all the complexity inherent in a C++ program, documentation is all the more important. A work mate put me on to doxygen. It can be summarised as Javadoc for C/C++. Technically, its more than that – it can handle a range of languages and input files (even Java!), but the largest use appears to be the C/C++ arena.

Just like Javadoc, you create special comments throughout your source code, which get turned into documentation. And, you can insert special directives in these comments which have special meanings. Some favourite examples are:

  • @todo to flag a To Do item – your documentation will include a TO DO page summarising all these items
  • @version to detail what is in a particular version
  • @bug to flag a bug. Again, your documentation will include a bug page summarising all flagged bugs

In some ways, Doxygen is more powerful than Javadoc, out of the box. It can generate HTML and LATEX formats (Javadoc can do LATEX, but you need a custom doclet). The default pages show the class hierarchy, as well as providing links to the source code, neatly colourised and formatted. And most impressively, it can integrate with DOT from GraphViz to do graphical representations of the class hierarchy, as well as simple “has-a, is-a” type diagrams.

The flexibility comes at a cost – typically you have a big config file to tell Doxygen how to run (It reminds me of the “less is more” nature of Java versus C++ – Java may have less language features, but is more straightforward to debug and use as a result). And the nature of C++ in particular, with a class definition spread over multiple files can make some of the documentation decisions tricky: Do I put the method summary and method detail in the header file, or the cpp file? Or one in each? Whichever I pick, I always end up swearing once a coding session and having to flip around source files to find the info I need.

Niggles aside, this all makes C++ programming a lot more manageable. On larger projects, I can hand over the source to another developer and know they have reasonable documentation from the start. And on smaller projects, I can keep track of the issues, and architecture more easily. If only my IDE supported it, like Eclipse supports Javadoc…. :)

J2ME Development in Eclipse – EclipseME

Tuesday, January 17th, 2006

I’ve been playing around with some J2ME development lately (thus my earlier posts on Sudokulet). The whole process has been pretty painless, thanks in large part to EclipseME.

EclipseME is a plugin for Eclipse to let you use Eclipse for J2ME development. And it fulfils my idea of a good design by changing very little about my Eclipse experience. I use Eclipse like I always do – its just I’m using a different set of APIs and the end result will run on a mobile phone. But all the normal Eclipse-y things like refactoring, etc work as normal.

As well as making J2ME “just work”, it also simplifies some of those tasks specific to J2ME. JAD files in particular (which are used to describe various aspects of your J2ME Midlet) are given a special editor so you don’t have to worry about the format of this file, or its various permitted keywords.

Also of great use is the new right menu option “Run on Emulator” (and “Debug on Emulator”). Its really handy to be able to do this from within Eclipse, rather than have to get out of the zone (and the IDE). That was one thing that used to drive me crazy in my old days when I used nothing but the Sun Wireless Toolkit to develop in.

(A note for new players – you still need the J2ME libraries which you can get from Sun, but also from various mobile vendors like Nokia, Sony, etc. The vendor SDKs also include special emulators that are more “true” to their particular phones. EclipseME supports a variety of these, and I’ve never found one that I couldn’t get to EclipseME to play with at all. However with at least one version of the Nokia SDK, I couldn’t get the “Run in Emulator” to work. It wasn’t a total loss though – I configured a “Run External Tool” setting to accomplish almost the same thing).

The development of EclipseME is nice and active, and it also integrates with other tools. ProGuard can be used in particular to obfuscate (and thus shrink) your J2ME midlet – which gets all the more important on limited storage mobile phones.

So, well worth checking out if J2ME is an area you want to get into. Its not the only option though – in particular I’m reading great things about NetBeans with the Mobility pack. As I understand it, this offers a slightly different model of graphically showing you the Midlet’s life cycle – giving you the option of more of a graphical based development process. I hope to get some time to play with it – expect a post soon! And Nokia are getting into Eclipse in a big way – an Eclipse-based tool for developing native C++ code is due out soon, and theres been talk of them contributing J2ME tools to the core Eclipse project.

WordPress 2.0 plus….. Ads

Monday, January 16th, 2006

What a day! Upgraded the site to WordPress 2.0, and introduced Ads. Its a surprise I have any time to do my paid job!

Well, not that surprising. The whole exercise has taken around 30 minutes – love that! The WordPress upgrade is a doddle. The hardest part is doing all the backup steps “just in case” – the actual upgrade is soooo simple! (And, touching wood, after 4 WordPress upgrades I am yet to need my backup files :) ).

Hard to tell from the look of the site that much has changed, but the back-end admin is much improved. AJAX really lifts the bar for what we expect from web-driven apps nowadays. Deleting comments is particularly nice – seeing them go red then fade away is kinda fun, and really satisfying when it happens to be comment spam.

As an added bonus, the SecureImage plugin I use to get Captchas (a means of preventing comment spam) worked straight away with the new version.

I’ve had ads on my company web site for some time now, to support those resources I make available for free, so I was already a member of the AdSense program. I thought I’d trial ads on the blog as a bit of an experiment. I’m using the Adsense Deluxe plugin, which seems really nice so far – this post will be the first real test of it. It seems to be under active development – last update was only a week ago.

If nothing else, the experience has been an eye-opener about the size of the WordPress community. There’s a real wealth of extensions and experience out there!

Sudokulet 1.1

Sunday, January 8th, 2006

Sudokulet (a Sudoku solver for mobile phones) has now been upgraded to version 1.1.

The changes are pretty minor:

  • A proper “Exit” option. Some Nokias automatically add an exit option to a J2ME midlet but many devices do not… There is now always an exit option :)
  • An “About” option to get the version information, and web address for the product

The program is still free, although you have the option of making a small donation should you be feeling generous!

As before, it can be downloaded from the AITC web site at http://www.asman-it.com.au/products.html

Sudoku Solver for your Google Home Page

Sunday, December 18th, 2005

Now that Google have release documentation on how to write widgets (or “modules”) for the Google Home Page, it seemed only logical to port the Sudoku Solver across.

So, you can now sign into your Google home page, read the headlines, check your stock quotes, check the weather, and solve that Sudoku you were working on during the trainride in!

You can find the details here. As the page discusses, we (AITC) have some plans for a more fully featured Sudoku “workshop” in this format. But, in the spirit of “release early, release often”, we’ve decided to make this simple version available now.