Articles by adam

You are currently browsing adam’s articles.

Last Saturday, Socialbomb held its first Hack Day.

I had two goals for Hack Day: (1) get a PS/2 keyboard talking to an Arduino and (2) make something interesting with processing.py. Here’s the end result (make sure to click through to the full-screen version for maximum legibility):

Crazy Animal Stories Keyboard from Adam Parrish on Vimeo.

It’s the Crazy Animal Stories Keyboard, a keyboard which intermittently replaces whatever you’re typing with a Crazy Animal Story.

It turns out that the part of this project that I thought would be difficult turned out to be easy: getting a PS/2 keyboard talking to an Arduino was a piece of cake. I already had a bunch of mini-din connectors; I just soldered one up to a breadboard, hooked it up to my trusty Arduino Diecimila, put the excellent ps2keypolled library in my libraries folder, plugged in the keyboard and voila: keystrokes gettin’ read.

Here's what the setup looks like

globbiest solders since middle school

I’ve got big plans for the PS/2-to-Arduino data chain, involving a data logging chip and shoes made of keyboards and sledgehammers and/or yogurt. But for Hack Day, I just wanted to whip up something fun. So the next step was to get the keystrokes from the Arduino to my computer, preferably into a processing.py sketch. Much to my surprise, Processing’s serial communication libraries worked with processing.py without a hitch*, which left me free to write the tiny little generative text toy that you see in the video above.

The biggest unforeseen timesink: I spent a few hours trying to figure out the best way to send ps2keypolled’s 16-bit key codes from the Arduino to the computer, eventually settling on the stupidest possible ad-hoc protocol that could work (and porting a big chunk of C code to Python to translate the key codes to ASCII). See the source code for more details.

Most surprising happy discovery: processing.py is amazing. Being able to quickly write the text-munging code in Python while still retaining Processing’s built-in functions and easy-to-use libraries is just… a revelation. For a project that’s just a few weeks old, it feels surprisingly polished. If you’ve got Python and Processing expertise, I recommend you give it a go.

Source code for the whole shebang: crazy_animal_keyboard_source.zip

Here’s a picture of Mr. Brendan Berg enjoying his time with the device, while I appear to be leering lecherously:

20100821-IMG_1981

* Okay, there was a single hitch. Apparently, the serial communication library included with Processing (and, therefore, processing.py) doesn’t support 64-bit Snow Leopard (as documented e.g. here). I was able to get around this without problems by using the -d32 parameter to the java runner, i.e.

$ java -d32 -jar processing.py animal_keyboard.py

Tags: , , , , , ,

Poetry in the Post-Now
Bowery Poetry Club
308 Bowery, New York, NY
May 8th, 2010, 12pm-2pm

This is going to be an amazing event. There will be performances, demonstrations, installations and readings from two ITP classes this semester: my Reading and Writing Electronic Text class and Nancy Hechinger’s Writing and Reading Poetry in the Digital Age.

This event is intended to be a showcase for the many text-, language- and poetry-driven projects at ITP, which are sometimes unsuited to the noisy glamor of the regular ITP show (which you should also attend!). I have been overwhelmed by the quality of student projects in both classes, and I’m excited to see them presented and performed.

A sampling of projects from my class: Ramones lyrics interpreted as code, Semaphore Hero, “tagrostics” (procedurally generated acrostics built from word frequency analysis), reading the Ramayana with regular expressions, procedurally generated Vogon poetry, poems composed by weather conditions, self-conversation mangled by Markov chains, physical interfaces for remixing movie subtitles, and more! It may not actually be possible for there to be a better way for you to spend your Saturday afternoon.

Here’s the poster in PDF format. Promotional materials designed by Ted Hayes.

Tags: , , ,

Last October I undertook a “lexical analysis” of the Twitter and Facebook APIs. Twitter came out on top in that analysis. I concluded that Twitter’s “simplicity … has been an important factor in [its] widespread growth among both users and developers” while Facebook’s “baroque and insular” API makes it impossible for users and developers to “keep track of how everything works together.” Facebook’s been promising changes for a while, and change has indeed arrived, in the form of the new Graph API. So how does the Graph API compare, lexically, to Twitter? Here’s a revised analysis. (Spoiler: things are looking much better for Facebook.)

Facebook Graph API Twitter
Verbs
get
post
delete

Nouns
album
photo
event
group
link
note
page
photo
post
status message
user
video
comment
feed
noreply
maybe
invited
attending
declined
picture
member
home
tag
activities
interests
friends
music
books
movies
television
likes
inbox
outbox
updates
search

Verbs
get
show
update
destroy
post
put
exists
verify
end
follow
leave
report
request
authorize
authenticate

Nouns
search
trend
status
timeline
mention
retweet
friend
follower
direct message
friendship
id
account
session
delivery device
color
image
profile
favorite
notification
block
spam
search
token
test
place
geocode

The tally: the Twitter API holds steady with 26 nouns and 15 verbs. The Graph API, meanwhile, has 35 nouns* and 3 verbs—a tremendous improvement on Facebook’s old (so-called) REST API, which has 43 nouns and 24 verbs. The Twitter API and Facebook’s REST API average around 1.7 nouns per verb; the Graph API has almost 12 nouns per verb. What’s especially interesting? The Graph API has managed to sidestep any verbs that aren’t HTTP methods.

The Graph API is a big deal, and an important step forward for Facebook. Here are a few reason I think that’s the case.

First of all, the Graph API is dead simple, especially compared to Facebook’s old REST API. Just as an example: the old API has (by my count) seven nearly synonymous verbs (set, create, add, register, upload, send, publish) that all essentially mean “add content for a user.” These verbs aren’t interchangeable; each works with only a subset of nouns (or even just a single noun). Each verb has idiosyncratic behaviors, arguments and error messages. The Facebook REST API is, in short, a mishmash of conflicting conceptual models. It’s tough to get a handle on all of it.

Not so with the Graph API. Every resource has exactly the same interface. Once you understand what each noun is, it’s easy to understand how to manipulate it—there are only three possible verbs, after all!

The complexity of the REST API necessitated a client library to perform even very simple operations. The Graph API, on the other hand, is so simple, I think that most developers won’t even use a library at all—it’s easier to just hit the URLs directly. Simply put: if you know how to make HTTP requests, you know how to use the Graph API.

That’s the second thing that makes the Graph API so important—it’s the web. The Graph API isn’t just a bunch of function calls for retrieving information; it’s a set of URLs to representations of the data itself. The data is all in JSON format, so it’s easy for browsers to consume it directly. Image URLs return the images themselves, so they can be thrown right into img tags without an intermediary API call. Most importantly, the resources returned from the Graph API are hypermedia: they include URLs to related resources. An example (from the documentation):

{
   "name": "Facebook Developer Garage Austin - SXSW Edition",
   "metadata": {
      "connections": {
         "feed": "http://graph.facebook.com/331218348435/feed",
         "picture": "https://graph.facebook.com/331218348435/picture",
         "invited": "https://graph.facebook.com/331218348435/invited",
         "attending": "https://graph.facebook.com/331218348435/attending",
         "maybe": "https://graph.facebook.com/331218348435/maybe",
         "noreply": "https://graph.facebook.com/331218348435/noreply",
         "declined": "https://graph.facebook.com/331218348435/declined"
      }
   }
}

The URLs are right there in the document, meaning that you don’t have to know anything else about how the Graph API works in order to get information related to a resource. Pretty slick. It’s an idea that (I think) every web API should incorporate.

There are, of course, a few factors that mitigate my enthusiasm for the Graph API. First off, it doesn’t quite model the entirety of Facebook’s functionality yet—notably, there aren’t any resources (so far) representing Facebook applications themselves. There are also privacy concerns that need to be addressed (for example, event listings).

Overall, though, the Graph API is beautifully constructed. It’s just as robust as the Facebook’s old API, but simpler, more convenient, and easier to integrate. As a developer (and programming instructor), my opinion has always been that Twitter’s main advantage over Facebook is its developer-friendly API. The Graph API has the potential to erase that advantage.

* There are a number of verb-like words and verb participles in the Facebook “noun” list. I classify them as such because, to my eye, they’re clearly presented in the API documentation as things you can act on, rather than actions you can take. For example, attending means “users who are attending something,” and acting on that resource allows you to fetch or manipulate that list of users.

Tags: , , , ,

Text lathe prototype

Text lathe prototype from Adam Parrish on Vimeo.

This is a little prototype for a textual interface that I came up with last week after receiving my nanoKONTROL. (I saw Jörg Piringer use one of these in a live electronic sound poetry performance last year at E-Poetry, and I knew I had to have one.) The idea is that two knobs on the controller determine how much text is cut from either side of a text fed to the program on standard input; another knob controls how fast lines of text are read in and displayed. It’s a very simple mapping, but I’m pleased with the results so far.

Tags: , , , ,

Forgot to mention this: Earl Grey won “Best Puzzles” in this year’s XYZZY awards! Rob and I were ecstatic with this result, especially considering the tough competition. IFWiki has a list of all the award winners and nominees, along with links to reviews and downloads. You should, of course, go play Earl Grey if you haven’t already, but there is so much more in that list deserving of your time—Blue Lacuna in particular lives up to every bit of the praise it has received.

Tags:

Another Castle

I’ve been in busyland lately, but I thought I’d post a quick update with a link to my appearance on Another Castle, NYC’s premier game design-related podcast. It was a really fun conversation! Charles and I discussed a number of things, including the Interactive Fiction scene, conversation (and language in general) in games, and games as texts. Here’s the audio file, but you really should go subscribe; the archives are amazing, and there’s a great new interview on a regular basis.

Just made a post this morning on Warp Skip regarding Foursquare, XBL achievements and usability. Here’s an excerpt:

Gamerscore and achievements serve a similar purpose. They give you feedback on your play; they give you acknowledgment when you do something noteworthy; they let you know (in broad terms) how much of a game’s content you’ve completed; they let you compare the way you’re playing the game to the way your friends are playing it. Achievements are one of the reasons I prefer playing games on the 360 to playing games on (for example) the Wii: more feedback, more context, makes for a more fun gaming experience.

With a few notable exceptions, no one plays games just for the achievements. They’re not a goal in and of themselves. Likewise, no one “plays” Foursquare just to get the badges. Both badges and achievements are there to let you know that your activities follow a particular pattern. As an added benefit, badges and achievements you haven’t earned yet suggest what other patterns are possible.

I wrote this before I read Sirlin’s response to Jesse Schell’s lecture, in which we are urged “to be vigilant against external rewards” (such as achievements). “How resistant are you to letting others manipulate you with hollow external rewards?” asks Sirlin. Obviously, I am much more sanguine about achievements—I think that people like them because they are useful and fun—and hope to argue for this more effectively in a future post.

Tags: , , ,

Lumarca

Friend and colleague Matt Parker just posted a video of Lumarca, an open-source volumetric 3D display. Lumarca was Matt’s thesis project at ITP, and appeared most recently at SIGGRAPH Asia:

It’s pretty awesome.

Gizmodo has a good roundup of the technologies behind a number of commercial 3D displays. Take a look and you’ll see that none of this technology really has a chance of getting into the hands of artists, makers and hackers any time soon. Lumarca, however, is ready to go. Here’s the build instructions and source code.

Tags: , , ,

Weekend roundup

A few quick links:

Tags: , , , ,

On top, we have a table of truth values that result when comparing values of different types in PHP. On bottom, we have a chart illustrating the strengths and weaknesses of the seventeen types of Pokémon. Is it crazy to wonder whether one might have influenced the other?

The former is a matrix of arbitrary values intended to produce convenience. The latter is a matrix of arbitrary values intended to produce fun. In my experience, neither achieves its goal. But both follow an arbitrary logic, strangely twisted through history and culture, that might someday make a good subject for a Ph.D. thesis. (Why does a non-empty string equate with integer zero? Why is Psychic strong against Poison?)

Tags: , , ,

« Older entries