Archive for category: Computer Science

Design of a simple ALU…

October 14, 2010 | Computer Science, electronics, Hardware | By: Mark VandeWettering

A couple of weeks ago, I noticed a bunch of links to a 16 bit ALU designed to operate using blocks which are defined in the game Minecraft. It got me thinking, and ordered the book that inspired that work. It contains the specification for an ALU which is very simple, and yet surprisingly powerful […]

On random numbers…

October 6, 2010 | Computer Graphics, Programming Languages, Stupidity | By: Mark VandeWettering

While hacking a small program today, I encountered something that I hadn’t seen in a while, so I thought I’d blog it: My random number generator failed me! I was implementing a little test program to generate some random terrain. The idea was pretty simple: initialize a square array to be all zero height. Set […]

From Nand to Tetris in 12 steps

September 28, 2010 | Computer Science | By: Mark VandeWettering

This came across my desk earlier today. I’ve actually been interested in this kind of “from the ground” up view: basically compiling simulators for very simple machines, but then bootstrapping all of a simulated virtual machine from the ground up. From Nand to Tetris in 12 steps. Addendum: This was the story that set me […]

Translating HAKMEM 175 into C…

September 8, 2010 | Checkers, Computer Science | By: Mark VandeWettering

A couple of years back, I made note of HAKMEM 175, a nifty hack by Bill Gosper that finds the next higher value that has the same number of ‘1’ bits as the input. brainwagon » Blog Archive » HAKMEM 175. If I bothered to convert it to C, I didn’t scribble it down, so […]

Somewhere… over the (simulated) rainbow…

August 31, 2010 | Amateur Science, Computer Graphics | By: Mark VandeWettering

A few days back, I simulated how light propagated in a single drop of water, but with a number of problems. First of all, it didn’t simulate the Fresnel equations, which describe how light is reflected and refracted at the interface between two media. This meant that in my simple model, no light is actually […]

Making a soft-circuit input device for your computer

August 13, 2010 | electronics, Hardware, Toys and Gadgets | By: Mark VandeWettering

I’m intrigued by various uses for embedded processors, and so are my readers. I hadn’t seen this particular microcontroller board before, the “Teensy”, which is very similar to the Arduino, except that it is uses an ATMEL AVR chip with a direct support for USB. The link also points at a nifty interface to “soft […]

Zounds! Sounds!

August 11, 2010 | Computer Science, Hacking, Music, My Projects | By: Mark VandeWettering

Tom and I have been discussing some early hacking efforts, probably spawned in part by my re-reading of Levy’s Hackers. A couple of days ago, this resulted in me pondering the mysteries of Minsky’s circle algorithm (still ongoing), but today it drove me to an early interesting sound algorithm documented in the legendary HAKMEM, ITEM […]

Drawing “circles” ala Marvin Minsky…

August 9, 2010 | Computer Graphics, Computer Science, Math | By: Mark VandeWettering

In my re-reading of Levy’s book Hackers, I was reminded of an interesting bit of programming lore regarding an early display hack that Marvin Minsky did for circle drawing. It’s an interesting hack because the lore was that it was originally coded by mistake, and yet the result proved to be both interesting and even […]

One Bit Ferrite Core Memory

August 5, 2010 | Computer Science, electronics | By: Mark VandeWettering

Anyone younger than me has probably never seen core memory, or even knows how it works. A very cool writeup, illuminating the actual workings of this technology from the past. One Bit Ferrite Core Memory – Wayne’s Tinkering Page.

Writing emulators for obscure old computers…

August 5, 2010 | Computer Science | By: Mark VandeWettering

(Hmmm. I’m sort of on a retrocomputing kick today…) A few years ago, I wandered into Tom’s office one day to find him typing away. I asked “whatcha doing?” and he replied “I’m writing an emulator for the PDP-1 so I can play the original Spacewar!” It tells you a lot about Tom to hear […]

10,000 Monkeys Typing…with a Unix/sh challenge…

July 27, 2010 | Cryptography, Programming Languages | By: Mark VandeWettering

I was testing some code that I wrote for analyzing cryptograms, and decided that the easiest way to do so would be to get some random text, drawn from the letters A-Z. A moments thought yielded this method, without even programming anything: tr -d -c A-Z < /dev/urandom | dd ibs=10000 count=1 The tr generates […]

Primality testing with Perl regexs

July 23, 2010 | Computer Science | By: Mark VandeWettering

Okay, here’s a little pet peeve of mine. Somebody brought up that it’s possible to do primality testing using Perl regular expressions. This has been kicking around for a while, I’m not sure who originated the idea, but you can find links to it with a Google search. As an example, consider the Perl one […]

Reminder: HOWTO tunnel http using ssh…

July 16, 2010 | Security | By: Mark VandeWettering

I have a couple of devices at home that provide http servers on my local network. I have them tucked nicely behind my firewall so that they are not accessible from the outside, but occasionally, I would like to login to them to perform some reconfiguration or the like. This is where ssh comes to […]

Crazy Optimization of Chaocipher…

July 15, 2010 | Cryptography | By: Mark VandeWettering

Okay, this is a minor hack, but I thought it was fun, so I thought I’d write it up here. My original code for simulating the Chaocipher machine proceeded as follows: it found the character in the plaintext wheel (by linear search), then rotated each wheel to get the plain and cipher text entry to […]

Typos in Exhibit 1?

July 12, 2010 | Cryptography | By: Mark VandeWettering

WARNING: if you are working on this code, this article contains spoilers which may blunt your own intellectual satisfaction in working on it yourself, including some recovered keys. Okay, I’m home, and feeling pretty jet-lagged, so this might be wrong in some way that additional sleep will reveal, but I wanted to get this out […]