Nature of Code Book Chapter 1 Draft Available

Ok, so I may very well be one of the slowest writers ever, but I am pleased to finally announce that I have completed a draft chapter for what I hope will become my next book: The Nature of Code. Based on my experience getting Learning Processing out into the world I’ve decided to go ahead and experiment with self-publishing. I’m not sure what service I’ll ultimately use or exactly how I’ll distribute the text (most likely as a PDF for sale online as well as print-on-demand physical book) so feel free to write me with suggestions, etc.

Let’s take a moment to go over some of the finer points as to why I am doing this.

Dollars and cents

Learning Processing retails for $49.95 (amazon’s discount is 10%: $44.95). When the publisher sells a copy of the book, I get some money (yay for me!). Based on my first royalty statement, this works out to approximately $3.73 per copy. Sure, I’m not writing books about programming with Processing to get rich, but I did spend a couple years working hard on the project and every little bit counts.

Let’s assume for the moment that I could sell the same exact book via lulu.com. The actual cost for printing the book would be ~$14.00. Ok, so let’s say I choose to sell the book at $25.00 (half the actual current cost.) That’s $11 of profit for every book sold, lulu takes 20%, leaving me with ~$8.80 per book sold. The book costs half as much and I get more than double the revenue! Now, this is just one scenario. I haven’t decided what service to use, how much of a mark-up is appropriate, etc. But you get the idea. There’s no reason a no color, no frills, beginner programming text needs to be $50.00.

Release early, Release often

As an author, it’s just nice to have a lot of flexibility with the process. With self-publishing, I can do things like release early drafts of PDFs online for feedback (see below). This is not something I could have easily done with a traditional publishing house. Instead of spending months or years writing a book before anyone sees anything, the idea is that I can just put stuff out there (for cheap) as I type and then iterate. And there are no limits of how I choose to distribute the book (excerpts published as tutorials on Processing.org? Free on my site? PDF for a million dollars? Audio book? It’s all fair game.).

Once the book is done, I can easily continue to make changes and update. Now, Processing has a fairly stable API, one that is not going to undergo massive changes anytime soon. And sure, how gravity works, the formula for the mandelbrot set, these aren’t concepts that are going to change that often. Nevertheless, anytime you write a technical book, technology changes faster than you can write, and no matter how careful you are, there’s no way to avoid making a serious amount of mistakes. With self-publishing and print-on-demand, I don’t have to wait (possibly years) for a print run to finish selling in order to make changes. I could make them daily if I wanted to. And that Chapter on PHP that I realized I really should have included in Learning Processing, well, I could just add it whenever I so choose.

Downfalls

There are certainly some pitfalls to self-publishing. One major issue, of course, is deadlines. Without a publisher I’ve got very little pushing me forward other than myself. In fact, getting this first chapter done took me twice as long as I intended. And other projects are getting in the way, I’m not sure how fast I will actually get to chapter #2.

The other main issue is distribution. I don’t care if I don’t get my book in Barnes and Noble, I mean who is really buying Processing books at Barnes and Noble?! I do need Amazon.com, but looks like there are plenty of print-on-demand options that can be distributed via Amazon. The major question for me is university bookstores. I don’t have any numbers, but it does seem to me that Learning Processing gets stocked in a lot of school bookstores because it is being used as a text for classes. So this is something I need to figure out, how can I get a self-published book to stores.

Oh yeah, an index. The publisher made an index for me. There’s got to be a way I don’t need them for that, though.

In the end, I could be wrong. This could be a failed experiment. Maybe no one will buy it, maybe I won’t finish it. The nice thing, however, is that if I’m really headed in the wrong direction here, I can always change my mind and start sending out proposals to a publisher. But the other way around, going from a publisher to self-published, well, that wouldn’t be so easy.

So, if you’re interested in checking out what I’ve started so far, for now (subject to change), you can purchase the PDF on lulu.com. I’m selling draft chapters for small amounts with the idea that I could raise a little bit of money to pay for design, typesetting, technical editing, etc. once I’ve got a more finished draft.

http://stores.lulu.com/dshiffman

UPDATE: I’m also looking for a service that would let users buy early drafts of a book and then upgrade to the final version at a discount or for free. Suggestions for how to do this welcome.

PHP Tutorial

I’ve finally posted something I’ve been meaning to do for quite a while, a quick PHP tutorial for Processing programmers. This probably should have been a chapter in Learning Processing, but hey, if it had made it in, then I wouldn’t be able to just put it online for free.

Tutorial: http://www.learningprocessing.com/tutorials/php/

There’s an example towards the end of the tutorial that demonstrates how to use PHP to save data to a server from a Processing sketch/applet. This could be particularly useful for a high score list, etc.

Persistence: http://www.learningprocessing.com/tutorials/php/php-persistence/

Oh, and while I’m at it, I’ve got three new examples up on the Processing site:

Learning Processing Available Now

nyu bookstore

Just a quick note to let you know that my book, Learning Processing, is now available for purchase. If you are local to NYC, you can buy the book at the NYU bookstore.

Amazon says “out of stock”, but I’m told by the publisher that this is an error and they do, in fact, have copies. Also, at $37.00, this seems to be the cheapest option online that I can find.

All the example code will be available live online at learningprocessing.com by early next week. Feel free to contact me with comments, questions, feedback!

Who is this book for? Check out my earlier post.

N in N

I recently participated in 7 in 7, a scheme cooked up by the ITP resident researchers to do seven creative projects in seven days. The project inspired the currently running and oh so more manageable 5 in 5. The rules are:

Projects must be completed in a day.
Each project needs a name and documentation posted by the end of the day.

Although I did complete seven projects, it took me nine days, and some of the projects were arguably not creative, but rather a quick experiment or a “i’ve been meaning to do this for the last five years so let me see if I can just get it started in one hour” deal-ee-o. Code-wise I worked on adapting examples into Java from the wonderful book Collective Intelligence by Toby Segaran, began the process of thinking about self-publishing a book, and developed a quick bayesian classification Processing library (which I would like to make more fully functional), among other things.

Best of luck to the five in fivers, look forward to seeing the results! And a quick plug to the ITP residents’ show, which will be this Saturday, August 2nd! Details here.

Sftp with Java / Processing

I know, I know, you’ve been waiting your whole life for this.

Download beta SFTP Processing library (source and example included in zip).

The library uses JSch (Java Secure Channel).
Copyright (c) 2002,2003,2004,2005,2006,2007 Atsuhiko Yamanaka, JCraft, Inc.

import sftp.*;
 
Sftp sftp;
 
void setup() {
  size(200,200);
  background(0);
  // Create the SFTP object
  // if 3rd arg = false, you must set the password in your code
  // if 3rd arg = true, you will be prompted to enter your password
  sftp = new Sftp("www.hostname.com","login", true);
  // sftp.setPassword("XXXXXX");
  sftp.start(); // start the thread
  noLoop();
}
 
void mousePressed() {
  // At any point you can execute an SFTP command 
  // Not all commands are currently implemented
  // but you do have "ls" and "get"
  // Gosh, I should implement "put", sorry!
  sftp.executeCommand("ls");
  sftp.executeCommand("get file.txt");
}

Particles ^ 6

IMG_4873.JPG

Flight404′s recent exquisite work with additive blending and particles led me to return to an old project of mine. Of course, these days, revisiting a project translates to “add more LCD screens.”

We’ve successfully added support for passing larger amount of data across clients in the multi-screen framework and this has led to some nice experiments, including having one client capture video for the entire system. The demo below involves 3 client computers, 6 LCD screens, and 2 video cameras. Did I mention this is all works with Processing???

Multi-Screen Video Particles on Vimeo

Download QT Version of Video

Now, I have to admit. I have a problem. When I had one screen, I wished for two. When two came, I wished for 3. Then 6. Now, I wish for 12. (Well, I would really quite prefer in the vincinity of 96 screens, but I have to be realistic.)

Thanks to Michael DelGaudio for appearing in the video.

Tech Trek TV!

March 4th 2007. New York City
3 Minutes

Wherein we pick a name we like (Tech Trek: Inside ITP) and catch ITP researcher and teacher Dan Shiffman working on 6, 32-inch TVs. His project is was just up and running when we talked to him. It’s an open source Java framework for spanning real-time graphics applets/applications across multiple screens.

  • More Info: Dan Shiffman: www.shiffman.net

Another trip to Savannah.

Installing "Garden" @ Jepson Center

I’m just finishing up another trip to Savannah, GA. It’s Art & Technology Week here at the Telfair Museum. I participated in two programs, a workshop at the Moses Jackson Community Center and a demo for high school students at the Jepson Center. Haeyoung Kim (who performs under the name bubblyfish) also spoke. I really enjoyed learning about 8-bit music and am interesting in playing around with nanoloop. I hope to catch some of her performances in New York!

I also installed my new work, Garden. Oh geez, I just used Youtube again.

The Garden

It’s been a while since I published a new work. But there’s nothing like a deadline. A year ago, I installed three of my works at the Jepson Center for the Arts in Savannah, GA. Since the installation was set to run for three years, it seemed like a nice, altogether reasonable thing to say “Well, how about in a year, I come back and swap out one of my old pieces for a new one?” A year quickly fills up with teaching, working on a book, and living la vida loca. Nevertheless, here I am, a week from heading back down to Savannah and spending all day programming again.

When I first developed the two generative pieces, swarm and mosaic, I always imagined them part of a series of three. I was working on my ITP thesis, an exploration of generative systems in the production of real-time non-photorealistic imagery. Flocking. Cellular Automata. The usual. Having only one semester, I never made it to adopting their formulaic sibling, Fractals (I think I might have to name a pet Fractals some day, kind of like Freckles, only nerdier.) Looking at how L-Systems work (which we do in my nature of code class), the idea was to create a generative garden of abstract and algorithmic trees, shrubs, and flowers, growing on and about the screen, creating a nice little digital painting of the viewer.

Some screenshots and a video (first one is me, second one is my dog, Petey “Fractals” Caloyeras):

garden garden

I’m not entirely satisfied with the result, as of yet. It’s nice to look at, but it’s just the swarm effect duplicated, only instead of smearing pixels with in a flocking pattern, they are smeared in a recursive tree pattern. I like to keep things simple, but perhaps augmenting the interaction in such a way that, at the very least, the viewer has a sense of “planting seeds” might improve the experience. I also intend to try some more sophisticated plant patterns, but with only one day of experimenting, keeping it simple for now. . .

Ok, so I will probably go back to using the video comments plug-in for posting video, but how could I live one more day without at least publishing one video to YouTube??