Zen-chan (smoothed)

ICFP 2008 #2

Yay! Geometric stuff!

Yay! Book got signed!

Boo! Monitor died last night.

Alright, time to stop for the night. This problem is interesting. At first it looked a lot easier than last year's problem. Certainly the problem description seems much shorter. But on thinking about it, there's a lot of interesting potential gotchas. Once I realized this, I decided to adopt my usual C++ approach though I'd thought of using Python at first. I'm not sure how far I'll get on this by working alone -- I haven't even started in on the networking code yet or the low level point A to B navigation. But I seem to be well on my way to having a fairly cool exploration and static path planning module to eventually direct that A-to-B code. Fast spatial data structures I can do! :-)
Zen-chan (smoothed)

ICFP 2008 #1 - The Live CD

Yay for fast network connections! I've now got a burnt copy of the official ICFP LiveCD in my hot little hands.

Here's hoping that it's an interesting problem and one that's soloable since it looks like I'll be working alone.

In an interesting case of timing, this guy will be visiting tomorrow. I'm going to have to see if I can get him to sign my copy of his book.
Zen-chan (smoothed)

The Eleventh ICFP Programming Contest

A blog entry linked from proggit reminded me that the ICFP programming contest is coming up in about a month. Last year, I tried it solo but I think it would be much more fun to compete on a team together this year. (It also helps that I don't have a fixed work schedule this summer and that that weekend is in a dead-zone for paper deadlines.)

So anyway, this is an open invitation to anyone who reads this to think about teaming up.

Zen-chan (smoothed)

How not to annoy me when I review your C.S. paper.

I've been meaning to write this post for a good long while. Last week finally triggered it. It's partly a rant about the presentation in some of the papers that I had to review then and partly a how-to guide that codifies all of the little rules-of-thumb that I strive to follow when writing my own papers. They're basically cosmetic so I try not to let them affect my reviews too much. I won't reject an otherwise solid paper just because the presentation is a bit off. But it might annoy me into being a bit more critical. So without further ado, Collapse )
  • Current Music
    Steeleye Span "Well Done Liar"
Zen-chan (smoothed)

The Billionth Fibonacci Number

A few weeks ago, lindseykuper wrote a post about calculating large Fibonacci numbers. Never one to resist a program challenge, I really wanted to try my hand at it and see if I could write an even faster program for calculating Fibonacci numbers. At the time, I was rather busy working on a paper but that's done now, so I gave it a shot today. Collapse )
  • Current Mood
    content content
Zen-chan (smoothed)

I dub thee... "triffid."

It's taken some thought, but I've decided that "triffid" (24" iMac, 2.8GHz Core 2 Duo, 4GB ram, 500GB HD) shall be the name of the successor to "godzilla" (Dual 2.5GHz G5 Mac tower, 2GB ram, 250GB HD, 23" Apple Cinema) as my school machine.  Other contenders for the name were "dalek" and "chupacabra".

Past and present machine names in chronological order:

  • boojum: 233MHz P2 desktop, main college machine

  • grue: 100MHz P1 desktop, toy linux server

  • jabberwock: 800MHz P3 desktop, first work machine

  • wumpus: 1.8GHz P3 laptop, second work machine

  • trogdor: 2.4GHz P4-M laptop (Dell Inspiron 8500), third work machine

  • moogle: 3.06GHz P4 Northwood desktop (Dell Dimension XPS Gen 3), old home desktop

  • domokun: 624MHz XScale Pocket PC (Dell Axim x30)

  • godzilla: 2.5GHz dual-G5 Mac tower, first school machine

  • sphinx: 1.8GHz Core 2 Duo, 17" iMac ([info]sonetka's current [edit: now old] machine and choice of name)

In other news, my SIGGRAPH paper is done and off to the committee.  Much thanks to [info]tollingbell for his assistance with writing it up and to [info]sonetka for putting up with the insanity that a paper deadline involves.  Wish us luck!

Update: Newer machines since then are...

  • triffid: 24" iMac, 2.8GHz Core 2 Duo, second school machine

  • basilisk: Linksys WRT-54G, old router

  • psammead: 1.6 GHz Atom netbook, old home portable (2009-2016)

  • rusalka: 2.833 GHz dual-Xeon E5440, old work machine (2009-2012)

  • huginn: 3.07 GHz Core i7-950, current home desktop

  • shoggoth: 2.80 GHz dual-Xeon X5660 (HP z800), old work machine (2012-2016)

  • cetus: 2.20GHz dual-Xeon E5-2699 v4, current work machine

  • chupacabra: current router

  • amphista: Surface Pro 4, i5 / 8GB / 256GB, current home portable

  • Current Mood
    calm calm
Zen-chan (smoothed)

Busy Computers Make Me Happy.

I love it when I get some kind of metaprogramming tool or a brute force search program up and running. Then I can just send it off to a remote machine somewhere that has a few trillion spare cycles, fire it up in a screen session and go off to play some video games.

Right now, my school machine happens to be off crunching through a few million FFTs in a brute force search for some filter parameters. There's nothing quite like making the machine do all the hard work.
  • Current Music
    OCRemix: Chrono Cross Time's New Scar
Zen-chan (smoothed)


/* And then Little Cat A
 * Took the hat off HIS head.
 * "It is good I have some one
 * To help ME," he said.
 * "This is Little Cat B.
 * And I keep him about,
 * And when I need help
 * Then I let him come out."
 * And then B said,
 * "I think we need Little Cat C."
 *     -- "The Cat in the Hat Comes Back"  Dr. Seuss
void little_cat(
    const char letter )
    if ( letter == 'Z' )
        little_cat( letter + 1 );
If I ever end up as a tenured professor teaching first year CS, I'm going to put "The Cat in the Hat Comes Back" on the recommend reading list. I'd noticed a couple of weeks ago that the "Little Cats" stored under the Cat's hat were an excellent example of recursion, with Little Cat Z using Voom providing the base case. Also that it's tail recursive (as it should be when cats are involved). This morning while reading it once more to Daniel I noticed that the first half of the book illustrates iteration, too, with the cat transferring the spot from place to place.
  • Current Music
    Steeleye Span - King Henry
Zen-chan (smoothed)

On the Naming of Variables

Sometimes I hate trying to name things in my programs. I work hard to try to come up with really descriptive, clear, standardized names since I think that it makes the programs much easier to understand. My programs may be a bit more verbose than some but they also tend to read pretty well. Besides, long names are why we have M-/ in Emacs.

Sometimes the right name is immediately apparent and it just jumps out and writes itself into the code. Other times, it's rather difficult. I know the Extreme Programming folks talk about finding metaphors as descriptions for what a program is supposed to do. Admittedly naming something in a program is pretty much a matter of finding a metaphor for that entity. But it feels like sometimes, even when you know what the metaphor for something should be, it still doesn't quite feel right as a name. I think sometimes there's more overlap between writing good prose and writing good code than we programmers will admit. In both cases just finding the right word can be a challenging struggle.

This evening I'd planned to do some refactoring in my renderer and merge a pair of classes together. I'm happy with what I plan to call the new class but was stopped in my tracks trying to thing of a name by which the references to the instances should be propagated around. Oh well, I'd rather take a little more time to think it through and get it right.
  • Current Music
    Dwelling of Duels: Reign of the Mana Sword
Zen-chan (smoothed)


I suppose I really ought to actually start posting here, rather than using this account simply for lurking. So with that I'll offer a few small tidbits from the last few days.

I've been doing CS for too long...
Stopping by another grad lab today I noticed a table with a large puzzle showing map of the world. It was probably a 1500-piece puzzle at least, given the area that the border marked off relative to the size of the pieces. So what was the first thing that popped into my head? "Ooh, that looks nice"? Nope. It was "Wait a minute! The complexity of puzzles is quadratic with the number of pieces, not linear!" I was immediately horrified that the thought had even occurred.

On asserts
I was reminded again this weekend why I really ought to be using assert() in my code more. I spent some time trying to track down the cause of spurious bright pixels from one of the particularly nasty-to-code BRDFs in my renderer and found that the BRDF was fine. It was that the code for the sphere primitive which should have been returning a unit-length normal vector was returning one with length three or so. The normal was found by subtracting the sphere's center from intersection point and dividing that by the radius. This works pretty well as long as the intersection point was actually on the sphere, which you'd expect by definition. But once every now and then it snagged on some numerical instability and the computation blew up. This of course broke all sorts of downstream assumptions in my code. Normally I'm pretty at keeping track of all sorts of dependent assumptions like this but every now and then something goes wrong. Using assert() everywhere to sanity check these assumptions would have saved me a few hours. Lesson learned. I'm thinking I might go on an assert()-adding spree soon.

Copy-and-paste code checking
Copy-and-paste code is one of those programming evils that we all preach against and we all do. Yesterday I was doing some pair programming with another guy driving and he copy-and-pasted a line for one component of a vector computation and then started changing and x to y and z respectively. Except that he missed the z and made it a y too. I called him on it and he fixed it, but it got me thinking. It'd be nice if we as programmers could admit that copy-and-paste is going to happen and stop simply chastising each other for the inevitable errors. There are tools for checking other kinds of errors, so why not something to check for copy-and-paste errors? I envision a tool that would do something like a hierarchical diff on the parse tree of the source, looking for adjacent parallel structures that differ by just a few characters. When it finds them, it would look at the parts that differ to see if they form a recognizable pattern. If it sees a pattern like "x, y, z" when it's seen the "x, y, z" pattern in 99 other places it's probably okay. If it sees a pattern like "0, 1, 2" or "1, 3, 5" where there's a linear increment, then it's probably okay. But if it see something like "x, y, y" it could spit out a warning saying, "Hey, dufus, did you really mean that?" It'd be tricky to implement and would probably need a flexible system of heuristics for pattern matching, but it'd sure be nice.
  • Current Music
    Orchestral Game Concert V: Meridian Child (SoM2)