Friday, May 26, 2006

HOW TO - Build a tensegrity coffee table

HOW TO - Build a tensegrity coffee table: "
Justin writes - 'Here's how to build a tensegrity coffee table. I was searching for pvc furniture pipe and luckily stumbled across this site.' - Link.

Open travel-time maps of the UK

Open travel-time maps of the UK: "Cory Doctorow: The MySociety project has produced an incredible set of travel-time maps of the UK, showing the voyage-time using color shading (red for close, blue for far) and contour lines to indicate each hour's travel -- they compare the overall travel time for going from A to B by rail and car and cab. They're laying an open geodata-bank for use in correlating house prices to travel times, cost-to-time, and generating realtime web-services. Link (via boingboing via Oblomovka)


"

Tuesday, May 09, 2006

Software Carpentry is Great!

Software Carpentry

The Problem

Many scientists and engineers spend much of their lives writing, debugging, and maintaining software, but only a handful have ever been taught how to do this effectively: after a couple of introductory courses, they are left to rediscover (or reinvent) the rest of programming on their own. The result? Most spend far too much time wrestling with software, instead of doing research, but have no idea how reliable or efficient their programs are.

The Solution

This site presents an intensive course on basic software development practices for scientists and engineers. Its aim is not to turn biochemists and mechanical engineers into computer scientists; instead, it introduces them to the 10% of modern software engineering that will satisfy 90% of their needs. The course has been taught at laboratories and universities in Canada and the United States since 1998. It is now being upgraded, and will be made freely available under an open license in the fall of 2005.

Status

This Nature article describes the course's background and goals in more detail.

See this page for known issues with the course.


Tuesday, May 02, 2006

jfugue, jython, jjedit, classpath, vpython, music viz

So I'm working on music visualization (with vpython) and would like to play the tunes I am visualizing. There are some very sophisticated sound tools out there, but simple real-time ones are hard to find. (I'd be happy to be able to specify pitch and duration, but no....).

Anyway, JFugue is admirably clean and simple looking, but written in java.
http://www.jfugue.org/

I've had some luck with jython recently, so I thought I'd pursue it. www.jython.org
First the happy ending,
[208-186-48-2:remo/MusicViz/JFugue] apple% jython
Jython 2.2a0 on java1.5.0_06 (JIT: null)
>>> from org.jfugue import *
>>> player=Player()
>>> pattern=Pattern("C D E F G A B C")
>>> player.play(pattern)
(music!)

For this to work, I need only have JFugue's directory tree called "org" in the current directory.

The above four lines are considerably shorter and simpler than than original java

import org.jfugue.*;
public class MyMusicApp
{
public static void main(String[] args)
{
Player player = new Player();
Pattern pattern = new Pattern("C D E F G A B");
player.play(pattern);
System.exit(0); // If using versions lower than Java 5.0
}
}

and to run the java code you must apparently
1) give the file the name MyMusicApp.java
2) compile the file using the incantation
javac -classpath ./jfugue.jar MyMusicApp.java
3) run the file using the incantation
java -cp ./jfugue.jar:. MyMusicApp
(and the colon is a mac-specific necessity. On windows you use semicolon(??))

Typing the classpath is a nuisance, and getting it into the environment requires the kind of unix geekery that drives me crazy. But I did find a really elegant little java IDE called JJEdit that gives you a compile button and a run button, and a form-field into which you can enter a classpath of ./ and get on with iterative development. http://homepage.mac.com/jmacmullin/

So this is more bearable, if much more cumbersome than working in jython.

On the other hand, I must say that the jython documentation leaves something to be desired. www.jython.org points you to an installer for Mac Classic(!) http://www.jython.org/platform.html.

Google led me to a darwin port installer which installed admirably and works as shown above.
But I just noticed
(a) that somehow I'm running version 2.2a0 and
(b) that it doesn't respond to command line arguments, so I can't run it non-interactively.
Fixing this will require tweaking the shell script that invokes jython I suppose...

but sheesh! Genuinely simple simplicity is apparently not simple....