Skip to main content

Posts

Showing posts from April, 2008

Linux: Resetting GNOME Settings

My mother-in-law uses Linux, but she's far from the most savvy computer user in the world. It's tough when you start using Linux in your seventies ;) Anyway, somehow she occasionally deletes her GNOME panel. That's a problem because it prevents her from starting any applications. After much practice, I've narrowed down the list of steps that are the easiest to dictate over the phone:Restart the computer.Don't log in. Rather, hit Cntl-Alt-F1 in order to get to a text-based login screen.Now log in.Type "rm -rf .gnome* .gconf*".Now, hit Cntl-Alt-Delete.Let it reboot and then log in normally. Things should be fixed.Note that this will wipe all of your GNOME settings. However, since it's easy to type, and she doesn't have any settings anyway, it's perfect. The reason I do this delicate dance of rebooting is to prevent gconfd from doing things behind my back.

UNIX: "join"

My buddy Pat Tufts showed me that Unix has a command called "join" that lets you do relational database style joins with text files. Let me show you how it works.

Let's suppose I have a bunch of purchase orders in a TSV (i.e. tab separated values) file called orders.tsv. The fields are order_id, item_id:1 3
1 2
1 1
2 1
2 2
3 3Next, I have all my items in another TSV file called items.tsv with fields item_id, item_name:1 Hammer
2 Screw driver
3 WrenchI want to print out the orders with item names instead of item ids.

The first thing I need to do to use join is pick the join field. Clearly, I'm going to join on the item_id field. The next thing is to make sure both files are sorted by item_id. This is a strange requirement if you're used to RDBMSs, but it makes sense if you think of how it's implemented. Clearly, items.tsv is already sorted by the item_id. However, I'll need to sort orders.tsv by item_id:sort -k2n orders.tsv > orders-sorted.tsvHence, I sor…

UNIX: "cut" Can't Cut It

What I wanted to use was:cut 3,4,1However, I discovered the hard way that cut can't be used to reorder fields. It treats the above the same as if I had typed:cut 1,3,4Well, awk to the rescue!awk -F '\t' '{ printf "%s\t%s\t%s\n", $3, $4, $1 }'

Web: Google Technologies Specialist

It'd be interesting to be a Google technologies specialist. Think of what you could get done if you were a true expert of Google Gears, Google Web Toolkit, and Google App Engine.

You could design apps that: worked offline, had really rich interfaces, scaled really well, and were easy to deploy.

On the flip side, why does the phrase "Microsoft Certified Engineer" keep coming to mind? ;)

Python: Werkzeug

I just finished the Werkzeug tutorial, and it looks pretty good.Werkzeug started as simple collection of various utilities for WSGI applications and has become one of the most advanced WSGI utility modules. It includes a powerful debugger, full featured request and response objects, HTTP utilities to handle entity tags, cache control headers, HTTP dates, cookie handling, file uploads, a powerful URL routing system and a bunch of community contributed addon modules.

Werkzeug is unicode aware and doesn't enforce a specific template engine, database adapter or anything else. It doesn't even enforce a specific way of handling requests and leaves all that up to the developer.

Werkzeug is most useful for end user applications which should work on as many server environments as possible (such as blogs, wikis, bulletin boards, etc.).Having coded applications in Aquarium, Django, Pylons, Ruby on Rails, Zope, Plone, etc., I've been fascinated by the idea of an anti-framework. A frame…