Google Wave Extensions – Wave Toolkit

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? ;)

Alt+Tab and Linux Window Managers

Regardless of window manager, why can’t I click on an icon to select the app I want to focus when ALT+TAB’ing? Or am I missing something?

Yes it’s used primarily for keyboard usage to prevent having to use the mouse, but sometimes I’m ALT+TAB’ing while I am web browsing to check on the progress in another application. Clicking would speed things up by, say, 0.0051 ms. Perfect, right?

Learning Scala – first impressions

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))

The Joy of Spotify

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.

Sony X-Series NWZ-X1060 Walkman, AVI/WMV Transcoding and Linux (Debian/Ubuntu)

Having purchased my awesome Sony X-Series and begun getting it to work with Linux, I was eager to begin using the OLED display to its full potential. Namely, video and lots of it. Most portable devices support the WMV and MPEG codecs and the X-series is no exception (WMV with/without DRM and MPEG-4, plus H.264 to be precise). Most AVI files you might have won’t be compatible with the device which means you have to transcode: convert from one codec to another.

There are lots of solutions for transcoding on Linux. Some more simpler than others. The solution I found to work out of the box was Mark Pilgrim’s mencoder based solution. I successfully converted from AVI to WMV by just running the following commands in a shell/terminal:

sudo aptitude install lsdvd mplayer gpac zenity mencoder
sudo wget http://diveintomark.org/public/2007/06/podencoder.txt -O /usr/local/bin/podencoder
sudo chmod +x /usr/local/bin/podencoder
podencoder foo.avi

This worked 100% for me. I then just copied the file to the videos folder on my Walkman and it worked!

Yay.

Sony X-Series NWZ-X1060 and Linux (Debian/Ubuntu)

Update: if you need to copy videos to your device with Linux, follow my transcoding howto post.

So I ended up having to purchase a new portable media player. I’d been used to my aged Samsung YP-Z MP3 player for a while with a broken screen; memorising the various menu selections to get where I needed to.

Sony have a mixed history with portable media — from MiniDisc to their Sonicstage software — so I was skeptical about choosing something from them again.

In short, the Sony NWZ-X1060 (X series) portable media player is outstanding. The OLED 3″ screen is stunning and vidid and the sound quality is unbelievable. I have Denon C751 earphones and combined with the X series I am hearing new things in tracks I’ve listened to for a while. It’s all very, very impressive.

The touch screen is great too. It’s quick, forgiving, responsive and very thumb friendly. If you’re unsure about buying it: drop your doubts and go purchase it. I got the 32 GB version and I’m really happy.

Enough of the propoganda though, there’s a point to this post. I’m an avid fan of Linux and this was my main concern when purchasing anything like this. “Will it work on Linux?!”.

In short, yes it works with Linux. It will mount just like any other mass-storage device. Good job Sony!

There are some caveats: mass copying can be a little flaky and I haven’t found anything to transcode to the WMV + Codec it requires for video (though I’ve only been look a day as of writing this).

I’ll keep looking for something that will work with regards to transcoding video.

Upgrading to Ubuntu 9.04 (Jaunty Jackalope) from 8.10

Run update-manager -c (not -d anymore, that’s for development releases) in a shell/terminal. This is handy if you don’t get the upgrade button.