Jekyll2020-06-06T22:04:21+00:00https://www.davidklotz.de/feed.xmlDavid’s BlogThoughts on software engineering, technology and the rest of the world. Personal blog, opinions are my own.David KlotzNew blog & domain2017-11-12T12:00:00+00:002017-11-12T12:00:00+00:00https://www.davidklotz.de/2017/11/12/new-blog<p>I finally re-activated my blog (and moved it to a <a href="https://www.davidklotz.de">new domain</a>)! Let’s see how often I’ll actually get around to writing something, but I convinced myself again that I wanted to have a place where I can put slightly longer notes and thoughts that is completely under my control, because I still <a href="http://tttthis.com/rememberwebsites.php/">remember websites</a> and don’t want to be completely dependent on <a href="http://theoatmeal.com/comics/reaching_people">Facebook & Co</a>.</p>
<p>I switched from my old wordpress to generating a completely static site using <a href="https://jekyllrb.com/">Jekyll</a> and the appropriately named <a href="https://github.com/jekyll/minima">minima</a> theme.
Since I’m lazy, I’m currently hosting on <a href="https://pages.github.com/">GitHub Pages</a>, where I can just directly push changes to a git repository and have the site automatically rebuilt without needing to set up any custom CI integration for this. But since I’m now generating a static site, moving to a different hosting solution should also be pretty easy if I ever want to do that.</p>
<p>Since you normally can’t use SSL and a custom domain for GitHub pages (and I don’t want to use a “benevolent MITM” like Cloudflare), SSL is provided by <a href="https://letsencrypt.org/">Let’s Encrypt</a> and <a href="https://nginx.org/en/">nginx</a> running on my own Server, reverse proxying my GitHub pages subdomain.</p>David KlotzI finally re-activated my blog (and moved it to a new domain)! Let’s see how often I’ll actually get around to writing something, but I convinced myself again that I wanted to have a place where I can put slightly longer notes and thoughts that is completely under my control, because I still remember websites and don’t want to be completely dependent on Facebook & Co. I switched from my old wordpress to generating a completely static site using Jekyll and the appropriately named minima theme. Since I’m lazy, I’m currently hosting on GitHub Pages, where I can just directly push changes to a git repository and have the site automatically rebuilt without needing to set up any custom CI integration for this. But since I’m now generating a static site, moving to a different hosting solution should also be pretty easy if I ever want to do that. Since you normally can’t use SSL and a custom domain for GitHub pages (and I don’t want to use a “benevolent MITM” like Cloudflare), SSL is provided by Let’s Encrypt and nginx running on my own Server, reverse proxying my GitHub pages subdomain.ldd replacement for Mac OS X2013-06-14T14:15:38+00:002013-06-14T14:15:38+00:00https://www.davidklotz.de/2013/06/14/ldd-replacement-for-mac-os-x<p>If you develop in C/C++, you will probably already know and love the <code>ldd</code> tool. If you don't know it, yet, <code>ldd</code> lets you check against which dynamic/shared libraries a given binary is currently linked (and which of them might be missing).</p>
<p><!--more--></p>
<p>If you come to Mac OS X with a Unix/GCC background, you will be quite surprised that the system seems to be lacking this essential utility. But fear not, there is another tool that can do this job under OS X just fine! Introducing: <a title="otool man page" href="https://www.unix.com/man-page/osx/1/otool/" target="_blank">otool</a>. It can do much more, but to use it as a direct substitute for <code>ldd</code>, just give it the <code>-L</code> switch and the path to the binary like this:</p>
<figure class="highlight"><pre><code class="language-shell" data-lang="shell">david@camaris:~/stuff<span class="nv">$ </span>otool <span class="nt">-L</span> rsb_videoreceiver
rsb_videoreceiver:
/usr/local/lib/librsc.0.7.dylib <span class="o">(</span>compatibility version 0.0.0, current version 0.7.0<span class="o">)</span>
/usr/local/lib/librsbcore.0.7.dylib <span class="o">(</span>compatibility version 0.0.0, current version 0.7.0<span class="o">)</span>
/usr/local/lib/libopencv_video.2.4.2.dylib <span class="o">(</span>compatibility version 2.4.0, current version 2.4.2<span class="o">)</span>
<span class="o">[</span>...]
/usr/lib/libstdc++.6.dylib <span class="o">(</span>compatibility version 7.0.0, current version 56.0.0<span class="o">)</span>
/usr/lib/libSystem.B.dylib <span class="o">(</span>compatibility version 1.0.0, current version 169.3.0<span class="o">)</span></code></pre></figure>
<p>(via/Thanks to: <a title="Mac OS X tips by Sergei Chumakov" href="http://schumakov.info/howto-osx.php" target="_blank">Sergei Chumakov</a>)</p>David KlotzIf you develop in C/C++, you will probably already know and love the ldd tool. If you don't know it, yet, ldd lets you check against which dynamic/shared libraries a given binary is currently linked (and which of them might be missing).The world needs more giant robots2009-09-29T17:56:54+00:002009-09-29T17:56:54+00:00https://www.davidklotz.de/2009/09/29/the-world-needs-more-giant-robots<p>Wollen wir doch mal den Titel* dieses Blogs etwas wörtlicher nehmen und über einen interessanten Menschen schreiben, der etwas mit Robotern zu tun hat. Großen Robotern, <a title="Giant Robot Project" href="https://web.archive.org/web/20131127010309/http://jamius.com/Robot/Robot.html">gigantischen sogar</a>, wenn man ihn beim Wort nimmt. <!--more-->Allerdings reden wir hier nicht wirklich über die Art von Robotern, die einem in der Uni oder beim RoboCup so über den Weg laufen. Und auch sonst hat das ganze mit Robotik nur sehr entfernt etwas zu tun.</p>
<p><a title="Jaimie's YouTube Channel" href="https://www.youtube.com/channel/UC1p7jFXjL7Q0qMii08oAeAQ">Jaimie Mantzel</a> hat sich vor einer Weile einen Traum erfüllt und hat sich ein <a title="Jaimie in Vermont" href="https://web.archive.org/web/20131108174922/http://jamius.com/vermont1.html">Stück Land in den Wäldern</a> von Vermont gekauft, um dorthin zu ziehen. Das zu diesem Grundstück keine Straße führt, hat ihn dabei nicht wirklich gestört, man kann es ja <a title="Directions" href="https://web.archive.org/web/20130519011026/http://jamius.com/vermont3.html">gut zu Fuß erreichen</a>, oder man baut sich halt <a title="Robot roads" href="http://www.youtube.com/watch?v=nf-lL8_aM0M">seine eigene Straße</a>. Aber generell war es wohl durchaus beabsichtigt, sich soweit wie möglich vom normalen "Grid" abzukapseln, womit etwas mehr als nur das öffentliche Stromnetz gemeint sein dürfte.</p>
<p>Neben einer <a title="big dome" href="https://www.youtube.com/watch?v=8gePIc6xXXA">größeren</a> und einer kleineren <a title="Wikipedia: Geodesic Dome" href="http://en.wikipedia.org/wiki/Geodesic_dome">geodätischen Kuppel</a> als Wohnhaus hat er dort unter anderem angefangen, an besagtem <a title="GRP" href="https://web.archive.org/web/20131127010309/http://jamius.com/Robot/Robot.html">gigantischen Roboter</a> zu bauen. Eine <a title="small giant robot" href="https://www.youtube.com/watch?v=_6qpSOjtB2E">Mini-Version</a> gibt es davon schon, aber in seiner (natürlich auch selbstgebauten) Werkstatt im Wald entsteht etwas, das groß genug ist, um selbst darin durch die Gegend zu fahren (oder eher: zu laufen). Und dokumentiert wird das ganze (neben anderen <a title="Jaimie's Adventures" href="https://web.archive.org/web/20131109044606/http://jamius.com/Adventures.html">interessanten Projekten</a>) in einer meist witzig kommentierten Art <a title="JME on Youtube" href="http://www.youtube.com/user/JMEMantzel">Video-Blog auf Youtube</a>, worüber ich auch auf diesen auf eine sehr positive Art verrückten Menschen aufmerksam geworden bin.</p>
<p><b>*Update 2017:</b> Der ursprüngliche Titel dieses Blogs war "robot campfire".</p>David KlotzWollen wir doch mal den Titel* dieses Blogs etwas wörtlicher nehmen und über einen interessanten Menschen schreiben, der etwas mit Robotern zu tun hat. Großen Robotern, gigantischen sogar, wenn man ihn beim Wort nimmt.Using HSV to build a traffic light2009-09-27T21:19:36+00:002009-09-27T21:19:36+00:00https://www.davidklotz.de/2009/09/27/using-hsv-to-build-a-traffic-light<p>A small tip for anyone working on some sort of data visualization. If you have values that lie between 0.0 and 1.0 (or 0% and 100%, or <em>$some_value</em> and <em>$some_other_value</em>), you can use a simple interpolation in the HSV (or HSB) color space to get a nice "traffic light" range of colors from red to green via yellow in the middle, which is fine for displaying something that is "OK" if the values are low and gets "critical" or "dangerous" for higher values (or vice versa). Just set the saturation and value (or brightness) parameters to 100% and use your data to vary the hue between 0° (which means red) and 120° (which is green). Since yellow sits right in the middle of that scale at 60° this gives you a smooth transition from red to yellow to green, which may look like this:</p>
<p style="text-align: center;"><img title="processing output" src="https://www.davidklotz.de/assets/hsv.png" alt="hue scale from 0° to 120°" width="120" height="30" /></p>
<p>Now this might be common knowledge, but I just stumbled upon it some time ago and thought it was a useful tidbit that I wanted to share.</p>David KlotzA small tip for anyone working on some sort of data visualization. If you have values that lie between 0.0 and 1.0 (or 0% and 100%, or $some_value and $some_other_value), you can use a simple interpolation in the HSV (or HSB) color space to get a nice "traffic light" range of colors from red to green via yellow in the middle, which is fine for displaying something that is "OK" if the values are low and gets "critical" or "dangerous" for higher values (or vice versa). Just set the saturation and value (or brightness) parameters to 100% and use your data to vary the hue between 0° (which means red) and 120° (which is green). Since yellow sits right in the middle of that scale at 60° this gives you a smooth transition from red to yellow to green, which may look like this: Now this might be common knowledge, but I just stumbled upon it some time ago and thought it was a useful tidbit that I wanted to share.Quest for a working Android on the FreeRunner2009-06-22T21:44:33+00:002009-06-22T21:44:33+00:00https://www.davidklotz.de/2009/06/22/quest-for-a-working-android-on-the-freerunner<p>So, i have been trying again to turn my Openmoko <a title="FreeRunner description in the Openmoko wiki" href="https://web.archive.org/web/20170630232847/http://wiki.openmoko.org/wiki/Neo_FreeRunner">FreeRunner</a> into a usable device, despite <a title="Engadged article about Openmoko company problems" href="http://www.engadget.com/2009/04/06/openmoko-freerunner-canceled-staff-slashed/">its uncertain future</a>. One that you can really use to make calls, send/receive SMS, surf the web (over WiFi or GPRS) and do other things you should normally be able to expect from a working smartphone. This is a little write-up of how far i've gotten in that quest.<!--more--></p>
<p>Since i have repeatedly been frustrated by the apparent lack of progress in getting a usable (from the standpoint of someone willing and wanting to do some application level tinkering but not wanting to do any lower level hackery) platform using the Openmokos "native" distributions (SHR, Om200x etc.), i turned to <a title="Android in the Openmoko wiki" href="https://web.archive.org/web/20171009181258/http://wiki.openmoko.org/wiki/Android">Android</a>. This has made quite some steps since i tried one of the first <a title="Koolu" href="https://www.androidauthority.com/koolu-to-distribute-android-for-the-openmoko-freerunner-990/">Koolu</a> beta versions, but it doesn't seem to be totally there yet, either.</p>
<p>I first tried using Koolu beta 7 and was quite impressed by how many things worked out of the box (WiFi, sending SMS). But, alas, some things also did not work, receiving SMS for example. The phone just didn't do anything when it was supposed to have received (according to a delivery report on the sending phone) a message.</p>
<p>I then tried <a title="Michale Trimarchis Android images" href="https://web.archive.org/web/20090928131300/http://panicking.kicks-ass.org/download/">the images</a> by <a title="Michale Trimarchis blog" href="https://web.archive.org/web/20100423220253/http://panicking.kicks-ass.org/blog/">Michael Trimarchi</a> (mostly for trying out something based on the newer <a title="Cupcake explanation by Google" href="https://en.wikipedia.org/wiki/Android_Cupcake">cupcake</a> development branch of Android), and they are definitely going in the right direction. I can even receive SMS with them. Haven't tried using GPRS, yet. Strangely, the freerunner-v14.6-cupcake image worked better for me than the newer freerunner-cupcake-snapshot-v6. The latter gives me a lot of crashing applications (com.android.media right at startup, and seemingly in a loop, com.android.phone after ending a phone call, the settings app when trying to enter the "Wireless" settings...) and i haven't managed to get WiFi working on both of them.</p>
<p>All in all there still sadly is no Android-on-FreeRunner image where everything i need "just works"(tm). But, seeing all the development happening right now, i am <span style="text-decoration: line-through;">confident</span> hoping that a cupcake based image where all the important stuff works is not too far off.</p>David KlotzSo, i have been trying again to turn my Openmoko FreeRunner into a usable device, despite its uncertain future. One that you can really use to make calls, send/receive SMS, surf the web (over WiFi or GPRS) and do other things you should normally be able to expect from a working smartphone. This is a little write-up of how far i've gotten in that quest.Using a custom smart pointer with Boost.Python2009-06-13T18:35:25+00:002009-06-13T18:35:25+00:00https://www.davidklotz.de/2009/06/13/using-a-custom-smart-pointer-with-boostpython<p>I'm currently working on creating a python wrapper for <a title="XCF" href="https://web.archive.org/web/20070920124558/http://xcf.sourceforge.net">XCF</a> using <a title="Boost.Python homepage" href="http://boost.org/libs/python/">Boost.Python</a>. During that project i stumbled upon the problem that i was wrapping some classes that used a custom smart pointer (i.e. not one from the boost library). Boost.Python is quite good at wrapping classes using smart pointers, but it has to know some things about the smart pointer used first.<!--more--></p>
<p>Most importantly, it has to know how to get the "raw" pointer from the smart pointer and how to determine the type of the object that is being pointed to (given the type of the smart pointer). Finding documentation about telling Boost.Python how to work with an unknown type of smart pointer wasn't easy (which is why i am blogging this), but fortunately at some point i stumbled upon <a title="How to expose a custom smart pointer?" href="http://pyplusplus.readthedocs.io/en/latest/troubleshooting_guide/smart_ptrs/smart_ptrs.html">this</a>. It's from the documentation of the Py++-package, but you don't have to be using Py++ to use the technique described in there.</p>
<p>You have to keep a lot of things in mind when implementing this (especially when the class your smart pointer is pointing to might also have some derived subclasses, in which case you should <strong>really</strong> take a look at the original example), but in essence it all boils down to <a title="Example from the XCF SVN" href="http://xcf.svn.sourceforge.net/viewvc/xcf/tools/xcf-python/IceHandlePython.hpp?view=markup&revision=1262">this</a>*. In that case, IceUtil::Handle<T> is the smart pointer i am working with. This class is coming from <a title="The Internet Communications Engine - ZeroC" href="http://www.zeroc.com/ice.html">Ice</a>, so if you're also using that, you might try creating something similar.</p>
<p><b>*Update 2017:</b> That link is dead and I can't find any version of the old XCF source code anywhere. This should serve as a reminder to myself to always include all code examples directly in future blog posts and not link to some external resource which might go down after a while.</p>David KlotzI'm currently working on creating a python wrapper for XCF using Boost.Python. During that project i stumbled upon the problem that i was wrapping some classes that used a custom smart pointer (i.e. not one from the boost library). Boost.Python is quite good at wrapping classes using smart pointers, but it has to know some things about the smart pointer used first.Rapa Nui2009-05-30T13:06:46+00:002009-05-30T13:06:46+00:00https://www.davidklotz.de/2009/05/30/rapa-nui<p>Gerade in der <a href="http://www.zeit.de">ZEIT</a> einen sehr interessanten und toll geschriebenen Artikel gelesen, "Warnung an die Welt" von Erwin Koch (den es leider nicht Online zu geben scheint), über die Osterinseln, ihre Geschichte, und was das mit der aktuellen Entwicklung der Welt zu tun hat. Darin das Zitat:</p>
<blockquote><p>Man steht auf dem Vulkan, im Blick das Gewitter, und denkt, es wird einen nicht treffen.</p></blockquote>
<p>Das fand ich eine sehr treffende Metapher für unseren Umgang mit der Welt. Falls ihr irgendwo eine ZEIT auftreiben könnt, lest diesen Artikel.</p>
<p><strong>Update:</strong> <a title="Erwin Koch: Warnung an die Welt" href="http://www.zeit.de/2009/23/DOS-Osterinsel" target="_blank">Der Artikel ist inzwischen auch online lesbar.</a></p>David KlotzGerade in der ZEIT einen sehr interessanten und toll geschriebenen Artikel gelesen, "Warnung an die Welt" von Erwin Koch (den es leider nicht Online zu geben scheint), über die Osterinseln, ihre Geschichte, und was das mit der aktuellen Entwicklung der Welt zu tun hat. Darin das Zitat: Man steht auf dem Vulkan, im Blick das Gewitter, und denkt, es wird einen nicht treffen. Das fand ich eine sehr treffende Metapher für unseren Umgang mit der Welt. Falls ihr irgendwo eine ZEIT auftreiben könnt, lest diesen Artikel. Update: Der Artikel ist inzwischen auch online lesbar.YAHOPL - Yet another history of programming languages2009-05-08T18:12:03+00:002009-05-08T18:12:03+00:00https://www.davidklotz.de/2009/05/08/yahopl<p>Aber diesmal eine <a title="A Brief, Incomplete, and Mostly Wrong History of Programming Languages" href="http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html">kurze, unvollständige, größtenteils falsche</a> (und sehr lustige)!</p>David KlotzAber diesmal eine kurze, unvollständige, größtenteils falsche (und sehr lustige)!Hello, world!2009-05-03T00:04:49+00:002009-05-03T00:04:49+00:00https://www.davidklotz.de/2009/05/03/hello-world<p>Nur mal ein schneller, inhaltsleerer erster Post, damit es hier nicht so leer aussieht!</p>David KlotzNur mal ein schneller, inhaltsleerer erster Post, damit es hier nicht so leer aussieht!