Neil Kandalgaonkar

hacker, maker of things

Brand X

I have a crude X in black duct tape on my laptop, and no other stickers. Almost everybody asks what it means because… it looks like it means something.

It originally didn’t mean very much; I bought this laptop & went directly to a conference, and just wanted it to look slightly distinctive, and the duct tape was all I had.

To my surprise, this was a guaranteed conversation starter. Even baristas remember me as the guy with the X.

DRAFT: How much would it cost to store every phone call in the USA?

UPDATE, 2013-05-05, 5:56pm Pacific:

STOP RETWEETING THIS LIKE IT’S NEWS. THIS IS SPECULATION. I ASKED IF SOMEONE WHO KNOWS BETTER COULD CHECK MY WORK.

I’m getting a lot of conspiracy theorist followers retweeting this uncritically, and not very much informed comment on the calculation I made.

On second thought, I don’t think I’m really qualified to wade into a debate that attracts this kind of attention. I’m afraid that someone’s going to quote me as an authority, but I do software, I don’t build data centers or operations. I’m leaving it up so you don’t think “the man” got to me.

The following is a draft post based on napkin calculations and may be completely wrong. I posted it on the draft version of my blog for people to check the math. Please reply to me on Twitter or ten.klien@klien with corrections/confirmations.

Some people read stories like Are all telephone calls recorded and accessible to the US government? and dismiss them out of hand; for one, it ends in a question mark, and two, to them it seems like that would just be beyond the government’s abilities.

But let’s find out! Let’s look at the cost of storing all these calls.

Why you should use Node.js for CPU-bound tasks

/doh by striatic
facepalm

In the first part of this discussion, I discussed the algorithms behind the Node.js-based Letterpress solver I wrote, called LetterPwn (source).

But I wasn’t just interested in making a cheater for a word game – I wanted to explore what it would be like to try to write a computation-heavy service in Node.js.

Many programmers – even Node.js aficionados – would say that’s a ridiculous thing to want to do.

LetterPwn, a Node.JS-based solver for Letterpress

Letterpress is a word game. I wrote a solver for it, called LetterPwn.

Try it out by hitting the ‘random board’ button. It creates a random board, makes an API request to the server, and shows you the best possible moves for the blue player at right.

It will probably do this in a fraction of a second, even if there are tens of thousands of possible moves to consider. You can pop open the “stats” link beneath the recommended words to see how much work it’s doing.

Hover over the suggested words to see the moves highlighted. Try using the tools at the bottom of the board to change letters, or simulate an ongoing game where red and blue already control some of the board, to see what LetterPwn recommends as the next move for blue. Also try the Vocabulary slider at the top right.

One of my favorite things is to create what seems like an overwhelming position for red, and then see how LetterPwn usually manages to gain the upper hand, or at least ruin the red player’s strategy.

Why?

Node.JS logo

I didn’t do this just to ruin Letterpress forever, or join the ranks of Letterpress cheater apps. It was an experiment to teach myself Node.JS. I couldn’t decide if I loved this framework or hated it. It had so many virtues, but it has so many quirks. Curiously, people often advise you not to try… computing in this computer language.

So I decided to sail straight into the winds, and try to develop a computation-heavy service in Node, just to see how bad it would be. It turned out to be very educational. I’ve split this into two parts.

In Part I, (this document), I’ll discuss LetterPwn’s algorithm for picking the best moves for any given board. It can often rank moves in excess of 100,000 moves per second. Not bad for JavaScript!

In Part II, I discuss the programming strategies to make this service quick and responsive to many users at once. A standard Node.JS server is single-threaded, and might be stuck for many seconds serving a single user.

So I bought some Bitcoin

Pirate coin by Neil

I’ve been watching Bitcoin for a longish while now without participating. So why am I getting in at this point, when we are almost certainly in some sort of bubble?

ObDisclaimer: Not only should this should not be construed as financial advice, let me assure you that I’m an idiot. I’m a more informed idiot than many other people, but I know enough to know how little I do know.

Blocks

Square blocks by rutty
 

The yearly corporate team-building exercise was, mercifully, almost over. The facilitator, a woman who claimed to have invented Burning Man, revealed boxes of toy blocks with segments of wooden tracks for a marble to roll down. She challenged us to build a track that had the most turns.

We divided into teams and started to attack the problem. Fitting the pieces into a tower, our team got about three turns. Some teams did better, others did worse.

The facilitator called time up, and held aloft a single large track shaped like a spiral. It must have had eight turns, at least. “I said at the start that you could ask me any question! None of you asked me for this!” she exclaimed, beaming at us.

I remarked to our tech lead that I was already mentally composing the Worst Feedback Ever.

He said he didn’t care so much, because when the exercise started, he just was happy that there were blocks, and started building whatever he wanted.

At this, the student was enlightened.

Use Flickr images, videos, and sets on Octopress

I wrote a plugin for including Flickr images, videos, and sets into an Octopress blog. Screenshots:

octopress-flickr fancybox previews by Neil
If you have the jQuery plugin Fancybox, octopress-flickr allows you to view a zoomed image in a lightbox.
Simple image by Neil
The simplest use of the octopress-flickr plugin - include content in your blog, with a link to the Flickr page.
narrow widths or mobile browsers by Neil
Octopress is itself reasonably good at "responsive" layout, and octopress-flickr itself has a few heuristics specifically for narrow widths.
Sets in “slideshow” mode by Neil
If you have the jQuery plugin Fancybox installed, octopress-flickr plugin will display next and previous buttons for your sets, and enable left and right keystrokes.
sets by Neil
A simple use of Flickr sets with the octopress-flickr plugin. Just like Flickr sets, you can mix photo and video content. Videos get a little "play" icon.

There are a number of hacks out there for doing similar things, but I particularly wanted a way to tell stories with Flickr sets. That meant captions, videos, next and previous links, and so on.

It’s reasonably easy to install, although you still have to hack a number of things to get it working. Octopress doesn’t have a very clean plugin system for modifying a bunch of things at once, but in fairness, if it did, it would probably turn into Enterprise Blogging Software.

Now that octopress-flickr is released, I already want more options, especially for set layout. But I think I’ll move on to other things for now - although I will happily accept pull requests!

New site launched

chiang-mai-pink-dog by Neil
Shameless unrelated puppy picture

Welcome to the new site! My stuff used to be over at brevity.org, but I’ve blog-ified all the content that was over there, and am having fun making new posts here.

Like a lot of people, these days I’m dissatisfied with pretty much all the social networks out there. App.net isn’t quite ready for prime time. And I’m a bit sick of never having control over my own words.

Plus, I have a lot of longer-form thoughts I want to push out there. You’ve been warned.

rabbit porch

This house always has elaborate seasonal decorations in their front window, with a rotating invitation (note that "rabbits" is pasted on top of the sign).

See the rabbits by Neil
The rabbits by Neil