Blog  |   Puzzles  |   Books  |   About

Goodbye, Gyorgy Ligeti

June 12th, 2006

One of my favorite composers, Gyorgy Ligeti, died this morning at the age of 83.


Time for a little Lux Aeterna.

Tag Cloud Tips

June 10th, 2006

What are Tag Clouds, you ask? Here’s a sample.

I’ve provided some tips for building Tag Clouds at O’Reilly’s ONLamp website.

This is an excerpt from my longer article, Building Tag Clouds with Perl and PHP.

Google US Puzzle Championship

June 10th, 2006

Registration is now open for the Google US Puzzle Championship, organized by Nick Baxter and Will Shortz. Players have 2 1/2 hours to complete 25 fiendishly difficult puzzles.

Mosaic Blossom

June 8th, 2006

Mosaic  Blossom #2

I’m currently working on a series of mosaics using landscape and animal photos. Here’s a sample.

UPDATE: I received a letter about this image. Here it is.

I love the work that you do, and I have a question about what an algorithm is. Is it math that you can Javascript, taken from an abstraction of poesy, or is it abstracted image?

I have a Javascript called “fireworks”, and the original colours and pattern of the work conjures up a whole poem by someone admiring a beachline by sunset.

Yours seems to say: Rose image. “I love roses”, and image synthesized from dew delineating rose shaping.

I am an artist, and I see things like this, but I never get to check things out.

How do you make an algorithm? is it hard?

Best regards,

Sue

My answer:

An algorithm is a detailed set of instructions. For example, here is an algorithm for acquiring a loaf of bread.

  • Walk out your front door.
  • Walk down the street to the east until you get to the corner market.
  • Walk into the market.
  • Walk to the bread aisle.
  • Choose a load of bread.
  • Take the bread to the counter.
  • Purchase the bread.
  • Walk home.

An algorithm can have more instructions than this. For example, in the above algorithm, I did not provide instructions for opening the front door. I did not provide instructions for the baker who is baking the bread. I did not provide instructions for how to walk. If I were writing such an algorithm for the computer, I would have to be much more detailed, because computers don’t have the common-sense understanding that humans have. I would have to explain everything in excrutiating detail. Walking to the store and buying bread is extremely difficult for a computer, because the algorithm it needs is very long and complicated. This is why we don’t see a lot of robots walking the streets with loaves of bread.

Computer algorithms generally involve manipulating data. That data might be words, colors, sounds, monetary values — all kinds of things. But ultimately, the data is represented as numbers. So, for example, the color pink might be represented as individual RGB values (red=255, blue=190, green=185) or just 255,190,185.

A sound can be represented as a series of numbers which indicate which direction the cone in the speaker moves when the sound plays back. Positive numbers move the cone forward, and negative numbers move the cone backward: 0 20 30 20 0 -20 -30 -20 0

So, the data that is being manipulated is numbers, yet it is also, simultaneously, an abstract image or poetry, or whatever the data represents. The algorithm, which tells the computer what to do with the data, involves math, because it is manipulating numbers, but it can simultaneously involve non-mathematical ideas, such as painting.

Making an algorithm for a computer involves being able to translate from the world of human concerns (painting, cooking, writing, whatever) to the more symbolic and numeric concerns of the computer. It is a skill that is acquired with time. I suspect that some people have a natural affinity for it, and can learn it more easily.

There are also some programmers who are not particuarly interested in human concerns, so they tend to translate one level of computer concerns to another level of computer concerns. These folks are “low level” or “system” programmers.

I myself am a “high level” or “applications” programmer, because I like making software that involves more human-centered issues, such as user interfaces, software toys, art and music.

So yes, making the image above involved some math, but it also says, “I love roses,” or perhaps more accurately, “I love the processes that cause things like roses to happen.”

If you’re interested in learning more about this subject, a good book to read is “The Pattern on the Stone,” by Danny Hillis.

Petals around the Rose

June 3rd, 2006

Petals around the Rose is a puzzle in which you must figure out an underlying system based on the roll of 5 dice. It took me about an hour to figure it out. Some people get it right away, others take months.

Here are two versions.

Chris Davis’s version (flash)

Lloyd Borrett’s version (javascript)

Virgin Territory

June 2nd, 2006

While on a morning coffee run with a coworker, we chanced on the subject of religious experience, and I mentioned that exploring mathematics is the closest I’ve come to a religious epiphany. Although this notion is probably familiar to folks versed in the physical sciences, my friend was surprised to hear it. I brought up fractals made with complex numbers as an example, and was pleasantly surprised to find that my friend was unfamiliar with them.

On getting back to the office, I fired up a windows program I had written a couple of years ago.

“Look at this shape. Have you seen this before?” I asked.

“No,” my friend said, “it looks kind of like a Buddha!”.

My heart skipped a bit as I realized I was in the presence of a Mandelbrot virgin. There was only one thing to do. Zoom in!

So I pressed the left mouse-button and proceeded to give my friend a guided tour of the hidden buddha-nature of this complex landscape. It is always a pleasure to introduce the Mandelbrot set to a newbie. Zooming into it for the first time is like opening up a fresh jar of wonder.

My program exploits the acceleration on modern graphics cards to do fractal zooms in real-time. You use the left-mouse-button to zoom in, and the right-mouse-button to zoom out. There are various other keys that do things, but that’s all you really need. As I explored and explained some different locations in the mandelbrot set, my friend sat there and said “Wow!” repeatedly, as unjaded Mandelbrot virgins are wont to do.

This was also a good time to explain the bizarre concept of “imaginary numbers,” so I made a stab at that too. I must admit, I still find imaginary numbers damnably counter-intuitive. I’m just glad they make such pretty pictures! The only other time I’ve encountered them in my work is in making pretty music – they are also used in audio effects processing.

Later, when my friend asked for some links to some software for exploring the Mandelbrot set, I had a hard time (using Google) finding software that does these kind of continuous zooms (although I’m sure there is lots of it out there). There is tons of Mandelbrot software on the Internet (writing such programs is a common hobby for newbie graphics programmers). The heydey of Mandelbrot exploration was probably the late 80s and early 90s. The problem is that a good deal of the Mandelbrot software that is out there and easiest to find was written some years ago, and is designed to generate still frames only. So there’s a lot of noise covering up the good stuff, and a need for simple programs with more intuitive interfaces.

Then there’s my software. Even though it’s a bit half-baked and completely undocumented (I just wrote it for my own use), I thought I’d provide it here, for those that lack a suitable substitute. If you have a friend that is a Mandelbrot virgin, you too can add a little wonderment to their world.

Here is my program, MandelZoom. Like I said, windows only.

MandelZoom supports the following commands, which are single keystrokes:

Escape Quit the program
Home Reset
Page Up Change Rendering Style
Page Down Change Palette
f Toggle Full screen
j View corresponding Julia set
p Take a screen snapshot
arrows Pan

There are a few other hidden commands in there (+ – [ ] space), which I’ll leave undocumented, for messing with the colors. You’ll figure them out if you dig.

Although this is a windows program, the source code is fairly portable. At some point I’ll get around to putting up a Mac executable. If you’d like to compile it on another platform, and you’re familiar with OpenGL/GLUT programming, here is the source code. Don’t try this if you’re not an experienced programmer. I love getting your emails, but it is not a good medium for me to teach you C++. :) If you manage to do a successful port, let me know, and I’ll link to it below, when I update this post.

No doubt, there are much better programs out there, with the same real-time zoom capabilities. If you know of them, please tell us in the comments, and I’ll mention the better ones below as well.

UPDATE: Krazydad irregular Ryan Govastes points us to a more full-featured cross-platform program called Xaos. Oooooh. Smooth zooms! The first of many, I am sure.

Krypto Kakuros in Games Magazine

May 26th, 2006

Hey look at that! I managed to sneak a few of my Krypto Kakuro puzzles into the July issue of Games Magazine!

Welcome puzzle solvers! If you’re visiting Krazydad because you want more puzzles, you’ll find ’em here.

Also, you may enjoy the various offerings in the fun & games section.

Processing Group at Flickr

May 26th, 2006

Logarithmic Starburst

The Processing group at Flickr contains a gallery of stunning images created with my favorite language for making motion graphics and algorithmic art: Processing.

As I’ve mentioned before, processing is an excellent first language for budding algorithmic artists.

Clouds, clouds, everywhere

May 24th, 2006

When I told my family I wrote an article about tag clouds for O’Reilly, they went “Huh? What’s that?” But then again, these are the same folks that thought I was writing an article for this guy, instead of these guys.

Anyway, this is a tag cloud:

This particular tag cloud is a map of my interests for the past few weeks, based on the bookmarks I have been saving to my del.icio.us account.

My new article, “Build Tag Clouds in Perl and PHP,” shows you how to build one of these amorphous wonders for your website. More importantly, it shows you how to use them effectively, and it contains the word “pie.” Doesn’t get much better than that. Here’s the official blurb:

Tag clouds are everywhere on the web these days. First popularized by the web sites Flickr, Technorati, and del.icio.us, these amorphous clumps of words now appear on a slew of web sites as visual evidence of their membership in the elite corps of “Web 2.0.” This PDF analyzes what is and isn’t a tag cloud, offers design tips for using them effectively, and then goes on to show how to collect tags and display them in the tag cloud format. Scripts are provided in Perl and PHP.

Yes, some have said tag clouds are a fad. But as you will see, tag clouds, when used properly, have real merits. More importantly, the skills you learn in making your own tag clouds enable you to make other interesting kinds of interfaces that will outlast the mercurial fads of this year or the next.

The Shape of Song

May 24th, 2006

Martin Wattenberg’s The Shape of Song provides a series of graphic analyses of MIDI files. The arches link musical phrases that are repetitions of each other, and provide a striking guide to the structure of the music.

The above image is Madonna’s “Like a Prayer.” The site contains images of varying styles of music ranging from Bach to Philip Glass.

Link courtesy of Darryl Handy.