Archive

Posts Tagged ‘processing’

Importing MySQL 1.4 Amarok data into Amarok 2.2 Nightly

September 28th, 2009

I was having a bunch of trouble today importing my old MySQL amarok database into the new nightly version of amarok I installed.  The Amarok Wiki had a great section on how to convert a MySQL Amarok collection into an SQLlite one.  This was the key to importing my old 1.4 collection into the new 2.2 nightly version of Amarok.


Uncategorized , , , , , , ,

Processing: It’s totally not Flash

July 20th, 2007

I’m not one to advocate Java generally, but Processing is totally hawt. Here’s something I screwed around with today:

type=”application/x-java-applet”
archive=”/assets/2007/7/20/sketch_070719a.jar”
width=”500″ height=”500″
standby=”Loading Processing software…” > codebase=”http://java.sun.com/update/1.4.2/jinstall-1_4_2_12-windows-i586.cab”
width=”500″ height=”500″
standby=”Loading Processing software…” > value=”/assets/2007/7/20/sketch_070719a.jar” />

Ball[] myBalls;

void setup()
{
  size(500,500);
  frameRate(25);

  myBalls = new Ball[300];
  for (int i = 0; i < 300; i++) {
    myBalls[i] = new Ball();
    myBalls[i].x = random(0, 500);
    myBalls[i].y = random(0, 500);
    myBalls[i].r = random(0, 10);
    myBalls[i].xv = random(-5, 5);
    myBalls[i].yv = random(-5, 5);
    myBalls[i].mycolor = int(random(0, 100));
    myBalls[i].myseed = int(random(25,100));
  }
}

void draw() {
  background(0);
  for (int i = 0; i < 300; i++) {
    myBalls[i].run();
  }
}

class Ball
{
  float x; //X acis centroid
  float y; //Y axis centroid\
  float r; // Radius
  float xv; //X axis velocity
  float yv; //Y axis velocity
  int mycolor;
  int myseed;
  int counter;

  void run()
  {
    drawShape();

    x += xv;
    y += yv;

    yv += 0.4;

    if(x < 0 || x > width) {
      xv = -xv;
    }
    else if(y < 0 || y > height) {
      yv = -1.1 * yv;
    }

    if(counter % myseed == 0) {
      xv = random(-5,5);
      yv = random(-5,5);
    }
    counter++;
  }

  void drawShape()
  {
    smooth();
    ellipseMode(CENTER_RADIUS);
    noStroke();
    fill(mycolor);
    ellipse(x,y,r,r);
  }
}

You can download it here: sketch_070719a


Uncategorized , , ,

0install: A package manager for the lusers

July 19th, 2007

Zeroinstall is my new friend. It’s a package manager that’s decentralized, and can be used on machines where users need applications, but don’t know how to compile (or are unwilling to). Installing applications happens in the home directory, and once a program is run once, it is stored in the home directory for later use. All packages can be signed with GPG keys, and the packaging GUI is amazingly awesome.

Check out my 0install repository. You can run things like this:


sudo apt-get install zeroinstall-injector
0launch http://modzer0.cs.uaf.edu/repos/hank/0install/Processing.xml

There’s packages for all the popular distributions. Get it now! It’s awesome.


Uncategorized , ,