aparrish: (Default)

Who's making a CGA-era PC Zelda clone for TIGSource's Bootleg Demake competition? That would be me.

The above screenshot is taken from DOSBox, running my little DOS program (compiled with Turbo C!). It's just drawing tiles to the screen right now—there's no animation or logic or anything. Just figuring out how to get pixels to the screen in CGA mode was a pretty big task for me. (I, uh, never really did any hardcore DOS programming back in the day.)

Realistically, there's no chance I'll finish this, but I've been having fun getting it this far...
aparrish: (Default)

This past week I participated in 5-in-5, along with a number of current ITP students and recent alumni. The challenge:

Do a creative project every day for five straight days, starting Monday, July 28th 2008

Projects must be completed in a day, so they need to be as compact as they are creative

Each project needs a name and documentation posted by the end of the day. It should be a stand-alone accomplishment

And so I did! It was fun and productive, but surprisingly exhausting. Here are my projects. The links for each day go to more detailed documentation on the 5-in-5.com blog.

Day One: Mega Man Linocut Prints

Also featured in Bre Pettis' overview video.

Day Two: twbasic: BASIC for Twitter

Send your BASIC listing to @twbasic. (It may take a while to respond... for some reason the replies API doesn't like to update very frequently.)

Day Three: Subwoofer Tactics (w/C. Anderson Miller)

A board game powered by a 30-watt subwoofer.

Subwoofer Tactics from Anderson Miller on Vimeo.

Day Four: Strokeweight (a New Interface for Textual Expression)

Translates between "drawing" gestures and "writing" gestures.

Strokeweight: Writing with fruit and Dunsany from Adam Parrish on Vimeo.

Day Five: Binary Telepathy (also with C. Anderson Miller)

I attempted to transmit binary data to eight experimental subjects using only my mind. Of the attempted 64 bits, 36 were correctly divined.

Distribution of Correctness for ESP Transfer

A few of my favorite projects by my fellow 5-in-5ers: Throwing Light, Japanese Family Crests, ZenTV, Flexible Cardboard Surface, and Vikram's honey, lavender and habanero ice cream.


Mar. 3rd, 2008 09:55 am
aparrish: (Default)
My thesis uses WebKit as a text-rendering engine. This has a number of advantages that make it worth the effort: easy printing is one, the familiarity of manipulating documents through the DOM is another. The main disadvantage so far is having to do the whole thing in Objective-C with the Cocoa framework. I didn't expect to dislike this combination, but when I sometimes feel like I should just can the whole thing and do it over in Java (!), then you know something must be wrong.

Among the annoyances:
  • We'll start with the most trivial one. Cocoa doesn't have any kind of random number framework—you have to use BSD's random(), and roll your own functions around that. Now, I don't like the way Java does random numbers, but at least its library provides a way of generating random numbers with a Gaussian distribution (which would have been helpful for this project). (Anyone know of a good C library that will do this for me?)
  • Cocoa doesn't have a native regular expressions library either. Yes, I know you can do this with regular C, and I know there are third party frameworks out there to help you do regular expressions in a more Cocoa-ish way, but this still feels like a huge omission to me, especially when NSString has so many other niceties.
  • No garbage collection. Not only that, but the rules about when to use [object retain] and [object release] are weird and cryptic and kind of scary.
  • Cocoa method names are usually needlessly verbose. Whoever chose objectAtIndex as the method to get an object from an indexed collection (instead of, say, get) should have to PAY for all the weird line breaking contortions I have to do in order to make my code neat.

Sure, I'd have garbage collection if I used Objective-C 2.0, and using Python would solve nearly all my problems. I wanted to learn the framework in its native language, though, and more importantly I want all this stuff to work on 10.4 in addition to 10.5. (Also, and most importantly, I don't have Leopard yet.)
aparrish: (Default)
There comes a time in every person's life when he or she must quine. This evening, gentle readers, that bell tolled for me. I was pretty happy with my initial attempt in Python:
qu = '\x22\x22\x22'
def pr(p): print p; print "pr(r%s%s%s)" % (qu,p,qu)
pr(r"""qu = '\x22\x22\x22'
def pr(p): print p; print "pr(r%s%s%s)" % (qu,p,qu)""")

Not very advanced stuff, sure, but it gets the job done (without backticks!).

Here is an attempt to write a quine in Processing. The approach I used there is slightly different from the Python code above; it also draws its own source in the applet window, which is kind of fun. You can see the rigamarole I had to go through in order to cope with Java's (apparent) lack of a multiline quoting structure, along with my desire to keep the code easy to read.

Suggestions and feedback solicited: at this point, I'm just relieved to have finally understood the concept of a quine after all these years.

Links: More information on quines, Python quines written by people more clever than me.
aparrish: (Default)
Tecmo Bowl

I stopped by GameStop on the way home from the train station today. There was a young fellow, maybe fourteen or fifteen years old, talking to the guys behind the desk. He says to them, "What can you tell me about Tecmo Bowl?" One of the register biscuits replies, "Oh, that's an old game. Really old." And the little kid replies, "Oh, like PlayStation 1?"

I think to myself, "Oh my god, this kid thinks that the PlayStation is old. I'm an old man."

Then the register biscuit replies, "No, even older than that, it was a Sega Genesis game."

Then I thought to myself, "Wait, no. Tecmo Bowl was on the NES!"


"Jesus, so I'm old, and I'm a dork."


Can someone recommend a good book on Java? I have a summer internship starting in a few weeks (with Alex Galloway!) that will require me to present myself as being more fluent in Java than I actually am.

I've done a bunch of Processing over the last two semesters, and hacked together some stuff with Java and OpenGL. I'm familiar with Java basics (like having to put f after all my floating point literals, for the love of holy), but I don't think I could put together a clean project written in idiomatic Java on my own.

So I need a book. I need a tome that will, with a knowing wink, guide this stripling into Java's fragrant bosom. Others have suggested Head First Java, which looks good but seems like it might spend too much time on stuff I already know. Any ideas?

A Poll

[Poll #973507]


Mar. 22nd, 2007 02:22 am
aparrish: (Default)
  • Ninbento: Visualizing audio with a circuit-bent NES. Screwy, psychedelic, awesome.
  • Knytt: This kept me up late last night—a brilliant (freeware, but Windows-only) platformer, focused on exploration. Plays and looks a lot like "Seiklus: The Lost Levels." (In fact, the designer cites Seiklus as a primary influence.)
  • Cool Bubble's "Elle": A brilliant way of making L-systems interactive. Other applications of L-systems that obviate all other inquiry: Luke DuBois' dissertation. Be sure to watch the video—the guitar is being played live, and a computer translates the notes into instructions for drawing the plant-like structure. Really amazing. (We're studying L-systems in one of the programming classes I'm taking this semester, and all I got out of it was some crappy generative poetry. I sure wish I'd come up with these ideas instead.)
  • Heaven's Gate: The Sequel: LA Weekly's retrospective/follow-up on the Heaven's Gate suicides. I didn't realize that they raised money by doing web design. Or that they ate at Marie Callender's the day before they headed off to Hale-Bopp ("39 chicken potpies, 39 salads and 39 pieces of cheesecake").


Jun. 14th, 2006 06:43 pm
aparrish: (Default)
So I've taken up Python. I'm a Perl programmer—a prototypical Perl programmer, in that my professional career has, in the main, consisted of writing CGI scripts and maintaining other people's CGI scripts. Forays into the actual writing of software as opposed to slapping some crap together or poking sticks at other people's crap have been few and far between. So I'm still learning. This is all preliminary.

I just wanted to write for a while about what it's like to code in Python after all these years of Perl.

Perlish things I'm used to that Python won't give me:
  • Anonymous subroutines. I know about lambda, but it isn't the same. There's something very intuitive about the way people use anonymous subroutines in Perl, especially for event-driven stuff.
  • Sigils. I like sigils for two reasons. They make it easy to pick out variables from the rest of the syntax. (They're like articles in this way, or word endings in Esperanto.) They also help prevent naming conflicts with reserved words or subroutines defined in modules. Oh, and it's easier to read when you want to interpolate them into strings!
  • $_. I don't like having to name my temporary loop variables! Writing stuff like print foreach @foo is awesome, much more so than for x in foo: print x.
  • Chapter 24 of Programming Perl ("Common Practices") basically taught me everyting I know about writing good Perl. I can't find anything similar for Python. Is there something out there that has examples of good, idiomatic, fluent Python in a concise, easy-to-read format?

Python things that make me want to keep coding in Python:
  • Sane scoping (for the most part). I don't have to type my all over the place!
  • Internal data types are objects. I feel like this makes for more intuitive code. And I like that I can make my own objects behave like built-ins without messing around with crazy tie stuff.
  • The % operator! Clever.
  • List comprehensions. Sorta. You can do the same thing in Perl with map/grep, but it's not quite as readable or convenient.

On the personality front, Larry Wall looks like Richard Kiel, but Guido van Rossum looks like Robert Pollard. So it's kind of a draw.

March 2016

20212223 242526


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 21st, 2017 05:05 am
Powered by Dreamwidth Studios