Archive for October, 2007

Happy Halloween!

Kevin Day, October 31st, 2007

Smiley Pumpkin

A dangerous combination…

Kevin Day, October 17th, 2007

…having both Pandora and Amazon’s MP3 store open in the same browser window. Just bought a few Concretes songs and didn’t even have to enter any credit card info. Gotta restrain myself.

Inkscape’s Hidden Features

Kevin Day, October 17th, 2007

Yesterday when I was working on a new banner for this blog I found that Inkscape has a few features that I hadn’t used before: font kerning and a cool smoothing filter for drawings.

The thing is that they’re only accessible through keyboard shortcuts. I didn’t find them until I looked in the Help menu. I rarely check Help menus because they’re never actually helpful. Inkscape seems to be the exception though. If you’re frustrated or new to Inkscape, try the help files.

Player Piano Pontificating

Kevin Day, October 14th, 2007
“Most fascinating game there is, keeping things from staying the way they are.”

That could be the official motto for engineers and hackers, but it’s actually a quote from Dr. Paul Proteus, an engineer and the main character of Kurt Vonnegut’s first book, Player Piano.

It was written in 1952, but the story takes place in roughly the year 2000. Despite the time difference, Vonnegut pegged society pretty well. For instance, if a factory worker gets displaced by a machine they have two choices: join the Army, or join the Reeks and Wrecks, a group that repairs broken machines and lives off government subsidies.

Another example of an accurate prediction is this scene where a foreign ambassador, Khashdrahr, is shown the home of a member of the Reeks and Wrecks in order to observe a typical American family. His escort, Doctor Dodge, is selling him on the benefits of civilized society:

“And this is the ultrasonic dishwasher and clotheswasher,” said Dodge. “High-frequency sound passing through the water strips dirt and grease off anything in a matter of seconds. Dip in, take out, bingo!”

“And then what does the woman do?” asked Khashdrahr.

“Then she feeds the clothes through this ironer, which can do what was an hour’s ironing in three minutes. Bing!”

“And then what does she do?” asked Khashdrahr.

“And then she’s done.”

“What is it she is in such a hurry to get at? What is it she has to do, that she mustn’t waste any time on these things?”

“Live!” said Doctor Dodge expansively. “Live! Get a little fun out of life.”

“And how is it you live and get so much fun out of life?” asked Khashdrahr.

Wanda blushed and looked down at the floor, and worried the carpet edge with her toe. “Oh, television,” she murmured. “Watch that a lot, don’t we Ed? And I spend a lot of time with the kids, little Delores and young Edgar Jr. You know. Things.”

“Where are the children now?”

“Over at the neighbors’ place, watching television, I expect.”

That conversation isn’t limited to married women though. If the word television were replaced with internet, it would describe my life fairly well. I guess except for the kids thing of course.

This is a fun book for engineers partly because there are lots of small examples of how technology affects people’s lives, and partly because the engineers are at the top of the social ladder. Oh, well, I guess everything couldn’t come out the way he predicted.

Python Magazine

Kevin Day, October 10th, 2007

The Python Magazine released its first issue this month, and one of their main articles tells how to create custom widgets for PyGTK. Awesome! All of the articles look pretty good and have a lot of technical detail. For this first issue you can download the PDF for free. Check it out:

http://pythonmagazine.com

Initial thoughts on Python GUI frameworks

Kevin Day, October 7th, 2007

In the last few weeks I’ve tried two different Python frameworks for writing GUI applications: wxPython and PyGTK. Here’s my initial thoughts on each.

wxPython

wxPython comes with an awesome set of examples, and it seems to be the favorite Python framework among programmers. Copying and pasting from the examples was easy, and I had my own simple applications working in no time.

I also played around with Boa Constructor, which is a GUI that will produce wxPython code for widgets as they are added and edited. Unfortunately, the Linux version seems to have a few bugs. The most frustrating part was when I ran into a bug just by following the tutorial.

PyGTK

Later I switched to PyGTK because I found that it’s supported by Nokia’s series of internet tablets. PyGTK has a 400-page tutorial with several examples that I’ve been working through. Once I got familiar with the different widgets it wasn’t too hard putting together my own applications, although I’m still running into a few problems here and there. I’ve read that Glade is nice program for building GTK interfaces, so I’ll probably try that out soon.

Conclusion

Both wxPython and PyGTK seem like great ways to build Python GUIs. It’ll take a few more weeks of hacking to really get a feel for them though. For the moment I’m sticking with PyGTK because of the potential for using it with Nokia tablets (the N800 is on sale now for $243 at buy.com…hmm…) . When I get enough time I’ll post a short tutorial for a PyGTK application based on my recent experiences.

Book review: High Performance MySQL

Kevin Day, October 1st, 2007

High Performance MySQL by Zawodny & Balling High Performance MySQL is a great book for programmers new to database administration who are using MySQL. It has tips on writing faster queries, tuning database parameters, and indexing tables properly. While I had previously stumbled around with EXPLAIN statements and tried to guess what was going on with slow queries, this book demystified how MySQL really works.

This book is most useful for programmers looking for help beyond the standard introductory PHP/MySQL books and tutorials. It assumes that you know how to create a database-driven website but don’t know how to make it faster or deal with high traffic. It also covers the basics of databases such as transactions and index types.

I would have preferred a more detailed description of database tuning because there are a lot of settings to tweak, and it’s not easy to predict how they will work together. The book does provide a decent starting point though, and I now feel comfortable fiddling around with MySQL’s settings until I find the ones that work.

Overall, it’s a good book that will help any programmer using MySQL.