Reading the PHP documentation has convinced me (again) of what a mind-bogglingly broken language this is. Quickly, see if you can predict this behavior:

<?php echo "This is the integer literal octal 010: " . 010 . "\n\n"; $things = array( "The 0th element", "The 1st element", "The 2nd element", "The 3rd element", "The 4th element", "The 5th element", "The 6th element", "The 7th element", "The 8th element", "8" => "The element indexed by '8'", "foo" => "The element indexed by 'foo'", "010" => "The element indexed by '010'" ); // The string index "8" clobbered the integer index 8. // But the string index "010" didn't... echo "Now check out what PHP thinks the array is..."; print_r ($things); echo "\n\n"; // As expected echo "\$things[0]: $things[0]\n"; echo "\$things[1]: $things[1]\n"; // Okay, so strings are interpreted as integers sometimes... echo "\$things[\"0\"]: " . $things["0"] . "\n"; // Ah, now things become strange. This integer key gets the string "8" instead. echo "\$things[8]: $things[8]\n"; // This should refer to the 8th element, but it gets converted to an integer by // the preprocessor, then to a string, where it matches the clobbered 8th // element... echo "\$things[010]: " . $things[010] . "\n"; // This string key returns the expected "8" element... echo "\$things[\"8\"]: " . $things["8"] . "\n"; // But this string octal key gets the "010" key as expected. Note that it // *doesn't* get the integer 8, as you might expect from $things["0"] echo "\$things[\"010\"]: " . $things["010"] . "\n"; echo "\n"; ?>

Here’s the output (PHP 5.2.6-3ubuntu4.1):

Continue reading (415 words)

It's midnight, and the car is almost packed. All our stuff in one little minivan, moving back to the west coast! Oh man it's exciting! Should be there in a little over a week.

I love hard science fiction. Actually all science fiction–Grace and I bonded over our love of the ridiculously cheesy Sarah Connor Chronicles this past year–but I remain fascinated by the darkened, measured futurism of Clarke and Asimov. I remember spending hours pouring over my dad’s copies of 2001, Rendezvous with Rama, The Caves of Steel and Ringworld. Phrases from these books formed the literary substructure for my whole life–and there’s something about the phrasing of those books, and the science fiction movies from the late seventies to early eighties, which remains poignant. The last survivor of a far-orbit spacecraft punctured by micrometeoroids, in the long months until rescue, turning as all listeners do, to Bach.

That’s why I enjoyed Moon so much. One man, serving out a three-year contract on a lunar mining facility, alone. No one to talk with save recorded messages from his wife and newly born daughter, and the company of a vapid, invariably rational finite-state automaton. If you haven’t seen the film, I strongly recommend it. It is best, however, to go in as blind as possible.

The film is visually astounding, reveling in the early-80s glory of space engineering. Hard bulkheads, rounded-corner insignia for which the interpretation must be immediately obvious to trained astronauts. There’s the slow drama of the moon itself, with massive harvesters stripping the surface and casting the tailings slowly behind. The modelwork is exquisite, enhanced by careful VFX, and retains the feeling of 2001’s massive spaceborne constructions. Even the Eurostile typography dates the film in a strange way–simultaneously classic and contemporary.

Continue reading (1119 words)

I released version 0.1.3 of Construct today. It incorporates a few bugfixes for nested schemas, and should be fit for general use.

I got tired of writing configuration classes for everything I do, and packaged it all up in a tiny gem: Construct.

OpenStruct-style access to key-value pairs. “` ruby config.offices = [‘Sydney’, ‘Tacoma’]

Nested structures are easy to handle. ``` ruby config.fruits = { :banana => 'slightly radioactive', :apple => 'safe' } config.fruits.banana # => 'slightly radioactive'

Continue reading (127 words)

My life recently has been an object lesson in extreme deviations from the norm. I got my teeth knocked out in broomball, but also landed an outstanding job in an arguably abominable economy where most of my peers have been struggling to find work and make ends meet. I’m now a software engineer at Vodpod, a web site oriented towards video aggregation and publishing. I love what I do, but how I got the job in the first place is also an interesting story.

Carleton College just started this new program called Engagement Wanted. As a graduating senior, you write a short “elevator speech” and post it on their web site. Here’s mine, in its entirety:

Looking for a year-long job while I apply to physics grad school. Physics research would be great, but I also have six years experience in IT, ops, and web development. Photographer, graphic designer, *nix admin, network guy, and open source software developer. If you know anyone who’s hiring (especially using Ruby), I’d love to hear from you!

Continue reading (387 words)

Here’s what I did to get the Macbook Pro (rev 3,1) running smoothly under Ubuntu 9.04.

Turn on the nvidia drivers with jockey-gtk (the hardware drivers manager).

Add the keys for the mactel PPA:

Continue reading (282 words)

I recently got a MacBook for work, and thought, “Hey, here’s a chance to finally stop mucking about with all the inconvenient things about Linux! Flash won’t be broken half the time, I can use things like VMWare Fusion and Adobe Lightroom… it’ll be great!” So I installed 10.4, and started trying to get some work done. Here’s my thoughts for that day.

Spaces is a total joke. Every time you open an application it switches workspaces to wherever the application was last. You can enter spaces to drag apps around, but that means that if you want, say, a new firefox window on the current workspace, you need to switch to another workspace, fire up a new window, enter spaces, drag the new window back to the space you want, and exit spaces to the new workspace. It’s completely broken.

Also, “new window” is a difficult concept. I wasn’t able to map a keyboard shortcut to it, even after giving up on the OS X keybinds configuration pane. Vague mutterings on the internet suggest you can write an Applescript program to accomplish this, and link it into quicksilver, but that’s still more keystrokes than I need, and Spaces gets in the way again.

Continue reading (644 words)

I just finished my last undergrad assignment—Hector's E&M test. Got an A in the course, actually, which really surprised me. I'm now done with Carleton, and graduate in a week. I'll be living in Madison for a few weeks, and then moving out to San Francisco for my new job. Should be exciting!

Also, I ported Cortex Reaver to Innate and Sequel 3.0.0. It works, but things are a bit shaky still.

If you haven’t seen the 2019 video, you should definitely take a look at Microsoft’s ideas about where we might be headed with computer interface design. It’s bold, slick, and leaves out a really big question.

Watch the video, and ask yourself: “how much work are people getting done?”

Continue reading (324 words)

Two things of note this week: I received distinction on my Comps, and submitted the first draft of Character in the Dark, my new book, to Blurb. If the copy I get back looks good, I’ll put it up for sale.

I originally intended to work with Engage Print like I did for Sampling Error, but I’m running into logistical constraints. First, it’s not really practical for me to bind more than 6 copies by hand, and I’d like to make the book available to a wider audience. Second, Engage’s Indigo printer can only run up to 12x18", which is slightly too small to really give the images good space on the page.

Hence, I’m sacrificing the pleasure of hand-making the book, and having good control over color/paper, for the convenience of Blurb’s automated print-on-demand system. I’m guessing price will be somewhere around $60; details when I finish the final version.

Continue reading (154 words)

Copyright © 2015 Kyle Kingsbury.
Non-commercial re-use with attribution encouraged; all other rights reserved.
Comments are the property of respective posters.