Neil Kandalgaonkar

hacker, maker of things

Graphing activities in a short project

I recently finished a short one week project, which took about a month. I wondered exactly where the time was going.

There were only a few hundred commits, so it was possible to tag them all. Here are the results:

Stack graph of tagged commits


Fruitvale BART station platform 2
“Fruitvale BART Station Platform 2”, by BrokenSphere CC-BY-SA-3.0 or GFDL, via Wikimedia Commons

We are strangely alone on the platform of Fruitvale station. A cop comes over to us and motions us to leave. It has something to do with a dark shape on the southbound side of the station, just beyond our vision.

This was the early morning hours of New Year’s Day 2009 in Fruitvale, Oakland, California. An incident which would rock the entire San Francisco Bay Area had just occurred: a young black man, Oscar Grant, already restrained by police, had been shot without provocation, in full view of an entire train of revelers, some of whom videoed the incident. When the video became public, riots followed. A movie about the incident, Fruitvale Station, was just released in theatres in the USA.

I missed the shooting by minutes. This isn’t an eyewitness story of a tragedy. It’s a story of what a tragedy looks like a few minutes later.

Testing Google Photos’ AI

Google just deployed a massive neural net to automatically categorize what’s in your photos. Some people report that it was very good, even able to pick out a camouflaged snake in a background. Or that it
could categorize concepts like “jump”.

If true, this would be a giant leap forward for image recognition. But I was skeptical. Sometimes people let other information about the photo leak in other ways, through its use on social media. Just by other people’s reports it’s hard to tell how much Google is using available textual information, or EXIF data (such as the time and place the photo was taken).

So I uploaded the last year or so of my photos on Flickr.

Some of these are photos that have been tweeted, or have descriptions, and others are just random photo data with automatically generated titles. The hope was to determine what factors Google is using here, or at least get some indications. It’s a small sample set, but it was worth trying.

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.

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

/doh by striatic

2018 NOTE: this blog post is very out of date, and some things were wrong when I posted it. I had been doing Node.js for only a few months. The title was supposed to be provocative, responding to a discussion that was happening on technical blogs in 2010-2012. Today, In 2018, JavaScript is definitely a possible choice for CPU-bound tasks, but it’s rarely a lot of fun for that. As this blog post eventually concludes, the real advantage for JS is being able to deploy it on lots of platforms, especially the web.

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.


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.


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.