Skip to: categories | main content
Entries from July 2008
Hook graphical widgets to shell scripts and you have a powerful but under-utilized class of applications. Systems programmers are typically writing code that does not need user interaction. Software developers are typically writing larger-scale programs in languages with rich widget libraries. But the domain in between does have some important uses, for instance small-scale programs that need input from non-technical operators, or need to alert them as tasks succeed (or fail).
I was reminded of this the other day when looking for a really simple Twitter client, just something I could click from the desktop or taskbar, input a string of text and be done. The one I found was a single-line shell script that used kdialog. I added a line to catch errors. Here is the complete script.
#!/bin/bash
curl -u username:password -s -F status="`kdialog --inputbox 'what are you doing right now?'`" http://twitter.com/statuses/update.xml http://twitter.com/account/end_session
if [ $? != 0 ]; then kdialog --error 'Twitter could not be updated'; fi
The next day I happened to read about a Python module that provides similar functionality for Mac OS X; it's called EasyDialogs. So I made a Mac version (my first real Python program). Here it is.
#!/usr/bin/pythonw
import EasyDialogs
import os
ret = os.system('curl -u username:password -s -F status="' + EasyDialogs.AskString('What are you doing right now?') + '" http://twitter.com/statuses/update.xml http://twitter.com/account/end_session')
if ret:
EasyDialogs.Message('Twitter could not be updated.')
Either can be made executable and linked from the dock/taskbar for quick launch. Check out the tutorials for kdialog or EasyDialog for a better idea of what the possibilities are (complete with many graphical examples) using the standard widgets such as file choosers, checkboxes, etc.
This is the second in a series of posts about my favorite albums over the years: the first (in no particular order) I wrote about was Robert Plant's Now and Zen.
This time it's Porcupine Tree's Stupid Dream, released in 1999. I wasn't even aware of Porcupine Tree until a few years later when I heard them on Radio Paradise (which in turn, I only happened to discover by picking up an issue of Linux Journal, which highlighted the netradio station's use of free & open source software). I bought a bunch of their albums and searched the file-sharing networks for the rest. What first captivated me was the science-fiction themes in a few songs. Later, getting into their early work, it was the lysergic lyrics that borrowed from and extended upon 60's classics like Sgt. Pepper's. Later still, it was the harder rock sound of albums like 2004's In Absentia. With many long songs and unconstrained musical changes, Porcupine Tree hearkens back to progressive rock bands like Pink Floyd or Yes without sounding dated.
Stupid Dream puts it all together beautifully. Mature lyrics that go far deeper than their early Alice-In-Wonderland psychedelic stuff. Songs that shift tempo from low-key ambiance to great power chord jams. A consistent quality throughout that keeps you hooked in.
I'm going to write a series of posts about my favorite albums, in no particular order, just a randomized assortment of those albums that, for whatever reason, stuck with me over the years. They may not be the best by any more objective measure, or even the best by the particular artist, but they're ones that I never grow tired of hearing.
First up is Now and Zen by Robert Plant, released in 1988. I got it on tape in 1989... eventually I wore out the cassette from repeated listening. Plant's solo work has always been overshadowed by his popularity in some 70's band whose name I forget. (That's a joke, folks). But it deserves an unbiased listen, particularly this album, perhaps his strongest (admittedly, I have not listened to the last few). Even now, twenty years later, it still sounds pretty crisp (of course, rock music hasn't evolved much in that time). It coupled a modern rock sound with smart use of synth/keyboards without sounding "Eighties" (not that it would be a bad thing). And the lyrics are masterful. Every track is great.
A comedian visits the Large Hadron Collider experiment at CERN. "Massive bosons blew my unit." The descriptions are amazing.
I grew up in a very religious (fundamentalist Christian) household; a faith-based approach to everything was encouraged on a daily, if not hourly, basis. But to their credit, while my parents presented their beliefs with absolute certainty, they did occasionally suggest coming to independent conclusions. Genesis 1 was probably one of the first things I learned to read and it introduced a lot of perplexing questions, such as: what did God do for eternity before deciding to create a universe? And (later), why did He create the Earth before the rest of the universe, it would seem more natural to work from the top down.
But most importantly, at the same time I learned that there were many different religions, with completely different Truths. It just did not seem possible that one specific group (ours) could happen to be the right one (with all the others damned to Hell)! This thought spurred a growing skepticism in me. This grew very strong as all the questions I asked led to circular answers, and everything that could possibly be claimed as evidence (anecdotes of answered prayer or other miracles) could be claimed with equal fervor by other faiths.
But at this point, I was still very young, and decided to give it all a try, to be diligent and do everything those around me were doing (in 3rd grade I started at a Christian school started by our Church). I memorized the ten commandments and prayed daily. I was told that eventually I would feel something, occasionally described as "a still, small voice." And yet, as the months turned into years, the only words ever forming in my mind were my own. My skepticism deepened.
But I hit upon the "argument from design" (though I had no idea that it was called that). The natural world was too intricately wonderful to not have a super-intelligent designer. So there was at least one basic principle I could agree on: the existence of God.
Read MoreMy new bike is a Trek 2.1. It'll be 15 years ago this November from when I last did some major road biking (the El Tour de Tucson, a 111-mile circumnavigation of our fair city). That was on a heavy, all-aluminum Raleigh road bike. The 2.1 is a serious step up.
First I rode Trek's "entry level" road bike, the 1.5, which has Shimano Sora shifters, where the 2.1 has Shimano's Tiagra brand. The Sora has little thumb down-shifters, while the Tiagra has it all smoothly integrated in one component. The rear derailler in the 2.1 is the Shimano 105; another step up. It also has a little bit more carbon composite so your forks, seat post, and seat stays are carbon. All together it seemed worth the $150 premium over the 1.5 and I'm elated with it so far. My longest ride so far was ~16 miles (a round trip out to the base of Mt. Lemmon). It's so incredibly light-weight, yet powerful... I am honestly not fit enough yet to really go all-out on this bike!
The compact style of cranks is a nice innovation, though I wasn't sold on it (marking me immediately as a complete newbie to road racing) initially till I calculated that it actually had a broader range of gear ratios, though shifted slightly towards the higher (racing) end. The front cranks have gears with 50 and 34 teeth, e.g. it's a double instead of a triple. The rear cassette has 9 gears ranging from 11 to 27 teeth. So you have less total gears (and hence less weight), but distributed more evenly with less near-duplicates. If I upgraded to the Shimano 105 on the front, I'd have 53 and 39 and hence a 6% faster top speed (53 ÷ 50). But let me tell you... I am not ready for that! On a ride down from Saguaro East (low rolling hills, no steep descents), I could barely drop it into the highest gear (53/11) and I was freaking f-l-y-i-n-g!
It is a joy to ride this bike. It's also more shock absorbent than anything I have ever rode (the carbon, no doubt).
Read MoreOkay, not really. But the results from a Stanford biology team are pretty astounding; they show that in a certain species of worm, aging is accounted for primarily by genes. The press release sums up the implication...
If aging is not a cost of unavoidable chemistry but is instead driven by changes in regulatory genes, the aging process may not be inevitable. It is at least theoretically possible to slow down or stop developmental drift.
Of course, this may or may not be the case in humans. And if you switch off the gene drift, it may not necessarily result in extended lifetimes, aging damage may predominate in our species.
Psycho by Puddle of Mudd is a fun, catchy, great, crunchy song that sounds a lot like Nirvana. Give it a listen... the louder the better. Unfortunately I couldn't say the same for the rest of the album (Famous, 2007); the other songs are mediocre at best.
An in-depth look at the quasi-legal pot industry in California. My favorite part? The author freely admits to toking up with his subjects. It's nice to see a token element of the old new journalism... a breath of fresh air as it were... ahem!
From the news-that-sounds-like-Monty-Python department comes a Bush administration idea to undermine birth control services, a crucial part of public health measures. It would define birth control as a form of abortion. There can be no doubt that this comes from the right-wing social conservative ideologues hired at all levels by the Bushites, showcasing their deep irrationality.
Last week I upgraded my laptop to the latest and greatest version of Linux, Kubuntu 8.04 (code-named the Hardy Heron; each new version of Ubuntu alphabetically increments an alliterative adjective and animal).
The only issue was that when resuming from hibernation, the screen resolution would change. I filed a bug report and asked a question on a Ubuntu support page. The response was pretty quick... if I had been checking my email! The simple fix was removing a package obsoleted by the new version of X Windows.
I'm not brave enough to try the new KDE (and, apparently, neither are the Kubuntu developers, it's still optional). KDE 3.5 with a few tweaks is just about perfect IMHO, and still leagues ahead of OS X or Vista, at least in terms of functionality. The screencap shows a feature that has yet to be built into other OS's, the ability to drag-n-drop with sftp:// locations, which I find vital for website management.
There's cool and useful features like this all over the place. It's a near perfect OS!
Nostradamus is the new album from hard rock pioneers Judas Priest. Leave it to JP to try something that has been anathema in popular music for a few decades: the double-length concept album!
Thankfully, it's all straight-up rock without the baroque excesses that could doom such a project to ridiculousness. Taking a medieval theme in keeping with many of their songs from the 70's, it presents a first-person narrative of the eponymous mythical seer. Needless to say, it's not trying to be historically accurate in the least bit, confabulating Nostradamus to be a heretic, misunderstood genius, and anti-hero.
As a skeptic, I would have been a little annoyed if they had tried to present the story as anything other than a work of fiction. Even in our own time the myth-making continues: new versions of his work have been published, with bits altered to make unmistakable references to 9/11!
Halford's singing is quite a bit more subdued than usual, but it fits. It's great to hear the Priest rocking once again!
I'm pretty disappointed over Congress giving Bush & Co. a free pass on warrantless wiretapping; it's an end-run around the Bill of Rights. Obama voted for it and (in the House) so did our (AZ District 30) representative, Gabrielle Giffords. [Side note: how freaking great is it to be able to get RSS feeds on your rep's?!!]
Not that I really need to, but starting now every email I send will be signed with a digital certificate. That gives everyone I write to the option to encrypt our communication. Modern email clients and browsers such as Mozilla Firefox & Thunderbird make this really easy.
Two certificate providers make this really easy (and free). InstantSSL makes it quite simple, while Thawte gives a few more options. I've had a little trouble with Thawte in that there service never sends the verification email to some of my addresses, with no error message. So I went with the former.
Design by Andreas Viklund | Ported to Serendipity by Carl

