Disco

Nikolaus Gradwohl2008-09-22T07:45:00+02:00

I recently read about disco a implementation of the map-reduce algorithm using erlang for the master node and the workload management and python for the map-reduce jobs. Its realy funny that the nokia research labs implemented an algorithm introduced by google using a language developed by erricsson :-)

its a bit complicated to install, but once running its realy fun to code with

read more ...

ReportLab Test

Nikolaus Gradwohl2008-09-10T09:03:00+02:00

I just have tested reportlab a python-framework for pdf generation.

from reportlab.pdfgen import canvas
from reportlab.lib.units import cm


c = canvas.Canvas("hello.pdf")

c.drawString(2*cm,28*cm,"Hello World")

c.line( 2*cm, 26*cm, 2*cm, 16*cm)
c.line( 2*cm, 16*cm, 12*cm, 16*cm )

c.setFillColorRGB( 0, 0, 1 )
c.rect( 2.5*cm, 16*cm, 1.5*cm, 7*cm, fill = 1 )
c.setFillColorRGB( 0, 1, 0 )
c.rect( 4.5*cm, 16*cm, 1.5*cm, 6*cm, fill = 1 )
c.setFillColorRGB( 1, 0, 0 )
c.rect( 6.5*cm, 16*cm, 1.5*cm, 8*cm, fill = 1 )

c.showPage()
c.save()

this little script generates a pdf containing 'hello world' and a simple bar-chart. i think i will give it a try if i have to generate pdf-reports the next time

read more ...

Rotating NeonBox

Nikolaus Gradwohl2008-09-06T16:26:00+02:00

i have hacked together my next processing sketch. This time its a rotating NeonBox.

dont wait for something sophisticated to happen its just a little rotating box :-)

read more ...

'Hello World' in 80 hacks / In 80 Sprachen 'Hallo Welt' - Phase 2 started

Nikolaus Gradwohl2008-09-06T10:29:00+02:00

As posted erlier, i'm working on a project to code a "hello world"-Application consisting of 80 programing languages.

I have started "phase 2 (planning)". The program will be seperated into 10 blocks that are executed parallel. Each block generates one letter and handles one of the following topics: * xml * webapp * webservice * sound * filetransfer (csv, fixlength-records, ... ) * pixelgraphic * vector graphic * cryptography * robotics * textdocuments ( rtf, doc, pdf, ... )

more infos can be found on the project-page

read more ...

SuperCollider on Linux

Nikolaus Gradwohl2008-08-17T09:35:00+02:00

Today i have installed supercollider on my ubutu system following this instructions. SuperCollider is a environment and programming language for audio synthesis simliar to chuck. SuperCollider can run on a network and uses OSC events for comunication.

After looking around in the source tree i found a plugin for vim :-)

Installations is a bit quirky (the folders 'ftpplugin', 'syntax' and 'intend' needed to be copied to ~/.vim by hand) but now i can edit my sc code using my vim - veeeery cool :-)

single lines of code can be sent to the server using F6 codeblocks are sent to the server using F5.

s.boot
(
c = { arg f=900;
    var x;
    x = SinOsc.ar(f);
    x * 0.1
}.play;
)

c.set(, 400);
c.set(, 670);

to start te server the first line has to be sent to sclang (using F6). Then the code block starting line 2 is sent to the server (using F5)... tata - a sine wave.

sending the last 2 lines (F6 again) change the frequency of the running synth.

F12 can be used to turn all sounds off.

read more ...

Parallax v2.0

Nikolaus Gradwohl2008-08-12T20:56:00+02:00

Because of the OVERWHELMING amount of reader comments - aehm, i mean compared to my other blogposts - i have decided to code another version of my Parallax scrolling demo (v2.0) containing a jumping white rabbit

read more ...

first nds demo

Nikolaus Gradwohl2008-08-11T07:13:00+02:00

I got a nintendo DS 2 weeks ago and have hacked my first demo using the arm compilers from devkitPro. To compile the code follow the drunkencoders-Tutorial.

the program initializes the lower screen in a 2d graphics mode, and draws a circle (using the bresenham-algorithm for circles) wherever the screen is touched by the stylus. if the A button is pressed the screen is cleared. No sophisticated doublebuffering, 3d or sound stuff this time - but hey! it's the first program for a nds! and it works! :-)

#include <nds.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void setPixel( int x, int y, int color ) {
    VRAM_A[x + y * 256] = color;
}

void circle( int mx, int my, int r, int color ) {
    int x = 0;
    int y = r;
    int d = 3 - 2 * r;

    while (x <= y) {
        setPixel( mx  + x, my + y, color );
        setPixel( mx  - x, my + y, color );
        setPixel( mx  - x, my - y, color );
        setPixel( mx  + x, my - y, color );
        setPixel( mx  + y, my + x, color );
        setPixel( mx  - y, my + x, color );
        setPixel( mx  - y, my - x, color );
        setPixel( mx  + y, my - x, color );

        if (d < 0) {
            d = d + 4 * x + 6;
        } else {
            d = d + 4 * ( x - y ) + 10;
            y --;
        }
        x++;
    }
}

int main(void) {
    touchPosition touch;

    videoSetMode(MODE_FB0);
    vramSetBankA(VRAM_A_LCD);

    lcdMainOnBottom();

    while(1) {
        scanKeys();

        if(keysHeld() & KEY_TOUCH) {
            touch=touchReadXY();
            circle( touch.px, touch.py, 20, rand());
        }

        if (keysHeld() & KEY_A) {
            for ( int y = 0; y < 192; y ++ ) {
                for ( int x = 0; x < 256; x ++ ) {
                    setPixel( x, y, 0);
                }
            }
        }
    }
    return 0;
}
read more ...

parallax demo

Nikolaus Gradwohl2008-08-07T06:55:00+02:00

A new processing sketch is online. I have coded a Parallax scrolling demo. All the graphics are drawn by hand - this demo also shows why i'm a coder and not a painter :-)

read more ...

water ripples

Nikolaus Gradwohl2008-07-30T21:34:00+02:00

I have rewritten my Mousetrail processing-sketch to make it look like Water ripples.

read more ...

Povray image

Nikolaus Gradwohl2008-07-24T05:58:00+02:00

While coding my little blob-demo in processing i realized that i had not used povray for a very long time. i have almost forgotten its syntax. Thats why i coded this littly guy :-)

littleguy

#include "colors.inc"

background { color Black }
camera { location <2, 2, -3> look_at  <-1, 1,  2> }
plane { <0,1,0>, -4 texture { pigment { color White }}}

// BODY
sphere { <0,-2,2>,2 texture { pigment { color Green }}}

// HEAD
sphere { <0, 1, 2>, 1 texture { pigment { color Pink }}}

// HAT
sphere { <0, 1.5, 2>, .75 texture { pigment { color Yellow }}}
sphere { <0, 2, 2>,   .5  texture { pigment { color Yellow }}}
sphere { <0, 2.5, 2>, .25 texture { pigment { color Yellow }}}

// NOSE
cone { <0, 1, 2>, 0.25, <0,1,.5>, 0 texture { pigment { color Red }}}

// EYES
sphere { <-0.3,1.3,1.1>,0.1 texture { pigment { color Blue }}}
sphere { <0.3,1.3,1.1>,0.1 texture { pigment { color Blue }}}

light_source {
    <20, 15, -10>
    color White
    area_light <5,0,0>, <0,5,0>, 10,10
    adaptive 1
    jitter
}
read more ...