Power Law

The power law distribution (and the associated long tail) is a much-discussed statistical phenomenon. I’ve been looking at wholesale electricity transactions, and it appears the the wholesale power business is also well described by the Pareto principle.

Continue reading

Posted in Energy | Comments Off

Updating PHP on EC2 (for phpMyAdmin)

I recently installed phpMyAdmin on one of my EC2 machine images. In the course of doing so, I found it necessary to upgrade the PHP interpreter. I did not think that the best way to perform this upgrade was obvious, and so I decided to document my experience.

Continue reading

Posted in Web stuff | Comments Off

File and Memory Offsets with DOS DEBUG

I often use the DOS DEBUG command to investigate older 16-bit programs; while there are doubtless better tools, DEBUG is ubiquitous and effective. There are many guides to its operation, but here I focus on a specific and practical question: How does one translate between file offsets and memory addresses?

Continue reading

Posted in Reverse Engineering | Comments Off

JSON Data Formats (Bloxorz)

After writing last week’s post on a Bloxorz solution algorithm, I was inspired to revisit the solver to make it a little more useful. In addition to cleaning up a few minor bugs, I preloaded it with all 33 levels of the original puzzle, so that users would no longer have to input a level before finding its solution. I wasn’t entirely happy with the data format I ended up using for the levels; my mistakes may be instructive.

Continue reading

Posted in Web stuff | Comments Off

Bloxorz/Bloxors

A few months ago I came across a cute little puzzle game called Bloxorz. Inspired by Norvig’s Sudoku solver, I hacked together a JS-based pathfinder for Bloxorz problems. Although the proper spelling of the game’s name continues to frustrate me, the puzzle turns out to be easily solved with breadth-first search.

Continue reading

Posted in Projects | Comments Off

1985 Data Structures (Hacker)

Editorial note: I enjoy poking around the innards of old computer games. I think it’s interesting to learn how the things worked, especially since they often had to cope with formidable resource restrictions. This is one of an occasional series of articles on things I found while looking through assembly code.

Hacker

Hacker is a 1985-vintage computer game; Wikipedia offers a good overview of it. A large part of its gameplay is given over to navigating through a maze-like system of tunnels. Hacker uses a simple look-up table to represent this maze, which I thought was a particularly elegant solution.

The analysis which follows is based upon a particular (PC) version of the game. The MD5 of the executable is:

  • a75940020c4d18e353203a2211ffca74

Continue reading

Posted in Reverse Engineering | Comments Off

Working with binary data in JavaScript

I recently needed to manipulate some binary data within JavaScript; my data stream was represented as a series of bytes, and I needed to extract floating point numbers from it. There were some existing solutions available on the Internet, but I thought that there was room for improvement. I wrote a generic solution (JS file here) to the problem, modeled on Python’s struct module.
Continue reading

Posted in Projects | Comments Off

Importing JS into the MochiKit Interpreter

I find the JS interpreter demo that the MochiKit folks put out to be quite useful. It makes it easy to do little JS experiments from any web browser. Many times, however, I’d like to import some external JS libraries that I’ve stored elsewhere on the web into that interpreter, and there doesn’t seem to be a built-in way to do that. A little googling turned up a nearly ready-made bit of code that can be copy-and-pasted into the interpreter to solve the problem.
Continue reading

Posted in Web stuff | Comments Off

S3 Bandwidth Costs

I’ve been looking at Amazon’s S3 service recently. S3 is a great deal for storage, but I wondered how cost-effective it is at serving content. After a little computation, the answer seems to be: “It’s not that great”.
Continue reading

Posted in Web stuff | Comments Off

Conditional comments and IE

This is pretty well worn ground, but I managed to do web development for an embarrassingly long time without discovering it: IE5 introduced special syntax that allows regions of an HTML file to be hidden from all but specified IE browsers. The special syntax and affected HTML may be made invisible to non-IE browsers because some of the syntax is similar to that of the comment (“<!-- ... -->“) tag.
Continue reading

Posted in Web stuff | Comments Off