I picked up the book Python for Data Analysis as I've been seeing it mentioned in quite a few places. And so far, it's great. A very good high level overview of using Pandas. No, not the cute kind of pandas. I'm talking about the Python library for data analysis. Derp.

Maybe I misunderstand our local retirees (at least the ones I've met) but this was surprising to me. I really expected Romney to come out on top.

I think that's enough peeking into my neighbors contributions habits for one night. I have to say Pandas makes this sort of thing really easy. I've only scratched the surface here. There's lots more that one can do (mathematically speaking) with Panads. Python for Data Analysis gives you a really good introduction to Pandas and then the webiste fills in the gaps.

#!/usr/bin/env python"""Spit out the currently playing song."""importdbusimportsystry:bus=dbus.Bus(dbus.Bus.TYPE_SESSION)spotify=bus.get_object('com.spotify.qt','/')info=spotify.GetMetadata()exceptdbus.exceptions.DBusException:print('Spotify is not running')sys.exit(1)track={}trackMap={'artist':'xesam:artist','album':'xesam:album','title':'xesam:title'}forkey,valueintrackMap.items():ifnotvalueininfo:continuepiece=info[value]ifisinstance(piece,list):piece=', '.join(piece)track[key]=piece.encode('utf-8')iftrack.has_key('title')andtrack.has_key('artist'):print('%s by %s'%(track['title'],track['artist']))else:print('No song playing')

If you want Spotify to use the built-in notifier in Ubuntu, then by all means check out Spotify-notify. It also adds support for media keys.

So, it's been over a year since my last "Books I Read" post so it's time I suppose. Only 28 books this year but this includes the behemoths that make up the first five books of the A Song Ice and Fire series so my page count is probably a bit higher this year. Hrm, that might be the job for a different script.

For no particular reason other than I need to post something to make up for all the times I didn't post (and because I love making lists), here's a list of the software that I use day to day.

Ubuntu: My main machine is running Ubuntu 11.04. I've got other boxes running older versions of Ubuntu (as well as OS X) but this is where my hat hangs for the time being. Speaking of hanging, Unity almost made me want to hang myself but I think I have it dialed into where I like it. Hidden inside the Compiz settings are some sweet keyboard shortcuts for windows management, which is the only reason I tried out xmonad for as long as I did.

GNU Emacs: Emacs is probably where I spend about 90% of my day. I've got it to the point where I hardly touch the configuration files anymore. People complain that emacs users spend tons of time fiddling with settings but you have to average that over the lifespan of you using the software. So the time setting it up isn't that much really. Emacs probably demands its own post about all the packages that I use come to think of it.

Google Chrome: Yep, I ditched Firefox. Chrome just seems a lot faster and the developer tools are built in and rock solid. Seeing as how Firebug was staring to cause me to stab my eyes out, I'm quite happy now.

Dropbox: This is a service that I actually pay for. At my last job, dropbox was blocked and it made my life kind hellish. Without it, all my ebooks, projects and personal wiki are inaccessible.

KeePassX: The older the get, the more I forget. And when it comes to the bazillions of passwords I need to remember for various sites, I rely on KeePassX. Open source and available on multiple platforms, it's a keeper. Har har! Get it? Keeper. KeePassX. I should move over to marketing.

Spotify: Another service that I pay for. The huge selection of songs and the integration with Facebook make it kind of hard to pass up. I mention Facebook because it's good fun to queue up weird songs so they end up on your wall and your Mom gets to see it.

Git: Yeah, I spend way too much time in git but I use it and it suits my software development needs. So much so, that I use git to interact with our Subversion repository at work.

Remeber the Milk: Another piece of software that I pay for. I know this is technically a web service but I have software installed for it on my phone and tablet so I'm lumping this into the software post.

urxvt: I'm using this less and less now that I've been using Emacs to run my shell but when I need to run complex commands, this is the termianal I turn to. My shell of choice is Zsh.

Oh My Zsh!: Speaking of Zsh, this is a great collection of very useful Zsh configurations and aliases which make working with Zsh very very nice.

homedir: I don't know how I exactly found homedir but it's very sweet. It's basically a small package manager for your home directory. I use to keep all configurations the same across machines. And where I need a machine specific configuration, homedir comes to the rescue. I don't really use this day to day but thought it was worth mentioning because it's saved my bacon a few times.

That about wraps up what I'm using day to day. I use other things on-and-off (like LibreOffice -- shudder) but didn't think they were worth putting in the post.

For some unknown reason, we have a problem with superfluous trailing commas at work in our JavaScript. It's probably because we have a bunch of Perl developers writing JavaScript. Unfortunately, this doesn't play well in a world with Internet Explorer.

JSLint makes this easy enough to track down. But I wanted something more. I wanted to know who the culprits were. Thus, I whipped up this little script that'll take a list of files and tell you who committed a file with a trailing comma in it. Besides, JSLint, You'll need Rhino and a script to execute commands (named runtime.js). I'll try and post that later.

I know you'll find this hard to believe dear reader but I'm a big fan of using Emacs to write JavaScript. One thing that irked me in the past is that none of the libraries got the indentation and other formatting how I wanted. Luckily, I recently stumbled onto js-beautify (via the most excellent jsFiddle.

Lo and behold, there is a command line interface to beautifying JavaScript! Good thing Emacs can call shell commands on text so easily. Thus, we have:

At my work we use git and Bugzilla for source code control and bug tracking respectively. We have a process where bugfixes are commited to a branch off of master with the name of bugfix/bz1234 where 1234 is the id of the issue in our bugzilla system.

After a fix is completed, a merge request is filed in our bugzilla system to merge this branch back into master (developers don't have write privileges to master). We are in the process of writing up a hook to parse commit messages to automate all of this but it's taking some time.

So, in the interest of making my life a bit easier until then, I took advantage of Bugzilla's excellent email_in.pl to parse incoming emails to edit tickets and wrote up a command to file fix and merge tickets for me.

I simply put git-bz on my $PATH and call it thusly:

> git bz fix
> git fix 1.2.3 hotfix | sendmail -t

Note: Our merge tickets require a milestone and a version for the merge ticket, thus the extra arguments for the merge.

Your system is probably radically different than ours but I thought it'd be interesting to post something here showing how powerful git is. Let me know what you think.