Soup Monster

Posted by Nikolaus Gradwohl Sat, 31 Jan 2009 17:48:00 GMT

a college of mine found another monster when she tried to eat her soup

soupmonster

Tags  | no comments

Tweet This! submit to reddit Digg!

extra low framerates in Processing

Posted by Nikolaus Gradwohl Thu, 29 Jan 2009 03:45:00 GMT

when you want to write a processing sketch, that doesn't redraw several times a second, but updates the main method only once in a while (for example once per hour or minute) the following code can be used to start a thread that triggers a redraw after a delay. Just make sure the setup method calls the noLoop() methode and than start the thread calling start( millisecondsToWait );

void setup() {
  size(300,300);
  smooth();
  noLoop(); // <- turn off the processing loop

  start( 20 * 1000 ); // <- start the thread
}

void draw() {
  background( 255 );
  // draw some random circles
  for ( int i =0; i< 10; i++) {
    color c = color(random( 255 ));
    fill( c );
    stroke( c );
    int radius = int(random( 100 )+ 40);
    ellipse( random( width ), random( height ), radius, radius );     
  }  
}

void start( final int mil ) { //<- mil has to be final to be accessible in run() 
   new Thread() { 
   public void run() {
     while( true ) {     
        delay( mil );
        redraw(); 
      }
   }
 }.start();
}

Tags  | no comments

Tweet This! submit to reddit Digg!

Ruby Caldav Library 0.2

Posted by Nikolaus Gradwohl Wed, 28 Jan 2009 03:16:00 GMT

I have made a new version of my ruby caldav lib.

version 0.2 is a bugfix release, there are no new features but i removed some essential typos

Tags ,  | no comments

Tweet This! submit to reddit Digg!

login screen background

Posted by Nikolaus Gradwohl Mon, 26 Jan 2009 04:25:00 GMT

i just cleand up my harddisk a bit and found a background image i made a while ago for the login screen on my laptop

Tags , , , ,  | no comments

Tweet This! submit to reddit Digg!

Nagios-Frontend in SL-viewer

Posted by Nikolaus Gradwohl Sun, 25 Jan 2009 14:53:00 GMT

i wanted to test the region modules in OpenSimulator - a opensource server implementing the SecondLife protocol.

Because I didn't want to write another "hello world"-region module, i took my nagios-server as a datasource for my module.

now i can see the status of all the services my nagios is monitoring using a SL-Viewer :-)

the code is based on the demo-region from the opensim team and can be downloaded here.

nagios region 1

Read more...

Tags , , ,  | 1 comment

Tweet This! submit to reddit Digg!

qr-code midlet installer

Posted by Nikolaus Gradwohl Sun, 25 Jan 2009 13:26:00 GMT

to simplify the installation of my mobileprocessing-sketch i have generated a qrcode-tag that downloads the jad file and installs the midlet on the mobile phone.

simply point a qrcode reader like the one from zxing to the image and click on download

qrcode-random-installer

Tags , ,  | no comments

Tweet This! submit to reddit Digg!

Random numbers with MobileProcessing

Posted by Nikolaus Gradwohl Sun, 25 Jan 2009 07:14:00 GMT

I wrote my first sketch in MobileProcessing. MobileProcessing is a processing dialect, that can be used to write apps for java-capable mobile phones.

The application can be used to generate random numbers. every key-event shows a new random number.

/**
  a random number generator by
  <a href="http://www.local-guru.net/blog">Guru</a>
*/

PFont font;
int rnd = 0;

void setup() {  
  font = loadFont( FACE_PROPORTIONAL, STYLE_PLAIN, SIZE_LARGE );
  textFont( font );
  textAlign( CENTER );
  fill(0);
  rnd = random(0,100000);
  noLoop();
}

void draw() {
  background(255);
  text( "\n\n\n"+rnd, 0, 0, width, height );
}

void keyPressed() {
  rnd = random(0,100000);
  redraw();
}

Tags , , ,  | no comments

Tweet This! submit to reddit Digg!

the first snowdrop

Posted by Nikolaus Gradwohl Sat, 24 Jan 2009 18:15:00 GMT

today i made a picture of the first snowdrop this year. the picture was shot with my new mobile phone (K550i - has a realy nice 2 megapixel cam with autofocus)

snowdrop

Tags , , ,  | no comments

Tweet This! submit to reddit Digg!

switching java-versions in ubuntu

Posted by Nikolaus Gradwohl Fri, 23 Jan 2009 14:19:00 GMT

to switch between 2 installed versions of the jdk in ubuntu 2 commands are needed:

sudo update-alternatives --config java

is used to choose the java version

sudo update-alternatives --config javac

is used to change the javac version

Tags ,  | 1 comment

Tweet This! submit to reddit Digg!

osc sequencer in ruby

Posted by Nikolaus Gradwohl Tue, 20 Jan 2009 04:29:00 GMT

I wrote a simple osc sequencer in ruby using rosc. The script triggers the drum-kit and the bass i implemented last week.

the pattern may also be of different length. This allows very interesting polyrythmic loops.

require 'osc'
Host = 'localhost'
Port = 3334

c = OSC::UDPSocket.new
hh = OSC::Message.new('/drum', 's', "hh" )
bd = OSC::Message.new('/drum', 's', "bd" )
sn = OSC::Message.new('/drum', 's', "sn" )

ba = OSC::Message.new('/bass', 'i', 64 )


#c.send sn, 0, Host, Port
bpm = 120
step = 1.0/8;
s = bpm * step / 60.0 ;

snd = [ bd, sn, hh ]
pattern = [
[1, 0, 0, 1, 0, 1, 0, 0 ],
[0, 0, 1, 0, 0, 0, 1, 1 ],
[1, 1, 1, 1, 1, 1, 1, 1 ]
]
bass = [
40, 40, 0, 40, 40, 0, 43, 0,
40, 40, 0, 40, 40, 0, 38, 0 ]

count = 0;
while(true)
    (0..2).each { |i|
        c.send(snd[i], 0, Host, Port) if pattern[i][count % pattern[i].length] == 1
    }

    ba.args = [bass[ count % bass.length]]
    c.send( ba, 0, Host, Port ) if bass[ count % bass.length ] != 0

    sleep s
    count+=1
end
Read more...

Tags , ,  | 1 comment

Tweet This! submit to reddit Digg!

Older posts: 1 2