Revisiting some old posts

Leave a comment

Apparently WordPress’s editor lets you drag and drop images on to a post, but if you do that, it silently deletes all of the post’s contents. Manually selecting “add image” is doing the trick. Third try is a charm.

I was reminded of one of my early posts, from 2008, when I saw this sign:

Free Beer / Great WiFi very much reminds me of Think Bank / Big Smart.

When looking up that post, I saw my espresso setup from 2008. I loved that machine – we had a Rancilio for the first 25 years of our marriage, and they’ve worked great. When we upgraded machines, we found new homes for our older ones, and most of them have been in daily use for > 30 years now. (wow). Well, we’ve upgraded again (and found a home for that PID controlled Rancilio) – to a Slayer Espresso, which I found used on Craigslist. Further, since 2008, I’ve started roasting coffee, and now buy green beans in 65lb bags from Genuine Origin. What a hobby! The shots are gorgeous, and more importantly, are delicious.

Slayer Espresso, view of the bottomless portafilter

My favorite coffee discovery since 2008 is how to make delicious shots out of either lighter- or darker-roasted coffee. I chronicle this discovery over on my webpage.


fixing my macOS machine: couldn’t play any videos – YouTube, Vimeo, local QuickTime or VLC

Leave a comment

 I’m writing this so if it ever happens again I don’t have to remember it, but rather can use google (I mean “google” in the generic sense, because of course I use DuckDuckGo).

 What search turned up didn’t help. This one from 2015 was all about Flash. This undated one says it can be YouTube servers, graphics drivers, or browser plugins. All possible and I poked around, but no luck.

I use Little Snitch, and that has caused weird things in the past, so I disabled it, and the problem was still there. Huh!

What I was seeing is that YouTube stopped playing videos – instead, I got the perpetual spinning white circle, then the message if the video doesn’t start playing, restart your device. I actually did that once, and it fixed it briefly, then it started (err stopped) again. Plus, restarting this machine is really disruptive — it’s my server for so many services: minecraft, owncloud, logitech Squeezecenter, deadwiki (and more?) Further diagnosis: QuickTime player and VLC also weren’t working – they started up, then stalled, just like YouTube. This is a pretty deep system-level issue. Of course I checked my networking – in fact, my son was using Zoom on his machine throughout, and I was able to use youtube-dl to fetch a video that wasn’t playing, then wasn’t able to play it using VLC.

So I tried to track it down. Quitting Steam and GoG Galaxy seemed to fix things, but only briefly. What else could it be? Well, I do have a number of Audio Output devices – I switched the System audio out to my TV instead of my USB D/A converter, and Boom- it started working! Switching it back to the USB D/A converter, and everything stopped – there’s our culprit. It’s hung somehow, not accepting data, and freezing threads trying to write to it. So I unplugged it from USB (thus rebooting it) and plugged it back in, and now all’s well again.

Writing a CS-2 book!

Leave a comment

I’ve got a textbook in me and I’m doing my best to let it out. The idea is that it’s a second class in computer science for students who just learned how to program in a garbage-collected language (such as Python or JS or Swift or Java or …) and want to learn how it all works under the covers. I’ve always been a “let’s take this apart and see how it works” person, so when I took this course at UC Berkeley, oh, some 30+ years ago (!) it blew my mind – when it clicked that a single person can comprehend a computer all the way from transistors up through logic and ALUs to assembly code to a systems programming language, the lights shone down from the heavens and I was permanently hooked.

So, back in the day, we learned PDP-10 assembly code, and our systems programming language was C. Not too shabby – I think those two choices still hold up in a lot of ways. More recently, folks are using MIPS/SPIM and C++, which in my opinion, are both prematurely gray.

So, my high-level idea for this class is to use Logisim to introduce Logic and ALU design including key RISC-V components, use RISC-V as the assembly code, and then Rust as the systems programming language. For folks who have the extra time and want hands-on stuff, I’m planning on incorporating an under-$30 hardware option where you can build a system with a breadboard and an I2C interface, so you can write RISC-V programs that blink lights, sense things, and write to cool little displays.

So, that’s the idea. Like my 3/4ths book on cryptography, it’s going to be on GitHub, but I’m open to having a publisher also produce it in physical form. I’m already having a blast learning RISC-V and Rust. I’m front-loading project infrastructure, so I don’t have any chapters ready yet, but here’s a RISC-V reference card that I made as I was learning its assembly code. The repo for the book is here.

Building a ship in a bottle

Leave a comment

Lately I’ve been having a lot of discussions with people about Computer Science education. Everyone I’ve spoken with is passionate and excited about broadening the reach of CS education, which is really exciting to me: it’s exactly what I want to help with. One thing I’ve been frustrated by, from time to time, is not having a common understanding of what Computer Science education is. I’m not going to say I have the one true definition, but I thought I’d document my thoughts on it so that folks know what my perspective is.

One boon for marketing CS education is that everyone has an amazing supercomputer in their pocket, which can (and often does) run amazing programs; immersive games, augmented reality planetariums, music instruments, social media, and on and on. Being able to say to someone “I can teach you how to make these things and more – only limited by your imagination” is a great lure. It’s also misleading, and here’s where my analogy comes in. I think a smartphone and all of its apps are a lot like a phenomenal Ship in a Bottle. Offering to teach someone how to make an App is a lot like teaching someone how to make a ship in a bottle, without teaching them how to make a ship outside of a bottle first. Sure it’s possible, but it’s missing out on a number of opportunities:

goodwin_blksquall-1-75tequilaFirst, you’ll never be able to make better looking ships in a bottle than you can outside of a bottle. If you want to innovate – make new, cool things that have never been seen before – you should experiment making those things outside of a bottle first, then once you’re happy with them, figure out how to get them assembled inside of a bottle.

Second, to have any chance of getting a novice shipbuilder to make anything they’ll consider acceptable inside of a bottle, you’ll have to give them a lot of parts pre-made, already in a form that can be put in a bottle. After your lesson, if they want to reproduce the experience at home, they’ll have to start with the same parts, which are essentially ship in a bottle kits. If those kits aren’t available, they’ll have to figure out how to back-fill the knowledge to construct them.

Third, and this is where the analogy stretches its limits, if bottle technology changes, the kits immediately become obsolete, and only folks who know how to build these things from scratch will have any chance of keeping up with technology.

For me, the notion of building a ship in a bottle is very much like getting a program to run on any computer, not just a smart phone. Taking a high-level idea of a game, an application, a musical instrument, and turning it into the 1’s and 0’s of the machine code for a specific computer, is a lot like building a ship in a bottle. Computers are crazy time-and-space dilating machines that require processes be expressed in very specific ways (the machine code), and when they are, those processes run at almost-unimaginable speed.

Teaching someone “game coding” using a high-level framework is akin to giving them a Ship in a Bottle Kit, and maybe even a bottle with a hinged bottom. After the class, if you give them a real bottle and raw materials, (no framework), they won’t be able to reproduce that experience.

I’m not saying these experiences are bad at all. In fact, I think they’re great for giving students a sense of “here’s where we’re headed,” and “cool stuff is possible.” But if the only focus is on using kits, students will be fundamentally unprepared for the world where computers, operating systems and languages change with a 3-5 year cycle.

So, what am I advocating?

Teaching someone how to build a ship outside of a bottle includes:

  • Teaching them about how all computers work, all the way from gates, through logic and memory, up to machine code,
  • teaching them about decomposing big problems into smaller steps, and assembling those steps into solutions, and doing so in the context of actually solving problems,
  • teaching them about algorithms: use, implementation, analysis (Big Oh)
  • teaching them about abstraction: using and creating your own,
  • … and more. I think this is very much aligned with the current notions of computational thinking, and the recent AP CS principles curriculum.

An example I particularly like is Google’s CS Unplugged, which is an extreme example of learning about computer science concepts outside of the bottle of computers. Their activity with a Binary Sorting Network can be done on a playground with chalk, and blows kids’ minds when they come out sorted, regardless of what order they start with.

Systems like MIT’s Scratch might seem too much like a ship in a bottle kit in my analogy, but in my (admittedly limited) experience, once a student gets Scratch, they understand programming in a fundamental way. Scratch turns syntax – the icky, in-the-way stuff about programming – into a puzzle-assembly problem, so the students can focus on what they want to express. Later, when they are ready for textual-based programming, the syntax of those languages, when laid out with discipline, actually looks a lot like the similar Scratch program. Brilliant design on their part. The key to making this work is to keep the students exploring, make sure they keep learning from cool projects they like on the website, until they can pretty much create anything they want.

right20tool20for20the20jobWhen teaching programming, I wholeheartedly recommend (when possible) teaching more than one language in a short duration. When I took Intro to CS at UC Berkeley (in 1984!), they taught us Scheme and C in the same year. Looking back on the experience, I think it was really clever: I learned the things that are fundamentally the same between the two, and also the things that are way better in one than the other. Choice of language is a choice of tool, and Mr. Natural’s “get the right tool for the job” was drilled in to me by my hippie dad from an early age.

While it’s totally okay to teach “writing Apps”, or “coding webpages”, it’s important to realize and advertise the limitations (and strengths) of these approaches. Knowing how to “code a webpage” was a lucrative skill in 1999, but quickly became irrelevant as Web technologies advanced. Similarly, we’re way past the time when simply writing an App and uploading it to Apple or Google is the road to a career. The role of teaching these things is to give an early glimpse at what’s at the end of the journey of a CS education. The peril of only using those approaches is that you’re on a never-ending treadmill of needing to take the next class when a new framework or web technology takes over, making your previous skills irrelevant. To stand the test of time, classes like this should include  fundamentals of usability and visual design, not just HTML, CSS and Javascript. On the games side, spend some time investigating what makes an activity fun, not just how to animate sprites using frameworks. Bonus points, on the games side, would be to include learning principles of physics, using a physics simulation framework.

One quote that resonates with me, often misattributed to Edsger Dijkstra, is “computer science is no more about computers than astronomy is about telescopes.” I think this quote may have been mis-used to try to push CS into Math departments, and is at odds with the accurate observation that the pre-eminent professional society dedicated to CS is named The Association for Computing Machinery. I think it’s safe to say that CS is something new: we spend too much time arguing about whether it’s a science, a branch of mathematics, an engineering discipline, or a vocational discipline – it’s all of those things. If you leave any aspect out, you’re missing out on something. Combining them isn’t easy, but if we manage to do it, we’ll be totally surprised at the kinds of things future generations will be building in these amazing bottles.

I’ve got a lot more to say on the subject of CS education, and even about the analogy (compilers are like CNC machines-in-a-bottle), but I’ll stop here for now.

Addenda: less than a week after writing this, I received the latest issue of CACM, and in it was a nice piece titled “Misconceptions About Computer Science.” I think there’s a lot of overlap in philosophy, and I’ve also got some stuff to learn from the authors who have been thinking about these issues for longer than I have, but I was encouraged.

Building and using a Paper Enigma

Leave a comment


As part of the book about cryptography, math and programming I’m writing, I’m encouraging readers to assemble their own paper Enigma machine. Since it’s pretty involved, I thought I’d write an illustrated blog post about doing it. I’m going to start with a summary of the context of the Enigma – and as a summary, I’ll gloss over some likely-important stuff, and also probably get some things a bit wrong. Corrections are welcome, of course. So, here we go!

First, the whole idea of making a paper replica of the Enigma came from the amazing Alan Turing, the British mathematician who is the topic of a decent movie, a great book, and is generally credited as being a pioneer of computers, artificial intelligence, and for shortening World War II by two years (and dare I say, perhaps keeping the Nazi’s from winning?) The story isn’t all rosy: he was also gay at a time in the U.K. when that was a punishable crime, and he eventually killed himself due to his treatment by the government. It wasn’t until 2013 that the Queen pardoned and thanked him for his service. As Martin Luther King Jr. said, “The arc of the moral universe is long, but it bends towards justice.” That’s certainly true in this case.

Thinking back to World War II, the German military was kicking butt all over Europe, and their submarines were causing  all sorts of mayhem in the Atlantic. They were able to securely communicate across vast distances by sending radio messages that were encrypted with an Enigma machine. This meant that the Allies could hear their messages, but couldn’t understand them, because they didn’t have the key used to decode them. Polish mathematicians cracked the Enigma code in 1932, taking advantage of a subtle misconfiguration of how the Germans used the machines. By 1938, Germany fixed this flaw, and was able to send secure communications again.

One of the first things Turing did at Bletchley Park was to create a model of the Enigma machine using comic strips. Our paper Enigma, from Franklin Heath (a security firm in the UK), was inspired by his work. The first thing you’ll need is the PDF of the paper Enigma. Since paper in the US isn’t the same shape as in the UK (A4), I had good luck printing it on legal sized paper (11×14 inches). The kit is designed to be wrapped around a cardboard tube that is 75mm in diameter. It turns out a Pringles potato chip can has this diameter (they’re called “crisp tubes” in Britain). I didn’t want to buy Pringles, so I used a cereal box. Here’s my setup before assembly:


Cardboard usually has a way it “likes” to be curled, and one that it resists (creases rather than curls). For this box, the preferred curl is horizontal. So I cut off the tabs at the top and bottom of the box, and curled it by hand a few times, to get the cardboard roughly in the right shape:


Then cut out two of the strips (I chose the input/output strip and the Reflector B), and carefully tape them into bands, put the bands on both ends of the tube, and let it expand, like this:


At this point, I put little tabs of tape inside the tube to help it hold its diameter, and fiddled with it until the bands were able to slide, but also didn’t have any slack. I tacked down the tube with a little tape, and pulled off the bands, then added a full-tube-length of packing tape to the outside-seam, like this:


Finally, wrap the three “rotor” bands around the tube, and tape them, again checking that they can slide around the tube, without being too tight. With the three bands on, add the Input/Output and Reflector B band to the outside-ends of the tubes. Align the grey bars on these bands, and tape them to the tube: they stay put while the rotors move. When you’re done, from left to right, you’ll have the Reflector, Rotor I, Rotor II, Rotor III, then the I/O band. It should look something like this:


Using your paper Enigma

(borrowing heavily from the Franklin Heath wiki – I will rewrite this with my own examples once the book chapter is done)

You can test your basic Enigma now. The “rotor position” part of the key is the letters between the grey bars. In the setup above, the rotor key is FAN. The next aspect of the machine is that each time you encode a character, you first “advance” the rotor, by carefully twisting its band towards you by one letter. Let’s pretend that the key was FAM, and we rotated the right band to make the rotor position FAN. After doing that, take the letter you’re encoding, and locate it on the I/O band on the right, and trace the lines from right to left. In this case, it’s nearly a straight line: A -> N -> A -> G at this point, we’re at the “reflector”, so trace the line on the reflector to see where it leads. It should be W. From there, trace the line back to the I/O band. When I did this, I got W -> I -> S -> K. K is the encrypted version of A. To encrypt the next character, you advance the right ring towards you and repeat the procedure.

With what you know so far, you should be able to decrypt the following message, with the rotors initially set at A B C:

A E F A E  J X X B N  X Y J T Y

If you get that, the rest of the Enigma is just minor tweaks to that process. We’ll go through each of them, because you need to do them all in order to decrypt real Enigma messages (which we’ll do at the end).

Advancing the Rotors

As you advance the right-most ring, eventually you’ll come back to the original configuration. If the Enigma did nothing else, it would be not too different from the Vigenère cipher – not a bad cipher (it was used during the Civil War) – but definitely not strong enough to protect against the codebreakers of the 1900’s. The next (and primary) advance of the Enigma machines was its rotor stepping process. When you are about to advance a band, look at whether the letters are grey in the line between the grey bars on the reflector and I/O bands, and

  • if the letter on the middle rotor is shaded grey, turn all three rotors one step towards you,
  • otherwise, if the letter on the right-hand rotor is shaded grey, turn the middle and right-hand rotors one step towards you,
  • otherwise, turn just the right-hand rotor one step towards you (this is the normal action).

Now the configuration won’t repeat for 26 * 26 * 26 (= 17,576) steps – much better.

To make sure you get it, here are some rotor  position scenarios. When you’re about to rotate, and the rotors are in positions:

  • F A V, because V is grey, you would advance both the right-hand and middle rotors toward you, resulting in position F B W
  • F E W, because E is gray, you advance all three rotors, resulting in G F X
  • G F X, because none of them are grey, only rotate the right-hand rotor, resulting in G F Y

Test your procedure by setting the rotors to A B R, and decrypt the message
M A B E K  G Z X S G


One tweak to the above procedure (which is, so far, just like a car’s odometer), is that if, after you follow the above procedure, the middle rotor’s grey bar enters the start position, then all three rotors step again. I’m not sure if this is critical to the strength of the Enigma, but doing so is critical to compatibility with real Enigma machines.

You can test whether you understand this part by starting in position B F C, and decoding
R Z F O G  F Y H P L

Rings – changing the turnover points

The next-to-last feature of the Enigma is that which rotor positions trigger turnover could be adjusted. In the real machine, this was done by removing the rotor and moving a pin from one position to another. In our paper Enigma, it’s done by sliding rings over each of the rotors. Each ring covers up the letters underneath it, and its position determines a different configuration of the machine (is part of the message key). Ring positions are described by the position of the ring’s letter A with respect to the letter it covers. Position 1 means that the ring’s A covers the rotor’s letter A, 2 means A covers B, etc. For convenience, here’s a list of which ring letter A needs to cover for each ring setting.

Setting 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Ring A  A B C D E F G H I J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z

Test whether you’ve got this by setting ring’s I, II and II to 10, 14 and 21. Then turn the rotors to set the message key (on the rings) to X Y Z  and decipher the following message:

Q K T P E  B Z I U K

Pokemon Go and graph theory

Leave a comment

Lately I’ve been focusing my efforts on teaching. One thing I’m working on is writing a book about cryptography, math and programming that is targeted at high school-aged students. One of my motivators is equity, so I’m licensing it under a creative commons license, and the source code to the book is here, on github.

Another motivator is enthusiasm – I like to convey my enthusiasm for the material to the students I’m working with. One way to do that is to tap into things they’re already enthusiastic about. For the book, it’s the innate fascination we all have about secret codes.

For this blog post, I’ve got a tidbit about graph theory that is motivated by many folks’ fascination with Pokemon Go. Pokemon Go players do a few different things: they walk around their town collecting items at Pokestops, which are associated with landmarks in the real world:

(image credit: Business Insider)

Some of those items are Pokeballs, which are used to capture the Pokemon creatures that also wander around town. You can evolve and power up the Pokemon you catch to make them more powerful. The reason you care about your Pokemon’s power is that in addition to Pokemon and Pokestops, there are Gymnasiums, which are also associated with real-world landmarks, but instead of having items, they’re places where Pokemon can battle each other. I’ll skip past the part about teams because that’s not relevant, but the part that is relevant is that a Gymnasium can have up to ten different Pokemon in it, and when you battle, you can choose six of your Pokemon collection to fight against the ones in the Gymnasium. The question is: “how do you choose which Pokemon to battle?”

It’s a good question because the designers of the game created complex varieties of Pokemon (e.g., Fire, Grass, Electric, Poison, etc), and a complex hierarchy of strengths and weaknesses among them. So, for example, it’s easy to remember that if you’re going up against a Fire-type Pokemon, that a Water-type Pokemon has a strong advantage. On the other hand, Fire has an advantage against Grass and Ice. It’s a lot like rock-paper-scissors, but with over a dozen types instead of just three. Even more complex than the Big Bang Theory’s rock-paper-scissors-lizard-Spock.

Now we’re up to where Graph Theory can help. Just as this link shows the interactions between rocks, paper, scissors, lizards and Spockrpssl

In computer science, the above diagram is called a graph. It’s not the same as the graphs we draw of functions, so it’s kind of a confusing name, but you get used to it. These kinds of graphs have nodes and edges. If the edges have arrows, it’s called a directional graph (digraph for short). What this graph tells us is that an arrow from one node to another means that the node “beats” the one it points to.

We’d like a similar diagram for Pokemon Go. It’s subtly different: instead of a simple “Fire beats grass” relationship, we have “Fire is unusually strong against grass”. Even so, this is important information. With a simple cheatsheet like this, we could go up to any Gymnasium with a decent collection of Pokemon, and do serious damage. Also, we could learn which Pokemon we should add to a Gymnasium to make it stronger. So, how to do this?

I started by Googling for “Pokemon Go rock paper scissors” to get a list of the strengths and weaknesses of Pokemon creature types. This list seemed good for my purposes. I don’t know how accurate or authoritative it is, but that’s not as important as what I did with the information. What I could have done is use an art program to draw the graph. The drawback of this approach is that it is very “brittle”, meaning if I want a different layout I have a lot of work to do, or if the data is wrong, I have do a tedious search through the diagram.

What I did instead is use a tool that is designed to take a definition of a graph as its input, and to create pretty drawings of them. The tool I used is called graphviz, and it’s quite powerful and configurable.

The input to graphviz is called a “dot” file (the filenames end in .dot). Here’s my conversion of the above Pokemon database into a dot file:

digraph Battles {
 node [margin=0 fontsize=24 shape=plaintext ]
 # layout=circo
 Fire -> Steel
 Fire -> Bug
 Fire -> Ice
 Fire -> Grass
 Water -> Fire
 Water -> Ground
 Water -> Rock
 Grass -> Water
 Grass -> Ground
 Grass -> Rock
 Electric -> Water
 Electric -> Flying
 Ground -> Fire
 Ground -> Electric
 Ground -> Poison
 Ground -> Rock
 Ground -> Steel
 Rock -> Fire
 Rock -> Ice
 Rock -> Flying
 Rock -> Bug
 Fighting -> Normal
 Fighting -> Ice
 Fighting -> Rock
 Fighting -> Dark
 Fighting -> Steel
 Flying -> Bug
 Flying -> Fighting
 Flying -> Grass
 Ice -> Grass
 Ice -> Ground
 Ice -> Flying
 Ice -> Dragon
 Poison -> Grass
 Poison -> Fairy
 Psychic -> Fighting
 Psychic -> Poison
 Steel -> Fairy
 Steel -> Ice
 Steel -> Rock
 Bug -> Grass
 Bug -> Psychic
 Bug -> Dark
 Dragon -> Dragon
 Fairy -> Fighting
 Fairy -> Dragon
 Fairy -> Dark
 Ghost -> Psychic
 Ghost -> Ghost
 Dark -> Psychic
 Dark -> Ghost

It’s really simple: to say that Dark Pokemon are strong against Ghost Pokemon I wrote “Dark -> Ghost” and so on. Then I loaded this file into graphviz (with and without the “#” in front of layout), I got these two images:


If you look closely you’ll see they have the same set of relationships, they only differ in how they’re laid out. Pretty cool, huh? So if you encounter a Gymnasium that has a Nidoking (ground/poison), Rapidash (fire), Snorlax (normal) and Gyrados (flying/water) you can use this chart, and know that you could choose a Water, Water, Fighting and Electric Pokemon to defeat them. Note that some Pokemon, like Nidoking, have two types, so you want to choose an opponent that is strong against one or both types, but is not weak against either. In this case, water fills the bill. Water works against fire, then you see that the only thing good against normal is Fighting, and finally electric against flying/water.

A nice follow-on activity, now that we have this graph, is to optimize sequences of Pokemon in Gyms so that it’s as hard as possible to defeat them. You’ll note that our above example had two water-type weaknesses in a row – you’d want to avoid that. After that, you’d like to find, given a set of Pokemon, which ones you can safely trade away, because their strengths are subsumed (dominated in CS-speak) by other Pokemon. And so on — there’s a lot of meat in this graph!

Installing MITE (minecraft is too easy) mod on MacOS

Leave a comment

Thanks to a pointer from our neighbor (hi, Sten!), I decided to try to install MITE on my Mac.

It turns out the very good instructions in the MITE zipfile are very much Windows-specific. If you try to follow them as best you can on a mac, it’s probably not going to work.

Here are the Windows instructions: (interspersed with my MacOS translations)

Step 1 = Paste this folder into .minecraft versions folder if you have not already done so =

open Terminal and type

cd ~/Library/Application\ Support/minecraft

Step 2 = Copy 1.6.4.jar to this folder =

cd 1.6.4-MITE
cp ../1.6.4/1.6.4.jar

Step 3 = Rename it to 1.6.4-MITE.jar =

skip this step

Step 4 = Open 1.6.4-MITE.jar using WinZip or 7Zip =

First, in terminal type “open .” to fire up the Finder in this folder
In Finder, double-click on “” – it will create a folder called “original”

Step 5 = Delete META_INF folder inside =

In Finder, open your “original” folder, and delete the META_INF folder in there

Step 6 = Copy contents of class Files folder into 1.6.4-MITE.jar =

This is the key place where Windows and the Mac differ. If you drag the contents of “class Files” to the “original” folder, it will clobber important files. Instead, open the “class Files” folder in Finder, select all of its contents (first click on a.class, then press Cmd-a to select all), then drag those files to the “original” folder. It will ask if you want to keep or replace. IMPORTANT: hold down the Option key, and the “Skip” button turns into “Keep Both”. Select that.

This procedure does the important interleaving, then create the new, modified jar file with these commands (you have to have the “JDK” installed):

cd ../original
jar cf ../1.6.4-MITE.jar .

Step 7 = Move MITE Resource Pack to the resourcepacks folder in .minecraft =

this is right, except drag it to “~/Library/Application Support/minecraft/resourcepacks”

Step 8 = Run the Minecraft launcher and edit your profile to use 1.6.4-MITE version =

Step 9 = Play Minecraft and select the MITE Resource Pack =

Yay – it should work!

The error message I kept getting when I followed the windows instructions was:

java.lang.NoClassDefFoundError: net/minecraft/client/main/Main

It was that error that lead me down the path of the solution. I checked the contents of my improperly-created jar file with the command

jar tf 1.6.4-MITE.jar

and saw that indeed there was no “net/minecraft/client/main/Main” entry. From there, I saw that the directory path in the “original” directory was deleted with the drag-and drop operation, and remembered the “tar” command solution to interleaving-copies (and then, thanks to Google, found the way to do this in Finder).

I hope this helps someone else install (the excellent-but-very difficult) MITE mod to minecraft. Apologies for the built-in dependencies on knowledge of “Terminal”, and assuming you’ve installed the JDK. It’s very possible you could avoid those dependencies, but this was my way of fixing the problem.

π Day programming activity

1 Comment

In our math club this afternoon, since it’s π day, I’m going to try to lead an activity where we write a program (on the Raspberry Pi, of course) that computes π. The idea I thought of (but we’ll see what the students think of as well) is to use the Monte Carlo method – guess random points (with uniform distribution) in a 2r x 2r square, and compute whether they’re “inCircle” or not (whether the distance from the center of the square <= r). Then use algebra to solve for the unknown quantity π in the formula

π r2 / 4r2 = inCircle / totalPoints

In my little Python program that does this, it pretty quickly gets to 3.14, but doesn’t get much further. Since these are 4th – 8th graders, I thought I should focus on techniques that have an intuition behind them, so Ramanujan’s fancy equations are out of the question. I’d be keen to hear other suggestions!

An entire music label goes “pay what you want”

Leave a comment

An entire music label goes “pay what you want”

Deep Elm’s entire catalog has gone to the “pay what you want” model. Already I have discovered (and paid for) music from three bands I’d never heard of before.

Keystone Kids’ “Things Get Shaky” is pleasant, well-done synth-pop, Lights and Motion’s “Unreleased” is really nice orchestral, post-rock, and their “Reanimation” sounds like the soundtrack to a movie I’d like to see, and Moonlit Sailor (also post-rock), is more intimate, also really good background music – especially liking their “We Come from Exploding Stars.”

I think it shows a lot of confidence to do this – believing that giving away your music is going to gain fans who are willing to pay. It’s already worked with me!

Lights & Motion’s “Unreleased”

Moonlit Sailor’s “We Come from Exploding Stars”


Domain Squatters Stink

Leave a comment

My previous post (3 years ago!) mentioned that discountdomainregistry was a bit wonky. Turns out they were circling the drain, and about 2 years ago were bought by  For some reason my “” domain didn’t come along with my other ones, and I had a difficult time convincing them I was the owner of the account, which interfered with my ability to renew the domain until…da da dum, a domain squatter (from Japan, of all places) registered my domain, and won’t let me have it back.  The folks in charge of the snafu apologized to me, but didn’t make it better.  I’m bummed out.

Older Entries