|
2008.11.08 in code and gnome
So! Robb announced the first release of Seed tonight! It's been a crazy journey, so far, and we're just starting!
In any case... I'm hacking together Debian packages for our PPA for version 0.2, which will probably land in a week or so... then it'll be really easy to get going...
2008.11.03 in code and gnome
Here's a bunch of applications Robb, Matt, and I have written in Seed... the source is all in Gnome SVN...

Lights Off was Matt's first application — he went from having written no Javascript at all to a nice, working game in a matter of hours one night.

n-oscillator was more or less the first working GTK application; Robb wrote it (who else would be interested in making annoying noises at all hours!?) just to figure out how to get things working... it lets you start an arbitrary number of oscillators and adjust their volume and frequency, and uses GStreamer for output.

calc was my first GTK+seed application. I wrote it on the train on the way to the Gnome Summit, without any documentation... it's a horrible front-end for eval, nothing else!

mini-browser is my rewrite of Robb's original WebKit/seed web browser, Spacewhale. It provides a tabbed interface (though, because of a WebKit bug, no GTK/WebKit-based browser can 'open in new tab/window' at all...), but not much else... I'm planning on revisiting this at some point, and getting it to a state similar to epiphany-webkit.

repl is where a lot of our testing takes place, since it provides immediate feedback. It's a rather vital part of an interpreted language, and can be written in very, very little Seed code:
#!/usr/local/bin/seed
while(1)
{
try
{ Seed.print(eval(Seed.readline("> "))) }
catch(e)
{ Seed.print(e.name + " " + e.message) }
}
shader is a cute demo Robb wrote that lets you edit GLSL shaders and apply them to an image, using Clutter to display the image and apply the texture. ide is a small Seed editor that I've been writing, eventually providing syntax checking and (maybe) debugging of Seed apps.
2008.11.03 in code and gnome
I've finished my Seed tutorial, which takes you from square one to writing a quick WebKit-based web browser in Seed, while explaining bits of Javascript and GTK along the way.
I tested it out on Matt, and he's got a working copy of the browser now, so I guess it works...
Firstly, I've started tagging photos that I've used as backgrounds before here.
First-and-a-halfly: posting to WordPress from WebKit nightlies is still broken. Firefox on OS X. Yuk.
Secondly! Last weekend was the GNOME Developer's Summit; Matt and Robb and I went. We stayed at Matt's house again, which was excellent and convenient as always! The first day involved a talk from two of the awesome guys working on gobject-introspection (which is also a cornerstone of our project), which cleared up some of my fuzziness about introspection and their implementation (to some extent).
We (Robb) talked to Mark a little bit that day, and explained our plans (which I have yet to detail here, and won't today!). More about all that later...
Seed release later this week, after the planned gobject-introspection release. Yay for Seed! I'll write more about it after the release, post the tutorial I'm writing, etc. Pay no attention to the tutorial in SVN; I haven't gotten a GNOME SVN account yet, so none of my updates are there... we just switched to SVN from a Bazaar repo @ Launchpad, so all of our commit history is missing too... oh well. In any case... all will be fun!
P.S. Intervalometer is waiting on PCBs from BatchPCB, so it might be a while!
P.P.S. Registration soon (the third)! Looking at... Programming Languages, Graph Theory, Models of Computation, Multivar, Engineering Processes, Electronic Circuits (that'll get me through the end of Junior year CS and a little further... also not taking Typography this semester because apparently the teacher is... not... optimal... and everyone)
P.P.P.S. Robb's going to be working for litl starting next week. Yay for an NDA with your roommate :-P
So! It's been an awfully long time since I've written here; that's mostly because of school and stuff, also because I wasn't quite sure when I was going to get around to introducing my latest project, which is one of the only other things I have to write about right now!
I guess I'm finally getting around to introducing said project to everyone!
One of my "complaints" about my D80 is the lack of built in intervalometer (providing, of course, the ability to take time-lapse photographs). I won't be happy until I've duplicated every bit of functionality that my old Coolpix had, and this is really the only thing remaining... but the market for such devices leaves much to be desired. Prices are insane (as is usual in the photography world), with less justification than usual.
I've been a long time out of electronics (long long time), so I figured this would be a good project with which to get my feet wet again (in the process, I remembered how much fun it is to be able to manipulate things you build, and how awesome — if frustrating — the added puzzle of DIY hardware is)...
I started out by deciding what I wanted in my intervalometer, and ended up with the following list:
- Interval mode: straightforward, take a picture every so many seconds.
- Interval Bulb mode: take a picture every so many seconds, keeping the shutter open for a given duration
- Bulb mode: provide a way to hold the shutter open for longer than the camera's 30" limit
- Trigger mode: coupled with external trigger devices, allow the capture of photographs based off of high-speed triggers; such devices could be a laser beam-break switch, or a microphone
These seemed like a reasonable goal — if anyone can come up with an obvious or otherwise useful mode I'm missing, I'd be more than happy to add it! Next step was deciding my platform; this wasn't a particular problem, what with MAKE and the rest of the hobbyist electronics internet heralding the Arduino as the next coming of Einstein. I bought two Arduino-derived devices: the official Diecimila, and an unofficial clone, the Stickduino. Both have FTDI chips onboard, so they can plug straight into USB and be programmed from the Arduino environment (based loosely off of the Processing UI, which luckily runs natively on OS X, which factored in to my decision a little as well). Of course, our dorm wasn't exactly set up for electronics work, so I spent a bit more GSoC money getting all the random generic parts, breadboards, wires, tools, etc. that we would need for just about any project. I also grabbed some more project-specific parts: rotary encoders, LCDs, and various bits of silicon. I posted some pictures of the subsequent assembly on my Flickr, though none of them are up-to-date at all (I'll post more pictures tomorrow, perhaps, depending on homeworks). In fact, I'm confident in saying that nothing that sits in the most recent pictures is still on my breadboard, and the addition of 4 external ICs (shift register, digital potentiometer, 7400, 555) for various purposes has massively complicated things. New pictures must be taken! I'm at the point of PCB design now; I have working software, though there's still lots to grow there! I have to reconstruct my circuit from the ground up, and also test out the part of my schematic that involves driving the ATmega, since I'm not putting a whole Arduino in each intervalometer... EAGLE is a little bit complicated (much more so for PCB design than schematic work, which I'm getting quite comfortable with...), but seems to be what everyone uses! I've posted my code and schematic here, in a git repo. Have at it! (Especially if you see any obvious reductions to be made...) The last thing I have to figure out is what I'm going to do with the design when I'm done! I'm most certainly going to publish complete schematics, source code, ideas, pictures, parts lists, etc., but I think that it would be not-horribly-unreasonable to offer a kit, or even a constructed version for a significant bit of profit, and still be incredibly competitive (competition being ~150$ devices with no LCD and a couple of random knobs). The parts cost for my design is ~30$, not counting an enclosure and the PCB, neither of which will inflate the price much beyond ~50$... a featureful, pretty, easy-to-use, Canon-and-Nikon compatible intervalometer in the 80-90$ range would — I think — be welcomed, and provide a fair bit of profit, as well!
2008.08.15 in code

Here's a post I promised a long time ago. I was playing around with Lisp back in late June, and wrote a little brute-force n-body problem solver. I should note that when I say brute force, I mean most naïve solution possible -- summing all of the forces, etc.
It seems this is one of the first things I write in a new language now... not sure why, it's not exactly a very good test of any language; at least not this type of implementation.
After the Lisp bit, I wrote a little point viewer in Perl (with Perl::OpenGL). It's not as pretty or fast as the one Radiohead used that was implemented in Processing, but this was before that was announced, and I've never (yet) written anything in Wiring/Processing, so I wouldn't have thought to use it.
So; it's all really very slow, and silly. Very. Very. Slow. But, it works. Also, it's physically inaccurate, in order to get results in any reasonable number of frames. Like, G is seven orders of magnitude larger than normal. So much for gravity being the weakest fundamental force... (EDIT: actually no. it's still not even close.)
So, for your particle-simulating-pleasure: the Lisp and the Perl.
So I made a little discovery in a 7 year old mailing list post yesterday, and found out how to create a fully-functional Cocoa app, without letting the default run loop take over permanently, and without embedding the executable in an application bundle. Here you go:
EDIT: OK Wordpress is being silly; obviously, put < > around the #import file :-)
EDIT 2: Also, obviously, you need MainMenu.nib to be in the same folder as your executable.
EDIT 3: If you want to go NIBless, use NSBackingStoreBuffered, not the default NSBackingStoreRetained when creating your window!
// Build like so: gcc short.m -framework Cocoa
#import Cocoa/Cocoa.h
int main(int argc, char *argv[])
{
[[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
[[[NSNib alloc] initWithContentsOfURL:[NSURL URLWithString:@"MainMenu.nib"]] instantiateNibWithOwner:NSApp topLevelObjects:nil];
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
[NSApp finishLaunching];
while (1)
{
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0.001] inMode:NSDefaultRunLoopMode dequeue:YES];
if (event) [NSApp sendEvent:event];
}
}
2008.07.18 in code
Last last summer, I inherited a set of old IBM PSLs from my physics teacher. In case you don't keep up with your early-eighties home science labs, it's a rather large beige box with all sorts of modules that you can plug in, which in turn plug in to sensors (light, temperature, sonar, etc.). It's got a 25-pin serial interface, so it took a bit of ... maneuvering ... to get it attached even to my old PowerMac G4, or Robb's desktop (the machine formerly known as cary3). Crazy, I know!
Way back before last Christmas, I wanted to get the PSL temperature probe, at the very least, working. A little bit of Python later, and it was working! (the manual had sample code for all sorts of things, and also detailed protocol and implementation documentation — try to get that from nVidia!)
I then wrote a little canvas-y viewer script, and left it running, polling the temperature in our room in Cary Hall every minute for approximately two and a half months. The final output is here:

You can pretty clearly tell when Robb and I weren't at school (especially spring break, the really smooth wavy part near the beginning). It was cool at the time, just a cute little thing... I dunno!
Anyway. I put it back up, here at home.
2008.06.25 in code
Here's a quick Perl script that I wrote to display Guitar chords. Really hacky, really quick, really messy, but I really just needed it for myself!
There's a live version here.
I'll write about NYC later! And pictures! And stuff...
2008.06.17 in code
I've hacked up a small program that lets you play with CoreText attributes, mostly as a way to learn my way around the API. I'm going to clean it up and post it in a few days (check back here!), but for now, here's a screenshot:

|
|