Archive for the 'Programming' Category


Me and MeshU up in Toronto

2008-06-03 / 07:22 / dave

Avi’s blog post reminded me that I never summarized my trip to MeshU. In a word: good.

Or in several words…

Prelude

I left Pittsburgh in a shiny new rented Sebring and drove to Toronto in about 5 and a half hours. The only events of interest were 1) realizing I had no washer fluid and 2) a small delay at the Peace Bridge for Victoria Day.

Tron I got parked ($10 CDN/night) and checked in to the Neill-Wycik, which exceeded it’s Hostels.com reviews. The room was a dorm single in a suite, though the other rooms seemed empty. I only saw one other person and only for the 2 seconds it took her to go from her room to the bathroom.

The roof offered some Victoria Day firework watching, unfortunately underwhelming compared to the Zambelli’s work. Then back to the room & free Wi-Fi to check if the post-conference weather would be good for camping. Not only was the weather looking dodgy, but I had forgotten my AC Adapter.

Tuesday morning

If I had to come up with a complaint of the Neill-Wycik, it would be the inability of the curtains to stop sharp rays of sunlight from stabbing me in the eyes. I woke up right around sunrise and spent some time reading Black Dogs. I considered showering, but since the plan was to drive straight from the conference to Tobermory and sleep in the car, it didn’t seem worth it. Plus I didn’t shave or bring business cards so I figured professionalism was right out the window. They’re lucky I wore pants.

Neill-Wycik disposes of trash proper Before going I checked all the drawers to make sure I didn’t forget anything. I’m not sure if it’s official Neill-Wycik policy, but there was a random porn DVD in a desk drawer. Feeling that this was the ultimate souvenier, I took it. This comes up later in the story.

I walked the few blocks to was a few blocks away the MaRS center. The sign-in and breakfast (fruit & carbs) was in an open area immediately adjacent to the conference rooms. I found a table and “networked.” It was an interesting mix of designers, technical-ers, and entrepreneurs. They did a quick and–from where I was sitting–unintelligible intro and then we were off.

Beyond relational

I decided to see Avi Bryant’s “Beyond Relational Storage” talk based on the strength of his blog and Seaside.

I wasn’t disappointed: his talk was awesome (my notes).

He covered a bunch of alternate data storage strategies (SimpleDB, in memory, Prevayler, etc.), took questions, and then gave us a sneak-peak of MagLev (which has blown-up the blog world since it’s official debut at RailsConf).

Aftwerwards there was a small talk at my table. My neighbor was Markus, the CEO of Palomino System Innovations. They make a CMS, but mostly I was interested in their custom XML store.

Interlude

I was planning on running to Best Buy over break, but my laptop seemed to be doing ok in real ultimate power-saving mode so instead I made some calls.

Thorncrest Outfitters strongly–as in “we won’t rent you a kayak”–spoke against my proposed paddle to Flowerpot Island in Five Fathoms Marine Park. They proposed a one-day river kayaking trip, which sounded far less exciting.

Blue Heron affirmed that they take campers to Flowerpot Island but warned that the boat might be canceled since the weather called for rain and high winds.

Designing

Iterative Design Strategies w/ Daniel Burka One of the breakfast webbies, Angie (I think, I didn’t get a business card) was excited about Daniel Burka’s “Iterative Design Strategies” talk (notes) so I thought I’d check it out. I had planned to go see Reg’s talk, but, while neither designer or manager, I’m closer to designer. Or at least I occasionally make a user interface that isn’t a command line.

Daniel’s talk was “I sat on the floor” crowded. I liked his case study of his redesign of the Digg comment UI, but otherwise I wasn’t the right audience. It was basically Agile for designers. A good idea, but not something I need. It is however the only talk I took a picture of.

Lunchtime networking

Lunch was notable for the company. I sat with some current/recently matriculated students: Julie, Andrey, Andrew & uhm… the tall woman with the blond hair whose name I have forgotten. Pete Forde from Unspace was also there facilitating the conversation and unashamedly flogging Ruby Fringe, which sounds interesting but is too expensive for me & too non-work related for my employer.

Implementing OAuth

My third session was Leah Culver’s “Implementing OAuth” (notes). Leah started with a review of OAuth (and the difference from OpenID), explained the protocol & showed the code. A fairly good talk, though again not directly related to me.

Some of the questions coming from the front seemed strangely pointed… perhaps beacuse they were being asked by Cal Henderson. The old “plant in the audience” trick. Very clever, Leah and Cal, very clever…

And finally, Mr. John Resig

Despite the rumors that John Resig’s jQuery talk (notes) was going to be introductory, I wanted to see him talk. Plus I’ve never used jQuery, so I was ready for an introduction.

Before the talk John got some water from our table (near the front). I talked to him briefly about processing.js, which I’ve been meaning to look at for online plotting.

His talk was a quick introduction to jQuery followed by some live examples of unobtrusive prototyping against live pages. jQuery looks as good as its reputation, I’ll be trying it out whenever I have a chance / excuse.

The end of the day

I kind of wanted to go to the afterparty so I could tell Avi I liked his talk. He was busy at lunch and the only other time I saw him was at the urinal, which seemed like an awkward time. I also wanted to make up for my lack of pictures by getting photos of all the presenters giving me bunny ears. Alas it turns out the after-party was a significant distance away. Instead, I tagged along with Julie, Andrew & Andrey for some pan-asian dinner at Spring Roll.

Dinner & conversation were both good.

Then I walked back to the car.

The drive north south

Google Map directions took me North on Spadina, which seemed more than a little suspicious. Eventually I turned around got on the Gardiner Expressway. It was about 7:30 and it would take another 3 hours to get to Tobermory where I may or may not get to ride a boat to Flowerpot Island. Given the chances & the weather I just took Gardiner to the QEW and headed south.

I stopped at a Tim Horton’s to pee and pick up a tea. I figured I’d need the caffeine later.

I stopped a second time at the US border crossing.

The border guard asked me a bunch of questions. He seemed especially interested in the fact that I was only in Canada for a day. Then he confiscated my contraband oranges and bumped me to 2nd level border check. I parked in the directed spot and went inside. Some border agents checked my license and passport and asked more questions. Then they went to search the car.

I was sitting in the waiting room when I realized I had a mystery porn in the trunk. I ran through a few nightmare scenarios where it was actually child porn or something. Who would believe I found it in a drawer in a hostel? Luckily the agents came back in and told me I was free to go.

The agent didn’t have a solid reason on why I was stopped. It was probably because I spent a single day in Canada and was crossing the border at night, but I was hoping it was something like “the agent saw your trunk full of perversion.” That would at least give me a funny story. As it is I was just left with a dull feeling of violation and powerlessness. How Kafkaesque.

I gave the DVD to Casey. It’s a Japanese porn. Nothing special, and certainly not worth the stress.

Final words

I suppose I should wrap up something about the conference and how good it was to meet new and interesting people. But really, my advice is to just leave porn in drawers.


On Java One and shark jumping

2008-05-08 / 12:29 / dave

After reading Tim Bray’s description of Java One, I’m even more un-interested in Java (which is not to say anything bad about Mr. Bray himself). Call me cynical, but when a company spends that much money to generate hype… well, shouldn’t people just use an environment because it works? Or do all languages do this? Have I been missing the annual C extravaganza?

Anyway, yet another sign. If it weren’t for Clojure I’d uninstall the JDK altogether.

In related conference news, I’ll be at MeshU 2008 in two weeks; hopefully followed by a stop at Five Fathoms.


Ah-hah! Of course recursion can create a dependence on the global namespace!

2008-04-29 / 16:44 / dave

This works because there is a global variable, fact, that has its value set to the value of the lambda expression. When the variable fact in the body of the function is evaluated to determine which function to invoke, the value is found in the global variable. In some sense using a global variable as a function name is unpleasant because it relies on a global and hence a vulnerable resource—the global variable space.

–Richard Gabriel, The Why of Y [PDF]

(emphasis added)

On reflection, “normal” recursion relying on the global namespace is obvious. So are the potential problems:

> (define fact (lambda (n) (if (< n 2) 1 (* n (fact (- n 1))))))
> (map fact '(0 1 2 3 4))
(1 1 2 6 24)
> (define fact2 fact)
> (map fact2 '(0 1 2 3 4))
(1 1 2 6 24)
> (set! fact (lambda (n) 1000))
> (map fact '(0 1 2 3 4))
(1000 1000 1000 1000 1000)
> (map fact2 '(0 1 2 3 4))
(1 1 2000 3000 4000)
>

Never really thought of it that way before.

That’s not the main point of the paper, of course. It’s really about the derivation of the oft-asked-about Y-Combinator.


Information economics

2008-04-11 / 16:01 / dave

(Here’s one from the vaults: I started writing this July 2007)

I like Reg, so I was surprised when I thought he wanted comments on his site instead of aggregators.

It turns out I misinterpreted his post. He responded to my comment:

…But yes, I do think comments on reddit and most especially links in social bookmarking sites break the web by placing them in someone’s proprietary database, instead of on the web itself…

But what happens if del.icio.us publishes a new EULA and shuts their API down? Suddenly, it’s as if all the links, all the intelligence, was locked in a box.

With “bloggers,” each individual has a lot of power over a very small part of the web, but no one entity has a lot of power over a lot of the web.

Social bookmarking sites concentrate that value in a few hands. You may not trust me. But you can trust bloggers in aggregate, and the web as a whole.

<3ing on Walmart

As long as marketing and advertising fund the web, information will be the currency (well, “attention” I guess, but information is the attractor). In an information economy, Reg is arguing against Walmart: why support a censor-loving union-busting monarchy instead of that quaint local shop?

Altruism is great, but sometimes Walmart is just easier. Gabe da Silveira nails it:

Regarding the concentration of power, that’s just an economic requirement. Most users can’t create their own websites, or run their own servers, much less write their own software.

Even if you can create your own website there are benefits to scale, not the least of which is PageRank. And used properly, an aggregator can raise all ships: the author reaches a wider audience, commenters get single sign-on and response tracking, and reddit gets content for their hungry eyeballs.

A third way

Unlike money, information is inexhaustible. Less pretentiously: why not copy the reddit comments onto your own site? Simply 1) query reddit for your stories URL 2) if found, screen-scrape comments and 3) add them to your own blog. Realistically: reddit has no API (despite the request), the HTML isn’t easily scrapable and, of course, there could–IANAL–be legal concerns.

But not all site are the same: del.icio.us and digg both have API’s and Flickr has made switching services easier by granting API keys to its competitors.

Reg points out that an API can be nullified with the flick of an EULA. A site could also disable their API or start blocking IP’s, but it’s unlikely. Economics cuts both ways: large sites grow larger by using their scale to provide value; large sites become small sites by pissing off their customers. The easiest way to piss customers is by having an inferior product. Open data isn’t as important to most people, but it will be once enough people get burned.

Interoperability is important to a specific group, namely developers. Check the furor over AppEngine. The business case for an API is that a thriving ecosystem provides the best sort of lock-in: happy customers. If restrictive policies drive away the builders of said ecosystem, why bother having an API at all? (Counterpoint: the internet swelled over the idea of coding to a closed platform. I wonder what will happen when Android phones show up?)

A monopoly would change everything. This is both worrying and… er, not worrying: closed data could be the new lock-in or maybe the internet’s low barrier to entry will keep facilitating innovation (and in turn defection).

Vote with your bits

If you care about open data there are several things you can do. In roughly descending order of difficulty: pass an open-data law, write data liberation programs (like the reddit comment-crawler) or use the meme-sharing power of the internet to organize (see: Creative Labs).

Those all require skill, or at least initiative. At the bottom of the hierarchy is the simplest: vote with your bits. In this light, Reg’s post (and those of the EFF, Larry Lessig, Cory Doctorow, Mark Pilgrim and others) form like Voltron into a digital Ralph Nader, educating the online community so we can all invest our information wisely.


Are your comments getting borked?

2008-04-11 / 14:58 / dave

Rob tried to comment got both a rejection by WP-IDS and a nice PHP error message about missing paths. Woo boy.

The error was probably caused by a configuration error that I think I fixed. But I’ve got no idea why the comment was rejected in the first place.

If the same thing happens to me let me know and I’ll try to fix things.


TDD skips the idea phase

2008-04-11 / 14:53 / dave

One of the parts I liked about The Myths of Innovation (full review) was the simple description of brainstorming:

  1. Facts
  2. Ideas
  3. Solutions

I’ve previously had some issues with TDD, and viewed in Scott’s three steps I realize it’s simply: TDD skips the idea phase.

The facts are the problem you’re trying to solve, and the solution is the end product. I guess the ideas are supposed to be the the tests & code, but that just doesn’t work for me. Maybe I need nimbler fingers but I suspect that the real problem is that code is too limiting. By nature, programming distills an abstract idea into instructions so simple that even the world’s fastest idiot–a computer–can understand them. This clear, orderly expression of ideas is too limiting for the free association that generates new ideas.

Or maybe it means that I’m not yet fluent in my language (Python) or the underlying language of programming (architectural decisions, algorithm complexity, etc.)? Perhaps being a master programming is a fluency such that it’s faster to sketch in Emacs than on paper; familiarity has certainly cut down on my need for crutches. Master level fluency also explains both the talented programmer’s obsessive devotion to their chosen language/environment and love of learning new languages. The first aids expression, like an artists well-lit studio or a gamer’s abbreviations and slang. The second expands the range of expression, like an artist trying a new medium or a gamer going outside.

But if expressing ideas in TDD requires fluency, then its purest “test&code” implementation is only useful for master level programmers. Is this an example of how agile is only for elites? (more “agile only works for elites” links welcome, I know there are more but couldn’t find them)


So what PHP security hole did that open up?

2008-04-11 / 01:56 / dave

To make playing around with Wordpress easier, I wanted to set-up a local test environment. Since Tim Altman has renewed my quest to get PHP authentication working on DreamHost, I need to run PHP via CGI.

Whew-ee.

The PHP Windows installer added some lines to httpd.conf:

ScriptAlias /php/ "c:/php/"
Action application/x-httpd-php "/php/php-cgi.exe"

After installation I could only run .php files from cgi-bin/ and only by using #!. The PHP install.txt lead me to add

AddType application/x-httpd-php .php

Which didn’t help. Luckily Apache’s logs/error.log sensibly stated

...[error] [client 127.0.0.1] client denied by server configuration: C:/php/

So now I’ve got:

<Directory "C:/php/">
    AllowOverride None
    Options None
    Order deny,allow
    Allow from all
</Directory>
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"

Which works, but at the expense of allowing access to the C:/php directory. What kind of security holes does that open? I poked around in the browser and couldn’t access any of the files. Plus the Apache user also doesn’t have write access to the directory and I only start httpd right before testing. Still…

White hats: advice, please.

Black hats: mercy, please.


Scott Berkun: writes ok, talks real good

2008-04-01 / 13:54 / dave

Scott Berkun talking at CMUNot only was I lucky enough to see Scott Berkun on his recent trip to Pittsburgh (easter egg: can you find me in the–blatantly hotlinked–picture?), I got there early enough to get a free copy of his book.

The book is ok.

It’s easy to read, well researched and visually beautiful. Beyond that, I didn’t get that much out of it. Many of the lessons–innovation is the result of hard work, you seldom know what you’ll end up with, bad ideas sometimes win, human skills are important, etc.–are things I’ve already internalized. The description of the steps of brainstorming–facts, ideas, solutions–and the role of soft skills stimulated some ideas on agile development and management, respectively (more on those in another post).

The writing is entertaining enough: Berkun’s style is casual and the stories are well integrated. His sense of humor runs a little more Dave Barry–aka non sequitur–than I prefer. YMMV.

According to the dust jacket and amazon my views are in the minority. I suspect this is due to 1) the audience and 2) Juno scoring.

As a 101, the book works well. It might also be useful for those from the “traditional management” or “wait for a lightning strike” school of innovation. I’m neither of these, though I can think of a few people who would benefit from a copy.

I suspect some people review the book like Juno: it’s not deep, but who cares? It’s entertaining. It’s far from onerous: at 150 pages and with a tone like listening to your well-read friend chat, the book is easily read in a day. And the “anyone can innovate, you just have to go out there and try!” message doesn’t hurt either.

This isn’t to discount these reviews or people who liked the book. As with the humor, YMMV.

Anyway, I’m glad I read the book, but it’s probably not one that will live on my bookshelf. That’s strictly reserved for books that make me look real smart.

But as a speaker…

…Berkun is very good. He is energetic and entertaining. He interacts with the audience. He knows what the hell he’s talking about. The ideas–as in the book–aren’t terribly deep, but hey, it’s an hour long talks. If you want entertaining and deep you’re basically limited to Simon Peyton Jones. He also had about 40 minutes of Q&A which provided some of the best take-aways.

Recommended.


Fixing a glitch in wp-validator

2008-03-16 / 23:17 / dave

After a missing </span> tag shrunk my sidebar text to an unreadable size (in IE only, which meant I didn’t realize it for a few days), I installed Rudd-O’s wp-validator Wordpress plugin. It’s a pretty nice plug-in: it validates your post when saving and pops-up a message on the editing page.

There are a few catches. It relies on xmllint and/or tidy, so those have to be installed on your hosting provider (mine has tidy). The bulk mode (check all existing posts) said my posts were all fine, which turned out not to be true when editing some of them by hand. And finally, some posts refused to open for editing: the page would just keep on loading.

The PHP opens tidy as a sub-process and pipes in the post content. I started looking for a time-out option in proc_open but then saw this comment. Adding stream_set_blocking($pipes[2], 0); seemed to solve the problem. I tested by opening one of the posts that formerly hung. I then triggered an xhtml error by inserting a literal &, so the change doesn’t disable checking.

Unfortunately I don’t completely understand why the code is blocking. I ran both a hanging and a successful post through tidy in the command shell and they ran fine. Since I didn’t understand what exactly was happening, I only added the change to the tidy section and not to the function that runs xmllint.

Anyway, here’s the patch and the complete file (right click and “save-as”, if you click you’ll get a PHP error).


Meta: category clean-up

2008-03-16 / 17:59 / dave

Since Wordpress 2.3 added support for tags, I’ve moved my old categories to tags and created some new ones:

Cycling
Info about bikes
LOTD
Link of the day
Misc
Everything else
Music
Chunes
Programming
Computer related

Categories will be stable and let you filter down to the posts you care about. So if you find yourself saying “cygwho?”, maybe Programming isn’t for you.

The plan is to add some display of tags later. But man, tag clouds sure are ugly.

Implementation

Moving the categories around wasn’t too bad using the built-in cat2tag and Rob Miller’s Batch Categories plugin.


Cygwin quickie: opening files with cygstart.exe

2008-03-11 / 10:23 / dave

Cygwin’s cygstart.exe is amazing. It opens data files as though you clicked on them in Windows Explorer. Best of all this including folders: cygstart mydir opens up a view of the directory. I’ve got mine aliased (actually a symbolic link so I can use it from eshell) to op. I started off with it aliased to open but I used it enough that the 2 keystrokes were worth it.

$ ln -s /usr/bin/cygstart.exe ~/bin/op

Meta update: no more LOTD on the front page

2008-03-10 / 06:12 / dave

Are you tired of all the damn LOTD posts? Well, fret no more gentle readers, so am I. Not tired enough to stop writing them, just tired enough to move them off the front page. LOTD posts will no longer show up on the front page or in the main Atom feed. You can instead find them here:

I’ll update the front page later to make the links obvious.

How’d you do it?

I used Wordpress’s query_posts command to filter the “lotd” category out of the main page. This required is_home on the HTML and some messing with categories in the Atom feed.

index.php:

<!-- Remove LOTD, also in wp-includes -->
<?php
   if (is_home()) {
      query_posts("cat=-7");
   }
?>
<!-- elided -->
      <?php while (have_posts()) : the_post(); ?>

feed-atom.php:

    <?php
      if (!$cat) {
        query_posts("cat=-7");
      }
    ?>
	<?php while (have_posts()) : the_post(); ?>

Alternates

Reg ues del.icio.us. That’s probably a better way. One of the benefits of LOTD posts are that I often go back and use them as references. Why not just store them in a link aggregator with an appropriate tag (e.g. “ref”)? I’ll play with the current system for awhile and see how it feels.


Tables are the new black?

2008-03-07 / 18:01 / dave

In early January, Zed Shaw redesigned his site with tables (but where are the links from the main page to the individual posts? Makes linking a bit un-fun). Now Kevin Yank says Table-Based Layout Is The Next Big Thing.

Some of the early comments on Yank’s article seem to be, as Zed might say, lemmings following that “Zen CSS bullshit”: they fault Yank’s example for being non-semantic. But if you check out his source, it looks like any other sexy mark-up:

  <body>
    <div id="header">
      <h1>Page header</h1>
      <p id="skipto">

That’s just a snippet, but you get the idea. No <table> to be seen. Instead, he uses (exceptionally simple) CSS to get it to render like a table.

On the other hand, Zed’s entire page is one giant table:

  <table id="fuckyourcssbitches" cellspacing="0" cellpadding="0">
    <tr>
      <td id="leftcolumn" valign="top" rowspan="2">

“Oh no” you think “a table!” But the markup is semantic; check the id="leftcolumn" attribute on the <td>. If you can’t figure out what that column represents, well… the problem is probably not the HTML. (and if you can’t figure out his view on CSS based on the id of the table…)

There is one problem with a table layout, though: adding actual tables. Putting an id on your main “page layout” table allows you to do special styling. This is what Zed does in his css:

#fuckyourcssbitches {
 padding: 0px;
 margin: 0px;
 border-spacing: 0px;
 width: 100%;
}

But what if you want to style an actual table of data? If you don’t write your CSS selector write, you’ll end up with your table styling affecting everything on your page.

On the other hand, using an HTML table has one huge advantage over Yank’s CSS table: it works. Yank’s article is specifically about how this will be viable once we get to IE8. 8. Doh!

What to do, what to do

If you want working HTML-tale-less layout now, you can do a few things: 1) Use one of the many tutorials or 2) use Blueprint CSS. Blueprint makes it easy to “design to the grid” (where “grid” is basically a designers word for “table”). You just have to include blueprint’s CSS file and add some classes to your source.

As I said before, the one problem I have with Blueprint is that, like using HTML tables, it injects some style information into your HTML. You have to add things like class="column span-20 last" in your markup. I’ve read some debate back and forth over whether this is a problem or not, but as a user of Blueprint I can say that it is for me. If I change a column position I have to change markup on every similarly formatted page. This kind of skips the whole beauty of changing a single CSS file and having everything change consistently.

Anyway, I’m using Blueprint and probably won’t change anytime soon. I am impressed with Yank’s CSS table layout–it’s just so simple–but given that it doesn’t work in IE it’s pretty much a non-starter. If anything, this points out the failings of CSS and browser implementations in general. Let’s hope CSS 3 and future browsers improve things.


Getting things done with Agile and pens

2008-03-07 / 16:42 / dave

Maybe when pair programming works it works because when you schedule a pair programming session with your buddy, you force each other to get started.
– Joel Spolsky Fire And Motion

Agile is all about

  1. Just get started
  2. Build for change

Joel says pair programming encourages the former. Test driven development is about the latter: unit tests make it easier to change your code in the future. If you always write tests first, you’ll have 100% coverage. Since you’re writing tests first, you’re also designing the interface you’d like to use. Finally, since you want to test components in isolation, TDD promotes loosely coupled code.

Brilliant! Well, when it works.

For awhile I was doing (fairly) strict TDD. I’d immediately write a test, watch it fail, then code until it passed. But sometimes, 2 hours later, I’d be down a rat hole. I’d coded myself into an interface dead end; all I could do was back up, burning the trusses on the way out. Occasionally I’d find that I’d gone down a rat hole in another house and was solving the completely wrong problem. Or, worst of all, that there was no problem in the first place. Like I was standing right next to a solution but said “Hey, let me go dig some holes in the basement of that haunted house in the middle of the ghetto! What could go wrong?” (answer: lots)

Clearly something was not working. So I grabbed a new tool: a pen.

Now I start out with a pad of paper covered with notes and arrows, sort of a verbose mind map. Writing things down organizes my thoughts so that I start coding with a clear idea of what the final code will look like. It changes along the way, of course, but I don’t have so many “oh shit” moments.

2 types of agile

I’m not saying you should go get make yourself a nice shiny pen, just that it worked for me. This is agile, or at least the small ‘a’ kind. I still think big ‘A’ Agile is the best methodology going, but only if you avoid getting ideological.

In other words, feel free to abandon “Agile”… but “agile” is forever.

(Just to be clear, this distinction has been pointed out by many people in many places, I just don’t have links.)


The Python web framework wars are over… NOT

2008-03-05 / 02:24 / dave

I thought Rails was supposed to push the Pythonistas to choose one web-framework to guide them? Judging from these comments, that’s still a ways off.


Computer programs are art, mine will be on display the 29th

2008-02-22 / 14:15 / dave

Computer programming is an art, which is good because that’s my fun-a-day art project. Come see some Project Euler solutions.

details:

Thursday, February 21, 2008
art show details

friday, february 29th (leap day!)
7pm, free!

fun a day art show

fun a day was a project that took place in january of 2008 where people were encouraged to pick a project and do it every day for the entire month and document it. now it’s time to display and celebrate everyone’s work.

some of the projects on display include: polaroid/haiku a day, quilt square a day, computer program a day, mini movie a day, record review a day, tie a fly a day, learn how to roll a cigarette a day, favorite song a day, and more

please come and check us out at:
the spare room
3923 1/2 mintwood street
lawrenceville


On writing well (on the web)

2008-02-20 / 16:43 / dave

Steve Yegge’s posts always generate discussion. Unfortunately a lot of it looks like this:

he’s still a 2yo noob at writing, pointless overexplanation of every detail of his thought process. someday he’ll learn how adults write.

– gsw07a, comment on Reddit

I don’t know how many of these comments Steve endures, but apparently enough that he wrote an article about why his long posts are popular. Conclusion: 1) because he’s a rebel and 2) it flushes your cache. Interesting, but I think he’s missing a key point: he’s entertaining. I mean “we have the Quality With a Name — namely, Suckiness.”? That’s just golden.

Most complaints point out that he could say the same thing in fewer words. I don’t doubt he could convey the same message–say, “static typing is dumb”–in fewer characters, but it wouldn’t have the same voice. Stevey is in no rush to get to the end and has a penchance for exaggeration. It’s like talking about programming with your friends. At a bar. If he were to have 15 pages of, say:

Static typing is inferior to dynamic typing for the following reasons:
1. Static typing requires system restart to change types
2. Static requires up-front design to avoid conflicting with the type-checker
3. Static typing is not a replacement for unit testing

It would be like having a discussion with that guy at work that no one really likes. That guy doesn’t have any friends which is why he spends his weekends memorizing the digits of pi.

Don’t be that guy

It’s easy to read blog posts and evaluate them as though they are computer programs[1]. They accomplish a task: teaching you something new. If that task can be accomplished in fewer tokens… great! Except reducing them to, say “don’t use static typing” is reductio ad absurdum. Unless you’re googling for “should I use static typing” this is pretty useless; it’s a simple recipe that teaches you nothing. Good teachers move beyond simple instruction to providing insight.

Great teachers are also entertaining. But being entertaining is hard. Thinking that you’re entertaining is often inversely correlated with success[2]. There’s also a thin line between entertaining and annoying, so if your style has a high variance you’re likely to just end up pissing-off a bunch of people.

The classic way to entertain with text is to be a good writer. Unfortunately, that’s hard to do: it takes lots of time to become a good writer and even more time to edit each work. And failing at writing can be worse than not trying: you end up boring and pompous.

The easy fall back is the one Steve adopts: use your own voice. At the very least it makes your writing authentic.

[1]: Well, if you’re a computer person.
[2]: Which explains this blog.

A tidbit on writing, the internet, and Paul Graham

Paul Graham seems to think his essays are delivered as informally as possible which makes me think he doesn’t read many other blogs and has never, ever been to something awful.


Programming with the old guard

2008-02-17 / 21:57 / dave

I’ve finished going through all the OOPSLA 2007 podcasts, and was struck by the keynotes from a pair of CS classics. David Parnas talked about the need for documentation while Frederick Brooks talked about collaboration and conceptual integrity. Parnas’ talk is clearly against the current hip “we don’t document because we write clean code” meme. Brooks’ love of conceptually integrity is uncontroversial. But he reiterates an idea he mentions in The Mythical Man Month, a development team with a clear leader, which is against the agile idea of a flat team that delegates design to individual coders (with design reviews, etc. for quality control).

It’s interesting, and kind of nice, hearing people I respect diss a development methodology I enjoy. My first reaction was “what?!”, which was a clear sign that I hadn’t been thinking critically about Agile for awhile. I’m also curious how their views are due to their age, or more specifically due to their history. Parnas’ quotes frequently from his work on airplanes for the Navy and the Airforce while Brooks is known for IBM’s OS/360. Both are the massive systems that are difficult–well, or incredibly easy, depending on who you ask–with Agile. Likewise, while both Parnas and Barnes state that they’re anti-waterfall, I wonder how they would imagine the development of something like a 37 Signals web app.

And then there’s John McCarthy…

…whose discussion of Elephant 2000 was complex enough that the only question was of the “I’m smart and know of this related research… do you?” format. In the spare time left over he went through a history of Lisp. Everyone loved that part.

So is John McCarthy bad at explaining things, or is he still so far ahead of his time that people will be talking about Elephant at OOPSLA 2057?


Avoiding trolls

2008-02-17 / 21:17 / dave

Paul Graham has some thoughts on trolls. I agree with his explanation of why people troll (also check the original comment thread), but think he might be over-selling the future of News.YC. He thinks they don’t have many trolls because

  1. News.YC users don’t tolerate trolling
  2. Votes on comments affect your karma
  3. They’re small

It’s nice to think that #1–the noble intention of the users–somehow matters, but in my experience it doesn’t. I’m just a lurker (check that bangin’ karma!), but I don’t think there is anything particularly anti-troll about the News.YC’s users. I’ve traveled from Slashdot to Digg to reddit and can say that none of them seemed troll-friendly. For a time, most of reddit’s stories seemed to be about how Digg was crawling with trolls while reddit was just peachy. Three months later…

Having comments affecting your karma (#2) seems like a good idea. It emphasizes good discussion rather than skill at hunting down pro Ron Paul stories or speed at posting xkcd’s latest. Of course, this only matters if trolls care about karma. Someone with nothing better to do than post drivel in forums probably doesn’t mind burning down their karma and starting a new account. It also puts faith in the wisdom of the crowds. Paul has observed that News.YC’s algorithm hasn’t resulted in the down-voting of unpopular ideas. Part of that is probably based on another part of the algorithm: only users with karma of 20 or greater can down-vote. This leaves the judgement in the hands of the “better” users.

Rapid growth makes companies stupid. Part of this is probably bureaucratic drag, but there is also the failure of hiring: B players hire C players. Similarly, as they grow, forums attract less concerned users. For most forums, “hiring” is “whomever can fill out a sign-up form”. News.YC’s 20-karma rule is an improvement, but the ability for anyone to up-vote ensures that some B’s and C’s will make it to 20-karma status.

All of this makes me think that the main effect is due to size (#3).

All is not lost (or “So, you want a forum that doesn’t suck”)

If you believe John Gabriel’s Greater Internet FuFartwad Theory [NSFW, language], you can avoid trolls by:

  1. Having a small audience
  2. Disallowing anonymity
  3. Attracting better than average users

The best example I know of is the most excellent Lambda: the Ultimate (L:tU). It’s a small group of extremely bright people. Anonymity is discouraged, so the majority of contributors use their real names and provide links back to their real web sites. Karma therefore is not a number in the upper-right hand corner, it’s public opinion of your intelligence. This seems to dissuade trolls. There are still minor (and intelligent) flame wars and joke comments, but overall the discussion is good. Real good. Other special purpose sites, such as the Clojure group or Paul’s own Arc forums are examples where the topic has refined the user base.

Small size isn’t for everyone, however. If you’re making money from ads (and want to drive a Jaguar), you probably want as large an audience as possible; if you’re selling your site on conversation you need a critical mass before it’s worthwhile. This makes growth a delicate game: too many users and your Digg, too few and you’re… well, you’re this blog. Though I do appreciate my audience: you are the four smartest people I know.

A strong leader

News.YC has another thing going for it: Paul Graham. He has a strong influence: his posts are always up-voted, his comments sway the conversation, and, to be honest, more than a few users are there because they respect what he’s done. Similarly Ehud Lamm (L:tU user #1 in case you mised it in the URL) is an active presence on L:tU and occasionally reminds users of the rules. Paul and Ehud are sharks in the water: their presence reminds posters that they are being watched. This is the intended effect of the News.YC’s 20-karma rule, just with way less scary sharks.

On the other hand, CmdrTaco was always present on Slashdot, and that didn’t stop it’s slide into mediocrity. That may have something to do with the tone. CmdTaco, god love him, is not the most serious cat. Even the name Slashdot was a joke. By contrast Paul and Ehud, while not crumudgeons, get down to business.

Bringing the power back to the (smart) people

The saying about B players hiring C players supposedly came from Apple. Apple is a good example of a company that is large but not stupid (anymore). This non-stupidity has a name: Steve Jobs. He’s a strong leader if ever there was one. But relying on a single leader also has it’s flaws. Do you need one?

Another company surviving incredible growth is Google. Although Larry and Sergi are smart guys, they seem more hands-off than Jobs. According to those at Google, it’s a very flat hierarchy, Google is relying on the genius of it’s crowds. And the crowd is pretty genius, thanks to Apple’s advice: Google’s interviews are tough. A flat hierarchy also makes it harder to hide in the corner of an org chart. If you’re not producing, people will know (this is also the case at small companies: everyone knows each other, so your stinky ideas are easily uncovered).

If you meet an idiot, don’t let him tell you that you suck

Can Google’s experience be applied to forums? All you need is a way to eliminate anonymity and rareify your users. I propose the answer is authorship.

For awhile, several bathrooms I used had books of zen sayings. One was something like

If you meet someone who is not a samurai, do not show him your sword.

My first read was “don’t cut up unarmed civilians,” which is certainly good advice. My second take was “someone who isn’t a samurai will not appreciate the quality of your sword.”

Trolls don’t contributed while telling everyone else how much they suck. Force people to contribute before they can comment (or vote), and maybe the problem goes away. Contributions could be a users own submitted blog posts or articles written on the site. This puts commenter’s skin in the game: they are creating an environment for evaluating their own work. It also makes for a very immediate form of karma: don’t piss off the people who are judging you.

This also effectively eliminates anonymity. I don’t mean anonymity as in hiding your “real-world” identity, but hiding your reputation behind a disposable identity. A non-disposable pseudonym works well, see chromatic for a good example. Combined with a karma system, the system could even allow for cloaked comments: a user posts sensitive items anonymously but the system applies moderation karma against their real identity. A downside is that cloaking is not legally anonymous: identity is discoverable via subpoena.

Another lesson from Google is it’s secret sauce: PageRank. When I started this post, I was mainly thinking of PageRank in terms of it’s technical implementation: high karma users votes carry more weight, etc. But it sounds like Slashdot already approximates that. If there are lessons in PageRank, they are 1) people try to game the system and 2) you’re going to need to tweak your algorithm.

So what about News.YC?

Oh, right.

I think News.YC’s best bet is simple: don’t try to grow.

If growth is inevitable, surviving becomes a matter of constant evolution: can your “algorithm” (which might be more social, such as disallowing anonymity) outpace the trolls? Karma from comments and a 20-karma minimum to down-vote are good examples. There is a small risk changes will alienate old users (as in “my karma went from 4 billion down to just ‘Excellent’… WTF?”), but this is outweighted by the positive effects: better content and that warm fuzzy feeling of knowing that someone is working hard to keep things tidy.

It’d be nice if such a system could remain open to all contributions. My fear is that it cannot, and that requiring contribution (as described above) will be required. But this is just another option to try if quality declines.

So I don’t think Paul’s stated reasons (anti-troll users and current karma system) are enough, but I do think it’s possible. And success will rely on rapid iteration so–given Paul’s methodology–I’m hopeful.


Planned outage

2008-02-07 / 12:12 / dave

Due to continued space and power constraints in our primary data center,
we will be moving the “randy” cluster to one of our newer data centers.
This move will begin Friday, February 8, at 10PM PST, and is expected to
last up to 8 hours, until Saturday, February 9, 6AM PST. All web servers,
mail servers, file servers, and MySQL servers in the randy cluster will be
unreachable during this time.

Fear not, loyal readers! It is only 8 hours.