<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>GuruBlog : Articles about python</title>
    <description>local-guru.net</description>
    <link>http://www.local-guru.net/blog</link>
    <ttl>40</ttl>
    <item>
      <title>Arduino based Office-WTF-Counter</title>
      <link>http://www.local-guru.net//blog/2009/7/3/arduino-based-office-wtf-counter</link>
      <description>&lt;p&gt;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 :-)&lt;/p&gt;

&lt;p&gt;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 ...&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/wtf-button.jpg" alt="wtf-button" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/wtf-arduino.jpg" alt="wtf-arduino" /&gt;&lt;/p&gt;
</description>
      <pubDate>2009-07-03T08:37:00+02:00</pubDate>
    </item>
    <item>
      <title>rotated text in reportlabs</title>
      <link>http://www.local-guru.net//blog/2009/4/9/rotated-text-in-reportlabs</link>
      <description>&lt;p&gt;if you want to make a great chart like the one below in &lt;a href="http://www.reportlab.org/"&gt;reportlab&lt;/a&gt;, you need rotated text.
it isn't very complicated - its just a bit hard to find som examples on the net.&lt;/p&gt;

&lt;p&gt;the canvas in reportlab has a &lt;em&gt;saveState&lt;/em&gt; and a &lt;em&gt;restoreState&lt;/em&gt; method, and supports &lt;em&gt;rotate&lt;/em&gt; and &lt;em&gt;translate&lt;/em&gt; similar
to openGL or processing. see the code example below who it is done.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/img/guru/reportlabs_chart.png" alt="chart with rotated lables" /&gt;&lt;/p&gt;
</description>
      <pubDate>2009-04-09T10:09:00+02:00</pubDate>
    </item>
    <item>
      <title>using the BlenderGameEngine as OSC client </title>
      <link>http://www.local-guru.net//blog/2009/3/8/using-the-blendergameengine-as-osc-client</link>
      <description>&lt;p&gt;i just managed to use the
&lt;a href="http://wiki.blender.org/index.php/BSoD/Introduction_to_the_Game_Engine/The_basics_of_the_Blender_GE"&gt;GameEngine&lt;/a&gt; of
&lt;a href="http://www.blender.org"&gt;blender&lt;/a&gt; as a client for OSC events :-)&lt;/p&gt;

&lt;p&gt;now i can change the color of a cube by sending osc events from my
 &lt;a href="http://www.local-guru.net/blog/2009/03/06/osc-events-in-pd"&gt;pd-patch&lt;/a&gt;
or the ruby-script i wrote for my
 &lt;a href="http://www.local-guru.net/blog/2009/03/06/osc-app-using-openframeworks"&gt;openframeworks-demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.local-guru.net/projects/bge-osc/bge-cube.png" alt="bge-cube.png" /&gt;&lt;/p&gt;

&lt;p&gt;the blend file can be &lt;a href="http://www.local-guru.net/projects/bge-osc/bgetest.blend"&gt;downloaded here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the blend file needs &lt;a href="http://www.local-guru.net/projects/bge-osc/OSC.py"&gt;OSC.py&lt;/a&gt; by
&lt;a href="http://dingoskidneys.com/~dholth/"&gt;Daniel W. Holth&lt;/a&gt; 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 :-] )&lt;/p&gt;
</description>
      <pubDate>2009-03-08T15:18:00+01:00</pubDate>
    </item>
    <item>
      <title>very simple OSC debug tool</title>
      <link>http://www.local-guru.net//blog/2009/3/6/very-simple-osc-debug-tool</link>
      <description>&lt;p&gt;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 &lt;a href="http://www.ixi-audio.net/content/body_backyard_python.html"&gt;the simple OSC api&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import osc
osc.init()
osc.listen( "127.0.0.1", 1234 )
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;in fact it &lt;em&gt;misuses&lt;/em&gt; the library ;-)&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;
</description>
      <pubDate>2009-03-06T08:09:00+01:00</pubDate>
    </item>
    <item>
      <title>What's new in Python 3.0</title>
      <link>http://www.local-guru.net//blog/2009/2/9/whats-new-in-python-3-0</link>
      <description>&lt;p&gt;i have played a bit with &lt;a href="http://www.python.org"&gt;python3.0&lt;/a&gt; and this are the things that catched my eye:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the new print syntax&lt;/li&gt;
&lt;li&gt;the exception-handling&lt;/li&gt;
&lt;li&gt;decorators&lt;/li&gt;
&lt;li&gt;the new io module&lt;/li&gt;
&lt;li&gt;classes in python&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;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.&lt;/p&gt;
</description>
      <pubDate>2009-02-09T18:48:00+01:00</pubDate>
    </item>
    <item>
      <title>flying with python3.0</title>
      <link>http://www.local-guru.net//blog/2009/1/16/flying-with-python3-0</link>
      <description>&lt;p&gt;I recently installed python3. While scanning through the module directory a package
named "antigravity" catched my eye.&lt;/p&gt;

&lt;p&gt;when i typed "import antigravity" python opend a browser-window with &lt;a href="http://xkcd.com/353/"&gt;this link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i really like python - and xkcd :-)&lt;/p&gt;
</description>
      <pubDate>2009-01-16T18:48:00+01:00</pubDate>
    </item>
    <item>
      <title>Disco</title>
      <link>http://www.local-guru.net//blog/2008/9/22/disco</link>
      <description>&lt;p&gt;I recently read about &lt;a href="http://discoproject.org/"&gt;disco&lt;/a&gt; a implementation of the map-reduce algorithm using &lt;a href="http://www.erlang.org/"&gt;erlang&lt;/a&gt;
for the master node and the workload management and &lt;a href="http://python.org/"&gt;python&lt;/a&gt; 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 :-)&lt;/p&gt;

&lt;p&gt;its a bit complicated to install, but once running its realy fun to code with&lt;/p&gt;
</description>
      <pubDate>2008-09-22T07:45:00+02:00</pubDate>
    </item>
    <item>
      <title>ReportLab Test</title>
      <link>http://www.local-guru.net//blog/2008/9/10/reportlab-test</link>
      <description>&lt;p&gt;I just have tested &lt;a href="http://www.reportlab.org/"&gt;reportlab&lt;/a&gt; a python-framework for pdf generation.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;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()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;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&lt;/p&gt;
</description>
      <pubDate>2008-09-10T09:03:00+02:00</pubDate>
    </item>
    <item>
      <title>Multicard setup with freevo</title>
      <link>http://www.local-guru.net//blog/2008/1/15/multicard-setup-with-freevo</link>
      <description>&lt;p&gt;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 ...&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;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'
      )
    ]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;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.rec_command = config.VCR_CMD % cl_options'
to 'self.rec_command = vg.vcr_cmd % cl_options'&lt;/p&gt;
</description>
      <pubDate>2008-01-15T07:07:00+01:00</pubDate>
    </item>
  </channel>
</rss>

