One thing I spend a lot of time doing at work is picking apart applications written by people who have come before me and left leaving nary a trace of their intentions. Software developers should write more comments. It’s either a form of hubris to think that you will be the last person to see your code and you will never need to reread it, or a form laziness to simply not care and take the time to type some simple, high-level documentation into your code.
However, occasionally it’s not the developer’s fault that there are no comments. Sometimes commenting just doesn’t make as much sense. One such place is in SQL schemas... Read More
The political spectrum across the developed world is often divided along the lines of Right versus Left. This dichotomy dates back to the French Revolution when members of the General Assembly clambering most for change and radical action sat to left of the chamber while those who urged caution sat to the right. Since then, this duality has become part of the standard taxonomy for nearly every political movement.
These days, politicians are either ‘Right-wing,’ ‘Left-wing,’ or more occasionally, ‘Moderate.’ George Bush was right, Obama left. The Tea Party is right wing, while the Green Party is left wing. Anarcho-syndicalists are leftists, while anarcho-capitalists are right-wingers. Everything and everyone is either left or right, liberal or conservative, Bolshevik or Bourgeois, and people fight long hard verbal wars over who belongs in which category... Read More
Some months ago, I got a Raspberry Pi in the mail and proceeded to install MPD on it. After a few days playing with an embedded MPD server and figuring out what I liked and didn’t like about the arrangement, I decided on a significantly more elaborate project to build on it. I wanted to be able to control the player, even if all of the computers in the house were off. I also wanted to run player while using my desktop, which I couldn’t really do because they shared the same desktop speakers. I ended up with a list of features for an embedded music system... Read More
One thing I’ve written about before is the problem of Compulsive Internet Use before. One thing I’ve tried in the past to deal with is was my Shutdown Nag. This, at the time, was a quick extension to my Window Manager which would lock the computer at a preset time and then give me the opportunity to save my work before shutting the computer down for the night. It worked reasonably well, but I’ve since changed the window manager I use from Stumpwm to Xmonad and the old tool no longer works. I’ve since intended to replace it with a similar window manager agnostic tool, but hadn’t the will to actually go through the effort to write it, until now... Read More
I wanted to attach a knob to my Raspberry Pi to act as a volume control for my MPD based jukebox. Traditionally volume control devices are implemented with potentiometers acting as inputs for amplifiers. A potentiometer is a hardware device with a knob or a slider that, in a word allows for a variable voltage input into a circuit. (Potentiometers are called ‘pots’ for short and their very common. You probably interact with them every day even if you don’t know it. If you’ve ever used a physical volume control on an amplifier or a pair of speakers or an amplifier or a knob on a dimmer switch, that knob was probable attached to a ‘pot’.) The problem here is that this is a very hardware oriented method of setting volume, when what I really wanted to do was set the software volume setting on the Raspberry Pi. I wanted to be able to change the volume from the operating system (a la alsamixer) or through the MPD client, and still be able change it up or down by physically turning the knob on the device. Essentially, I wanted the ALSA PCM element volume to increase as I turned the knob clockwise, and decrease as I turned the knob counterclockwise, I wanted to actual volume to be independent of the position of the knob and because a potentiometer is an absolute input device which returns it’s position and cannot be turned indefinitely there was no way to make one work for what I needed... Read More
Waaay back when I first finished college and moved out on my own, I remember taking a small amount of pride in not intending to own a television set. My thinking was that if I didn’t own a television, I could avoid some of the most addictive distractions that modern people deal with. Rather, all I would get was an Internet connection, which would be much more educational, productive, and less addictive than television. I would spend my time chasing ‘elevating’ pursuits. I could be a modern renaissance man.
Damn I was a fool... Read More
So, after 6 months of waiting, a Raspberry Pi finally arrived in the mail a few days ago and I’ve finally had the chance to play with it.
... Read More
One of the enduring complaints people have with American political system is the two party system. We have two warring political parties which position themselves in the center of American politics and take opposites sides of every controversial issue at stake and them some. They create an artificial dichotomy where American voters are consistently forced to choose side on issues which they would otherwise not care about in order to choose the “lesser” of two evils. The two parties have a polarizing effect on American politics where people are lumped into “right” and “left” categories and have their views increasingly flanderized. The two party system is clearly a problem, but how can it be dealt with? Here are a few suggestions... Read More
So I’ve recently come across “numbers” radio stations. What these are, are shortwave radio stations across the world which regularly broadcast streams of seemingly random numbers. To give you an idea, here’s a recording of the Lincolnshire Poacher:
... Read More
Once upon a time, I was working on a personal programming project which I kept in a public repository on Github when I unthinkingly committed some sensitive information into git and pushed it to the repository.(It was a database login. I know that I could have just changed the login; I did so, and later deleted he whole database. That’s not the point. It’s impossible that you didn’t use a similar password elsewhere and even if you didn’t, it could still reveal information about your password creation process. It’s better to restrict that kind of information as much as possible and not get sloppy.) It was a remarkably harebrained mistake I admit, but these things happen to everybody sooner or later. Anyway, I didn’t notice my mistake right away and I pushed a lot more changes to the public repository before noticing what I had done, several month’s worth... Read More
Smart people sometimes believe the dumbest things. I know people who can read through massive tomes in an afternoon, translate pages from one dead language to another and yet despite all evidence to the contrary, believe fervently in the efficacy of homeopathic medicine. I’ve known others who are convinced that George Bush initiated the bombing of the World Trade Center but are otherwise as well spoken as any person your likely to meet. I know a man who can hold the designs for vast computer networks in his head yet still believes everything he reads in the news without question, so long as reaffirms his prior beliefs... Read More
Recently I built a small webapp to allow me to view my org files online. I know that I can export org files to HTML and scp them to my server, but this was for a TODO list among other things and I wanted to both password protect it and possibly also make so that I could perform simple edits to the file from the web. As a result, I decided to write a webapp which parsed and converted the org file to HTML on the fly with each request. What resulted was a very simple web application, written in Clojure, which can display a directory of org files online. If you want to use it, you can get the code here.
Anyway, while writing this, I struggled a little with Clojure’s mostly functional nature to write an efficient and clean parser/translator for the org files. The issue is that, for me, the most natural way to parse something more complicated than a simple sequence of tokens, is to use a state engine to keep track of the context while parsing in each new character, line, or token... Read More
In the 1960’s NASA needed a writing instrument that could be used in the vacume of space. In order to combat this problem, they spent over a million dollars on R&D in developing the Astronaut Pen. When faced with the same problem, the Russians used a pencil.
Or so the legend goes. Actually the truth is a bit different. In the beginning of the space race, both NASA and the Soviet Union used pencils. But pencils break, and they are also inflammable. In space, both of these things are very bad... Read More
As an online discussion grows longer, the probability of a comparison involving Nazis or Hitler approaches 1.
In 1990, Mike Godwin made the above observation. To date, it has held up, as people today seem to like comparisons to Hitler just as much as they did in 1990. In addition, there’s a corollary to Godwin’s law which states that if you are the one to make that comparison, or to pull a Godwin, then you are the one who is wrong... Read More
Sometimes I think that Unix is pretty awesome. You can strip it down to nothing but a kernel and a shell and maybe a few drivers/modules and end up with a perfectly useful, if minimal, system. At the same time you can build Unix out into anything from a desktop system to a high trafficked webserver to even a phone OS depending on your definition of Unix. Unix is pretty flexible is what I’m saying.
A lot has been written about the flexibility and power of Unix. Suffice to say, Unix’s power is due in a large way to its modularity and the composability of its component programs. One key ingredient of this composability is the venerable pipeline idiom, Unix’s ability to feed the output stream of one program to the input stream of another. Pipes actually are quite amazing, at the shell, they turn a set of small utilities into a complete system administration toolkit... Read More
If you use SSH to administer your own server there’s a strong possibility that you use public key authentication rather than password authentication to log into it. Public key authentication is generally more desirable than password authentication for a number of reasons. For one, it’s more secure; it doesn’t transmit any secrets over the wire and has a much larger secret to guess, making snooping and brute force attacks practically impossible. Nothing secret is stored on the server either so one compromised login cannot compromise other logins. Because keys are unique to client, it becomes simple to disable logins which have become compromised or have outlived their usefulness. Finally, if one knows what one is doing, one can set up key based authentication so that it does not require any password entry to login, which is a great convenience.
One inconvenience however with public key authentication however, is that logging in from a new machine is somewhat more involved. You’ve can’t just install PuTTY (or whatever) and type your password to login. You need the a key to login and this computer doesn’t have it. Now, your first temptation when presented with this situation might be to copy one of your private keys to the new machine and log in with it. However there is an easier way. Temporarily enable password authentication on the server and add the new client while it’s open. All you need is access to an already active client. I’ll show you what to do... Read More
EDIT: I didn’t realize when I wrote this that I sounded as critical as I did. I’d like to make clear that this post about a minor philosophical difference and not about any real usability problems with Clojure.
Clojure is probably my current favorite programming language. It combines most of the advantages of Lisp with the most important advantages of Java and introduces a number of ideas not present in either. Some of those ideas nearly unique to Clojure. In all, I believe Clojure occupies a pretty awesome sweet spot in language design that is hard to beat. Despite that, there are at least a few “warts” in the language, (there always are,) and I’m going to write about one here which annoys me.
Clojure’s core language seems to contain a number of leaky macros. For a language community which seems to try so hard to be functional and avoid macros whenever possible, presumably to avoid leaky abstractions, this baffles me. The biggest offender I think, is the “with-open” macro... Read More
I’ve just finished reading the book Life of Pi. I personally think that it’s a fantastic book and the author, Yann Martell, does a brilliant job making the quite outlandish and surreal story seem so believable. I’ll confess that through the first half of the book or so, I thought I was reading a true story; he’s that good. Of course, that’s actually part of the point of the story. It deliberately challenges what one accepts as criterion for belief by asking the question, “Between two equally complete and sound explanations for an event, which makes the better story?”
... Read More
I’d like to ask you a question. It’s a little personal, but in this day and age of social networks and online exhibitionism who really cares about privacy and personal space? Anyway, here goes: when was the last time you got your Facebook account broken into by a hacker? Never? Good, you’re either lucky or you know how to defend yourself against online attacks. However, far too often I find myself up against spam and vandalism being sent to me via Facebook, email, etc. from people who are ostensibly my friends and wouldn’t be sending me adverts for “V14gra” if they could help it. Really, considering that defending one’s online accounts from attack isn’t that complex, and how damaging these attacks can be,(They’re bad enough when you know about them, but identity theft can take years to be discovered and by then you’ll be out thousands of dollars.) There’s really no excuse for not doing so. In that spirit I’m writing this as a practical guide to defending oneself from online attacks.... Read More
Yesterday, hundreds of websites(Including such notables as Wikipedia, Reddit, and even my rather unimportant corner of the web.) were “blacked out” in protest against two pieces of particularly onerous legislation, SOPA and PIPA.((For those whe don’t know, these are anti-piracy bills (in the sense of copyright infringers, not open seas marauders) which threaten to emplace draconian measures which will affect thousands of perfectly legal and innocent websites and businesses along with the criminals. Google has more info. )) In addition to the blackouts, many other websites posted information about these two bills on their websites along with reasons to oppose them. As a result 18 senators, some of who had previously been cosponsors, have newly announced their opposition to these bills. In addition, the subject has broached the national consciousness and now mainstream new organizations across the country are reporting on the debate. With all kerfluffle, one would think that the blackout has served it’s primary purpose in spreading awareness and dealt a powerful blow to forces attempting to push these bills through Congress.
There are, however, dissenting voices. Maddox an individual known for his controversial entertainment website has made the claim that “Blackout Day” is just another example of Internet “Slacktivism,” which will ultimately go nowhere and is a symptom of the general malaise and of todays generation of protesters: people who will protest anything so long as they can do so from the safety and comfort of their own computer screens... Read More
The Masons and the Powells have finished with their latest film endeavor: Fruitcake. This is the first time to my knowledge that they’ve attempted to make a comedy of some sort that wasn’t a spoof and I guess it’s an interesting project. The premise is that a drunken young man hides an engagement ring meant for his girlfriend in a fruitcake and mails it to her family. After sobering up and realizing just how stupid that was, he travels across country attempting to chase it down as it gets re-gifted time and again.
The show is funny, in spurts... Read More
So I read a book. I know. Surprise! This book is called Blindsight, it’s by Peter Watts, and you can read it here. This is an interesting book. It’s a piece of hard science fiction, which means it focuses on the exploration of scientific theory and maintains strong fidelity to scientific accuracy. Blindsight also heavily features vampires. Weird, yet this isn’t the most interesting thing about this book. What is the most interesting thing is what this book is attempting to say about the human condition: That human consciousness is a superfluous, and probably temporary aberration of the natural progress of evolution... Read More
So I’ve been working with Clojure webapps again lately and I noticed how I keep forgetting what middleware is, what it does, and how to use it. This is a shame because it’s actually not very complicated and it’s quite useful once you get it. So I’m going to place here a write-up on middleware and an example of its use... Read More
I have a pet pieve. Actually, I have many, but only a few worth complaining about. One of these is when programmers describe their creations as “beautiful.” At first blush it might seem strange that people would describe computer code, filled with semi-colons, parentheses, and brackets as “beautiful.” One might be tempted to ask whether they were just in love with their syntax highlighters. However, I’ll be fair. The term “beautiful” in this sense refers not to visual aesthetics, but to a sort of notional aesthetic: ideas which seem so simple and elegent that they provide a certain sense of pleasure when one comes to understand them. When coders use beautiful as an adjective to describe their programs, they aren’t describing the visual asthetics of their computer code, they are discussing the presummed elegence of their solutions. They are declaiming the cleverness of their own inventions... Read More
I just bought a car today. The sway bar broke on the old one and instead of getting it fixed I decided to drive on it while looking for a new car. I spent several weeks planning, researching, weighing priorities, fretting over trade-offs and just all around pulling out my hair all the while waiting in anxious anticipation for my current model fall apart while I’m driving down the highway and 65 miles an hour. I wanted a car that was small, fuel efficient, reliable, and sporty. Eventually, I decided that money was priority one and sporty had to go, ultimately picking a used Honda Civic. How boring… and yet very practical. It’s just the kind of thing I would get. Anyway, you may be wondering what this has to do with God and His proof thereof... Read More
I use Stumpwm as my primary window manager on my desktop at home. Stumpwm is actually a pretty neat window manager: it’s tiled, provides facilities for group and be controlled completely from the keyboard, no mouse necessary, but it’s chief advantage to me is that it’s written and configured with Common Lisp, which make it much easier for me to script and modify. I can arbitrarily load programs, libraries, and code into the Stumpwm runtime in realtime while it is still running just to see if and how it works. This actually makes it much more deeply modifiable than most other windows managers (or indeed, programs of any sort,) and I’ve taken advantage of this from time to time.
One of my more perennial problems is a sort of insomnia that I have. I’ve found however, that if I limit my computer usage in the evening and spend a couple hours away from it before going to bed, it becomes much less of an issue. This presents a bit of a discipline problem however with me having to remember and be willing to do so every night. That’s a pain so I figured why the hell not write a program that helps me with this? Stumpwm seemed like a natural place to put it. ... Read More
So… It would seem that classical music is dead. That might seem like a bold claim. After all, people still listen to classical music all the time. It has it’s own stations on the radio. There are whole orchestras devoted to it. It’s the first thing people learn in most music classes. Many people dedicate their lives to playing and improving at classical music. All this is much more than is dedicated to say, jazz. I’m not saying jazz is dead am I? No, (well, maybe) but I am say that classical music is dead, or largely so.... Read More
I’ve been fiddling with Sacraspot lately and I discovered that the technique I’ve been using to daemonize the server and integrate it into my init-environment wasn’t working properly. This is a lisp application which I was running with start-stop-daemon. The problem was that for some reason, start-stop-daemon was failing to fully daemonize the application. The Repl seemed to conflict with start-stop-daemon’s ability to do this properly and while it would look like it worked at first, once one closed the shell which lisp was started from, the lisp process would close.... Read More
What is evolution? Seriously. Think about what that word is supposed to mean. It means gradual change over time. It usually refers to the process which life on Earth has gone through over the past something odd million-billion years. Now think about what we supposedly know about evolution. It works by random mutation and natural selection, meaning small changes accumulate in different species and changes which improve the odds of reproduction of an individual or population relative to other populations will be propagated and contribute to long-term, substantial change. That is, it’s driven by natural forces and random chance. So why do people insist on assigning teleological purpose to a materialistic phenomenon like evolution?... Read More
In its day, one of the more interesting places on earth was the Kowloon walled city. Just outside of Hong Kong proper, on a disputed part of the Kowloon peninsula, Kowloon walled city was not so much a city as it was a neighborhood. And, it wasn’t so much a neighborhood as it was the closest thing to a nest that human beings have every built or inhabited. Actually, even ‘nest’ is the wrong word, ‘hive’ would be better. Only 0.01 sq mi in area,(6.5 acres) at its peek, the Kowloon Walled City housed an estimated 33,000 people, making it the most densely populated place on earth. ... Read More
I’ve been writing this blog and maintaining this site for almost two months now. For most of that time, I’ve been maintaining it using a program called nanoc which generates a static website from some templates and source files. I talk more about that here.
One of the things I like about this setup is that it give me a lot of flexibility in how this website works. For example, I can apply a series of filters to my source files to generate the final web pages I want. I use Markdown, for example, to convert most of my blog posts (Like this one!) from a legible plain text to html. I can also write my own filters: I’ve written two of them and I thought that they were worth sharing even if they didn’t merit there own projects.... Read More
So I was brushing up on my algorithms knowledge and I stumbled across something that rather blew my mind. It turns out I’ve been computing powers the wrong way all this time. ... Read More
While doing doing a project properly from the start is a fine goal, there’s something to be said for just shipping. It’s pretty rare that that you have all of the requirements from the get-go and you certainly can’t predict every problem that’s going to arise while your project is in production. If you attempt to anticipate every feature you could need it’s likely that the project will never be finished, it’s certain they you’ll waste a lot of time on uneeded features, and it’s still possible that you’ll miss features and bugs that are important. In fact, it’s more likely that you’ll miss things as many issues don’t arrise or make themselves apparent until you reach production... Read More
So I have an idea for a web-based game. I don't have time to write it just yet, but I thought I'd outline the concept here for now instead.
The general premise is that of players competing in an election for president of a fictional country. Each player will have to court lobbyists, political parties, public opinion, ethnic groups, etc by making campaign promises, establishing positions on issues, making backroom deals, advertising, etc.
I've divided up the general aspects of the game as below. The specific mechanics haven't been worked out yet; they'll probably take a turn a day structure where players manage their candidates through a panel which allows them to schedule actions and set general policies. ... Read More
I kind of hate Facebook. There I said it. Now, I hate Facebook for a lot reasons: the chronic privacy issues, its walled garden nature, the shallow level of communication it encourages, the fact that it’s taking over the Internet, but one reason in particular bugs me the most. Now, I know this makes me a rather sore sport, but I hate how Facebook turns me into the odd man out.
You remember that big party back in college? The one that everyone went to? Everyone but you? You remember out for months afterwards everyone would laugh about something that happened at that party and when you would ask what was so funny everyone would just say, “You really had to be there?” Do you remember that? Well, for me, Facebook is that party.... Read More
Recently, I listened to a story about an Asimov style robot. You know, robots which surpass their creators and have to deal with the existential confusion which arises…
Anyway, this story reminded me of one of the major staples of Asimov’s robots which is the so-called Three Laws of Robotics. The story didn’t actually make use of these laws but I’m not actually talking about that story. What I am talking about are Asimov’s Three Laws of Robotics and why I think that they’re impossible.... Read More
A recent debate attended has prompted me to think about the issue of just how extensive the right of freedom of speech should be in a modern society, specifically whether pornography should be protected under the guise of freedom of speech. In principle, we tend to think of freedom of speech as being pretty absolute, that we should be able to say whatever we want without regard for the consequences and people should have to accept that. However, in practice, this right seems to be abridged all the time. We need a permit for most kinds of demonstrations, some things such as slander are forbidden outright, and advertising is subjected to such a dizzying array of restrictions that one must wonder whether it was ever considered free at all. ... Read More
So, I’m about a third of the way through the book Snowcrash. It’s one of the standard novels of the cyberpunk genre of books that were popular in the 80s and early 90s. ‘Cyberpunk’, for those unfamiliar with the term, refers to science fiction stories featuring computers and computer hackers. Usually there is some kind Internet which manifests itself as a complex virtual reality which rebellious protagonists log in and out of to perform heroic deeds which would be impossible in the real world. ... Read More
So I’ve encountered my first major nuisance in using nanoc. In nanoc, the filenames of source files are treated rather unintuitively and it can be confusing why one can’t have multiple files with the same name but different extensions at first. I haven’t found a lot of information about this so I’ll put down a quick writup on this. ... Read More
So, I’m currently working on getting my house in order. By ‘my house’ I mean this website. I’ve been looking for a way to get a nice combination blog, project portfolio that a lot of software developers seem to have. I decided early on that I wanted a statically generated site as that would simplify a lot of things from server security, to maintenance. It’d be easier to migrate. Also, and this is important, it would be a lot simpler to use Emacs as my primary editor if I use a static generator rather than a solution like Wordpress or Blogger which generally require editing little boxes on a website which I hate. (I suspect this can be worked around with WP, but I’d rather not try.)... Read More
I recently finished reading the book How to Survive in a Science Fictional Universe. This is an interesting book, both in its unusual style but also in its strange plotting and subject matter. The book is a lot easier to read if you don’t try too hard to understand what is going on and how things work in the world that the author creates.
The book takes place in world which is literally fiction, even from the viewpoint of the characters. Science in this world is based on story-lines and expressed in terms of human emotions. This is interesting but is not deeply important to the story. It would seem to be more a stylistic choice on the part of the author, except for that moment in the story where the protagonist describes how the concept of time travel (which is an integral part of the story,) works in a science fictional universe.... Read More
Most people are aware of the First World War and have some knowledge of its history. They know that it was started when some Austrian prince was shot and that it ended when the English invented tanks and drove them into Germany. They know that in between there was a lot of fighting and that a lot of it had to do with trenches and machine guns and gas masks and Red Barrons and many might be able to name drop the Somme or Gallipoli. But, when it comes down to it, everyone remembers the Second World War better.
And why not? The Second War was bigger, broader, louder… It had clear villains and clear heroes. The motives of all sides were clear and everything was black and white (almost.) What’s more, even though there was an unprecedented amount of tragedy in that Second War, he good guys won and peace was restored throughout the world. All in all, it had all the markings of a great story and was quite photogenic. ... Read More
The turn of the twentieth century was a pretty crazy time. Major European wars were a thing of the past (or so people thought.) The world had mostly been conquered by Europeans and was rapidly being tamed. Technological advancement was on the rise and new wonders, such as recorded sound, moving picture, electric lights, the telephone… Oh yeah! And in 1896 and 97 men from Mars were trolling about the American midwest, kidnapping people and taking them hostage in their airships. ... Read More