WPTouch
February 14th, 2010
Credit to Jaap A. Haitsma’s WPTouch blog entry for first mentioning this plugin (at least, the first place I saw it, since it seems to be making rounds on other blogs as well). With the simple activation of this plugin, your blog gets automatic formatting on mobile devices. Once it was installed I took a quick peek on my iPhone and it looks awesome. Very cool stuff for such a simple installation.
Fedora Win
February 14th, 2010
I recently came into some new hardware, an Alienware M9700 laptop. The thing is a beast, both in processing power and sheer size. Disappointingly, Dell seems to have tainted Alienware, as what would normally ship as a clean, optimized installation is now cluttered with shit.
I have unavoidable needs for Windows on this box, so I decided to dual boot it. With as new as the hardware is, I figured XP would just be asking for trouble, so I decided to go with Windows 7. I figured with both the newness and hype of Windows 7, it actually contained drivers that were written this millennium.
When I first booted into Windows, I noticed the sound card wasn’t detected. It wasn’t hard to spot, as the system tray icon was huge due to the 800×600 resolution it was running in since the video card wasn’t detected either. Amazingly, the network cards were picked up, which didn’t really matter since Alienware doesn’t have Windows 7 64-bit drivers for… well, anything.
Seriously Dell, what did you do to that company? I used to have nothing but great things to say about them.
Dejected, I rebooted into my Fedora installation disk. A few minutes later, I was listening to music and trying to not go blind at the 1920×1200 resolution. Both of which worked fine out of box. And for the record, my video card is an NVidia GeForce Go.
This makes my head hurt. This laptop is for my wife, who is non-technical (that’s putting it mildly). If I were to sit here down to do the installation with both the Windows and Fedora installers, it’s pretty clear she’d end up with a much more usable system running Fedora. Apparently, when the people on the commercials were saying what they wanted in Windows 7, no one mentioned drivers.
Django “no such column” error
February 13th, 2010
I’ve been getting into Django recently. I’ll go into it more in another entry, but I ran into a small issue where my database seemed to get out of sync with my model. Running syncdb didn’t throw any errors, but when I tried to access the model from the server I’d get an error about “no such column”, even though I could see it created in the generated DDL.
It took me a bit of digging (in other words, it wasn’t in the tutorial), but there’s a manage command to reset the database for a particular app. Running that and re-syncing my database got me moving again.
python manage.py reset [appname] python manage.py syncdb
Screen
January 19th, 2010
I love when I find useful built-in commands that I never knew about. When starting out with Linux, I heard about the typical heavy hitters like grep, sed, and awk. Then I discovered some variations on common commands, such as htop and less. And then every so often, someone mentions a command in passing that causes me to say “Wait… what is that?”
Screen is one of those sorts of tools. I was watching a VNC demo of one of our team’s sprint reviews and was distracted by the fact that he had a tab bar on the bottom of a terminal. It turns out that was just part of the coolness of “screen”.
Screen is basically a window manager that runs in a terminal, letting multiple shells run within the single terminal. I’m sure there are other features that I’d find awesome, but there are two that immediately stood out.
As I mentioned, screen allows you to run multiple shells inside of a single terminal. Instead of starting up a handful of separate SSH sessions to a server, I now just use screen to manage multiple shells inside of a single connection. Each call to screen creates a new shell, with a simple emacs-like syntax to switch between them:
ctrl + a + n # next ctrl + a + p # previous ctrl + a + 0 # select screen 0
One side note on this, by default the tab bar displaying the running shells isn’t displayed. Adding the following to ~/.screenrc enables a visual indicator of the current and possible shells that are open:
hardstatus on
hardstatus alwayslastline "%{-b gk}%-w%{+b kg}%50>%n %t%{-b gk}%+w%< %= %{w}%D %M %d %C%a"
While useful, it can still get a little confusing when a bunch of shells are opened. The title can be set by:
ctrl + a A

The second major piece of awesomeness is the ability to detach from a running screen and reattach later. Going back to the SSH example, this lets me leave some shells running, detach, completely disconnect from the server, and then reattach to the screen later (with everything left exactly as it was).
Again, an emacs-like syntax for detaching from a running screen:
ctrl + a + d
Later, to reattach to the running screen detached from earlier:
screen -dr
Like I said, I’m not trying to make this post sound like I’ve discovered some hidden black magic in Linux. It’s just an attempt to let new users know about this awesomeness.
From Java to Python
January 13th, 2010
I’m not completely sure why, but I’m a bit embarrassed to admit to Planet Fedora how little my Python experience is; the majority of my experience is in Java. I was able to read and bug fix the Python code in Spacewalk, but I hadn’t really dug deep into my own project. Now that I’m not teaching any longer and have some free time (one of my main reasons for quitting), I can finally sit down and dork around with the language. After spending some time working on some basic games and a simple IRC bot, I figured I’d step back and think about what the transition from Java to Python has felt like.
Don’t Fear The Whitespace
I constantly hear people mention the indentation in Python as the first thing when talking about moving to the language. Not only is it not as jarring of an experience as people make it out to be, it’s downright awesome. I’ve always been compulsive about my code format anyway, so the biggest difference is the lack of curly braces.
Collections Are Awesome
It’s much lighter-weight to throw things into a list or map (dictionary in Python) than it is in Java. Get out of the mentality that you have to jump through import hoops and rigid notation to create, access, or return collections. In Python, they even let you do cool things like assign multiple variables as a return from a call:
exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
Looping Feels Weird At First
I got a little thrown off by this initially. Most loops read really well:
for square in openSquares:
However, when looping through a set of numbers, you need to use the range method:
for i in range(0, 10):
Looking at both of those examples brings me to my next point…
Don’t Forget The Colon
This keeps throwing me off, but after declaring a function*, loop, or if statement, don’t forget to end the line with a colon. I’m happy to be rid of curly braces, but I get over-ambitious and forget the colon too.
Don’t Over-engineer Configuration
Depending on what you’re doing, you can likely just stuff configuration values into a script and import it (not needing to compile really is liberating in this respect). That’ll also give you the use of lists and maps by default. If you’re not reading between the lines I’ll spell it out: no need for XML-based configuration, which is one of the more evil trends in Java.
There are definitely more things I could mention; don’t take this to be the only lessons I’ve learned (any other hints/tips are appreciated). But I do want to avoid a mammoth blog post that causes readers to go into a zombie-like trance, so I’ll stop it here for now. I do want to thank Devan (dgoodwin) and Jesus (zeus) for dealing with the Java-veteran-turned-Python-noob and not finding a way to crash my chat client to avoid more questions.
* I haven’t seen a solid explanation of “Call them ‘functions’ because you’ll sound like a Java guy calling them ‘methods’”, but this feels like something where using the wrong term will make me stand out as a Java developer in a Python world. So I’ve been advised to take a militant approach of “Yes, I’m a Java guy learning Python, deal with the occasional terminology missteps.”
Dangers of working at home
January 8th, 2010
My mouse died yesterday, so I’m using an old trackball. My 2 year old daughter just came in to say goodbye before they went out. She took one look at the it, grabbed the ball out of the rest of the mouse, and ran out of my office to go play with it.
Since it fully renders my mouse useless, this is actually more crippling than the last such incident. I keep my RSA FOB on a lanyard. A few months ago, my daughter saw the lanyard and then ran around the house showing off her “new jewelry”.
Child’s Play Charity
December 10th, 2009

http://www.childsplaycharity.org/
I’m not the type to get preachy about charity and donations and Christmas and all that stuff. But since this is the time of year where people are more inclined to give to charity, I wanted to drop a quick note about Child’s Play Charity just to increase awareness. More information can be found on their site, but I’ll mention a quick snippet to summarize what they are:
Since 2003, we’ve set up and organized Child’s Play, a game industry charity dedicated to improving the lives of children with toys and games in our network of over 60 hospitals worldwide. In five short years, you as a community have answered the call and come together to raise millions of dollars.
And just to be clear, I’m not affiliated with them in any way. I’m a video game geek and have a soft spot for children, so this initiative has always resonated with me.

