aBe PaZoS SoLaTie

August 2014

Sat Aug 30, 2014

This is a semi-automated backup of my old Tumblr account.

Git activity as an object

08/15/2014

During the last months I’ve been very busy working on a project. I use git to track code changes. A few days ago, for one of the exercises at the http://schoolofma.org, I wrote a Processing program that analyzed the git log and exported SVG shapes visualizing the data, which I fed into a laser cutter.

Each layer represents a week, and each side of the heptagon represents a day. The size of the layer depends on the total number of lines of code the project has, so they become larger as the projects goes forward. It’s possible to see that some days I did more commits than others. The sizes of the shapes sticking out or in indicate lines added and removed. And as you can see, I never worked on Sunday :)

I’ll post another photo when I glue the pieces together.

Raspberry Pi + PyGame

08/02/2014

My first code one a Raspberry Pi. With Python + PyGame. Next time I’ll use OpenFrameworks. I tried cross compiling OF code from Ubuntu, but didn’t get quite there.

By the way, the RPi cameras (normal and UV) are super sharp and configurable (compared to a webcam). Something to try next time.

#!/usr/bin/env python

import pygame
import sys
from pygame.locals import *

pygame.init()

sz = pygame.display.list_modes()[0]
screen = pygame.display.set_mode(sz)
pygame.display.toggle_fullscreen()
pygame.display.set_caption('Hmmm')
pygame.mouse.set_visible(False)
x = 0
y = 0

while 1:
    for event in pygame.event.get():
        if event.type in (QUIT, KEYDOWN):
            # save to home folder (if started double clicking)
            # or to current folder (if started from terminal)
            pygame.image.save(screen, 'pretty.png')
            sys.exit()
    x = x + 3
    y = y + 7
    col = pygame.Color(x % 256, y % 256, (x*y) % 256, (x+y) % 256)
    pygame.draw.rect(screen, col, (x % sz[0], y % sz[1], x % 100, y % 177))
    pygame.display.update()
    #pygame.time.delay(5)
Tags: processing. tumblr.