atc » Life http://blog.alexcollins.org Musings of technology, sport, life et al Thu, 10 Jun 2010 10:24:24 +0000 en hourly 1 http://wordpress.org/?v=3.0.5 Ant TODO Update http://blog.alexcollins.org/2010/01/02/ant-todo-update/ http://blog.alexcollins.org/2010/01/02/ant-todo-update/#comments Sat, 02 Jan 2010 21:34:38 +0000 atc http://blog.beplacid.net/?p=111 Quick update regarding Ant TODO: there’s now a JAR available for download, so you can get it running even quicker!

]]>
http://blog.alexcollins.org/2010/01/02/ant-todo-update/feed/ 5
Ant Task for TODOs http://blog.alexcollins.org/2009/12/31/apache-ant-task-todo/ http://blog.alexcollins.org/2009/12/31/apache-ant-task-todo/#comments Thu, 31 Dec 2009 15:58:35 +0000 atc http://blog.beplacid.net/?p=108 I often felt the need to scratch an itch when it comes to source code and a little fragment called //TODO. It’s scattered everywhere; I’m sure you’ve seen it. Yet no matter what codebase you’re looking at, there’s never any real exposure to them.

I therefore decided to implement an Ant Task for parsing TODOs in source code. You can read more about it over on the Google Code project. Please feel free to review code, suggest features or try it out and report a bug.

Happy new year to all; many happy returns.

See you in 2010!

]]>
http://blog.alexcollins.org/2009/12/31/apache-ant-task-todo/feed/ 0
Google Wave Extensions – Wave Toolkit http://blog.alexcollins.org/2009/10/17/wave-toolkit-google-wave-extensions/ http://blog.alexcollins.org/2009/10/17/wave-toolkit-google-wave-extensions/#comments Sat, 17 Oct 2009 22:38:36 +0000 atc http://blog.beplacid.net/?p=82 Update: You might find my latest posts on Google Wave helpful.

So I managed to join the select elite bandwagon that is the Google Wave preview, which entitled me to early access to Google’s new masterpiece and 8 invites to bribe friends with (although I only have a few, so the whole eight might not stretch too far…). I have to admit, I’m not sure what the fuss is about. It’s clever, really clever; but there’s not much to it yet. It is, for all intents and purposes, a well-marketed collaboration tool, or put simply: a clever chatroom. Time will tell though. Perhaps its usefulness is yet to be seen.

Being a devout geek, and a sucker for anything Google, I was led to explore the programming possibilities behind Wave. Rather brilliantly Google have created an API that will allow you to do one of two things: create a ‘Robot’ – an automated participant programmed by you – or embed your own ‘gadget’ in a wave (think a Google map, but your content). The API is rich, if its documentation can be a bit light in some respects (where the hell are the CreateBlip() and such methods documented?! All you get in the API docs are ‘Get*’ methods…pointless!).

Introducing Wave Toolkit

Having programmed plenty of bots for IRC and Eternal Lands over the years I had the experience and ideas behind creating an automated character that can be used to aid users, or simply provide a bit of light entertainment. So after plenty of reading and hacking, I managed to come up with Wave Toolkit; a simple Python robot for wave that provides features that are either lacking or a little tool that might aid your chatroom…err I mean collaborative-blue-sky-thinking…yeah.

To get a bot running you do need a Google App Engine account, which allowed me to explore this little world offered by Google. It’s cleverly done and nicely polished. Still think it’s just cleverly managed free-hosting though ;)

The capabilities of robots within the Google Wave extension API are pretty much exactly what a human participant can do: edit, post, delete and edit ‘blips‘, create waves, see who’s participating and apparently manipulate playback. It’s very fun writing something that can do all this too; that wonderful satisfying feeling of achievement when you spam “hello world” to a wave…

Wave Toolkit‘s in constant development so it might be a little ropey, but please feel free to add wave-toolkit@appspot.com as a contact and invite it to a wave, and feel free to suggest new things, report bugs or even tell me you love it. ;)

So back to coding more lovely Python, and perhaps writing something useful for all the wavers out there. Right? ;)

]]>
http://blog.alexcollins.org/2009/10/17/wave-toolkit-google-wave-extensions/feed/ 7
Learning Scala – first impressions http://blog.alexcollins.org/2009/09/03/learning-scala-first-impressions/ http://blog.alexcollins.org/2009/09/03/learning-scala-first-impressions/#comments Thu, 03 Sep 2009 18:45:08 +0000 atc http://blog.beplacid.net/?p=74 So every year I learn a new language. It’s fun, insightful and leaves me feelin’ a fresh for new challenges in my new found religion.

This time round I’ve been learning Common LISP and now Scala. Being a Java programmer professionally it makes sense to try the latter. I love the idea of it being its own language – for scripting as well as fully-fledged development – that can run inside the JVM (or if you’re evil, the .NET CLR).

First impressions are that it’s exciting to learn. I love its simplicity, and its productivity. One thing I do hate: the syntax of array indexes. I can’t for the life of me think why it’s a good idea. I like the [] syntax because it makes it explicit as to what you’re working with. Doing array(1) looks like a method call, not great. Sure I’ll find out soon enough as to why it’s done that way.

I wrote the following today whilst waiting for my Grilled Mackerel to finish soaking :)

#!/bin/sh
exec scala $0 $@
!#
args.foreach(arg => for (c <- arg) println(c))

]]>
http://blog.alexcollins.org/2009/09/03/learning-scala-first-impressions/feed/ 2
The Joy of Spotify http://blog.alexcollins.org/2009/06/27/the-joy-of-spotify/ http://blog.alexcollins.org/2009/06/27/the-joy-of-spotify/#comments Sat, 27 Jun 2009 14:06:08 +0000 atc http://blog.beplacid.net/?p=73 When it comes to music distribution, we’re in slightly controversial times. You’re deemed a criminal if you copy your CD to your PC or portable media device so you can listen on the train. You’re — rightly or wrongly — breaking the law when you download your favourite track from the various distribution methods such as Bit Torrent et al.

Various efforts have come about attempting to cash in on this phenomenon; Last.fm to Napster, they’ve all got their merits. Somewhat under the radar is Spotify, an iTunes-esque attempt at bridging the gap between the stubborn fat-cats running the music industry and the slick distribution medium that is the internet. Spotify has some great features, from playlists to quick but advanced search (which includes a command-like interface such as ‘genre:blues’). Spotify also runs very well under Wine non-natively; it’s completely free (ad-supported) and doesn’t seem to waste too much bandwidth.

Spotify is split into free and premium services. The former having audio ads every 50 or so minutes and banner ads throughout the GUI, the latter having no ads and higher-quality music.

It’s different to alternatives like Last.Fm. Spotify doesn’t run with the idea of suggesting music for you. You put in an artist and it’ll list all it has. It’s up to you to build your own playlists. Without knowing the advanced search feature like ‘genre:blues’ you might get frustrated, but I’ve found that the freedom to build my own playlists leaves me with the music I love, and not the tripe that Last.fm thinks I’ll like (nor it’s crappy ‘loved tracks’ idea).

A feature I’d love to have is the ability to purchase the playlists as CDs; that is, I click ‘burn to CD’ and Spotify mails me a burnt copy of my playlists. Bit of a nice to have, though :)

Check Spotify out. Well worth it, in my most humble opinion.

]]>
http://blog.alexcollins.org/2009/06/27/the-joy-of-spotify/feed/ 1
Favourite Quote: “Complexity has nothing to do with intelligence. Simplicity does.” http://blog.alexcollins.org/2008/12/05/favourite-quote-complexity-has-nothing-to-do-with-intelligence-simplicity-does/ http://blog.alexcollins.org/2008/12/05/favourite-quote-complexity-has-nothing-to-do-with-intelligence-simplicity-does/#comments Fri, 05 Dec 2008 09:52:39 +0000 atc http://blog.beplacid.net/2008/12/05/favourite-quote-complexity-has-nothing-to-do-with-intelligence-simplicity-does/ This excellent phrase was coined by Lawrence “Larry” Bossidy, the retired CEO of Allied Signal. What I find particularly interesting about this quote is that it’s so eloquently structured and an example of what it’s stating; the statement is simple yet intelligent. Here it is in all its wonderful, quoted glory:

“Complexity has nothing to do with intelligence. Simplicity does.”
- Larry Bossidy, CEO Allied Signal

]]>
http://blog.alexcollins.org/2008/12/05/favourite-quote-complexity-has-nothing-to-do-with-intelligence-simplicity-does/feed/ 1
Most Inappropriate Name for a Packet of Cigarettes http://blog.alexcollins.org/2008/11/13/most-inappropriate-name-for-a-packet-of-cigarettes/ http://blog.alexcollins.org/2008/11/13/most-inappropriate-name-for-a-packet-of-cigarettes/#comments Thu, 13 Nov 2008 07:09:06 +0000 atc http://blog.beplacid.net/2008/11/13/most-inappropriate-name-for-a-packet-of-cigarettes/ Whilst on holiday in Kenya, the need for smokes was abundant. Amused we were when we stumbled across these:

Sportsman Cigarette Packets

]]>
http://blog.alexcollins.org/2008/11/13/most-inappropriate-name-for-a-packet-of-cigarettes/feed/ 0
Apache Axis Woes – Return Code (0)null http://blog.alexcollins.org/2008/03/17/apache-axis-woes-return-code-0null/ http://blog.alexcollins.org/2008/03/17/apache-axis-woes-return-code-0null/#comments Mon, 17 Mar 2008 12:40:41 +0000 atc http://blog.beplacid.net/2008/03/17/apache-axis-woes-return-code-0null/ The latest project at work is using a service tier setup. We have the web front-end that’s using Struts 1.2 (yes, old!), Weblogic 9.2, Apache Axis 1.3, JSON & jQuery. The back-end web services are written in .Net (and how difficult it seems to be for developers to work in .Net). Things at least work, up until you receive very strange errors such as this:

java.lang.NullPointerException
at weblogic.xml.jaxp.ChainingEntityResolver.popEntityResolver(ChainingEntityResolver.java:75)
at weblogic.xml.jaxp.RegistryDocumentBuilder.setEntityResolver(RegistryDocumentBuilder.java:179)

and this:
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (0)null
faultActor:
faultNode:
faultDetail:
{}:return code: 0

The worst thing about this error is that it’s completely non-descriptive. You can’t get a damn thing from your code (the WS call looks good; no connectivity errors). I spent in total 1 and a half days debugging this issue, and got nowhere. Google was returning red-herrings and forum posts with no solution and desperate coders saying ‘plz help me’. Painful stuff.

The fix as I see it, is to ensure the services are in sync. with the client.

  1. Make sure your web service is deployed correctly – the issue we discovered is that the client was sending extra objects that the service wasn’t expecting
  2. Regenerate your client – the client must be talking to the right methods and sending the correct object types. It looks like because the web service didn’t like our objects, it wasn’t returning a result (errors such as ‘There was an error while trying to serialize parameter X with data contract name Y’). The response therefore cannot be parsed, and you’ll get XML parsing errors caused by null pointers
  3. Check your logs; both server & client – we only found the true cause of our particular error because the service developer opened up the log directory in IIS. From that, I tail’d the log file when making a call and noticed the serialization errors.
  4. Don’t panic – yes it’s true, HHGTTG is right: panicking doesn’t help.

I first encountered this error well over a year ago when developing some web services myself. I’m no expert and I didn’t have the time to add logging (and indeed rebuild Axis) to Axis itself, but I’m sure the response returned from the service is totally unusable by the XML parser in your Application server and thus Axis itself.

I hope this helps someone. I spent so much time searching Google and pulling my hear out with no real solution…

]]>
http://blog.alexcollins.org/2008/03/17/apache-axis-woes-return-code-0null/feed/ 4