SIDEBAR
»
S
I
D
E
B
A
R
«
New website publishing software
Nov 30th, 2012 by Ken Hagler

For about eight years now I’ve been using a Win­dows pro­gram called City­Desk to man­age the Orange Road web­site (except for the blog). Although it works well enough, it was aban­doned by its devel­oper long ago, and also requires the incon­ve­nience of fir­ing up a Win­dows vir­tual machine when­ever I want to edit my site. Since I needed to make var­i­ous changes due to my recent move, I decided it would be a good idea to look for a mod­ern replacement.

After a bit of search­ing around I set­tled on nanoc, a sta­tic pub­lish­ing sys­tem writ­ten in Ruby. It’s a lit­tle harder to use than City­Desk due to being a command-line tool, but it’s much more pow­er­ful as you can extend it with Ruby. It also has the advan­tage of using indi­vid­ual files instead of CityDesk’s mono­lithic data­base, which means that every­thing can be put under ver­sion con­trol. I’ve put the source for the Orange Road web­site up on GitHub.

I con­sid­ered the need to write some Ruby code to be a plus, as I’ve been want­ing to learn the lan­guage. I read a book a while back, but to really learn a lan­guage you have to actu­ally 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 fairly old ver­sion installed, and I wanted to put the lat­est ver­sion on my Mac. Unfor­tu­nately, Ruby has thor­oughly embraced the open-source ethos: “we hate our users and want them to suf­fer.” It ended up tak­ing many, many hours spread out over a period of months to finally get Ruby 1.9.3 installed.

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

curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz
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 ..
make
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­larly Bombs Pak­istan and Yemen

reason.com

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

We Should Be Spend­ing Bil­lions Fight­ing Bath­tubs, Not Ter­ror­ism. Qual­ity Legislation: Every year, on aver­age, 40 Euro­peans die in ter­ror­ist attacks. When you com­pare the poli­cies and bil­lions plown down into this num­ber, you quickly dis­cover that we should not be spend­ing bil­lions to fight ter­ror­ism, but to fight bath­tubs. Over five times as many peo­ple drown in bath­tubs every year.

[…]

To our sur­prise, we find that drown­ing in bath­tubs kills over five times as many peo­ple as ter­ror­ism – 223 per year! We need to pull all the tax­payer bil­lions from fight­ing ter­ror­ism imme­di­ately and put them to work against bath­tubs. They are more than five times as dan­ger­ous as terrorism!

Even more, over six times as many die from falling off chairs – 254 peo­ple per year. We should be spend­ing bil­lions fight­ing chairs!

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

[Falkvinge on Infopol­icy]

This arti­cle is writ­ten from a Euro­pean per­spec­tive, but the sit­u­a­tion in the US is even worse. The politi­cians in the Evil Empire used hys­te­ria over ter­ror­ist attacks to not only spend far more money, but also slaugh­ter over 100,000 peo­ple (so far) and bring about the final con­ver­sion of what was meant to be a con­sti­tu­tional repub­lic into a total­i­tar­ian dic­ta­tor­ship where the ruler has absolute power to imprison, tor­ture, or kill on a whim.

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

Occa­sion­ally I run across peo­ple (gen­er­ally of the obnox­iously 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 never really 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 conversation:

Cus­tomer: I think somebody’s dead in the restroom.
Other Cus­tomer: Don’t say that.
Employee: Okay.

I can safely say I’ve never 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 model of grief)–and that indi­vid­u­als have to rec­og­nize them before they can address the under­ly­ing per­sonal prob­lem of why they put any cre­dence in the vot­ing process.

  1. You believe in the story you’ve been fed about the sys­tem; you enthu­si­as­ti­cally 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 position.
  2. You see that gov­ern­ment is “not work­ing” and blame the peo­ple cur­rently 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 suited 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 never 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­ally 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 party sys­tem is only half as bad as a one party sys­tem like communism–and you strike a blow for lib­erty by cast­ing a bal­lot for a third party.
  5. You return to the two party fold–realizing that the only way change can be invoked will be by work­ing within that exist­ing sys­tem. In this stage you’ve actu­ally con­vinced your­self that there is only one party that stands a chance of being con­verted to good.
  6. You’re not happy with any of the avail­able can­di­dates; but go to the polls to cast a bal­lot for the lesser of the two evils that are likely to win.
  7. You sub­mit an empty 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­ity to rewrite his­tory with the rebase com­mand. It looks a bit scary at first, but if you read the doc­u­men­ta­tion care­fully and know what you want to do before you start, it’s incred­i­bly useful.

Case in point: I recently updated 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 worry about hav­ing a huge pile of changes in my work­ing direc­tory 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 server in the mid­dle of all this, so I was pretty happy with my strategy.

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

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