Posted by Nikolaus Gradwohl
Fri, 03 Jul 2009 06:37:00 GMT
As in any office, my co-workers and I experience several WTF-Situations during our working day. So we decided to implement a
simple system to count the WTF's and use them as a metric for our working climate :-)
we use an "emergency stop"-Button which is connected to an arduino. This arduino sends the string "WTF" on the serial line
a little python scrip writes them to a file, another processing app count's the lines in the file and offers the result
via http, which is read by a processing app for visualisation ...


Read more...
Tags arduino, processing, python, wtf | 21 comments | no trackbacks
Tweet This!
Posted by Nikolaus Gradwohl
Thu, 09 Apr 2009 08:09:00 GMT
if you want to make a great chart like the one below in reportlab, you need rotated text.
it isn't very complicated - its just a bit hard to find som examples on the net.
the canvas in reportlab has a saveState and a restoreState method, and supports rotate and translate similar
to openGL or processing. see the code example below who it is done.

Read more...
Tags pdf, python, reportlab | no comments | no trackbacks
Tweet This!
Posted by Nikolaus Gradwohl
Sun, 08 Mar 2009 14:18:00 GMT
i just managed to use the
GameEngine of
blender as a client for OSC events :-)
now i can change the color of a cube by sending osc events from my
pd-patch
or the ruby-script i wrote for my
openframeworks-demo

the blend file can be downloaded here
the blend file needs OSC.py by
Daniel W. Holth to be in the python searchpath, so either copy it to location you
start blender form or copy it to your site-package folder (obviously i'm not the only one who had
the idea of using this lib with the blender game engine :-] )
Read more...
Tags bge, blender, osc, python | 9 comments | no trackbacks
Tweet This!
Posted by Nikolaus Gradwohl
Fri, 06 Mar 2009 07:09:00 GMT
when playing with OSC and i'm not quite sure what osc messages get send by an application
i use a little python script which uses the simple OSC api
import osc
osc.init()
osc.listen( "127.0.0.1", 1234 )
in fact it misuses the library ;-)
every time a message is received that isn't bound by a callback function (which is all
messages, since we dont bind anything here ), the listener prints a waring containing
the address, the format and the value of the message
Tags osc, python | no comments | no trackbacks
Tweet This!
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 python | no comments
Tweet This!
Posted by Nikolaus Gradwohl
Fri, 16 Jan 2009 17:48:00 GMT
I recently installed python3. While scanning through the module directory a package
named "antigravity" catched my eye.
when i typed "import antigravity" python opend a browser-window with this link
i really like python - and xkcd :-)
Tags python | no comments
Tweet This!
Posted by Nikolaus Gradwohl
Mon, 22 Sep 2008 05:45:00 GMT
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
Tags erlang, mapreduce, python | no comments
Tweet This!
Posted by Nikolaus Gradwohl
Wed, 10 Sep 2008 07:03:00 GMT
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
Tags pdf, python | no comments
Tweet This!
Posted by Nikolaus Gradwohl
Tue, 15 Jan 2008 06:07:00 GMT
I'm using freevo for my vdr and like it very much. Recently in austria terestrial analog tv has bin turned off
and everyone had to switch to DVB. So our block got a big Satelite-Receiver and a box that transcodes the DBV-S
signal to DBV-C. and i hat to put a DVB-C card in my freevo box ...
to "make the hunt more interessting (shirkan - the jungle-book)" some of the channels still come over analog-tv.
freevo handles mulit-card setups very well, but only if the cards are the same type. So i had to
patch it a little to support my setup where some channels have to be recorded and viewed from one card and some
from the other.
i extended the 'VideoGroup' class by a "vcr_cmd" member, and wrote a little record-pluin that sets the command
depending on the channel description
VIDEO_GROUPS = [
VideoGroup(vdev='/dev/video0',
adev=None,
input_type='tuner',
input_num=0,
tuner_norm='pal',
tuner_chanlist='europe-west',
desc='Default Video Group',
group_type='ivtv',
record_group=None,
vcr_cmd='/usr/local/bin/ivtv-record.py %(filename)s %(channel)s %(seconds)s',
),
VideoGroup(
vdev='/dev/video0',
adev=None,
input_type='tuner',
input_num=0,
desc='DVB Viewer',
group_type='dvb',
record_group=None,
vcr_cmd = 'mencoder -oac copy -ovc copy -o %(filename)s -dvbin card=1
"dvb://%(channel)s" -endpos %(seconds)s'
)
]
ivtv-record is a small script i have written because i cant use the ivtv plugin anymore (it doesnt use the cmd variables).
my record-plugin is a extenion to the "generic-record.py" where i changed the line 'self.reccommand = config.VCRCMD % cl_options'
to 'self.reccommand = vg.vcrcmd % cl_options'
Tags freevo, python | 1 comment
Tweet This!