New website publishing software
Nov 30th, 2012 by Ken Hagler

For about eight years now I've been using a Windows program called CityDesk to manage the Orange Road website (except for the blog). Although it works well enough, it was abandoned by its developer long ago, and also requires the inconvenience of firing up a Windows virtual machine whenever I want to edit my site. Since I needed to make various changes due to my recent move, I decided it would be a good idea to look for a modern replacement.

After a bit of searching around I settled on nanoc, a static publishing system written in Ruby. It's a little harder to use than CityDesk due to being a command-line tool, but it's much more powerful as you can extend it with Ruby. It also has the advantage of using individual files instead of CityDesk's monolithic database, which means that everything can be put under version control. I've put the source for the Orange Road website up on GitHub.

I considered the need to write some Ruby code to be a plus, as I've been wanting to learn the language. I read a book a while back, but to really learn a language you have to actually use it for something.

That’s a lot of hoops to jump through
Nov 29th, 2012 by Ken Hagler

One of the things I’ve been learn­ing in my spare time is the Ruby pro­gram­ming lan­guage. Mac OS X comes with a fair­ly old ver­sion installed, and I want­ed to put the lat­est ver­sion on my Mac. Unfor­tu­nate­ly, Ruby has thor­ough­ly embraced the open-source ethos: “we hate our users and want them to suf­fer.” It end­ed up tak­ing many, many hours spread out over a peri­od of months to final­ly get Ruby 1.9.3 installed.

Here’s the trick to mak­ing it install with RVM:

curl -O
tar xzvf readline-6.2.tar.gz
cd readline-6.2
./configure --prefix=/usr/local
cd shlib
sed -e 's/-dynamic/-dynamiclib/' Makefile > Makefile.good
mv Makefile.good Makefile
cd ..
sudo make install
cd ..
rvm install 1.9.3 -C --with-readline-dir=/usr/local/
Quote of the Day
Nov 19th, 2012 by Ken Hagler

No coun­try on Earth would tol­er­ate mis­siles rain­ing down on its cit­i­zens from out­side its bor­ders,” Says Man Who Reg­u­lar­ly Bombs Pak­istan and Yemen

Some perspective on danger
Nov 19th, 2012 by Ken Hagler

We Should Be Spending Billions Fighting Bathtubs, Not Terrorism. Quality Legislation: Every year, on average, 40 Europeans die in terrorist attacks. When you compare the policies and billions plown down into this number, you quickly discover that we should not be spending billions to fight terrorism, but to fight bathtubs. Over five times as many people drown in bathtubs every year.


To our surprise, we find that drowning in bathtubs kills over five times as many people as terrorism – 223 per year! We need to pull all the taxpayer billions from fighting terrorism immediately and put them to work against bathtubs. They are more than five times as dangerous as terrorism!

Even more, over six times as many die from falling off chairs – 254 people per year. We should be spending billions fighting chairs!

Worse still, 941 people per year die from falling out of beds – 941 people per year. That’s over twenty times as many as die from terrorism.

[Falkvinge on Infopolicy]

This article is written from a European perspective, but the situation in the US is even worse. The politicians in the Evil Empire used hysteria over terrorist attacks to not only spend far more money, but also slaughter over 100,000 people (so far) and bring about the final conversion of what was meant to be a constitutional republic into a totalitarian dictatorship where the ruler has absolute power to imprison, torture, or kill on a whim.

Chain coffee shops vs. independent coffee shops
Nov 11th, 2012 by Ken Hagler

Occa­sion­al­ly I run across peo­ple (gen­er­al­ly of the obnox­ious­ly smug and self-righteous vari­ety) who would go on about how inde­pen­dent cof­fee shops are so much bet­ter than large chains like Star­bucks. I’ve nev­er real­ly noticed any dif­fer­ence before, but today I’m in an inde­pen­dent cof­fee shop near a hotel wait­ing for my room to be ready and over­heard the fol­low­ing con­ver­sa­tion:

Cus­tomer: I think somebody’s dead in the restroom.
Oth­er Cus­tomer: Don’t say that.
Employ­ee: Okay.

I can safe­ly say I’ve nev­er heard any­thing like that in a large chain cof­fee shop.

Eight stages of voting
Nov 2nd, 2012 by Ken Hagler

From a forum post:

I’m think­ing that there are prob­a­bly some com­mon stages that most peo­ple go through with respect to vot­ing (akin to the Kübler-Ross mod­el of grief)–and that indi­vid­u­als have to rec­og­nize them before they can address the under­ly­ing per­son­al prob­lem of why they put any cre­dence in the vot­ing process.

  1. You believe in the sto­ry you’ve been fed about the sys­tem; you enthu­si­as­ti­cal­ly research the can­di­dates’ posi­tions; you dis­cuss and debate those posi­tions with friends and rel­a­tives; then you vote for whom you decide is the best can­di­date to fill the posi­tion.
  2. You see that gov­ern­ment is “not work­ing” and blame the peo­ple cur­rent­ly hold­ing posi­tions in it. You look over the elec­toral options avail­able and vote for the non-incumbents you deter­mine are best suit­ed to fill the posi­tion. A follow-on iter­a­tion to this is that you search for the non-incumbent can­di­dates who have nev­er held office.
  3. You say to your­self, “if only a wise and benev­o­lent indi­vid­ual of high moral fiber and char­ac­ter could be con­vinced to run for office”; and you even­tu­al­ly rec­og­nize “the one we’ve all been wait­ing for”; and you con­tribute to, and cam­paign for this indi­vid­ual as though he or she were the phys­i­cal man­i­fes­ta­tion of all that could be con­sid­ered “the way”.
  4. You come to the con­clu­sion that the two par­ty sys­tem is only half as bad as a one par­ty sys­tem like communism–and you strike a blow for lib­er­ty by cast­ing a bal­lot for a third par­ty.
  5. You return to the two par­ty fold–realizing that the only way change can be invoked will be by work­ing with­in that exist­ing sys­tem. In this stage you’ve actu­al­ly con­vinced your­self that there is only one par­ty that stands a chance of being con­vert­ed to good.
  6. You’re not hap­py with any of the avail­able can­di­dates; but go to the polls to cast a bal­lot for the less­er of the two evils that are like­ly to win.
  7. You sub­mit an emp­ty ballot–hoping that oth­ers will join you and that, some­how, some­one will notice.
  8. You stay home on elec­tion day and do some­thing worth­while with your time.
Interactive rebasing is great
Nov 2nd, 2012 by Ken Hagler

One of git’s more pow­er­ful fea­tures is the abil­i­ty to rewrite his­to­ry with the rebase com­mand. It looks a bit scary at first, but if you read the doc­u­men­ta­tion care­ful­ly and know what you want to do before you start, it’s incred­i­bly use­ful.

Case in point: I recent­ly updat­ed a large Python class to use the log­ging mod­ule instead of print state­ments (I wrote it many years ago when I was new to Python). I com­mit­ted the changes for each method as I fin­ished with it, as I didn’t want to wor­ry about hav­ing a huge pile of changes in my work­ing direc­to­ry all at once. I had to do a fix in the mas­ter branch for a con­fig­u­ra­tion change on the Per­force serv­er in the mid­dle of all this, so I was pret­ty hap­py with my strat­e­gy.

How­ev­er, this left me with two dozen com­mits that all had near­ly iden­ti­cal com­mit mes­sages, because they were basi­cal­ly doing the same thing for each method. Using git’s inter­ac­tive rebase (git rebase -i) I was able to quick­ly and eas­i­ly turn all of those indi­vid­ual method com­mits into a sin­gle com­mit with a reword­ed com­mit mes­sage. That way I get a clean, easy to fol­low his­to­ry with­out hav­ing to have all of those “216 lines added, 117 lines delet­ed” hang­ing over my head in my work­ing direc­to­ry.

»  Substance:WordPress   »  Style:Ahren Ahimsa
© Ken Hagler. All rights reserved.