Friday, May 25, 2007

more exciting edutech!

Scratch, from the Lifelong Kindergarten group at MIT, is this lovely environment for kids (or other novice programmers) where you can make funky animations and play sounds and do cool effects! The cool effects are a major selling point -- you can get funny animations right off the bat. Everybody loves a fisheye effect. And it has this lovely website, where kids can share and tag their projects! Web 2.0 ahoy!

It's really easy to figure out, especially if you've seen things like the LEGO mindstorms interface, or Alice -- commands snap together with a familiar building-blocks metaphor. This is to say that there's a fairly standard vocabulary for childrens programming environments, these days...

The Scratch intro "Facilitorial" video is here.

Also fairly interesting (and brand new on my radar as of today), is Greenfoot, which is another educational programming environment, perhaps for slightly older kids. It makes it easy to do simulations with different kinds of "actors" on these nice 2D worlds (they can be grid-worlds, but they don't have to be)... although you have to write some Java, it looks like, to build up your new behaviors. Maybe this is awesome too.

Wednesday, April 25, 2007

you'll probably tell me that Emacs already does this

In the future, my text editor will have an option to make it think of camelCaps and underscores_in_identifiers as word boundaries.

How useful would that be for you?

Monday, April 23, 2007

retrocomputing from the other side of the pond

Here's what I found out on my recent voyage through the wikipedias! Semi-vicarious nostalgia ahoy!

In the early 1980s, the BBC started an initiative called the BBC Computer Literacy Project, a major part of which was the production of the BBC Micro, a machine produced by Acorn Computers, complete with its own line of peripherals including expandable memory and various pluggable co-processors. There was an associated television show, The Computer Programme, which ran in various incarnations through the decade and featured music from Kraftwerk. The computers came with BBC BASIC, a rather more advanced system than the BASICs that were shipping stateside -- it had proper named subroutines and if/then/else, features most users on the MS-DOS side of things wouldn't see until QBASIC.

The mind-blowing part of the project was Telesoftware, whereby computer programs were sent embedded in the broadcast television signal, using Teletext, which is how the closed-captioning data was sent in Britain at the time. Analogue technology like broadcast TV feels so alien these days... but the Beeb was busy using it to send example programs to eager learners at home.

There seems to be a pretty active online community of BBC/Acorn enthusiasts out there, two and a half decades later.

You know how to use the Googles, of course, but here's another, more detailed overview of the BBC/Acorn system.

Wednesday, April 18, 2007

java 6: apparently even less of a loss than java 5!

Java 6. It's so hot right now. Java 6.

Well, I'm excited anyway. The new Scripting API provides a standard interface for embedding other languages in Java and making calls between the two. See if there's already a project to handle your favorite language here -- there probably is, unless you like Common Lisp. There's even a mechanism for manipulating namespaces in the embedded language, pretty snappy.

Apparently recent releases of Jython already have hooks to support the new API. Maybe the next version of JES should be rewritten with that in mind, say once Jython 2.2 is stable. And perhaps we'll see ABCL ported to the new standard...

Also in Java 6, the built-in support for splash screens is kinda cute. And they're saying that the whole shebang is faster and prettier. Good job, guys!

Tuesday, April 17, 2007

tools for blogging and reading

I had an idea for a tool today, one to keep track of links that you want to blog about, assuming you keep a buffer of a few links hanging around like I do. Usually, I have a bookmark folder set aside for the next batch of links, but it might be nice to have a special command that would let you right-click on a link and save it to somewhere. Later on, you'll be able to paste back your links (maybe with HTML link code) into arbitrary text boxes using another context-menu command. This probably wants to be a Firefox extension.

Graham suggests that this would be better with online storage -- it could sync up with your del.icio.us bookmarks and keep track of what you've already blogged about. Perhaps someday soon I'll be cool enough to use del.icio.us.

Speaking of reading things on the web and managing one's reading -- please allow me to direct your attention to BibDesk and Skim, a pair of apps for the Mac designed with your reading pleasure in mind. The first is a bibliography manager that works with BibTeX format and has a lovely UI and lets you drag references around and whatnot, and the latter is for reading, highlighting, and annotating your papers, which is traditionally pretty difficult with a PDF.

The downside of these is that they're Cocoa apps and Mac-only, but they're pretty much what I'll want to build when I get around to putting together that cross-platform Python paper manager thing I've been thinking about...

Thursday, April 12, 2007

things that start with p

Programmable completion for bash (mentioned earlier) is still a pretty exciting idea. I came up against the first situation where I felt like it needed to be extended today, though.

I've taken to using jar to deal with .zip files, so I can use consistent tar syntax and don't have to remember how to use the zip options. But! The bash_completion file for Ubuntu doesn't include ".zip" as an extension that it looks for when tab-completing files for jar, oh noes!

Easy enough to fix, right? I pop open /etc/bash_completion and start searching for "jar". There's a section near the second occurrence that looks like:
         _filedir '?(e|j|w)ar'
After some fiddling, I change that one line to " _filedir '?(ear|jar|war|zip)' ". And it works! For reference, that the _filedir function looks like this. It's painfully obvious to everyone what this does, yes?

To be totally fair, there's some explanatory comments right above it... but it's obtuse things like this that make we want to switch to a shell with a more sensible scripting language. bash is often line noise. We claim that allowing users to modify their environments to fit their needs is one of the major benefits of Free Software, but are we doing enough to encourage that? How is your mom supposed to pick up bash script? It seems like scsh isn't meant for interactive use as your daily shell, but what if your everyday environment had a more modern language embedded in it? Are things like that already out there?

Also: speaking of Scheme embedded in things, JScheme is a dialect of Scheme with a very simple interface to Java, called the Javadot notation . It's by Peter Norvig and crew, fairly recently updated and feature-complete. Also on Peter's (fantastic) site, you can find his older "mercilessly small, easily modifiable version". I very badly to embed this in JES. Media Computation in Scheme ahoy.

Monday, April 09, 2007

Alice wants him. Bob fears him. Charlie wants to be him.

Bruce Schneier not only has a Bruce Schneier Facts page devoted to him -- he's aware of it and has a favorite Bruce Schneier Fact.

My favorite so far: "Bruce Schneier writes his books and essays by generating random alphanumeric text of an appropriate length and then decrypting it." -- Bruce Schneier in the comments

Saturday, March 31, 2007

list comprehensions!

List comprehensions. I've been a fan of these for a while, but I'd like to share:

tenpercent = len(lines) / 10
testset = random.sample(lines, tenpercent)
trainingset = [line for line in lines if line not in testset]


Python makes me warm and fuzzy on the inside. Also, random.sample() is pretty sexy!

Wednesday, March 28, 2007

brains 'n' balancing training data

- Martin points us to a nice article over on Developing Intelligence: 10 Important Differences Between Brains and Computers. Your computational metaphor just breaks down eventually, y'know? The brain is not very much like a Von Neumann computer. It's a lot squishier.

If building classifiers is your thing, you may be interested to take a look at these articles:

- Gustavo E. A. P. A. Batista , Ana L. C. Bazzan, and Maria Carolina Monard: Balancing Training Data for Automated Annotation of Keywords: a Case Study.
Three researchers, seven middle names, one novel technique for building balanced data sets out of unbalanced ones for training classifiers: generate new instances of your minority class by interpolating between examples actually in your dataset. I'm still trying to decide whether this approach should work for the general case -- does it make too many assumptions about the shape of the space? Particularly: can you arbitrarily draw lines (in higher-dimensional space) between positive instances? What if there are negative instances between those two? Which dimensions do you look at first, and how is this better than just adding some noise or weighting positive examples higher? (is that last option the same as simply counting them several times?)

- Foster Provost: Machine Learning from Imbalanced Data Sets 101.
A basic overview of the problem, examining the motivation for building classifiers at all and some different approaches to sampling. The award for Best Name Ever goes to Dr. Foster Provost.

Friday, March 23, 2007

reading feeds over the web

It seems like all the cool kids are using Google Reader these days, and I must admit, I'm impressed. The interface is so clean, and a web-based feed reader where you can aggregate all of your habitual reading seems like the right thing. And the ability to share items from your feed with your friends without making link-only blog posts (or forwarding emails around) is pretty compelling. On the other hand, the point of so much of the web thus far has been linking to other parts of the web: it has a mysterious self-referential nature... does this sort of sharing diminish that aspect? Does a meta-feed like this put you, as the independent media maven that you are, on a different level than the well-established weblogs? When you stop putting links in your blog and publish a Google Reader feed, are you more like BoingBoing or metafilter, or less?

It is the future. We've got dynabooks and memexes, and we use them to distribute pictures of cats doing cute things.

O my vast readership, I address to you this question: how do you read news online? Do you have some separate feed reader program? Do you use your browser's RSS features? Google Reader? Your LiveJournal friends page? Something else?

And moreover: for the LiveJournal denziens, does anyone know of a good method for reading "friends-only" posts through Google Reader? There are a few posts out in the world on this topic, but nobody seems to have a decisive answer yet... perhaps we can answer the question definitively.

Monday, February 26, 2007

Ripping DVDs with Free Software!

Just today, a friend of mine needed a copy of a DVD that she could take around with her on a hard drive. So I thought, "well, I'll just take the disk image of it..."

But Apple's DVD player won't play DRM'd disk images, of course.

However! Here's a very nice howto for some very friendly software for Linux, Mac OS X, and BeOS (I know you've all got BeBoxes out there) that'll make video files from your DVDs, no sweat. Super-easy to use. Your mom could do it.

Thanks for the link, Cory Doctorow!

programmable tab completion: you may already have it!

Not long ago, I was doing some mundane upgrade task on the Ubuntu box on my desk. I'd switched out monitors and video cards, and I wanted to make it reconfigure X.org. I type out "dpkg-reconfigure x..." (details are orthogonal, I suppose). But the amazing thing was, I hit tab out of habit, and bash magically filled in the name of the package and some other options, appropriate for the context!

It turns out that this is a feature known as Programmable Completion, available in modern versions of bash and enabled by default in Ubuntu! Who knew?

For example, the Ubuntu version of the programmable completion only fills in ".java" files when you're issuing a "javac" command, and it auto-completes class names (but not .class files) when you're trying to run a Java program from the command line. Flippin' sweet.

Monday, February 05, 2007

Programmatic poetry: oh noetry!

Automatic generation of texts has been on my mind for rather a while. Particularly, I've been thinking about poetry and the what characterizes it, in contrast to, say, technical manuals or want ads. Some (five?) years ago, my cohort Esther and I had set at the generation problem from an ontology standpoint, trying to figure out what it would take to get thematic relationships into an automatic poem. We didn't get very far, probably because at that point my first instinct was to code everything from scratch in C!

Anyway, it turns out that there are non-me people interested in this sort of thing, and the ever-helpful Graham has pointed out a bunch of interesting things happening in the field!

- The prosthetic imagination is a blog by a one Jim Carpenter, who's been working on Erica T. Carter (aka "the electronic text composition project", mentioned on GrandTextAuto here), which uses probabilistic grammars to generate free verse poems. I think the output is pretty convincing ("convincingly what?"); according to Mr. Carpenter, it's rather unnerving to readers who've been informed that they were composed by machine.

It's interesting how people react, when confronted with "creativity" from a non-human source; one is reminded of Douglas Hofstadter's surprising reaction to David Cope's lovely work with algorithmic music composition, which makes music, in a sense, in the style of other composers.

I'll have to read more, but I'm not entirely sure, if it's just using hierarchical grammars, how Erica is different from The Postmodernism Generator (the best-known use of the world-famous dada engine)... but I'll report back on this later.

- There is an Electronic Poetry Center at Buffalo. Interesting!

- Gnoetry is another system out there, and a very prolific one at that, apparently connected to this super-fascinating Beard of Bees publishing group. Language is a prosthesis of an ancient neuro-chemical regime; but now the chemical author is dead. Gnoetry places language at a remove from its typical sources: pre-conscious governance, psycho-historical flux, conscious-mind narration. YES. I will be getting in contact with these guys.

- At upenn, they have a series of readings, M^<4|\3, with all sorts of "literary uses of technology" things going on, including, next week, Flarf poetry (!) .

- Speaking of literary uses of technology, the GTR Language Workbench looks like something between Eclipse and a word processor... I'm not quite sure what to make of it yet.

I'm all excited. Let's get hacking.

Tuesday, January 30, 2007

begging the question, language composition and orthogonality

Not too long ago, one of my friends used the phrase "begs the question" in the colloquial sense of "what we're talking about suggests that this other issue should be addressed".

And I've come to the point in my life where this doesn't bother me anymore, despite the fact that I know the technical rhetorical sense of "begging the question" -- an argument presupposing what it's trying to prove, often implicitly. I prove that unicorns exist thus: all those magical one-horned horses out there are unicorns. I prove that there's an objectively extant material world by kicking a rock and hurting my foot.

This post, of course, begs the question: will I be secure enough as an armchair philosopher to start using the phrase in the vernacular sense? I'm torn: there are few things I like less in the world than prescriptive grammar, but few things I like quite as much as precise, expressive expression.

Wednesday, January 24, 2007

gmaps and quicksilver

So I've started work on the gmaps mashup for runners I'd mentioned last time... the Google Maps API is very straightforward, easy to understand. And getting a simple example working is quick. I'm not surprised, but it turns out to be very pleasant. Everything you wanted to know about gmaps is right there, have at!

Also: my ATLhack compatriot Erik introduced me to this really nice interface tweak for Mac OS X -- quicksilver. It lets you do a lot less mousing on the Mac, which is a pretty welcome change -- a quick key-tap, and it pops up a window where you type the first few letters of something, say an application or a folder or whatever, and it searches out what you probably mean! It seems like it's more efficient than reaching for the mouse, and for right now I've taken everything off my Dock to see if quicksilver is a viable replacement. Thanks, Erik!

Thursday, January 18, 2007

Run and jump on that gmaps bandwagon!

All the cool kids are doing Google Maps mashups, and it just occurred to me, while chatting with Graham: we could do one that picks a meeting place for runners to meet. Say given starting points for n runners, it finds some convenient corner for everybody to get together. For the case of two people (say, me and Graham), it might be just the midpoint on the best path between our houses -- but what about a big running club? And what if some runners are stronger than other? Clearly, some weighting and scaling is in order. And you could put in how fast you expect to run and when you want to get there, and it could tell you when you should leave, adjusted for traffic!

Maybe not as immediately useful as Gmaps Pedometer, but it'd be fun to put together. The API looks kinda neat, and I should learn this newfangled Web 2.0-AJAX-web-services schlock one of these days...

Wednesday, January 17, 2007

Mapping and reducing is like popping and locking for programmers

If you don't read Lambda the Ultimate, that's quite alright. But fairly often over there, you find a link to Why Functional Programming Matters, by John Hughes. Recently, I decided to sit down and actually read it. It's mind-expanding!

Previously, I'd thought about mapping functions onto lists as an operational thing, a set of steps to complete, but that's not the cleanest way to think about it. Mapping is actually a special case of "reduce", an operation where you just go through and replace the all the "cons" functions in a list expression with something else, then evaluate the expression again. "map" functions have a cons in the function they're reducing with, so the end result is another list.

For example: you might write, in lisp: "(mapcar #'(lambda(x) (* x 2)) '(1 2 3 4))", yielding (2 4 6 8).. and you might think of that procedurally... but a map is just a reduce where "cons composed with the mapped function" replaces every "cons". Append can be written similarly; it's all essentially just replacement, function composition and evaluation. The paper also goes into beautiful issues like lazy evaluation (the author says that if he wrote the paper now, the examples would be in Haskell!) and continues to do some lovely examples, some numerical and one very close to our heart: a bot that plays tic-tac-toe, optimally, with pruned game trees.

Years ago, Kurt Eiselt told me that the future of computing was going to be functional languages on very-parallel hardware; functional languages, at least in principle, make synchronization easier by limiting or removing-altogether side effects. (although reconciling this idea with stateful, event-driven end-user applications is another issue!) To an extent, it looks like he was right, and the future is here! MapReduce is the method Google is using to crunch super-giant datasets with enormously parallel clusters. It's not just for functional languages, of course, but the idea is there.

Friday, January 05, 2007

Possibly interesting, but almost definitely not useful!

- My aunt, years ago, had a Newton eMate 300, and I recently found a Newton PDA while cleaning out the space behind an A/C unit -- in any case, I've had this weird fascination with Newtons for years. Now, you can relive the Newton Magic that you probably never experienced in the first place, under emulation! The Einstein Platform is a Newton emulator that works pretty well -- and you can find Newton ROM images here. It's kinda interesting. (Although I got stuck in fullscreen mode once, careful!)

- Self. It's been ported to Linux. It's one of those languages that one feels like one should learn more about. It has interesting family relationships with SmallTalk and Dylan and JavaScript...

- Thinking Meat celebrates the holidays. I just found this blog, but over at the Thinking Meat Project, she has a lovely article about taking part in the culture around the holidays and coming to terms with the cognitive dissonance from enjoying good Bach choral music while feeling like one shouldn't be participating in religious rites, for consistency's sake. It can hard to balance these things, particularly soon after giving up a faith.

Friday, December 15, 2006

Help me, Don Knuth, you're my only hope!

If you're typesetting something with pdflatex -- you can't include eps images with the graphicx package.

You can only use figures if they're in pdf format, but the error message for when you try to use eps is non-helpful.

Maybe this will help someone some day.

Monday, December 04, 2006

rapid-feedback poetry and lisp environments

I think, ultimately, TEB is going to want to be less of a fully automated thing and more of a computer-aided composition tool for poetry. Or maybe it'd be better to think of it as a generator, with a human in the loop. Something that would let you get really rapid feedback and come up with suggestions. It would let you build poetry by search, recognizing what you like and what you don't like. And it'll keep versioning information...

Hey, speaking of development environments! On Lemonodor, I just found out that there's an Eclipse plugin for writing Lisp called Cusp. It uses SBCL and swank, like all right-thinking lispers, letting you do SLIME-like things without Emacs -- SLIME being the currently en-vogue common lisp development environment, and swank being the backend. There's a similar project out there that I've been watching too -- Slim-Vim, which is an attempt to make that same swank code work with vim. (the mailing list has been a little quiet, but it might pick up steam again)