<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.f4k3.net/fake/index.php/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>fake's blog - Tag - code</title>
  <link>http://blog.f4k3.net/fake/index.php/</link>
  <atom:link href="http://blog.f4k3.net/fake/index.php/feed/tag/code/rss2" rel="self" type="application/rss+xml"/>
  <description>everything fake</description>
  <language>en</language>
  <pubDate>Wed, 29 Jun 2011 16:51:30 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>PS3Eye GUID support for sysfs/udev</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2011/02/12/PS3Eye-GUID-support-for-sysfs/udev</link>
    <guid isPermaLink="false">urn:md5:fe449d376eb5f2c277b00d5ec41bc011</guid>
    <pubDate>Sat, 12 Feb 2011 04:09:00 +0100</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>linux</category><category>multitouch</category>    
    <description>    &lt;p&gt;You've got a twin- or quad-&lt;a href=&quot;http://en.wikipedia.org/wiki/PlayStation_Eye&quot;&gt;PS3 Eye&lt;/a&gt; setup for a multitouch solution? On linux? Then you probably noticed there is no way to uniquely identify the cameras for persistant device names, if you change usb ports you're out of luck.&lt;/p&gt;
&lt;p&gt;On windows, the CL-Eye SDK from &lt;a href=&quot;http://www.codelaboratories.com&quot;&gt;codelaboratories&lt;/a&gt;&amp;nbsp;has GUID support, which makes assigning the cameras in your code very reliable. On linux, the way to implement this would be udev rules.&lt;/p&gt;
&lt;p&gt;I wrote a patch to expose the GUID and hardware version attributes of the cameras in sysfs. This required adding 2 hooks to the gspca framework, and implementing them in the ov534 driver file - i have no idea about the side effects this causes for the other gspca drivers, i don't have any other device to test this with. Also, i have never used sysfs before, and i didn't really test the usb sound stuff after my modifications, but for my use case it works perfectly. Be warned: use at your own risk.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.f4k3.net/fake/public/ps3eye-guid-support_linux-2.6.35.patch&quot;&gt;Get the patch&lt;/a&gt; for kernel 2.6.35 - i use Ubuntu 10.10. Rough usage instructions, assuming you have your kernel source ready in /usr/src/linux&lt;/p&gt;
&lt;pre&gt;# patch -p1 &amp;lt; ~/ps3eye-guid-support_linux-2.6.35.patch
# make M=drivers/media/video/gspca
# cp drivers/media/video/gspca/*.ko /lib/modules/`uname -r`/kernel/drivers/media/video/gspca
# depmod -a
&lt;/pre&gt;
&lt;p&gt;Then plug in the cam. The hardware version should be printed in the dmesg output, and /sys/classes/video4linux/video0/guid should show you the GUID of the cam. This can be used in ATTR{guid} - udev rules like this:&lt;/p&gt;
&lt;pre&gt;SUBSYSTEM==&quot;video4linux&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{guid}==&quot;123456-ABCD-DCBA-AAAA-BBCCDDEEFFAA&quot;, NAME=&quot;cam1&quot;
&lt;/pre&gt;
&lt;p&gt;This should create a device called cam1 for this (and only this!) camera.&lt;/p&gt;
&lt;p&gt;Have fun!&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2011/02/12/PS3Eye-GUID-support-for-sysfs/udev#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2011/02/12/PS3Eye-GUID-support-for-sysfs/udev#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/59</wfw:commentRss>
      </item>
    
  <item>
    <title>openfire 3.6 and lotus domino/notes ldap</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2009/08/31/openfire-3.6-and-lotus-domino/notes-ldap</link>
    <guid isPermaLink="false">urn:md5:79f3f2bfa181737201bc4fac22a2fc67</guid>
    <pubDate>Mon, 31 Aug 2009 15:03:00 +0200</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>linux</category>    
    <description>    &lt;p&gt;i just found the time to finally get the 3.6.4 &lt;a href=&quot;http://www.igniterealtime.org/projects/openfire/index.jsp&quot; hreflang=&quot;en&quot;&gt;openfire&lt;/a&gt; working with my company's notes ldap server again. &lt;a href=&quot;http://f4k3.net/~fake/notes-ldap-support-36.patch&quot;&gt;here is the new patch&lt;/a&gt;&amp;nbsp;to the sources, it's a -p1 (when in the untared openfire_src dir) unified diff.&lt;/p&gt;
&lt;p&gt;one hunk of &lt;a href=&quot;http://www.igniterealtime.org/community/message/167276&quot;&gt;my old patch&lt;/a&gt; was merged it seems (though no one even commented on that post, hence the blog post this time), but additional fixing was necessary so the setup tool does disable DN enclosing by default, which breaks authentication in the case of lotus notes. the no-base-dn fix (which is in fact a workaround for the broken notes ldap, but i stopped argueing a while ago) is also updated.&lt;/p&gt;
&lt;p&gt;after installation and setup, if your admin users were found and added but you're still unable to log in, you will need to set the following properties, either in your sql database or in the embedded database script file while openfire is stopped:&lt;/p&gt;
&lt;pre&gt;ldap.encloseDNs = false
ldap.encloseGroupDN = false
ldap.encloseUserDN = false
&lt;/pre&gt;&lt;p&gt;That way, the DN enclosing will also be switched off after installation. Start up openfire and you're good to go.&lt;/p&gt;
&lt;p&gt;Another property of interest for lotus domino ldap users is &quot;ldap.override.avatar&quot;, it will enable the display and transmission of user icons. yay... technology just can't be stopped ;-)&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2009/08/31/openfire-3.6-and-lotus-domino/notes-ldap#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2009/08/31/openfire-3.6-and-lotus-domino/notes-ldap#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/57</wfw:commentRss>
      </item>
    
  <item>
    <title>one-liner for changing file endings</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2009/05/10/one-liner-for-renaming-files</link>
    <guid isPermaLink="false">urn:md5:21bc2ef7b0d55be727b1c7db86073744</guid>
    <pubDate>Sun, 10 May 2009 19:13:00 +0200</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>linux</category><category>osx</category>    
    <description>    i have not been blogging for quite some time, i noticed when replacing the blog software; so now i keep constantly thinking about what i may blog, so a little more density in the posts evolves ;-)&lt;br /&gt;
&lt;br /&gt;
here's today's note; i just needed it and figured someone might say &quot;aaw! that's useful&quot; - a one-liner to use in bash for changing the extension of given files in a directory. bash is the shell that is by default installed in mac os x, and opens when you start the &quot;Terminal&quot; application. It is also the default in almost all linux distributions.&lt;br /&gt;
&lt;br /&gt;
in this example, i rename all .mp4 files to .m4v (thanks, ps3...). adapt as needed.&lt;br /&gt;
&lt;pre&gt;for i in *.mp4 ; do mv &quot;$i&quot; &quot;${i%%mp4}m4v&quot; ; done
&lt;/pre&gt;
the %% operator strips the string following it from the end of the variable's content. the ## operator does the same, but at the beginning of the string.</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2009/05/10/one-liner-for-renaming-files#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2009/05/10/one-liner-for-renaming-files#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/52</wfw:commentRss>
      </item>
    
  <item>
    <title>GPIO to I2C on a Soekris net4801</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/11/20/GPIO-to-I2C-on-a-Soekris-net4801</link>
    <guid isPermaLink="false">urn:md5:3ff8da83706def116bcd7de882a17b79</guid>
    <pubDate>Thu, 20 Nov 2008 21:22:00 +0100</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>embedded</category><category>linux</category>    
    <description>    &lt;div style=&quot;float: left; margin: 10px 10px 10px 10px;&quot;&gt;&lt;a href=&quot;http://blog.f4k3.net/fake/resource/rp6-soekris.jpg&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/fake/resource/rp6-soekris.jpg&quot; width=&quot;200&quot; height=&quot;160&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I recently started playing around with robots from &lt;a href=&quot;http://www.arexx.com/&quot; target=&quot;_new&quot;&gt;arexx&lt;/a&gt; - a friend introduced me to the &lt;a href=&quot;http://www.arexx.com/arexx.php?cmd=goto&amp;amp;cparam=p_asuro&quot; target=&quot;_new&quot;&gt;asuro&lt;/a&gt;, and - impressed by the steep learning curve - i got myself an &lt;a href=&quot;http://www.arexx.com/rp6/&quot; target=&quot;_new&quot;&gt;RP6&lt;/a&gt;.
&lt;br /&gt;&lt;br /&gt;
having toyed around with it, i remembered i had an old &lt;a href=&quot;http://www.soekris.com/&quot; target=&quot;_new&quot;&gt;soekris&lt;/a&gt; &lt;a href=&quot;http://www.soekris.com/net4801.htm&quot; target=&quot;_new&quot;&gt;net4801&lt;/a&gt; lying around... which, unfortunately, does not have i2c ports pinned out - but it has &lt;a href=&quot;http://www.soekris.com/manuals/net4801_manual.pdf&quot; target=&quot;_new&quot;&gt;12 GPIO pins &lt;/a&gt;... i quickly found i2c-gpio in the linux kernel, but that uses the arch-independent gpio layer called gpiolib. the soekris pc8736x gpio driver does not support this layer :(
&lt;br /&gt;&lt;br /&gt;
i'm by far not a kernel developer, but i managed to insert a small wrapping layer that seems to work. it basically registers the pc8736x as generic gpio chip, additionally to the character device(s).
&lt;br /&gt;&lt;br /&gt;
i repeat: i am not a kernel developer. this is a hack so ugly it will most likely not work for you. if you have a soekris net4801 (no, a &lt;a href=&quot;http://www.soekris.com/net4501.htm&quot; target=&quot;_new&quot;&gt;net4501&lt;/a&gt; will not work! it has &lt;a href=&quot;http://www.soekris.com/manuals/net4501_manual.pdf&quot; target=&quot;_new&quot;&gt;lesser gpio pins&lt;/a&gt;! go count!) your chances are indefinitely higher it may work, but i don't guarantee anything. also, even the most basic cleanup code is missing - i am not removing the gpio chip on unload, i just dont' care for now.
&lt;br /&gt;&lt;br /&gt;
included in the patch below is a i2c-gpio-generic module i found in the &lt;a href=&quot;http://openwrt.org/&quot; target=&quot;_new&quot;&gt;openwrt&lt;/a&gt; &lt;a href=&quot;https://dev.openwrt.org/browser/trunk/package/i2c-gpio-custom/&quot; target=&quot;_new&quot;&gt;subversion&lt;/a&gt; by pure coincidence, it works very well. i just patched it so it hardcodes sda and scl to open drain, which is the default on the soekris.
&lt;br /&gt;&lt;br /&gt;
to get i2c up and running on the gpio pins 0 and 1 (jp5 pins 3 and 4 on the connector!) with 0 being sda and 1 being scl,  you have to
&lt;br /&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;modprobe pc8736x_gpio&lt;/li&gt;
&lt;li&gt;read dmesg and note the assigned lowest pin nr (244 for me)&lt;/li&gt;
&lt;li&gt;modprobe i2c-generic-custom bus0=245,244,245 (the latter two being the number from above 1st, and 1 added to it 2nd. the first nr. is the i2c bus id. choose it to your liking.)&lt;/li&gt;
&lt;li&gt;modprobe i2c-dev&lt;/li&gt;
&lt;/ul&gt;
that should enable you to run i2cdetect on the newly appeared bus.
&lt;br /&gt;&lt;br /&gt;
a little warning: i wouldn't mess around with the character device while using this, especially not for the pins in use for i2c. you have been warned.
&lt;br /&gt;&lt;br /&gt;
i also wrote &lt;a href=&quot;http://blog.f4k3.net/fake/resource/_test-i2c.c&quot;&gt;a small test program&lt;/a&gt; that reads out the current light sensor value (left) of the rp6 running the IC2_Slave example program that it has been shipped with.
&lt;br /&gt;&lt;br /&gt;
also, the *actual* pinout-to-minor-device-nr for the gpio character device might be of interest here: &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;float: right; margin: 10px 10px 10px 10px;&quot;&gt;&lt;a href=&quot;http://blog.f4k3.net/fake/resource/soekris-rp6-2.jpg&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/fake/resource/soekris-rp6-2.jpg&quot; width=&quot;200&quot; height=&quot;240&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Soekris&lt;/th&gt;&lt;th&gt;PC8736x&lt;/th&gt;&lt;th&gt;Minor Device #&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 0&lt;/td&gt;&lt;td&gt;GPIO 20, 117&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 1&lt;/td&gt;&lt;td&gt;GPIO 21, 118&lt;/td&gt;&lt;td&gt;17&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 2&lt;/td&gt;&lt;td&gt;GPIO 22, 119&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 3&lt;/td&gt;&lt;td&gt;GPIO 23, 120&lt;/td&gt;&lt;td&gt;19&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 4&lt;/td&gt;&lt;td&gt;GPIO 24, 121&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 5&lt;/td&gt;&lt;td&gt;GPIO 24, 122&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 6&lt;/td&gt;&lt;td&gt;GPIO 26, 123&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 7&lt;/td&gt;&lt;td&gt;GPIO 26, 124&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 8&lt;/td&gt;&lt;td&gt;GPIO 4, 6&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 9&lt;/td&gt;&lt;td&gt;GPIO 5, 7&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 10&lt;/td&gt;&lt;td&gt;GPIO 13, 55&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GPIO 11&lt;/td&gt;&lt;td&gt;GPIO 12, 54&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
kudos to the guy who found this out, it cost me 2 days to figure out the straightforward approach (GPIO 20 = minor 20?) was wrong.
&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.f4k3.net/fake/resource/_soekris-gpio-i2c-linux-2.6.27.6.patch&quot;&gt;here is the patch&lt;/a&gt;. handle with care. it's against linux-2.6.27.6. i used &lt;a href=&quot;http://blog.f4k3.net/fake/resource/_soekris-config&quot;&gt;this .config&lt;/a&gt; to build the kernel.
&lt;br /&gt;&lt;br /&gt;</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/11/20/GPIO-to-I2C-on-a-Soekris-net4801#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/11/20/GPIO-to-I2C-on-a-Soekris-net4801#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/49</wfw:commentRss>
      </item>
    
  <item>
    <title>exportPB4Fritz updated</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/11/09/exportPB4Fritz-updated</link>
    <guid isPermaLink="false">urn:md5:456c6247e5a05985aed89008747c901a</guid>
    <pubDate>Sun, 09 Nov 2008 14:04:00 +0100</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>osx</category>    
    <description>    i just updated the exportPB4Fritz.py skript so it can handle contacts that do not have a first, but a lastname set.
a minor fix, of course, just thought i'd quickly replace the version from &lt;a href=&quot;http://blog.f4k3.net/fake/entry/avm_fritz_box_vs_os&quot;&gt;the original posting&lt;/a&gt; so people not into python can use it with &quot;interesting&quot; os x address books ;-)
the download url is the same, it's in the blog post linked above.</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/11/09/exportPB4Fritz-updated#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/11/09/exportPB4Fritz-updated#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/48</wfw:commentRss>
      </item>
    
  <item>
    <title>AVM Fritz! Box vs. OS X Address Book</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/10/04/AVM-Fritz%21-Box-vs.-OS-X-Address-Book</link>
    <guid isPermaLink="false">urn:md5:2cadc8c94718352e35dacb1ca18c148a</guid>
    <pubDate>Sat, 04 Oct 2008 21:43:00 +0200</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>osx</category>    
    <description>    &lt;div style=&quot;float: right; padding-left: 8px; padding-bottom: 8px; padding-top: 8px;&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/fake/resource/fritzappleab.png&quot; border=&quot;0&quot; /&gt;&lt;/div&gt;
I am a pretty happy user of a &lt;a href=&quot;http://www.freetz.org/&quot; target=&quot;_new&quot;&gt;freetz&lt;/a&gt;'d AVM Fritz! Box 7140 for a while now, the only thing bugging me was the lack of an address book import built into the box.
i tried messing around with the &lt;a href=&quot;http://www.wehavemorefun.de/fritzbox/index.php/XML-Adressbuch&quot; target=&quot;_new&quot;&gt;/var/flash/phonebook&lt;/a&gt; file, but for some reason my xml files kept being rejected.
ultimately, i found a utility called &quot;Fritz!box Monitor&quot; or short FBM, which is &lt;a href=&quot;ftp://ftp.avm.de/fritz.box/tools/fbm/&quot; target=&quot;_new&quot;&gt;supplied by AVM&lt;/a&gt;. It can import CSV files in a certain (pretty weird) format, so i re-wrote my xml-generator to print out that format instead. FBM's a windows program of course, so fire up your parallels/fusion/qemu/whatever.
You have to edit &lt;tt&gt;fritzboxmonitor.ini&lt;/tt&gt; in it's program directory before using this, and set the key &lt;tt&gt;ExportAll&lt;/tt&gt; to &lt;tt&gt;1&lt;/tt&gt;. I also set the &lt;tt&gt;AutoSpeedDial&lt;/tt&gt; entry to &lt;tt&gt;0&lt;/tt&gt; because i don't use speed dialing and thus the csv exporter doesn't support it.
The exporter is written in python, i used &lt;a href=&quot;http://www.programmish.com/?p=26&quot; target=&quot;_new&quot;&gt;this script&lt;/a&gt; as a basis. It's an ugly quick hack, so bear with me. It should work with mac os x 10.5.5 stock python, probably earlier, too.
You can find the exporter script &lt;a href=&quot;http://blog.f4k3.net/fake/resource/exportPB4Fritz.py&quot;&gt;here&lt;/a&gt;.
i also came up with a version that exports to a windows-addressbook-reimportable format; i use it to push my contacts to a siemens gigaset sl56 bluetooth enabled dect phone, which only supports a windows program as source either. that version is &lt;a href=&quot;http://blog.f4k3.net/fake/resource/exportPB4GigaSet.py&quot;&gt;here&lt;/a&gt;.</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/10/04/AVM-Fritz%21-Box-vs.-OS-X-Address-Book#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/10/04/AVM-Fritz%21-Box-vs.-OS-X-Address-Book#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/47</wfw:commentRss>
      </item>
    
  <item>
    <title>minipokereval</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/04/17/minipokereval</link>
    <guid isPermaLink="false">urn:md5:1a0e37d24c157a6d760cc6af5787ec40</guid>
    <pubDate>Thu, 17 Apr 2008 18:18:00 +0200</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>poker</category>    
    <description>    about one year ago i played with poker evaluation libraries, and found one of the &lt;a href=&quot;http://poker.cs.ualberta.ca/&quot; target=&quot;_new&quot;&gt;university of alberta computer poker research group&lt;/a&gt; which i liked best. i hacked up a little &quot;evaluator&quot; using free card graphics from &lt;a href=&quot;http://www.openclipart.org/&quot; target=&quot;_new&quot;&gt;opencliparts.org&lt;/a&gt;. it's not a complete game, but it's still fun. i think ;)
&lt;div style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/fake/resource/_minipokereval.png&quot; alt=&quot;minipokereval.png&quot; border=&quot;0&quot; width=&quot;301&quot; height=&quot;156&quot; /&gt;&lt;/div&gt;
here you go: &lt;a href=&quot;http://blog.f4k3.net/fake/resource/minipokereval.jar&quot;&gt;minipokerval.jar&lt;/a&gt;
i found the library sufficient in features, easy to use and it has a small footprint. i started to work on some poker server using flex, but didn't really get far before i was overloaded with work and school again ... you know how it is...</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/04/17/minipokereval#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/04/17/minipokereval#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/42</wfw:commentRss>
      </item>
    
  <item>
    <title>Planets 0.2.53</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/03/11/Planets-0.2.53</link>
    <guid isPermaLink="false">urn:md5:83deb587aa88dc91e68349c2afa88bd7</guid>
    <pubDate>Tue, 11 Mar 2008 18:13:00 +0100</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category>    
    <description>    I quickly packed to together the changes i made since the last release of planets, which are:&lt;ul&gt;&lt;li&gt;automatically select a planet if &quot;distance&quot; is clicked, so something happens visually&lt;/li&gt;
&lt;li&gt;background- and gridcolors are now configurable through a new &quot;preferences&quot; menu item&lt;/li&gt;
&lt;li&gt;the size of one calculation step is also configurable in that new dialog - bigger values means it becomes less accurate.&lt;/li&gt;
&lt;/ul&gt;
I needed the background- and gridcolors changeable for the documentation i wrote (see below, german only, sorry). i also came up with a few more examples (sorry for the germanisms in the file names...), but removed the screenshots from that package.
here we go: there are again binary builds for windows 32bit (almost untested) and for mac os x 10.4 or later (universal) available:&lt;div style=&quot;float: right; padding-left: 8px; padding-bottom: 2px;&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/fake/resource/planets-config.png&quot; border=&quot;0&quot; /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Windows Binary: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.2.53-bin-win32.zip&quot;&gt;planets-0.2.53-bin-win32.zip&lt;/a&gt; (3.3 MB)&lt;/li&gt;
&lt;li&gt;Mac OS X Binary: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.2.53-bin-mac.zip&quot;&gt;planets-0.2.53-bin-mac.zip&lt;/a&gt; (7.5 MB)&lt;/li&gt;
&lt;/ul&gt;
the source:&lt;ul&gt;&lt;li&gt;Source Code, .tar.gz: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.2.53-src.tar.gz&quot;&gt;planets-0.2.53-src.tar.gz&lt;/a&gt; (0.65 MB)&lt;/li&gt;
&lt;li&gt;Source Code, .zip: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.2.53-src.zip&quot;&gt;planets-0.2.53-src.zip&lt;/a&gt; (0.68 MB)&lt;/li&gt;
&lt;/ul&gt;
and the new samples package:&lt;ul&gt;&lt;li&gt;Sample Files, .zip: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-samples-0.2.zip&quot;&gt;planets-samples-0.2.zip&lt;/a&gt; (0.05 MB) &lt;/li&gt;
&lt;/ul&gt;
the - as mentioned - german-only documentation is &lt;a href=&quot;http://blog.f4k3.net/fake/resource/Physik-Fachreferat-Dokumentation.pdf&quot; target=&quot;_new&quot;&gt;available as PDF file&lt;/a&gt;, it's not exactly a documentation of the software as you would expect it handed alongside a program, but rather a description of the purpose of the project in general, spiced with a few technical details of how the simulation works. nothing special, though - i wish days had more hours ;-)</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/03/11/Planets-0.2.53#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/03/11/Planets-0.2.53#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/39</wfw:commentRss>
      </item>
    
  <item>
    <title>iPhone SDK - first usable output</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/03/10/iPhone-SDK-first-usable-output</link>
    <guid isPermaLink="false">urn:md5:da846255a8d4cdba6349acf469d9e19b</guid>
    <pubDate>Mon, 10 Mar 2008 17:38:00 +0100</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>iphone</category>    
    <description>    while playing around with the iPhone SDK, i quickly lost my motivation digging through the Cocoa Touch API definitions, not being able to run the code on my phone just removes the fun for me... i want to play, not design ;-) I guess i'll have to start writing some Mac Cocoa apps first, anyway, though this Objective-C they keep talking about doesn't look as weird as i initially thought.
Meanwhile, in part due to the lack of an Interface Builder for the iPhone, i played with the extensions made to Dashcode, quickly hacking up the micro-app i intended to code for my &lt;a href=&quot;http://catb.org/jargon/html/S/SO.html&quot; target=&quot;_new&quot;&gt;SO&lt;/a&gt; in native Objective C (which i will maybe do later on... when it's fun, heh). The overall time i spent on this is about 2 hours.
&lt;div style=&quot;float: left; padding-right: 8px; padding-bottom: 2px;&quot;&gt;&lt;a href=&quot;http://f4k3.net/~fake/PtCalc/&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/fake/resource/ptcalc_ptcalc.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
It's a points calculator using the (european) formula of &lt;a href=&quot;http://en.wikipedia.org/wiki/Weight_Watchers&quot; target=&quot;_new&quot;&gt;&quot;an international company that offers various dieting products and services to assist weight loss and maintenance&quot;&lt;/a&gt;.
it's called &quot;&lt;strong&gt;PtCalc&lt;/strong&gt;&quot; because i'm so creative. You can check it out at
&lt;center&gt;&lt;a href=&quot;http://f4k3.net/~fake/PtCalc&quot; target=&quot;_new&quot; style=&quot;font-size: 120%;&quot;&gt;http://f4k3.net/~fake/PtCalc/&lt;/a&gt;&lt;/center&gt;
i also uploaded the &lt;a href=&quot;http://blog.f4k3.net/fake/resource/ptcalc_PtCalc.dcproj.zip&amp;quot;&quot; title=&quot;PtCalc.dcproj.zip&quot;&gt;dashcode source file&lt;/a&gt; and the &lt;a href=&quot;http://blog.f4k3.net/fake/resource/ptcalc_PtCalc.zip&quot; title=&quot;PtCalc.zip&quot;&gt;generated output files&lt;/a&gt; in case you want to drop it onto your iPhone / iPod touch and use the file://-Support-Hack (there is a patch in Installer for most firmware versions), copy it onto your home server, print it out, or whatever you may want to do with it, i don't care - in other words: Public Domain...
the scale on the calories is from 0 - 700&amp;nbsp;kcal; the fat is from 0 - 70&amp;nbsp;g. like it or not, i seldom eat something with more than that per 100g. and i can do *5 and alike calculations in my head ;)
if you suggest some new features, i might even give it a whirl and put some more energy into this before the iPhone firmware 2.0 ( + jailbreak + unlock) release.
(2008-03-13) note: i changed the graphics included in the zip file and in the hosted versions to be of optimal size. they were huge...</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/03/10/iPhone-SDK-first-usable-output#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/03/10/iPhone-SDK-first-usable-output#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/38</wfw:commentRss>
      </item>
    
  <item>
    <title>First &quot;Planets&quot;-Release: Planets 0.1.47</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2008/02/28/First-%22Planets%22-Release%3A-Planets-0.1.47</link>
    <guid isPermaLink="false">urn:md5:08693e25f446d143149c6a71f7e6775b</guid>
    <pubDate>Thu, 28 Feb 2008 00:35:00 +0100</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category>    
    <description>    &lt;div style=&quot;color:red;&quot;&gt;&lt;strong&gt;Note&lt;/strong&gt;: there is a newer version available &lt;a href=&quot;http://blog.f4k3.net/fake/index.php/post/2008/03/11/Planets-0.2.53&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;float: right; margin: 5px; padding: 2px;&quot;&gt;
&lt;a href=&quot;http://blog.f4k3.net/resources/fake/action.jpg&quot; target=&quot;_new&quot;&gt;&lt;img label=&quot;Click for a bigger Image&quot; src=&quot;http://blog.f4k3.net/resources/fake/action-thumbnail.jpg&quot; width=&quot;150&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.f4k3.net/resources/fake/dialogopen.jpg&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://blog.f4k3.net/resources/fake/dialogopen-thumbnail.jpg&quot; width=&quot;150&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;em&gt;From the &quot;I'd rather be toying around with the iPhone SDK&quot; - department:&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Finally it is mature enough so i can put a first version &quot;out there&quot;: &lt;strong&gt;Planets, a multi-platform gravitational movement simulator&lt;/strong&gt; written in C++ using &lt;a href=&quot;http://trolltech.com&quot; target=&quot;_new&quot;&gt;Trolltech&lt;/a&gt;'s wonderful &lt;a href=&quot;http://trolltech.com/products/qt/homepage&quot; target=&quot;_new&quot;&gt;Qt&lt;/a&gt; 4 is here!&lt;br /&gt;
&lt;br /&gt;
There are binary builds for windows 32bit (almost untested) and for mac os x 10.4 or later (universal) available:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Windows Binary: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.1.47-bin-win32.zip&quot;&gt;planets-0.1.47-bin-win32.zip&lt;/a&gt; (3.2 MB)&lt;/li&gt;
&lt;li&gt;Mac OS X Binary: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.1.47-bin-mac.zip&quot;&gt;planets-0.1.47-bin-mac.zip&lt;/a&gt; (7.4 MB)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
A binary X11-Version (for Linux, *BSD, ... ) is not available (packagers? anyone? there are only 1000 combinations to choose from ;-), so please compile yourself (it's easy, see included README) using the source:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Source Code, .tar.gz: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.1.47-src.tar.gz&quot;&gt;planets-0.1.47-src.tar.gz&lt;/a&gt; (0.8 MB)&lt;/li&gt;
&lt;li&gt;Source Code, .zip: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-0.1.47-src.zip&quot;&gt;planets-0.1.47-src.zip&lt;/a&gt; (0.8 MB)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Also available are a few example .planet files:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Sample Files, .zip: &lt;a href=&quot;http://blog.f4k3.net/resources/fake/planets-samples.zip&quot;&gt;planets-samples.zip&lt;/a&gt; (0.1 MB) &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Obviously, there is not much practical use in this program, it's merely part of a technical lecture i'll be giving sometime next month. Stay tuned for documentation and have fun gravitating ;-)&lt;br /&gt;
&lt;br /&gt;
I'd be happy if you report bugs either via mail or as a comment on the bottom of this article. Also i'd be interested in the .planet files you create - please send them to me via mail, i'll publish them here if you like. Also, patches are gratefully accepted via mail, once i held the technical lecture (and hopefully got a good grade *g*)&lt;br /&gt;
&lt;br /&gt;
-----</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2008/02/28/First-%22Planets%22-Release%3A-Planets-0.1.47#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2008/02/28/First-%22Planets%22-Release%3A-Planets-0.1.47#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/35</wfw:commentRss>
      </item>
    
  <item>
    <title>Acegi LoginCommand for FDS</title>
    <link>http://blog.f4k3.net/fake/index.php/post/2007/06/06/Acegi-LoginCommand-for-FDS</link>
    <guid isPermaLink="false">urn:md5:d0014c349c68c903ae7455c3eab75718</guid>
    <pubDate>Wed, 06 Jun 2007 12:53:00 +0200</pubDate>
    <dc:creator>fake</dc:creator>
        <category>code</category><category>flex</category>    
    <description>    I have been working with &lt;a href=&quot;http://www.adobe.com/products/flex/&quot; target=&quot;_blank&quot;&gt;Flex&lt;/a&gt; for a project at work the last 3 months, and am very, very thrilled by the possibilites it offers. While evaluating, i also looked at Flex Data Services, a J2EE web application that enables a tight interaction between flex and java on the server, much thighter even than with the webservice method that doesn't need the FDS. Especially the Message Queue Support for pushing Information to the browser catched my eye, so i started re-working a private project i had lying around for long where i kept a socket open and constantly loading, parsing the incoming data with javascript the moment it arrives, thus giving the illusion of browser push. This sucked badly, and the much cleaner FDS / Flex solution is working like a charm - but one thing was bugging me. The whole security system provided by flex is based on Container-Based-Security; This renders the wonderful &lt;a href=&quot;http://www.acegisecurity.org/&quot; target=&quot;_blank&quot;&gt;Acegi Security&lt;/a&gt; annotations useless; So i needed integration.&lt;br /&gt;
&lt;br /&gt;
I looked far and wide for a nice solution, and finally came up with one of my own. flex.messaging.security.LoginCommand Interface implementations are shipped for different containers like cataline/tomcat, jboss, webspehere etc, but can also be replaced by custom implementations in WEB-INF/flex/services-config.xml in the &amp;lt;security&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Having used a dao authentication provider with acegi security and &lt;a href=&quot;http://www.springframework.org/&quot; target=&quot;_blank&quot;&gt;spring&lt;/a&gt;, i wrote the following class:&lt;br /&gt;&lt;pre style=&quot;font-size: x-small;&quot;&gt;
package my.own.security;
import java.security.Principal;
import java.util.List;
import javax.servlet.ServletConfig;
import org.acegisecurity.Authentication;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.providers.AuthenticationProvider;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import flex.messaging.security.LoginCommand;
public class AcegiLoginCommand implements LoginCommand {
private static final Log log = LogFactory.getLog( AcegiLoginCommand.class );
protected static ApplicationContext applicationContext;
private static String[] CONFIG_LOCATIONS = {
&quot;classpath:applicationContext.xml&quot;
};
private static AuthenticationProvider authenticationProvider;
public AcegiLoginCommand() {
super();
if ( applicationContext == null ) {
log.debug( &quot;Initializing Spring context&quot;);
try {
applicationContext = new ClassPathXmlApplicationContext(
getConfigLocations() );
} catch (Exception ex) {
log.error(&quot;exception loading spring context&quot;,ex);
}
log.debug( &quot;... done !&quot; );
}
if(authenticationProvider == null) {
authenticationProvider =
(AuthenticationProvider)applicationContext.getBean(
&quot;myAuthenticationProviderSpringBean&quot;);
}
}
public Principal doAuthentication(String username, Object credentials) {
Authentication auth = authenticationProvider.authenticate(
new UsernamePasswordAuthenticationToken(username, credentials));
SecurityContextHolder.getContext().setAuthentication(auth);
return (Principal)auth;
}
public boolean doAuthorization(Principal arg0, List arg1) {
GrantedAuthority[] roles = ((UsernamePasswordAuthenticationToken)arg0).getAuthorities();
for(int n =0; n &amp;lt; roles.length; n++) {
for(int m = 0; m &amp;lt; arg1.size(); m++ ) {
if(roles[n].getAuthority().equals(arg1.get(m))) return true;
}
}
return false;
}
public boolean logout(Principal arg0) {
log.debug(&quot;logout called with arg: &quot; + arg0);
// TODO
return false;
}
public void start(ServletConfig arg0) {
log.debug(&quot;start called with arg: &quot; + arg0);
// TODO
}
public void stop() {
log.debug(&quot;stop called&quot;);
// TODO
}
private static String[] getConfigLocations() {
return CONFIG_LOCATIONS;
}
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
i never saw the items marked with TODO called up to now.&lt;br /&gt;
&lt;br /&gt;
i then replaced the default LoginCommand in services-config.xml with the following:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;login-command class=&quot;my.own.security.AcegiLoginCommand&quot; server=&quot;Tomcat&quot;/&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The latter part (server=) i'm not sure about, i'm using tomcat, so it will be used, but maybe &quot;*&quot; would be better. It needs to be noted, that i deploy my web application inside the flex webapp, or to put it in correct terms, i added the contents of the flex web application to my webapp, so cross-webapp-security is out of the question in this specific case.&lt;br /&gt;
&lt;br /&gt;
maybe it's of use to someone else, it cost me a few days to figure this out. remember, this is only important if using non-http(s)-transports like rtmp, because there is no acegi session filter for it.&lt;br /&gt;
&lt;br /&gt;</description>
    
    
    
          <comments>http://blog.f4k3.net/fake/index.php/post/2007/06/06/Acegi-LoginCommand-for-FDS#comment-form</comments>
      <wfw:comment>http://blog.f4k3.net/fake/index.php/post/2007/06/06/Acegi-LoginCommand-for-FDS#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.f4k3.net/fake/index.php/feed/atom/comments/32</wfw:commentRss>
      </item>
    
</channel>
</rss>
