Ken's Weblog

People should not fear their governments; governments should fear their people.

Month: November 2012

  • New website publishing software

    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

    One of the things I’ve been learning in my spare time is the Ruby programming language. Mac OS X comes with a fairly old version installed, and I wanted to put the latest version on my Mac. Unfortunately, Ruby has thoroughly embraced the open-source ethos: “we hate our users and want them to suffer.” It ended up taking many, many hours spread out over a period of months to finally get Ruby 1.9.3 installed.

    Here’s the trick to making 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

    “No country on Earth would tolerate missiles raining down on its citizens from outside its borders,” Says Man Who Regularly Bombs Pakistan and Yemen

    reason.com

  • Some perspective on danger

    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

    Occasionally I run across people (generally of the obnoxiously smug and self-righteous variety) who would go on about how independent coffee shops are so much better than large chains like Starbucks. I’ve never really noticed any difference before, but today I’m in an independent coffee shop near a hotel waiting for my room to be ready and overheard the following conversation:

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

    I can safely say I’ve never heard anything like that in a large chain coffee shop.

  • Eight stages of voting

    From a forum post:

    I’m thinking that there are probably some common stages that most people go through with respect to voting (akin to the Kübler-Ross model of grief)–and that individuals have to recognize them before they can address the underlying personal problem of why they put any credence in the voting process.

    1. You believe in the story you’ve been fed about the system; you enthusiastically research the candidates’ positions; you discuss and debate those positions with friends and relatives; then you vote for whom you decide is the best candidate to fill the position.
    2. You see that government is “not working” and blame the people currently holding positions in it. You look over the electoral options available and vote for the non-incumbents you determine are best suited to fill the position. A follow-on iteration to this is that you search for the non-incumbent candidates who have never held office.
    3. You say to yourself, “if only a wise and benevolent individual of high moral fiber and character could be convinced to run for office”; and you eventually recognize “the one we’ve all been waiting for”; and you contribute to, and campaign for this individual as though he or she were the physical manifestation of all that could be considered “the way”.
    4. You come to the conclusion that the two party system is only half as bad as a one party system like communism–and you strike a blow for liberty by casting a ballot for a third party.
    5. You return to the two party fold–realizing that the only way change can be invoked will be by working within that existing system. In this stage you’ve actually convinced yourself that there is only one party that stands a chance of being converted to good.
    6. You’re not happy with any of the available candidates; but go to the polls to cast a ballot for the lesser of the two evils that are likely to win.
    7. You submit an empty ballot–hoping that others will join you and that, somehow, someone will notice.
    8. You stay home on election day and do something worthwhile with your time.
  • Interactive rebasing is great

    One of git’s more powerful features is the ability to rewrite history with the rebase command. It looks a bit scary at first, but if you read the documentation carefully and know what you want to do before you start, it’s incredibly useful.

    Case in point: I recently updated a large Python class to use the logging module instead of print statements (I wrote it many years ago when I was new to Python). I committed the changes for each method as I finished with it, as I didn’t want to worry about having a huge pile of changes in my working directory all at once. I had to do a fix in the master branch for a configuration change on the Perforce server in the middle of all this, so I was pretty happy with my strategy.

    However, this left me with two dozen commits that all had nearly identical commit messages, because they were basically doing the same thing for each method. Using git’s interactive rebase (git rebase -i) I was able to quickly and easily turn all of those individual method commits into a single commit with a reworded commit message. That way I get a clean, easy to follow history without having to have all of those “216 lines added, 117 lines deleted” hanging over my head in my working directory.