Blog  |   Puzzles  |   Books  |   About

Circles, Spirals, and Sunflowers

October 17th, 2011

Long time readers of this blog know that I am obsessed with circles and related things, like donuts, and cups of coffee. As a result, I have amassed a small arsenal of techniques for producing them.

If you know Javascript, and would like to develop your graphics chops, you may enjoy my new tutorial, which explains the first steps towards circle mastery, including how to draw the shape seen here (and a few other ones) in HTML5.

Enjoy!

Throwable panoramic ball camera

October 13th, 2011

I want!

Thanks Steve

October 6th, 2011

I first heard of Apple computer in college.. My friend Kevin Bjorke brought an Apple II from home, with a shoebox full of pirated games. For a few precious weeks, we would stay up all night, munching on junk food, and loading one disk after another, playing Kings Quest, Mystery House and others, the litle CRT glowing white on black. This was my sole exposure to this wondrous little machine. My own computer was a more affordable Timex Sinclair.

A year later, we went to the local Computerland to check out the new Macintosh, which was the height of high technology. It didn’t look like all the other PCs, which were boxy and rectangular. It was taller than it was wide, small and squat, with a built-in screen. It had a tiny 3 1/2 inch floppy drive (so much cooler than the 5 inch floppies we were used to). We spent some time picking up and marvelling at these disks, with their hard plastic cases in our hands, and playing with the strange new interface device called a mouse. You could actually draw pictures on it! In the word processor, there was a choice of fonts! When you selected bold-face, you saw bold-face on the screen! What a revelation. A year later, 8-inch floppies were a thing of the past, and pretty soon, every PC came with a mouse, and every word processor was WYSIWYG (what you see is what you get).

I couldn’t afford a Macintosh back then, so I ended up, a few years later, getting the closest thing I could afford, a Commodore Amiga, which also had a mouse, and 4096 color graphics. By then the Mac II had come out, which was a superior machine in most respects, but still way out of my price range. I also had a cheap Northstar PC with VGA graphics. These machines were okay, but I really wanted a Mac.

Finally, I got a job in the late 80s working for a company that made Macintosh software, and I was able to work on Macs for the first time. Switching to the Mac from the PCs I had been working on was a dream come true. The Mac had all kinds of innovations compared to the DOS machines I was used to. Files could have long names with spaces in them. The system could tell the difference between files without having to look at the file extension (this is a capability which essentially went away with OS X)

For the first time, I had access to QuickDraw, Bill Atkinson’s elegant graphics library, and reliable consistent graphics hardware with square pixels. Up till that point, most of the graphics systems I had worked with used non-square pixels, which were a pain in the ass – to make a circle look like a circle, you had to draw it squashed, correcting for the non-square aspect ratio of the pixels. Ugh! Quickdraw was also the first graphics library I worked with which assumed that a point was the infinitesimal space between four pixels, and not a pixel. Many naively written graphics libraries back then treated pixels and points as the same thing, which led to all kinds of awkwardness. For example, in QuickDraw, if you want to fill a rectangle of width W and H, you would use rect( x, y, x+W, y+H). When systems use pixels as the addresses of points, it looks like rect(x y, x+W-1, y+H-1) — you have these minus ones all over the place, which leads to tons of cosmetic “one off” errors. QuickDraw was the bees knees.

Atkinson was also responsible for the awesome Hypercard, an important precursor to the world wide web that was ubiquitous then, but mostly forgotten today. In the early 90s, I worked for a company (Warner New Media) whose main business was making giant ‘edutainment’ Hypercard stacks and selling them on CD-ROMs. The Internet killed Hypercard, and abolished this kind of business model.

Throughout the 90s I programmed Macintoshes with pleasure, and eventually taught a series of C programming Macintosh classes at UCLA extension. I had every volume of “Inside Macintosh” and I would frequently switch between C and 68020 assembly language for speed. It was a great time for me, but not such a great time for Apple. This cover, from the June 1997 issue of Wired summed up the situation well. Apple was really struggling, and by the late 90s, I began to be worried about the long term prospects of my career.

In 1999, I bought a PC to replace my aging Mac, and began the arduous process of relearning to program PCs, after a 10 year absence. Things had changed immensely. DOS was still around, but to do anything useful, you had to write for Windows, and programming for Windows was colossally unpleasant for me. I stuck with it, and managed to put out some Windows software in the early 2000s. I could never get my head around how something so inelegant could be so popular. I much preferred programming for Linux machines, but the desktop interfaces on Linux boxes tended to be awful as well.

But something interesting started to happen from 2000 – 2005. A lot of my hacker friends, who formerly used PCs with Linux installs, started sporting titanium Macbooks. When I would attend project meetings at work, suddenly there more Macs than PCs. It was because Apple had switched to a Unix (BSD) based operating system. OSX, despite being new, was more familiar to these folks, and slowly, the prospect of using a Mac seemed more attractive to them. They could have their Unix commands *and* a nice interface.

In 2006, when I started working at Yahoo, I was asked whether I wanted to use a PC or a Mac. Joy of joys, I took the Mac in a second, and began the process of learning how the Mac had changed in the 7 years since I had used it. My clunky Windows desktop machine was gathering dust in the garage within a few weeks.

I no longer do much C and assembly language programming on Macs (I still do a bit of C++ programming, but not much). These days, I prefer to work in more cross-platform languages like Processing and Javascript. I don’t want to get burned again if I have to switch platforms, so I’m hesitant to develop in any system that locks me down to one platform. This keeps me away from Cocoa and Objective C, as interesting as they seem. Apple is so successful now, that maybe those concerns are overkill, I don’t know.

I *do* know that programming and using Macs has always been a pleasure. These machines are an extension of me. The products from Apple computer have transformed my career and my life. For this I have two Steves to thank, Wozniak and Jobs, and especially the late, latter, one. Thanks Steve.

Musical Floppy Drives play Imperial March

September 29th, 2011

via Laughing Squid.

Processing Classes with Krazydad

September 28th, 2011

I’ll be teaching two Processing seminars at Crash Space, the hacker space in Culver City that I belong to. You can sign up for these classes in the Crash Space store. All proceeds from these classes will go towards Crash Space’s legal fund (they are seeking 501(c)3 status). Each class is 3 hours long, and costs $60 ($40 for Crash Space members).

Processing 101, Wednesday October 26th, 7:30pm

An introduction to the Processing language and development environment. Processing is an open-source language and development environment which is popular with designers, artists, and DIYers. It’s a great language for learning computer programming because of its simplicity and immediate visual rewards. You can use Processing to build a sketchbook of reusable code snippets for future projects.

This class will cover installation and introduce graphic programming techniques in Processing.

Students will learn

  • Basic vector drawing and color manipulation in Processing
  • Simple image processing techniques
  • How to effectively use randomness.
  • Make an animated logo
  • Make movie files with processing

Processing for Musicians, Wednesday November 2nd, 7:30pm

An introduction on how to mix Processing with music. Although Processing was originally oriented around visual design, it can also be used by musicians to input, output, and synchronize to musical events.

This class will introduce a variety of ways to incorporate music into Processing. Students will learn

  • How to play music and sound effects.
  • How to hook Processing up to a MIDI keyboard or instrument.
  • How to control Processing with an iPad or iPhone
  • How to control animation with a keyboard
  • Methods for sound synthesis within Processing

For both classes, students will need a Windows, Macintosh or Linux laptop. For the music class, it helps (but is not required) to have a working MIDI setup.

OMG Wheels!!!

September 23rd, 2011


Regular readers of this blog may have noticed that I have a major obsession with circles, wheels and other round objects. Much of my experimental music and art is circular or spiral in form. I collect kaleidoscopes, pictures of crop circles. The list goes on.

If I had to spend the rest of my life only with objects which are round, square or triangular, I would pick round in a heartbeat. I understand that square is convenient, but squares and boxes are boring. It goes without saying that anyone who would choose triangles and pyramids has gotta be a psychopath. Seriously… Circles, cylinders and spheres are the way to go.

Anyway, here are some mysterious ancient circles to obsess over. These appear to be related to crop circles in that they are large circular forms created by humans, but they are much, much older than crop circles, dating back at least 2,000 years. Scientists are now using the satellite images on Google Maps to study them.

Pretty cool, huh?

Kagen Schaefer’s Pipe Organ Desk

September 21st, 2011

This is undoubtedly the coolest wood working project I have ever seen. A wooden desk whose drawers emit pipe organ sounds ranging over an octave. Open the doors to play a particular melody, and a secret compartment opens. The password can be changed by turning wood screws on the wooden pneumatic logic board, shown below.

That’s right, I just said pneumatic logic board.

The desk is made entirely of wood by the phenomenal Kagen Schaefer, who specializes in elaborate wooden puzzles.

Muybridge Zoopraxiscope GIFs

September 17th, 2011

I needed some animations yesterday, so I downloaded a bunch of images of Zoopraxiscope discs by Eadweard Muybridge, and wrote a little Perl script that extracted out the images into separate PNG cels. After a little photoshop massaging to remove the backgrounds, and a little more ImageMagick, I now have 15 animated GIFs to play with.

BEFORE

AFTER

If you want to see or download the full set, go here.

Interactive Sudoku Beta

September 8th, 2011

I’m currently working on an interactive Sudoku page (to be followed by other puzzles as well). If you’d like to play with a very early “beta” version of it, you’ll find it here.

The page is designed to work in modern web browsers (Safari, Chrome, Firefox 4+, IE 9+), and also works on iPads. A few notes:

1) The page will break horribly on old versions of Internet Explorer (Version 8 or before). I haven’t gotten around to adding a friendly warning message.

2) If you want to mark cells, use the shift key (e.g. Shift-5). Use space or backspace or 0 to clear cell contents.

If you have any feedback, drop me a note in the comments of this post. If you find you greatly prefer this to printing out your puzzles, I’d love to hear it. If you think it’s OK, but is missing a very important feature, I’d love to hear that too!

Thanks for being my guinea pig :)

Sudoku Troubleshooter #3 – X-Wing

August 29th, 2011

This is part of a series on puzzle solving techniques. If you are stuck on a particular Krazydad puzzle, drop me a note, and I’ll use this space to help you out.

This is a tough puzzle, book 7, puzzle 7. It was submitted by Stephen, who got stuck after solving 4 numbers, like so:

If you’d like to try the puzzle yourself, before reading the rest of this, you’ll find the original here.

When I get stuck, I often look at one number at a time, looking for patterns. Let’s take a look at all the cells that appear to have 1 as a possibility. Am I missing any 1s?

Okay, looks like I got them all. That’s a lot of 1s! Now take a closer look at rows 1 and 4.

You’ll notice that in those rows, the 1s form the corners of a square. No other cells, but those 4 corner squares can take on the value of 1. This formation is called an X-Wing. It means that if C1 is 1, than F4 must be 1. If F1 is 1, then C4 must be 1. Thus, in both the rows and columns that are occupied by these squares, these are the only 4 cells that can take on the value of 1.

The X-pattern formed by the relationships between these 4 squares is where the ‘X’ in X-Wing comes from (and the columns and rows that shoot out are the “wings”). It means that in the columns, we can also eliminate 1 as a possibility from C2, F2, C5, F5 and C8. Having eliminated C8 as a possibility, we can now fill in the 1 for A8.

Can you see where to put a 4 now?