Monday, April 28, 2008

Video Of My GoRuCo Presentation On Archaeopteryx

Check me out rocking the mad scientist hairstyle at GoRuCo, showing the world just how bald one man can get.



I got good feedback on this presentation, and definitely enjoyed making my point. One person on the great big interwebs tweeted that my MountainWest RubyConf presentation was the best they'd ever seen in their lives. Another person who was at both GoRuCo and MountainWest said this one was better. I don't know about any of that, but in this presentation, I live-coded drum and bass in Ruby with Reason using Archaeopteryx, demonstrated weird lambda techniques, showed how Steve Jobs stole a great idea from Andy Warhol, and ranted about muppetfuckers.

I posted a short live-coding video late last night:



Now you can see the whole presentation that goes with it at as well. Fair warning, though - it's a full hour of streaming video (via Confreaks).

More About Bootstrapping vs. VCs

from Ryan Carson

Archaeopteryx: Live Coding Drum & Bass

Here's a video where I'm using Archaeopteryx to live-code drum & bass.



Here's a download version - QuickTime .mov @ 4.3MB.

Sunday, April 27, 2008

My Approach To Giving Presentations

I got great feedback on my presentations at all the conferences I've presented at this year - Philly Emerging Tech, MountainWest RubyConf, Scotland on Rails, and GoRuCo (Gotham RubyConf, in New York). At both GoRuCo and MountainWest people said my presentation was the highlight of the conference for them. Not only that, but when my MountainWest presentation became available as video on ConfFreaks, it appeared on Hacker News and I got tweets where people said it was the best presentation they'd ever seen in their lives. It's pretty awesome to get that kind of feedback.



Probably the most flattering story I heard about my presentation at GoRuCo last night was that, during the more rambling, abstract, hand-waving bits, people in the IRC backchannel were asking, "Where the hell is he going with this?" and other people were telling them, "Who cares? Shut up!"

Another great moment of drunken feedback came last night when Trotter Cashion's girlfriend interrogated me. She came up and told me I had given a great presentation. I was like, thank you, I'm glad you liked it. She was like, I wasn't there, I just heard about it. I was all ah, OK. Then she was like, are all your presentations incredible? Do you just have a gigantic ego? And I'm like, whaaaaaaat? (because I'm in New York). And she's like, well, I'm like, I heard your presentation was awesome, and you're just like yeah. And I'm like, yeah. And she's like, that's what I'm saying.

Maybe you had to be there.



Anyway, during the course of the conversation, which actually made a lot more sense than it may appear to have made when replayed via my blog, I found out that she'd heard my presentation was good from another presenter who'd been complaining about how not good his presentation looked by comparison. (As if my ego needed to get bigger.) In fact this presenter's presentation was good, and had looked good, but just for the hell of it, here's my philosophy on presentations.

1. Decide What You Want People To Do

I got this one from either Presentation Zen or Really Bad Powerpoint. The idea is you choose a specific action you want your audience to take, or a specific decision you want your audience to make. I had several things I wanted people to do, but more than any other thing, I wanted to restore the debate about venture capital vs. bootstrapping which flourished in 2006 and then just disappeared once the VCs started flooding the Valley with money, as they are known to do from time to time. Although I actually see very real upsides to venture capital, I took the position in my presentation that they were nothing but scum, a scourge of the earth to be purged, and put that argument forward with a reasonable amount of gusto. Basically, I sounded like I was trying to start a riot.



The reason for this is that the debate shouldn't be about "what are the VCs backing?" The debate should be about, should we include the VCs at all, or bootstrap? VCs deserve to have a place in the future of the technology industry, but the reality is, only a few elements of the VC culture deserve to have a place in the future of the technology industry at all, and some of them should just fucking die.

So the question shouldn't be "What are the VCs backing?" The question should be, "Since open source and commodity hardware have made VCs fundamentally unnecessary for many technology business models, what elements of the VC culture should we keep, and what elements should we throw away?" But the question many people are asking is still, "What are the VCs backing?" To fix this, I asked the question, "As we destroy the VC culture forever, who should we execute and who should we merely imprison?"



It's a good question, because the truth is that the VCs, as a group, contain brilliant people who, if they were fighting to remain in the industry, would make some very worthwhile moves, and also, as a group, contain some worthless human trash - Paris Hiltons who are playing dice with other people's lives because their long-forgotten great-great-grand-daddies conquered the world as captains of industry or whatever. But I didn't actually ask that question because it was a question on my mind. I asked that question because people usually naturally gravitate to the middle ground, so the truth is, whoever defines the extremes defines the whole debate. (I got that from Noam Chomsky.)

This backfired somewhat, but overall it worked. The backfire was that I held up one venture capital firm as an example of VCs who were actually worth taking seriously, and a few people seemed to think I was pointing out the first aristocrat to send to the guillotine. That was messy; I screwed that one up. But on the whole it worked.



Anyway, in addition to this goal, I had a couple other specific goals as well, and when you have those, you're ready to begin.

2. Go Quickly, And Use Hundreds Of Slides

I actually thought this was my own invention, a caffeine-fueled variation on the Lessig method, but Alan Francis from Scotland on Rails clued me into the fact that Dick Hardt has already been wowing people at conferences with this approach for years. If anything, he makes me look like an amateur. Where I managed to cover 382 slides in an hour - including a coding demo - Dick Hardt's been known to do 1124 slides in 45 minutes.



This approach wins two ways. The visual stimulation captures your audience's attention, and your slides function as rapid-fire flashcards, which makes it much easier for you to remember what you planned to say.

3. Engage The Monkey Within

I get this from Kathy Sierra, and an episode of the Ruby on Rails podcast which I haven't heard, but which Joe O'Brien and Jim Weirich told me about. You need pictures of creatures that can eat your audience, creatures that your audience can eat, and beings that your audience could (in theory) mate with. Apparently the mind wanders every 10 minutes, almost like clockwork, so you need to grab their attention all over again on a pretty regular basis.



4. Be Funny

You also need elements of humor, especially if you really are grabbing their attention and refusing to let go at any point during the entire presentation. A great way to do this is to satisfy the above criteria in silly ways. Show a picture of a dinosaur with a laser gun, for instance, or a sexy cartoon bunny rabbit, or something. As long as it's creatures that can eat you, creatures you can eat, or beings you could in theory mate with, your attention belongs to the presenter anyway.



The best book on comedy I've ever found is Why Is That So Funny?, which is a technical manual on humor from the British theater world. It may not be available in the US. It actually goes into the neurochemistry of humor fairly early on, which - to put my nerd hat on - makes it very easy to logically determine things which are likely to be funny ahead of time.



I've also been taking improv classes for years. I highly recommend professional training in the art of being funny, but only if you're willing to take it seriously. Don't be Michael from The Office in your acting class. The real actors might find a way to get their revenge.

(By the way, if you're a serious actor, and you find Michael from The Office in your acting class, I very much encourage you to take your revenge.)

4. Get Comfortable In Front Of Your Audience

In addition to taking improv classes for years, I've also been taking serious acting classes for years, I've done a bunch of DJing and grunt work organizing parties, club nights, and raves, and I speak at conferences and user groups pretty often. For me, standing up in front of a group of programmers is really at the low end of the public-speaking stress spectrum, so it's pretty easy to get comfortable, relax, and enjoy the experience.

5. Read The Crowd

Again, the whole performing arts thing gives me tons of practice with this, but realistically, this is easy. The key is to aim high. If you want people to watch you and think about what you're saying, that's really hard to measure. If you want them to be totally riveted and laughing like crazy every three minutes, it's really easy to figure out if you're reaching your goal or not. So skew your presentation towards the provocative and the hilarious, because that makes it much easier to benchmark.

6. Practice

Steve Jobs does it. I sometimes do it, and when I do it, I get good feedback. When I don't, the feedback's more mixed. Pretty simple and obvious cause-and-effect relationship going on there.

The easiest way to practice a presentation is to give it to a small audience that knows you personally before giving it to a larger audience that doesn't. You can achieve this with your co-workers, your local user group, your friends, your family, whatever. If I was really hardcore I'd recommend using a camcorder.

Actually, fuck it. I've decided to become really hardcore. I recommend using a camcorder.



7. Enjoy It

That's pretty much everything, really.

Thursday, April 24, 2008

Wired Magazine: Two Versions Of The Same Prediction

I wrote this for Wired in 1995:

It's argued that computers will grow more and more autonomous, eventually surpassing human intelligence. Eventually, some say, these machines will realize we're a liability and leave us behind. If you think this sounds like a '50s B-movie, don't worry: it's not going to happen. If anything, humans and computers will grow together, becoming increasingly difficult to separate.

Computers are stuck in an intimate symbiosis with human beings because we're the dominant factor in their reproduction. Computers may evolve, but their evolution isn't shaped by natural selection; it's shaped by the human computer market. So, to ask what computers will become is to ask what we want from them.

Look at how people use artificial intelligence today. The emergence of expert systems, which spurred people to envision great electronic brains running international corporations, instead produced pattern-recognition software that enables people in large companies to make better decisions.

Instead of replacing us, computers will become a secondary, symbiotic species, enhancing our lives in specialized but powerful ways. In the process, they will transform what it means to be human.


Gary Wolf wrote this for Wired 13 years later:

SuperMemo is based on the insight that there is an ideal moment to practice what you've learned. Practice too soon and you waste your time. Practice too late and you've forgotten the material and have to relearn it. The right time to practice is just at the moment you're about to forget. Unfortunately, this moment is different for every person and each bit of information. Imagine a pile of thousands of flash cards. Somewhere in this pile are the ones you should be practicing right now. Which are they?

Fortunately, human forgetting follows a pattern. We forget exponentially. A graph of our likelihood of getting the correct answer on a quiz sweeps quickly downward over time and then levels off. This pattern has long been known to cognitive psychology, but it has been difficult to put to practical use. It's too complex for us to employ with our naked brains.

Twenty years ago, Wozniak realized that computers could easily calculate the moment of forgetting if he could discover the right algorithm. SuperMemo is the result of his research. It predicts the future state of a person's memory and schedules information reviews at the optimal time. The effect is striking. Users can seal huge quantities of vocabulary into their brains. But for Wozniak, 46, helping people learn a foreign language fast is just the tiniest part of his goal. As we plan the days, weeks, even years of our lives, he would have us rely not merely on our traditional sources of self-knowledge - introspection, intuition, and conscious thought - but also on something new: predictions about ourselves encoded in machines.

Given the chance to observe our behaviors, computers can run simulations, modeling different versions of our path through the world. By tuning these models for top performance, computers will give us rules to live by. They will be able to tell us when to wake, sleep, learn, and exercise; they will cue us to remember what we've read, help us track whom we've met, and remind us of our goals. Computers, in Wozniak's scheme, will increase our intellectual capacity and enhance our rational self-control.

Neal Stephenson's Neo-Victorians Idea Was Utterly Dead Wrong

...because tribes are re-emerging. We don't call it tribes with distributed elders; we call it "Internet Famous." But that's because most of us don't know what it is yet.

Jerry Springer For Programmers: Only A Matter Of Time

After TechCrunch hit a new low, insulting a departing Twitter developer, Mike Desjardins got mad:

TechCrunch gleefully taunted a guy who left his job, forcibly or otherwise. What company does that put TechCrunch in, when compared to traditional media? Who follows the real rock stars around, revelling in their success and revelling even more when they crash hard?



It's an insightful question, but Peter Cooper from Ruby Inside took a totally different point of view:



It's interesting to contrast this with Paul Graham's recent essay You Weren't Meant To Have A Boss:

I think it's not so much that there's something special about [startup] founders as that there's something missing in the lives of employees. I think startup founders, though statistically outliers, are actually living in a way that's more natural for humans.

I was in Africa last year and saw a lot of animals in the wild that I'd only seen in zoos before. It was remarkable how different they seemed. Particularly lions. Lions in the wild seem about ten times more alive. They're like different animals. And seeing [corporate programmers] was like seeing lions in a zoo after spending several years watching them in the wild.




Obviously if startup founders and movie stars are lions, it's easy to guess what kind of animal Mike Arrington is.



However, since I've already mentioned Arrington, it's only fair to point out that PG's post thorougly outraged the second most horrible and boring tech blogger in the universe, Jeff Atwood. Watching Jeff Atwood pick a fight with Paul Graham was marvellous entertainment. Not only did we get to see a baboon flinging its doodoo at a lion, we got to see how silly and befuddled the lion had gotten in the winter of its old age. Paul Graham first defended himself, then wrote a post called How To Disagree - which Atwood pretty accurately described as "an EULA for disagreeing with Paul Graham" - and finally had Atwood over for a Y Combinator dinner where they presumably hashed out their differences.

Atwood launched a similar attack on DHH as well. I can only assume he was angling for a dinner with DHH but may be willing to settle for lunch. Or in fact a photo opportunity. However, DHH never responded at all. The sad truth is that if Blaine Cook is Britney, and Mike Arrington is Entertainment Tonight, Jeff Atwood is Dr. Phil. (When Britney had her meltdown, Dr. Phil stalked her in rehab, angling desperately for a photo opportunity despite her total unwillingness to speak to him.)



All this ridiculous programmer-celebrity blogging echo-chamber bullshit results in very little software being built. It's important to realize there are tons of people who just don't care. Be one of those people.

I don't share Peter Cooper's respect for Arrington - I think being good at doing something awful is more awful than being bad at it - but I definitely do share his amusement. Mike Arrington is way too busy manipulating the echo chamber to produce ad sales for him to actually care about anything that happens inside it. He's actually said so, very explicitly, in the past. Jeff Atwood is doing the same thing, but less effectively and very probably also with much less deliberate intent. This ridiculous pack of hyenas is a silly distraction at best.



This pandering idiocy mirrors the mainstream media's lowest-common-denominator gossip factories for a very fundamental reason. Advertizing-supported media gains much more from your attention than it does from your edification. This is not coincidence. It is fundamental and inherent. There is a huge economic incentive to grab your attention, and there is no economic incentive at all to give you something worth reading.

That's why my own blog has ads - because it works in reverse as well. I sometimes get enormous amounts of traffic from people who are very interested in expressing their opinions on my posts, but not interested at all in actually thinking about those posts. I know this for a fact because I used to allow them to comment on my blog. I was only able to stop these idiots from commenting on my blog by stopping everyone from commenting on my blog, which is regrettable, but it's worth the sacrifice, because some of these people really were complete fucking idiots. I know, because they disagreed with me.



My blog has ads because it's my little way of saying, "Thank you for reading my blog. That means you represent 1/11,429th of a burrito to me, and that makes you special."

Don't get me wrong. I'm grateful for my readers, but I'm grateful because they tend to come back at me with interesting ideas. It's cool when cool people think your ideas are worth thinking about, and it's even cooler when they actually take the time to think about those ideas. But in and of itself, reading a blog is not an accomplishment.

Likewise, running a blog does not make you important. Jeff Atwood and Mike Arrington are not vital to the programming community. You represent 1/11,429th of a burrito to them too.

It's awesome to get a free burrito every 11,429 times somebody decides to read your blog. But that awesomeness doesn't translate well to full-time careers, because it's all too easy to get 11,429 people to visit your blog even though every single one of them realizes they should know better. There are a lot of people reading blogs when they should be chasing their dreams, and there are a lot of bloggers more than happy to waste your whole day.



Blog ads encourage a fundamentally trashy form of "journalism." Keep this in mind the next time somebody suggests building a business on ad revenue. To the extent that it functions as an economic incentive to useless, divisive gossip, ad revenue is fundamentally erosive to the communities which generate it. That makes it parasitic, and nothing to be proud of.

Wednesday, April 23, 2008

Tuesday, April 22, 2008

Ruby Golf: ASCII Sierpinski Triangle



For wide terminals:

ruby -le '64.times{|y|print" "*(63-y),(0..y).map{|x|~y&x>0?" .":" A"}}'

For thin terminals:

ruby -le '33.times{|y|print" "*(32-y),(0..y).map{|x|~y&x>0?" .":" A"}}'

A classic fractal, via Brian Mitchell. I have no idea how it works. In a weird inversion of my usual pattern, I know the math but I can't figure out the code.

Sunday, April 20, 2008

Fortune 5,000,000 == Long Tail

DHH @ Startup School

Archaeopteryx: Logging (And Soon Unit Tests)

In developing my music system Archaeopteryx, I haven't written many tests, and the few I did write, I threw away when the implementation changed, because changes in the implementation made the tests completely out of date. Unreliable tests are worse than no tests at all, so I stopped writing tests altogether, and I used the excuse that I was exploring this very mysterious problem space where I hadn't written any code before. (I'm not the only person to argue in favor of the explorer exemption.)

The first problem with that is I have written code for this problem space before. In fact, if you count writing MIDI by hand, I've done it many, many times. I did it when I was 15, with a Korg M1, and later in my 20s with an MPC-2000. I've done it so many times that writing music with a GUI feels weird to me. Writing raw MIDI notes and events within a hardware sequencer differs in many ways from writing a software meta-sequencer, but it still means familiarity with the fundamentals of the problem space, which makes the explorer exemption harder to justify. And this isn't even the first time I've written Ruby to generate MIDI, so this explorer exemption thing is really kind of a lie.





The second problem with that is that the explorer exemption has to come with an expiration date anyway; once you've explored a little while, by definition, the territory becomes more familiar. But the third and most troublesome problem with that is writing code without tests means writing legacy code. This means you have to test, or you're just screwing yourself.

However, I knew that already. The reason I had stopped testing wasn't because I wasn't enjoying that tasty testing Kool-Aid. I'm digging on the Kool-Aid. In fact I've been using various music generators as pseudo-tests, running them repeatedly after every change to be sure my code still works, just because I'm so hooked on that damn Kool-Aid.



The reason I stopped testing is because I couldn't figure out how the hell you unit test a system whose primary purpose is to control a third-party, closed source, proprietary application. I did some asking around and some googling and the recommendations I got mostly involved mocking the ever-lovin' beejezus out of my system. But that didn't appeal to me at all. So I held off entirely, until I figured out a solution.

If you've seen my presentation on code generation, or read the blog post where I illustrated one example of the technique, you may already know what my solution was. Last night I did a tiny bit of refactoring and threw some dead-dumb simple logging via puts into Archaeopteryx.



The end result is that Archaeopteryx now generates playable Archaeopteryx code as its log files. This code isn't in svn yet, and I still haven't had time to put the project on GitHub at all, but all these things will happen soonish. I've actually got to add a little bit to it before it really does what I need. Hopefully it's pretty obvious that the remaining changes are absolutely trivial. First, the only way you can capture this as a log file is with a Unix pipe. Second, logging to the command line by default is lame.



Obviously, I can fix this with a Logger right out of Ruby's standard library.

I hope it's also obvious why this is useful. Archaeopteryx doesn't play back sequences; it generates them. The user doesn't define the music to play, but rather a process for deciding which music to play. Arkx then generates the music accordingly. In practice this is all a combination of probability matrices and a random number generator. San Francisco's awesome underground techno DJ Andy W, who's done a ton of this, told me the most important thing is to always be recording the music your system generates, since every once in a while it'll generate something awesome, not even necessarily due to your code, but just to the sheer fact that if you throw a random number generator at a beatbox, once in a while you'll find some random number generator funk.

But automatically recording everything is kind of a pain - it can eat up your hard drive fast, and you sacrifice a shit-ton of hard drive space for those few moments of serendipity. At the same time, there is lurking off in the land of vaporware another, related problem: what if you use Archaeopteryx for live performance? Trekking out to your gigs with a ton of wires, cables, power adapters, and hardware is a pain in the ass, and I know from personal experience that I'll go to extraordinary lengths to minimize complexity, especially in loud places with bright lights, dark corners, cool music, and hot women. Adding another hard drive to record every performance? Just in case? That would never happen in a million years - even if there weren't such an obvious risk of the extra hard drive being stolen. I hate to bring this up in the context of the dancefloor paradise, but thieves are everywhere.



However, the extra hard drive isn't actually necessary. If you're working within the confines of programmatic MIDI, logically then recording every performance can mean nothing more than capturing a log file. Currently Arkx only generates brief snippets, and recording audio to a hard drive would work perfectly well in that context. Scale Arkx to a full-length DJ set, however, and recording audio doesn't scale, while capturing a log file scales effortlessly. It's not even about adding a layer of abstraction; it's about leveraging the layers of abstraction your system already contains. The whole point of Archaeopteryx is to play music; playing the same music twice should be a nonissue.

I'm kind of belaboring my point here, but just to wrap up, let me say that this is actually not just a pleasant side effect - it's actually one of the reasons why algorithmic composition matters. In an MP3 world, recordings are cheap. Therefore, the whole fundamental business model of selling recordings is completely doomed. A business model based on expensive recordings sells recordings; a business model based on cheap and abundant recordings gives recordings away. This makes the body of recordings of your live musical performances equivalent to a blog - you should be updating it all the time. Recording your live performances should be as cheap as capturing a log file, since distributing those recordings is as cheap as publishing an RSS feed.

Obviously, also, the same strings which my Logger returns can be repurposed in a different way for testing. Ultimately all I need to test is that this system generates the correct MIDI. If I can represent the MIDI as text, then mocking the system in all its complexity is a total waste of energy. My specs are going to consist entirely of string comparisons. Running them will be fast, writing them will be fast, and life will be good.

Saturday, April 19, 2008

Three Ways To Say The Same Thing

Twice I've heard Ezra Zygmuntowicz from EngineYard say that every great software project starts as a hack.

DHH said it like this:

The best frameworks are in my opinion extracted, not envisioned. And the best way to extract is first to actually do.

Linus Torvalds said it like this:

Nobody should start to undertake a large project. You start with a small trivial project, and you should never expect it to get large. If you do, you'll just overdesign and generally think it is more important than it likely is at that stage. Or worse, you might be scared away by the sheer size of the work you envision. So start small, and think about the details. Don't think about some big picture and fancy design. If it doesn't solve some fairly immediate need, it's almost certainly over-designed. And don't expect people to jump in and help you. That's not how these things work. You need to get something half-way useful first, and then others will say "hey, that almost works for me", and they'll get involved in the project.

Thursday, April 17, 2008

Innovative Journalism Around Coachella

From the LA Weekly, which mashed up Holovaty-style statistical journalism with a healthy dose of opinion:



(via bb)

Wednesday, April 16, 2008

Corporations: Quit It With The So-Called "Protecting"

First because we know it's always a lie.

Sellers have already begun revolting by papering eBay's discussion boards and starting a petition, which has more than 3500 signatures...Alastair MacGibbon, eBay's trust and safety director, said the announcement was designed to protect users as one is four times less likely to have a problem on eBay if one pays using PayPal than with other methods.

You're either foisting off some kind of illegal, anti-capitalist, anti-competitive practice, or you're protecting yourselves or your money. But second because it's not just dishonest - it's a horrible intention for you to have. The excuse you make is even worse than the thing you're making an excuse for. We don't need corporations to protect us. If I want protection I'll put on a condom.



We're adults. You're supposed to be doing business with us, not changing our freaking diapers. The eBay policy might be designed to make eBay's commerce safer, but that doesn't mean it was designed to protect anybody.

Fight Corporate Obfuscation With Programmatic Analysis

Like many corporate projects, my current project includes some enterprise integration - the bane of the Rails world, not because of any inherent difficulty, but because of a cultural mismatch. There's a large, expensive product which some people are implementing, and they publish relevant details of their implementation in an Excel spreadsheet.

I just had an interesting conversation with one of these implementers, and although he's usually a nice guy, I didn't enjoy the conversation. It included some extremely bad advice, and a round of questioning about my power in the corporate structure, and a number of other questions on matters so irrelevant that I not only didn't know the answer, I wouldn't be able to remember the answers if anyone told me.

The extremely bad advice concerned what to do with the data he'd given me. He essentially recommended creating some kind of rules system based on the Excel file. The Excel file contained a very large number of columns and rows governing a very large number of variables, all named in classic enterprise application style - that is to say, all of them impossible to remember and utterly devoid of any semantic significance.

Fortunately, although the conversation did irritate me, it didn't do any harm, because I had already written a 39-line Ruby script to analyze the data this Excel file described the schema for. Although the Excel file dictated setting a large number of different variables, in practice, this script showed me that only five of these variables ever actually changed in value, which means that the whole thing can be handled with an ERB template and some variable interpolation.

Pretty much every beauraucrat out there seeks power over other people by making it difficult for those other people to accomplish their goals without the beauraucrat. It's very rare that these intentions are conscious; it's got to be an unconscious thing, I'm sure, because anybody who approached life that way on purpose would be pretty messed up. But unconsciously or consciously, it's what they do. In governments they can threaten you with jail time or confiscating property if you don't follow their rules; in corporations, unless they're actually managers, all they can do is give you baffling Excel spreadsheets and bad advice, confident in the fact that nobody will ever be able to figure out the spreadsheet, so everybody will have to follow the advice, no matter how bad it might be.

These time-wasting, inappropriate power trips are the reason why it's really useful to write code which can analyze code - and the truth of the matter is, it's absurdly easy. All you have to do is throw regular expressions at strings and store results in hashes. I learned this with Perl but it's just as easy with Ruby.

More generally, this illustrates a fundamental rule. Never trust business users to analyze their problem space correctly, whether they irritate you or not. If you build a system to their inaccurate understanding of the data, they'll blame you. (Conversely, if your code exposes flaws in their business process, they'll tell you "we can live with the way you handled that.") Their job is to give you the data and tell you the results they want. Your job is to give them the results - and since interpreting the data happens after they give you the data and before you give them the results, that means figuring out the data is your concern.

(And if you ever find a beauraucrat wasting your time, telling you how to do your job, and asking you rude questions about your role in the corporate power structure, relax, and just remember, you can probably route around their obstructions with only 39 lines of code.)

Tuesday, April 15, 2008

Los Angeles Is Totally Radical

Exhibit A: Machine Project

Have you seen King of Kong, that documentary about extreme videogame nuts who battle over the title of World Donkey Kong Champion? If not, you’re in luck — our neighbors at the Echo Park Film Center are screening it this Thursday night.

Have you ever come out from a screening about crazy videogamers and thought that you yourself could probably pwn both those guys, if only you had a shot? This is the luckiest night of your life.

While the screening is going on next door, we’ll be giving you to the chance to start your own overblown gaming rivalry using a giant 6-foot-tall functional joystick! Come play Donkey Kong, Donkey Kong Jr., and other classic-era video games projected on a wall-sized screen in the gallery.


Second Life No Longer Boring As Fuck

In my ever-so-humble opinion, Second Life was absurdly boring, a technology which served no useful purpose other than to isolate already isolated wealthy "creative" types (not artists) from the real world.

But (again, in my humble opinion) Second Life just shot from boring as fuck to incredibly fascinating overnight.

Here's why.



As cool as this, however, I think Linden Labs is still bullshitting the entire world here, and being incredibly pretentious, just by claiming credit for this at all. I think it's obvious that the real credit has to go to Johnny Lee.

Monday, April 14, 2008

The Problem With Fighting Terrorism

The whole concept of fighting terrorism has a serious, fatal flaw. It's not just that it enables all kinds of invasive policies. The problem with fighting terrorism is that terrorism is extremely cheap politically motivated violence. This means that any organized political entity is capable of becoming a terrorist entity. That means that the only way to track potential sources of terrorism is to find people who disagree with the government about something and then measure how angry and/or desperate they are. You really can't accomplish this without destroying a free society. However, since this category of people - people who disagree with the government about any given thing - can easily become equal to the number of people in a given country, even if you've destroyed all freedom in your society, the task remains impossible, because the sheer overhead in tracking every member of your society requires that nothing happen in your society other than people tracking each other. And even if you were able to pull off all that surveillance, measuring how angry and/or desperate people are is extraordinarily difficult.

The problem really comes from modelling political dissent as a threat. We should regard terrorist acts as acts of war, and focus on resolving the economic and cultural conflicts which motivate such acts. Extending diplomacy, rather than dropping bombs, is a commonplace strategy for every country in the world other than the United States. The United States needs to learn this strategy, but even then it isn't enough. Since any organized group can now perform acts of war, we now need to extend diplomacy not only to other countries but also to any organized group capable of becoming violent, which is to say, any organized group.

Extending diplomacy to any organized group is essentially impossible, especially in a Web 2.0 world where groups can form overnight and then dissolve just as quickly. It's as difficult as spying on every member of a society, for pretty much the same reason: there's just too many people, and only one state. There's no way in hell the gigantic beauraucratic apparatus which you need to have in order to run an entire country will ever be flexible enough to extend diplomacy to any and all organized groups. The logistics are utterly ludicrous.

What's really going on with all this is that terrorism is essentially a disruptive technology, and there's really no way that any country can respond to it effectively. The only way to effectively deal with terrorism is to construct some new approach to organizing civilization. This is a huge problem, partly in the sense that it's horrible and awful, but also in the sense that proving Fermat's theorem was a huge problem: you can measure the amount of time between realizing that a solution was needed and finding that solution in centuries rather than years.

Here's one idea for a solution. It might be a really good idea for people to form counter-terrorism groups. By counter-terrorism groups I don't mean groups which answer terrorism with terrorism; I mean groups which take the fundamental dynamic of terrorism and counteract it. If a terrorist group is a group which performs acts of war without necessarily representing a nation, a counter-terrorism group would be a group which performed acts of peace without necessarily representing a nation.

It could be that our governments are in fact too stupid and corrupt to ever keep us safe, and volunteer citizen groups of this nature are the only way to counteract terrorism. Since it's a very safe bet that resolving a few economic and cultural conflicts would take away the motivation behind terrorist acts, it's very much in the interest of ordinary citizens to resolve those conflicts. But this is what makes it such a hard problem: if what the world needs is citizen groups which perform acts of peace to prevent terrorism, without necessarily representing any particular nation, what on earth would that look like? Probably some strange hybrid of Dr. Martin Luther King and the micro-investment movement, combining pacifism with economic improvement.

It's scary writing about these things in the modern political climate. I got an e-mail from somebody named Mustafa asking me to help him use Gumstix to build a video surveillance system. It's entirely possible that somewhere out there, some dude in the CIA read my recent blog post about robotics and war and decided I was some kind of wannabe terrorist. If I was a CIA guy looking to bait a potential terrorist software engineer, I might write this e-mail too:



Just in case: I'm not a fucking terrorist, you brain-dead monkeys. (And Mustafa, if you are in fact a real human being with a genuine legitimate interest in Gumstix and video surveillance, well, sorry man, my bad. It seems kind of unlikely, though, given that there's no reasonable connection between the two subjects at all.)

Anyway - I bring this up not just because it makes for an interesting post, and not just because it kind of freaks me out - I could be looking at a very big dog barking up a very wrong tree - but also because it highlights a big problem. Say you decide the government is stupid and corrupt and making the world a more dangerous place. Say you decide to form a citizen group to resolve the economic and cultural conflicts which are driving terrorism in the world today. So, that's awesome, you're doing your part for world peace. There's just one little problem. How do you do that without getting thrown in Guantanamo Bay?

OK I have to write some JavaScript now. If this is the last post on my blog then I've been arrested for thinking out loud. God bless America. Just to wrap up, my point isn't to found a citizen group of this nature, but to say that this is probably what will happen in the next few centuries. Proving Fermat's Theorem took 357 years, finding a way to organize society so that terrorism doesn't happen will probably take just as long.



Update: Upon reflection I think it wasn't the CIA. It's not that I don't think the CIA's capable of that kind of profoundly inaccurate misinterpretation. It's just that if the CIA was investigating a blogger, I don't think they'd use such blatantly obvious e-mails, and I'm damn near certain that if they were writing such transparent attempts at entrapment, they wouldn't be sending them from freakin Hotmail. If anything, I shouldn't be terrified the CIA are after me, I should be glad I banned comments on my blog, because if this is the kind of stupidity it provokes from people who care enough to e-mail me at 3am, I can only imagine what a zero-effort format like blog comments would have brought me.

AI Writes Books

He is laying the groundwork for romance novels generated by new algorithms. “I’ve already set it up,” he said. “There are only so many body parts.”

Saturday, April 12, 2008

Static vs. Dynamic Typing: Finally, A Post Worth Reading

This is literally the first time, in any of the billions of posts on static vs. dynamic typing, that I have seen anyone do any actual thinking about the topic at all:

A statically typed language with type inference will give you some of the same benefits as a good dynamic language, but definitely not all of them. In particular, you get different benefits and a larger degree of flexibility from a dynamic language that can't be achieved in a static language. Neal Ford and others have been talking about the distinction between dynamic and static typing as being incorrect. The real question is between essence and ceremony. Java is a ceremonious language because it needs you to do several dances to the rain gods to declare even the simplest form of method. In an essential language you will say what you need to say, but nothing else. This is one of the reasons dynamic languages and type-inferenced static languages sometimes look quite alike - it's the absence of ceremony that people react to.

Kudos to Ola Bini.

Thursday, April 10, 2008

Archaeopteryx Generating Drum And Bass

Recently I was speaking at conferences, seeing family, and meeting people in London, so I made some improvements to Archaeopteryx and built a drum and bass groove generator while riding (and waiting for) various planes, trains, and automobiles.

I haven't got it in svn yet, or migrated it to github for that matter, but here's a pair of videos:

Hard-coded painfully-simple bassline
Dynamically-generated plain-old-painful bassline

I only had so much juice at the airport, so they're both QuickTimes, slightly over 20MB.

Wednesday, April 9, 2008

Tuesday, April 8, 2008

Geek Politics FTL

With Google App Engine, we have a service name as corporate and lifeless as anything from Microsoft, a degree of language diversity also worthy of Microsoft - it runs Python and only Python, you get no access to the filesystem, no cron, no Unix of any kind - and last but not least Microsoft tactics to boot, in the form of a blatantly copied, not-for-profit, freeware version of 37 Signals' Campfire.



This is the real difference created by the Web. Not that Google toppled Microsoft. That had to happen sooner or later, and Google was as reasonable a contender as the world could want. The real difference is that the same trajectory which Microsoft took over the course of decades, from outfoxing and opposing the megagiant (IBM), to dominating it, to unpleasant anti-competitive bullshit coupled with a total across-the-board loss of quality, now takes not decades but only years.

A few years ago, if you were to google Lisp, Bayes nets, or anything related to statistical AI, you'd end up with more Google ads than you could shake a stick at. One of these ads used to say, "We can't hire smart people fast enough!" It's pretty much obvious that if you can't hire smart people fast enough, your options are to slow down your hiring process, or settle for idiots. Everybody knows that Google didn't slow down its hiring process.

Here's Guido von Rossum introducing Google App Engine:



The really interesting part isn't the video - it's who's leading the talk. There's nothing wrong with Guido von Rossum per se - he created and develops a powerful, popular language, and deserves kudos for that. Only last week I spoke at a Ruby conference where I said that dissing Python to make Ruby look good was petty bullshit, and we should give the Python community credit where credit is due. But developing a language and developing a Web applications platform are different jobs, and if you do them both at the same time, you could be looking at a conflict of interest.

To his credit, Guido betrayed his employer's interests for the interests of his personal open source project. I think that was the right decision - or, at least, it's the right decision, if you've already made the wrong decision of getting into that kind of conflict of interest in the first place. At the very least, it's a decision I can respect, as it's obviously the act of a fellow pirate.



But the question remains: what the hell was he doing on that stage in the first place?

I'm fairly certain the answer was that stacking the deck at Google with Python programmers meant giving unreasonable power to Python's creator. It should be obvious that when you're hiring programmers, and you've realized that you can't hire smart people fast enough, and you've opted to compromise on smart rather than on fast, you're going to end up hiring some stupid programmers. This much should be obvious. I'm going to add a corollary which I can't actually prove: hiring stupid programmers inevitably means hiring programmers who are furiously loyal to some arbitrary language, and most importantly, programmers who are more loyal to that language than they are to common sense.



Google App Engine and Amazon EC2 have two essential differences:

1. Google App Engine is the me-too product
2. Amazon EC2 permits orders of magnitude more diversity

The first point gives the Rails community every reason to dismiss the obvious, petty insult in Google's Campfire clone. But the second point is the one that matters. The best analysis of open source software you'll ever see in your life is Clay Shirky's in Here Comes Everybody, and the second best is James Surowiecki's in The Wisdom Of Crowds, but pretty much every open source commentator has noted that it's the enormous diversity and experimentation of open source that yields its most successful projects their consistently high level of quality. If you read either one of these excellent books you'll discover that diversity is an absolutely essential component of the success of open source, which is one of the reasons polyglot programming is so popular today. Google App Engine locks you out of that diversity, and limits you to a dramatically curtailed subset of the power and diversity that open source developers have come to take for granted.



Google App Engine is a joke. You can't create apps in Rails, Haskell, Erlang, Seaside, Perl, PHP, or Lisp. You can't even leverage Unix. You get all the restrictive corporate BS you'd have to deal with if you worked at Google, but you don't get the stock options, the salary, the free food, or even a parking space for your trouble. Packing Google with partisans who favored a particular language to unreasonable degrees resulted in a product which just isn't even worth considering. This is why polyglot programming matters. The age of one dominant language is over, and Google's attempt to make Python numero uno just means wasted time and wasted money.

Friday, April 4, 2008

A Conversation In A Scottish Pub

But it doesn't matter that nobody will ever be able to charge for Twitter. Nobody will ever be able to steal Twitter's user base. It's not about monetizing. First you have to get the community.

Bullshit. See that guy?

With the pool cue?

No. On TV. Fifty Cent.



Fifty Cent?

Fifty Cent.

What about Fifty Cent?

You can build Fifty Cent a private Twitter with SMS for next to nothing. And for Fifty Cent there's more value in a private Twitter that only keeps him in touch with his music industry and marketing peeps than a public Twitter with the biggest user base. In terms of delivering real value, a large user base is not necessarily useful. If you're famous, the larger the social network, the lower the probability that you'll be able to use it as a social networking tool. I mean it's commoditization gone insane, isn't it? Those monkeys on TechCrunch say that a social network site hasn't arrived until somebody else has reduced it to a code generator. But if you can reduce it to a code generator, then it's not just arrived, it's been reduced to a formula.

And all your friends are on it.

Because you're a fucking Web developer. None of Fifty Cent's friends are on it. And Fifty Cent's got an interesting set of friends. Ever see that picture of Fifty Cent hugging Bill Gates? Fifty Cent's friends split evenly down the line between ghetto fabulous and corporate thieves. In either case there's massive value for someone like Fifty Cent if he can get always-on near-instant micro-blogging via SMS with all his most crucial associates, but that value only exists if the network is private. Being able to make your updates private is not enough. The entire conversation needs to be contained.

Yeah but how much money could there be in building a Twitter for Fifty Cent?

How much money? How much fucking money? Have you seen MTV Cribs?

MountainWest RubyConf Talks Online

ConfFreaks, which recorded all the talks from MountainWest RubyConf, has put several of them up at its site. This includes my own talk and several others.

This was a really fantastic conference - great logo, great talks, great acoustics, fantastic energy, single-track vibe. Very highly recommended. One of the absolute best I've ever been to.