ruby symbols vs string vs constant

Posted by Nikolaus Gradwohl Tue, 10 Feb 2009 02:13:00 GMT

on saturday i was asked by a ruby-newbie (sorry - i had to write it :-) ) whats the difference between a symbol, a string and a constant in ruby. even tough there are realy, realy many articles about ruby symbols ( a google search for "ruby symbols" results in 1,340,000 hits - so this is the 1,340,001 aricle covering the topic) there is obviously still some confusion out there. So i try my own definition here.

Read more...

Tags ,  | no comments | no trackbacks

Tweet This! submit to reddit Digg!

What's new in Python 3.0

Posted by Nikolaus Gradwohl Mon, 09 Feb 2009 17:48:00 GMT

i have played a bit with python3.0 and this are the things that catched my eye:

  • the new print syntax
  • the exception-handling
  • decorators
  • the new io module
  • classes in python

are no complete list of changes between 2.5 and 3.0 - and don't want to be. they are just a list of thing's i noticed. Some of them are already present in python 2.6 but i newver used that release - so i don't realy know.

Read more...

Tags  | no comments

Tweet This! submit to reddit Digg!

Treemonster

Posted by Nikolaus Gradwohl Sun, 08 Feb 2009 11:53:00 GMT

a friend of mine found another monster - this one tried to camouflage as a tree

treemonster

Tags ,  | no comments

Tweet This! submit to reddit Digg!

abstract art generator

Posted by Nikolaus Gradwohl Fri, 06 Feb 2009 17:29:00 GMT

my latest processing-sketch is a generator for abstract art.

just click on the applet to generate a new image

abstract art generator

Tags ,  | 1 comment

Tweet This! submit to reddit Digg!

Processing links

Posted by Nikolaus Gradwohl Thu, 05 Feb 2009 17:02:00 GMT

http://www.processing.org/ the mother of all processing sites :-)

http://www.arduino.cc/ a language and a microcontroller board that that go very well with processing

http://mobile.processing.org/ a mobile phone edition of porcessing

http://www.openvisuals.org/ a site showing how to visualize data using processing

http://www.openprocessing.org/ a site collection processing sketches

http://www.processingblogs.org/ a processing meta blog

http://www.rmx.cz/monsters/ a collection of black'n'white monsters - coded in processing (one of them has been written by me :-) )

http://www.local-guru.net/blog/tag/processing my own site

two really great art collections using processing

http://www.complexification.net/gallery/

http://abandonedart.org/

some artists using processing

http://www.flight404.com/blog/?cat=1

http://www.toxi.co.uk/

http://www.benfry.com/

http://www.groupc.net/

Books:

make things talk

visualizing data

Processing: A Programming Handbook for Visual Designers and Artists

Tags  | 1 comment

Tweet This! submit to reddit Digg!

Door Monster

Posted by Nikolaus Gradwohl Thu, 05 Feb 2009 03:52:00 GMT

A while ago, a hook on our bathroom door fell down. First we thought it was because of some loose screws. but today i found out the real reason - there was a monster lurking behind it!

doormonster

Tags ,  | no comments

Tweet This! submit to reddit Digg!

i2c thermometer on arduino

Posted by Nikolaus Gradwohl Mon, 02 Feb 2009 04:07:00 GMT

I have hooked up my c-control i2c thermometer-module (link in german) to my arduino and wrote some code to read the current temperature in Celcius.

The module uses the maxim DS1631 chip.

The temperature is send as a 2 byte value using a 12 bit resolution. in the MSB the first bit is used as a sign bit, the other seven bits are represent the part before the comma, in the LSB the first 4 bits are used as the fractional part.

the code below doesn't handle negative values yet. i want to use it in my livingroom - i never ever want it to deal with negative values!

i2c-thermometer

Read more...

Tags , ,  | no comments | no trackbacks

Tweet This! submit to reddit Digg!

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!

Older posts: 1 ... 16 17 18 19 20 ... 27