Android emulator temp directories

If you are using the Android SDK on a shared computer, you might run into the awesome “NAND: could not create temp file for system NAND” error. This is because “/tmp/android” is hardcoded into the emulator as the directory to start temporary files during emulation, and somebody else has likely claimed it first.

The easiest workaround is, if it won’t cause any problems, to delete or chown the /tmp/android directory, preventing anybody else from using it. If you must share, then you can set up the group so that multiple devs can access it.

But the best way, if you’re not the sysadmin, is to change the temp directory for yourself. You can modify the emulator and change the hardcoded values.

Run “vim -b tools/emulator” and search for “tmp/android” (which would be “/tmp\/android” in vim-speak). Overwrite the name android to something that doesn’t already exist, like “/tmp/anderic”, being careful not to change the length of the file.

Restart your emulator.

Our friend Scope

Scope is one of those things that is absolutely essential to understand as a programmer. If you don’t understand how a language handles scope, you are doomed to continue making difficult-to-understand mistakes and poor code design.

Scheme is a good platform for exploring how scope works for beginners, and the language features that it has distilled to the minimum form the basis of 99% of the cases you encounter from day to day.

Let’s look at one pattern that you’ll find in every jQuery plugin:

Continue reading Our friend Scope

“usbscale”: read USB scales

I’ve just finished writing the big parts of usbscale, a command-line program written in C that reads and interprets data from USB scales. It was meant as a little hack for the Stamps.com scale, so currently it’s only set up to recognize the Stamps.com 10-lb scale (manufactured by Elane). It should be trivial to add support for more scales, though.

If you have a USB scale, please let me know!

You can find the software at usbscale on Github: https://github.com/erjiang/usbscale

Chicken-NBT: A Minecraft NBT reader for Chicken Scheme

I didn’t see any Scheme code to read Minecraft NBT data files, so I made one. And in doing so, I see why there weren’t any NBT readers in Scheme. (Haskell programmers can use Adam Foltzer’s much cleaner Haskell version.)

When I found out that there was a gzip egg called z3, I thought my troubles were over. Not quite, because although z3 made it ridiculously easy to read compressed data, the only real procedure I had to read data from the gzip stream was read-byte. And not only did I have to read only one byte at a time, but they were all promoted to ints anyways, since there is no notion of different-width integers in Chicken (only fixnums).

Continue reading Chicken-NBT: A Minecraft NBT reader for Chicken Scheme

Blast from the past: The “cloud” five years ago

I was cleaning out some miscellaneous files from my computer today when I found a folder called “eyeos”. EyeOS. My friend and I thought we were uber-cool when we set up eyeOS on our shared hosting accounts and looking back, yeah, well, we were.

A screenshot of the eyeOS.org website from November, 2005.
eyeOS.org, ca. November, 2005. Very Web 1.9.

EyeOS was an ambitious open-source project to give you a desktop in your browser. You could have files, record appointments, and write documents from anywhere, as long as you had an Internet-connected computer. Nothing was stored on your local hard drive, it was all up on the … Internet.

This was November, 2005. This was back when clouds meant fewer UV rays.

Continue reading Blast from the past: The “cloud” five years ago