De Jong Attractors with processingJS

Please upgrade your browser to something new like Google Chrome.

//click to generate new
//press any key to export frame

float x, y, a, b, c, d, iteration;

void setup() {
    size(400, 400);
    stroke(255, 100);

void reinit(){
    x = 0; 
    y = 0;
    a = random(-3.0, 3.0); 
    b = random(-3.0, 3.0); 
    c = random(-3.0, 3.0); 
    d = random(-3.0, 3.0);
    iteration = 0; 

    text("De Jong Attractors  [ x' = sin(a*y)-cos(b*x);   y' = sin(c*x)-cos(d*y); ]", 10,20);
    text("a="+a+"   b="+b+"\nc="+c+"   d="+d,10,height-25);

void draw() {
    for (int i=0;i<500;i++) {
        float x2 = sin(a*y)-cos(b*x);
        float y2 = sin(c*x)-cos(d*y);
        x = x2;
        y = y2;
        point(map(x2, -2, 2, 50, width-50), map(y2, -2, 2, 50, height-50));

    if(iteration>=1000) reinit();

void mousePressed() {

void keyPressed() {

String timestamp() {
    return year() + nf(month(), 2) + nf(day(), 2) + "-"  + nf(hour(), 2) + nf(minute(), 2) + nf(second(), 2);


ColorScheme version 0.0.2 ! !

I added a new feature to the ColorScheme processing library I made.
Now you can pass image files to the constructor like:

ColorScheme colorScheme = new ColorScheme("image.jpg", this);

It will generate a color scheme based on the most common colors in the image
(with a bit of randomness in there to give you some accents).

Source code


7E Guest Artist - Casey Reas

The first time I was exposed to Casey Reas' artwork was through installation art he created for Yeasayer. I was excited to see them perform at FYF in 2012 since they had recently added Cale Parks, one of my favorite drummers, to the lineup. I was wondering who created the triangular pieces on stage and much much later found out it was Casey. That discovery led to another realization that I had actually been introduced to his work even earlier by using Processing, the programming environment for visual artists. Casey co-created processing with Ben Fry and it has of course also now been adapted as the default development environment for arduino.
Learning to code was a necessity to express his art. Casey’s visual work is mostly generative, always interesting and spans a wide range of mediums. Jinna would love to own one of Reas’ pattern dresses shown above. As an engineer I deeply respect an artist who has made such widespread contributions across the union of Art + Engineering. Thanks Casey for joining us on 7E.


PCDuino: Samba server with write permissions

Install Samba:
sudo apt-get install samba-common samba

Edit samba config (if you don’t have nano: sudo apt-get install nano):
sudo nano /etc/samba/smb.conf
Search for the section marked ##### Authentication ##### Uncomment the following line by removing the #:
#   security = user
    security = user
Search for the section starting [homes].
In the [homes] section, change:
    read only = yes
    read only = no

Add the below command at the end of the file, save and exit:
    comment = PCDuino
    path = /home/ubuntu
    public = yes
    writeable = yes
    browseable = yes
    guest ok = yes
    create mask = 0775
    directory mask = 0775
    read only = no

Edit /etc/fstab in order to allow write permission in Samba
sudo nano /etc/fstab
Remove the latest line (or comment by adding # at the beginning):
#none             /var/log          ...       ....

Set a password for ubuntu user as well as permissions and restart Samba:
sudo smbpasswd -a ubuntu
sudo chown -R ubuntu /home
sudo chmod -R ug=rwx,o=rx /home
sudo /etc/init.d/smdb restart

PCDuino: starters notes

Node: run shell from nodejs function

var runShell = function(command){
	var sys = require('sys'),
			exec = require('child_process').exec;
	function puts(error, stdout, stderr) { 
	exec(command, puts);

// Example.

Python: Accessing command line arguments
import sys

print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)
$ python arg1 arg2 arg3
Number of arguments: 4 arguments.
Argument List: ['', 'arg1', 'arg2', 'arg3']


Sometimes we need to serve static content and share it using HTTP protocol, but we don’t want to setup a full HTTP Server such as Apache or Lighttpd. If we’re in a Linux (or Mac OS X), we can use python’s http server.

Python provides a Simple HTTP Server, which can be executed by any user in a non-reservers port (port > 1024). To use it, just run following:

python -m SimpleHTTPServer <port>

You have to run this command in the same directory where the files you want to server are located.

Here’s a “real” life example:

Command above will show you:



Prove di voxelizzazione dipendente dai vettori del campo fluidodinamico.
Catalogazione dei risultati variando:

-il numero di celle  in cui è diviso il campo
-parametri di coesione,allineamento,separazione degli agents
-viscosità,diffusione,influenza del fluido sugli agents,influenza degli agents sul fluido.

I risultati ottenuti forniscono una gamma  di mesh più o meno compatte a seconda della  variazione  dei parametri.