Archive for October, 2006



15
Oct
06

Bloglines, or why web apps (occasionally) kick ass

I just grabbed an account at Bloglines. It seems like a not-horribly-sucky feed aggregator; it’s free; and it’s a webapp.

The last is why I went with Bloglines, rather than with (say) Sage, which I imagine isn’t horribly sucky either. (I don’t claim that Bloglines is the only web-based aggregator, merely that it’s the first one I ran into.) See, being able to get to my blogroll from any web browser is an important feature for me.

I have Windows XP and Linux installed on my home machine; they can communicate via a shared FAT32 partition, but it’s a bit of a pain in the ass. I have accounts on at least two different networks at my university. When I travel, I find myself borrowing computers from friends and family. I can’t just rely upon a single piece of data (a feed aggregator program, for example) to do stuff — it’s much easier to use a webapp.

Before you start — USB keys are a pain in the ass, and carrying around programs on a USB key is problematic if you use a number of different platforms regularly.

Web apps certainly aren’t perfect. AJAX or no, most web app interfaces range from crawling horrors to Lovecraftian pits of shivering madness. Further, storing any kind of data remotely on a web app host requires a certain degree of trust, which (given how well any of us knows web app developers) ranges from foolishly naive to blatantly suicidal for all but the most innocuous data (like, say, one’s blogroll).

But when you want your data to be easily accessible from any web browser, web apps kick ass.

14
Oct
06

Ubuntu Linux and a digression into window managers

Let me say this from the very beginning: I’m a Gentoo fanboy. For one thing, successfully installing Gentoo involves a certain amount of scary low-level config hacking: You build your own kernel, configure your bootloader, write your fstab — all of these things could conceivably fuck your computer up to the repave-and-reinstall state. If you manage that, you gain a great deal of confidence in your abilities — it’s a rite of passage that used to be integral to installing any free Unix-like operating system, and which has largely been replaced by slick user-friendly LiveCDs.

Unfortunately, installing Gentoo takes the better part of a weekend, and for fundamentally boring reasons I needed to install a Linux distro most fucking pronto the other day. Therefore, Xubuntu. It’s just like Ubuntu, only it doesn’t force Gnome up your quivering starfish like a slavering cellmate. Instead, you get Xfce — which, continuing the prison-sex simile way beyond its best-before date — is more akin to an unwelcome pat on the ass in the shower. More on window managers in a moment.

Xubuntu is delightfully easy to install. All you really need to do is take an install DVD, stuff it in your drive, boot it up, and hit enter a dozen times. It is, in fact, much easier to install than Windows XP. When the install finishes, you reboot, and you’re presented with a login screen. Type in your username and password, and you get Xfce and a nice little menu fully populated with Firefox, OpenOffice, gaim, and other neat little pieces of software that toe the OSI party line. All very nice and welcoming for the first-time Linux user.

Unforunately, what you see is (almost) all you get. Xubuntu is set up for the lowest common denominator of PC user — excluding all of the ideologically suspicious software that said user might want to use. (For example, the MP3 format is somewhat copyrighted, so you don’t get an mp3 player by default. Not only do you have to install one yourself — you have to give the package manager explicit instructions to download such impure software.) But that’s okay: you get a perfectly good web browser, and a perfectly good (well, as good as such things get) office suite, and so on. I haven’t checked, but I bet there’s a perfectly good Solitaire clone somewhere.

More shocking to a Un*x guy like me, Xubuntu doesn’t install developer tools. If you don’t understand why that’s a big deal, let me explain: free Unixalikes were developed by programmers for programmers — or, at the very least, highly technical users. The traditional way to install software under a Unixlike is to compile the source code yourself. (Gentoo, bless it, takes this to the limit — to the eXtreme, one might say — and encourages you to compile absolutely everything from scratch.) A Linux distribution that doesn’t install gcc by default is akin to a church that doesn’t worship. Sure, it might provide some of the side benefits usually associated with these things, but the guts are gone.

No C compiler. No make. No LaTeX implementation. I’m shocked.

Okay, let’s get back to the prison sex — er, I mean, the window managers.

If you want to interact with a computer in a way that permits pretty pictures, you need a program called a window manager to, well, manage all the windows and shit you have floating around. This way, programs don’t have to concern themselves with the global state of your computer — they can just do their own thing and not give a shit whether some other window sits atop them, or who exactly needs to read from the keyboard, or whatever.

Your window manager mediates all of your interactions with your computer (unless you’re a hardass and do all of your work in screen — which, I see, describes itself as a window manager as well). Windows provides one window manager — Explorer — and doesn’t advertise the fact that you can change it if you really want to. MacOS does something similar, I imagine. The X Window System — the standard GUI for Unixlikes — doesn’t lock you into any particular window manager.

This is both good and bad.

It’s good, because it gives you explicit control over an important part of your, uh, user experience. (I feel dirty just typing that.) If you’re a feature junkie, you can use a flashy, featureful window manager, with all kinds of bells, whistles, and gongs for you to mess with. If you prefer your window manager to simply stay out of your way and let you work — well, you can do that too. You don’t have to use a window manager designed for the lowest common denominator.

It’s bad because most of the window managers out there suck.

The two most popular — somehow — window managers are Gnome and KDE. They have a lot of features. They’re slow. They’re designed to be somehow user-friendly — but they hide everything truly useful behind a layer of simplistic menus and saccharine interface. As far as I’m concerned — they suck.

All I really want in a window manager is a right-click mouse menu and a ring buffer of virtual desktops, a Spartan lack of clutter, and split-second alacrity. Gnome and KDE can’t seem to figure any of those things out. Instead, they give you a fuck-ton of glittery crap on the screen, fancy-ass two-dimensional desktop layouts that break at the edges, buttons and icons and menus and status bars out the ass, and load times that would make Ion Storm cringe.

Xfce loads at least mildly quickly (you don’t have enough time to get a beer from the fridge) and gives you a right-click menu. Otherwise, you’re screwed.

Fluxbox, on the other hand, gives me everything that I want. Continuing my unpleasant simile, installing Fluxbox is like being assigned a cellmate who’s willing to suck you off for a pack of cigarettes and watch your back in the showers. It’s small and lightweight, it’s trivial to configure, it’s as clean as an operating theatre, and it loads in the blink of an eye. And it has a ring buffer of desktops! Joy!

That said, I’m always willing to try new things, even if they’re old, so I installed Enlightenment. Back in the day — you know, when unix hackers were unix hackers, men were men, and sheep were nervous — Enlightenment was a gigantic elephantine flashy-and-slow window manager: just the sort of thing I despise. But times have changed, and what used to be a baroque monstrosity now seems rail-thin, like a rib-spoked runway model.

Enlightenment surprised me by starting up with nearly the same alacrity as my beloved Fluxbox. After a few moments of fucking around, I had it configured nearly to my tastes, and discovered what might be E’s killer feature: mouse-wheel desktop scrolling.

Turns out that Fluxbox does it too! O joy, O rapture unforseen!

Then I clicked somewhere unsupported, and Enlightenment shat its guts out. Crash, bang, back to the login screen. Oops.

In conclusion: Xubuntu’s pretty good if you need a Linux installation right this minute, but be prepared to install everything useful yourself. Oh, and stay away from Enlightenment and communal showers.

14
Oct
06

Learning evolved

There’s some cool stuff going on on tdaxp’s blog lately:

  • Learning Evolved: Darwinism-Cognitivism

    “I propose a theory of motivation rooted in exploiting student’s neural-cognitive modules. I will outline methods of motivation that are adapted to small group and large group interactions and defend them with new research.”

  • Learning Evolved: Social Motivation

    “[W]ise teachers have no alternative but to manipulate the modules of students to make them behave as if they were motivated.”

  • Learning Evolved: Coalitionary Education

    “All a teacher must do is make sure that student groups perceive a threat from another groups, and the behavior will follow automatically.”

These articles focus on methods teachers can use to motivate and instruct students — but they’re just as interesting for those of us who are interested in teaching ourselves. A casual study of cognitive neuroscience is great for autodidacts — it gives us the tools to (first) figure out why we behave, learn, and react the way we do, and (second) consciously push ourselves to improve our habits and behaviours.

O’Reilly, of all publishers, put out an excellent introduction to this sort of thing: Mind Hacks. It’s an easy read, with a lot of entertaining little tricks (my favourite is the research showing that first-person shooters improve subitizing speed), and it clearly explains the way we can train our minds to behave the way we want them to.

Cognitive science is to self-improvement what higher-order functions are to programming. (Besides, analyzing the brain as a formal system tends to make the creationists nervous — and that’s a powerfully good thing.)

11
Oct
06

A practical programmer’s reading list

By “a practical programmer”, I mean someone who isn’t trying to do cutting-edge software engineering or language design, someone who isn’t wedded to a given ideology — just someone who wants to write code that works and keep it working through as many upgrades as it needs. I’m also talking about programmers who think of themselves as programmers, not “web programmers” or “Java programmers” or “eXtreme Programmers” or (balls forbid) “software engineers” — people who are genuinely interested in the crafting of programs for its own sake, not just as part of their day jobs.

To start with, every practical programmer should know C to a fairly high level of competence. I’m not just being perverse here:

  1. C teaches you about the behaviour of programs at the virtual-memory level. What I mean is, C makes you care about how your program behaves in the idealized flat chunk of memory that the operating system gives it. It’s important to know this stuff, but it’s not critical to go into more detail (to the OS scheduler level, or the CPU level, for example) in the general case.
  2. C has influenced a whole shit-pot of other languages — C++, C#, Java, Perl, and so on. Familiarity with C will bleed over into those languages that C has influenced.
  3. For all its supposed faults, C is still an elegant language that’s damn fun to write.

So, Kernighan and Ritchie’s The C Programming Language — known simply as K&R — should be at the top of your list. Not only is it a brilliant, terse, and complete introduction to the C language, it’s also an excellent source of basic programming methods, techniques, and idioms. Read it cover to cover (well, skip the appendices). Work through the examples.
Once you’ve done that, you should have a solid grasp of basic C. To become truly adept, you should read Peter van der Linden’s Expert C Programming. Expert C Programming explains C’s peculiarities and quirks in sufficient, but not overwhelming, detail. As a pleasant side effect, it gives you a solid intuition into the work a compiler has to do to make your programs make sense.

If you’re a truly dedicated practical programmer, you should pick up the Dragon Book — Aho, Sethi, and Ullman’s Compilers: Principles, Techniques, and Tools — and write yourself a compiler. When you’ve written code to arrange the bytes of a multidimensional static array on the stack, you will fully understand why C does things the way it does.

If you’re fortunate enough to use C every day, you can move on. Otherwise, you need to develop a similarly high level of competence in whatever language you’re using. That involves finding your language’s K&R — a book that will serve as textbook, reference, and style guide. Ruby’s K&R, for instance, is the Pickaxe Book: Programming Ruby by Dave Thomas, Chad Fowler, and Andy Hunt. Common Lisp’s K&R is ANSI Common Lisp by Paul Graham.

When you’ve reached a respectable level of competence in the language(s) you use every day, it’s time to start honing some more general programming skills. Two good books for that task are Kernighan (yeah, same Kernighan) and Pike’s The Practice of Programming and Andy Hunt and Dave Thomas’s (yes, same as the Pickaxe) The Pragmatic Programmer.

Kernighan and Pike take a fairly low-level approach to general programming tuition, starting with some fundamental notes on style and following up with several examples of actual development practice. They develop general programming techniques without depending on any particular language while using several, although (surprise surprise) if you can read C, you can figure out what’s going on.

Hunt and Thomas, on the other hand, start at a high level and work their way to specifics. They touch on more general themes than Kernighan and Pike, spending more time on design, tools, and philosophy than on naming conventions and data structures. If Kernighan and Pike teach tactics, Hunt and Thomas teach operational art.

By this point, you should have a solid grasp of the practical side of programming: it’s time to turn to the theoretical. The next book on the list is Cormen, Leiserson, and Rivest’s Introduction to Algorithms. As a programmer, you need an instinctive feel for time complexity and development complexity: how long an algorithm takes to run, and how long an algorithm takes to develop. Cormen, Leiserson, and Rivest will give you both.

Development complexity deserves some more explanation. Most problems are easily solved with the right data structure — it’s finding the data structure that makes a problem easy that’s truly difficult. The more you know about data structures, the better.

You should also know about intractable problems — in particular, you should have some idea about NP-Complete problems and why they’re difficult. You can probably get a sufficient intuition from Cormen, Leiserson, and Rivest, but if you want to go further (and if you love your craft, you probably do), Garey and Johnson’s Computers and Intractability is invaluable.

Now that you have a good grounding in theory, it’s time to return to practice by way of theory: learn Lisp. (Yes, really.) If writing C is programming on the bare metal given by your operating system, writing Lisp is programming in theory given flesh. It is an utterly different — and invaluable — experience. Graham’s ANSI Common Lisp will get you there, but the Wizard Book — Abelson, Sussman, and Sussman’s Structure and Interpretation of Computer Programs — is probably a better introduction to the language and mindset from a more abstract point of view.

If you’ve gotten this far, you’re probably a better programmer than I am. The next step towards true mastery of programming is Knuth’s famous Art of Computer Programming series. Reading the books, working the exercises, and truly understanding the material will give you a comprehensive mastery of the fundamentals of programming.

10
Oct
06

Against innumeracy, vol. 2

Today’s peeve: people dealing poorly with randomness. First, an article:

Here’s the money shot:

We perceive trends when there are none. Poker players invariably believe they can lock into streaks. Backgammon champions swear that dice can go hot or cold. Likewise, people think they can cosmically predict what song will come next on their shuffle. The blogger Kapgar, who claimed this power, remembers vividly the times when he predicted a song and the iPod amazingly delivered it. But there may have been a thousand times when his iPod played songs he didn’t guess – non-memorable circumstances that, not surprisingly, didn’t make an impression. Likewise, is it really so astounding that Kapgar’s iPod played a run of what he considers great songs? Dude – he’s loaded the iPod with his favourite tunes. You know what would be really freaky? If his iPod came up with a run of tunes that he despised.

The idea that a random source can “remember” what it’s just produced and somehow correct itself to “balance things out” is called the gambler’s fallacy, and like all fallacies it’s wrong. A “random” source that picks new output based on past output is, er, no longer random.

(Amusingly, this is how pseudorandom number generators — including the one in Steven Levy’s iPod — work. Extracting a “random” number from a PRNG tweaks the PRNG’s internal state a little bit, influencing the next number in an entirely deterministic way. A PRNG’s output depends entirely upon its structure and upon its initial state — its random seed. Picking a sufficiently random seed is critical to getting sufficiently random numbers out of your PRNG. But that kind of determinism is far more subtle than the “patterns” people see in their iPods. The whole process is explained in detail in Bruce Schneier’s excellent Applied Cryptography.)

People expect “random” sequences to have a certain amount of variation. We’ve evolved to look for patterns where none may exist (it’s less dangerous to think you see a tiger where there isn’t one than to think you don’t see a tiger where there is), and the same intuition applies to sequences. For instance, if I flip a coin eight times, and get the sequence

  • H H H H H H H H

you’re going to be pretty suspicious of my coin. If, however, I get

  • H T H H T T T H

you’re not likely to have a problem. (The sequence of three tails might make you a bit nervous, but that’s all.) The fun part is that I’m just as likely to get the first sequence as the second. If I conduct Sagans of eight-flip tests, I should get as many eight-heads sequences as HTHHTTTH sequences. (Well, assuming a fair coin that never lands on its edge, but that’s why this is a thought experiment.)  See, the probability of any given fixed eight-flip sequence coming up is the same, regardless of whether it “looks” random or not.
Generalizing horribly, we perceive patterns where we see clusters. For instance, there’s a “spike” in the eight-heads sequence above, and another much smaller “spike” in the three-tails section of the second sequence. If you place points completely at random on a plane, it won’t “look” random — you’ll have tight clusters of dots in some places, and wide gaps in others, as if the random point-producer favours some regions and shuns others.

A more “random-looking” point placement routine works much the same way — only, when it places a point, it makes sure there are no other points within a small radius. This is a Poisson disc distribution:

(image from Dunbar and Humphreys’ paper). It has a pleasing look to it — uniform, but not too uniform. No big gaps, no big clusters — this is how we like to think of randomness. (It’s also very closely related to the distribution of photoreceptors in the human eye. Coincidence? I doubt it.)

This is basically the approach Apple uses in their “less-random more-random-feeling shuffle” approach, as far as I can tell from the article on the Guardian.

10
Oct
06

So, North Korea has nukes…

…and I’m more concerned about the nascent hockey season.

Well, that’s not quite true — I’m concerned enough about their nukes (if nukes they are… now some people are saying the explosion might’ve been merely conventional) to blog a little. First I’d like to point out these two posts on Barry Eisler’s delightful blog:

I tend toward the argument (from the first post) that Kim Jong-Il just wants some international attention after all this kerfuffle with Iran’s nuclear programme, al-Quaeda, the civil war in Iraq, and so forth. I prefer this theory to the idea of the DPRK trying to influence American mid-term elections or Abe’s talks in Seoul because it’s by far the simplest alternative, and I have no real reason to prefer any other.

What I get out of the second post is that dealing with North Korea — whether it actually has nukes or just wants nukes really bad — has to be local. (This fits with what Thomas Barnett says — no big surprise, as I found about Barnett’s blog from Eisler.) It makes a lot of sense — the US has been estranging itself from most of the international community, and is tied down in Iraq and Afghanistan (does anyone remember Afghanistan any more?), whereas the PRC has a tremendously strong economy, lots of local influence — and, oh yeah, the world’s largest army and a few dozen nukes of its own. It’s also right on the border, which is a plus.

Eisler’s “calculus of hostages” from the second post makes me uncomfortable. I think it’s worth pointing out that a similar balance of embargo, foreign aid, and starvation happened in post-1990 Iraq (hey, remember “no-fly zones”? Those sure worked well), which casts doubt upon the idea of dealing with asshole nations (I like the term “asshole nation” much better than “rogue state”) with embargoes whilst simultaneously trying to provide humanitarian aid.

Next — and this has nothing to do with North Korea — I want to point out this hysterically funny parody on tdaxp:

Delightful.

06
Oct
06

How not to run a campus pub, vol. 3

The menu at my campus pub includes this fascinating piece of writing:

No minors allowed in the student pub must be 19 years or older.

It’s prohibiting people who are not yet 19 from being 19 or older. Gee, that’s a useful rule.

I thought that English composition classes were required here. If so, this one clearly didn’t take.

04
Oct
06

A short-form combatives bibliography

Okay, to start with: personal security is not being able to “fight”, nor is it being able to “kick a mugger’s ass”. As far as I’m concerned, personal security is getting home safe — and the best way to do that is avoiding risky situations whenever possible.

The Newbie’s Guide to Self Defense is an excellent introduction to personal-security awareness. If that isn’t enough, take a read at Marc MacYoung’s site: No-Nonsense Self Defense. It is by far the best reference I’ve found for not getting dead. Once you’ve had your fill, check out Ted Truscott’s Lies to Bleed For.

I cannot sufficiently emphasize how important those three links are to keeping yourself safe.

No, seriously, go back and read them. Yeah, I’m sure you got the gist of it the first time. Read them again.

Oh, okay, suit yourself.

Let me put this as clearly as I can: keeping yourself and your loved ones safe isn’t about kicking ass, it’s about not putting yourselves at risk. The kicking-ass bit is the far end of the spectrum. It’s like insurance: sure, it’s nice to have flood insurance, but it’s even nicer not to build your home on a fucking flood plain! The best self-defense tool is a U-Haul trailer: move out of the bad neighbourhood!

But suppose, for a moment, that this advice isn’t enough. For example, you might have to take the bus: it’s a great way to get to know your fellow (sub)urbanites, including those who just love heroin and don’t really care what it takes to get more of the horse. Or you might go to school in an, um, underdeveloped neighbourhood and run into less than fully socialized individuals whilst walking to class. Am I being sufficiently sensitive here? Not offending anyone’s delicate sensibilities? Bad people are out there, and you might have to cross their paths to carry on with your life.

Okay, suppose for just a minute that you might want to be able to do something more effective than gasp in righteous indignation if some dick throws a punch at you. Let’s ask the perpetual academic question: what do you read? What’s the textbook for not getting hit in the face?

Well, if there’s one book, it’s William Ewart Fairbairn’s Get Tough!, from Paladin Press. Sucks but true, the best way to not get beaten into a coma is to hit the other guy in the face first. Get Tough! was written, essentially, as a textbook for British irregulars expecting to fight off Nazi invaders hand-to-hand, tooth-and-nail, in the early 1940s. The methods expounded in GT! are easy to learn and horribly effective. The only problem with GT! is its lack of context: all it shows you how to do is kick ass; it doesn’t show you when or why to kick ass.

Still, if you’re about to get hit in the face, the best way to get home safely to your loved ones — you do care about your loved ones, right? Right? — is to chin-jab the guy who’s about to attack you and walk away very quickly.

Does that sound somewhat less than satisfying? It should. You might object to the idea of smacking everyone who makes you nervous upside the jaw — and you should! Most of them aren’t actually out to make you unconscious. But how can you tell the difference? Yeah, that’s where the rest of our little reading list comes in. Let’s begin with more from Marc MacYoung, who if you haven’t noticed is pretty good at this shit: Cheap Shots, Ambushes, and Other Lessons. Not only will CSAaOL give you a good education in nasty shit, but it’ll put it in context — and you’ll start noticing all sorts of unpleasant behaviour from your fellow bipeds which will make you more cynical.

Yeah, that’s a good thing.

Okay, suppose you take all this seriously enough to do some training with like-minded individuals. You could do far worse than to obtain books about your chosen arts, be they boxing, karate, wing chun kung fu, or what the hell ever — but you ought to look into some more pragmatic monographs as well.

The first thing I’d recommend is another Marc MacYoung book: Taking It to the Street. See, martial arts as they were originally developed were codified dirty fighting, and what the esteemed Mr. MacYoung has done in TIttS is codify the dirty-fighting principles that have worked for him and applied them to the general state of martial-arts training.

The next thing you need to do is read up on your SouthNarc. SN is the man when it comes to the theory of ruthlessly preserving your own life — because, you know, you might have friends and family who might be a little bit unhappy if you got yourself killed. This isn’t a fucking game. I’m not bringing this up because it amuses me. SouthNarc, his writing, his DVDs, and his style aren’t especially sociable. That’s not a mistake. They are designed to preserve life in the presence of immediate and aggressive lethal threats.

Okay, so you’ve read MacYoung and SouthNarc. If you’re at all interested in close-range combat — which I think you should be, but I’m a short little shit so I’m biased — you owe it to yourself to pick up a copy of Bob Orlando’s Indonesian Fighting Fundamentals. This book is by far the best I’ve read in terms of concepts and methods for teaching yourself to dominate a close-range confrontation. The methods and concepts described will make more sense if you train in a formal art — like boxing, Wing Chun, or karate, for instance. Pretty much any striking art will do.

If your art involves forms, you desperately need to find yourself a copy of The Art of Kata, which seems to have avoided an internet presence. (It’s written by Lawrence Kane and Kris Wilder, and published by YMAA.) Hell, even if your art doesn’t involve forms, you would be well served by reading TAoK and inventing a few forms of your own based on its principles.

If you’re interested in keeping your skin intact, rather than adhering to the doctrine of martial arts (or the Canadian government, for example, which seems adamant in insisting that law-abiding citizens need not worry about such things as knives and guns), you ought to do at least a little bit of thinking about knives and guns — namely, what the hell do you do if some asshole pulls one on you? I’d say the best reference for pragmatic weapon defense — that is, coming home with the same number of holes you left with — is Col. Rex Applegate’s Kill or Get Killed, also from Paladin Press.

At this point in my rant, you should take a look at Tony Manifold’s combatives pages and Phil Elmore’s The Martialist.

Finally, if you accept the idea that some people actually have weapons and you might need to give a shit, you ought to read up on John Farnam’s quips. The esteemed Mr. Farnam is a bit of a right-wing loonie at times, but goddamn if he doesn’t know his shit about self-defense — particularly with tools. Mr. Farnam’s comments on armed self-defense are incisive and accurate — and you need to read them if you intend to avoid unnecesary perforation.




anarchocapitalist agitprop

Be advised

I say fuck a lot
Grammar Nazi

Categories

Archives

Statistics FTW