Python Highlights

Nice parsing differences between python versions: languitar@cinnabar:~$ python2 -c 'print("test", "42")' ('test', '42') languitar@cinnabar:~$ python3 -c 'print("test", "42")' test 42

May 20, 2014 · updated April 30, 2021 · 1 min

My own cloud: Seafile

Continuing with my journey to replace publicly hosted cloud services with self-hosted solutions. One of the nice developments of the recent years are services like Dropbox or Google Drive, which really simplify some use cases. For example, in my own workflow I mainly use these services to a) synchronize unix configuration files, b) synchronize some random temp files I need on several computers or which I need from my phone (I am usually too lazy to get a cable), c) for easy sharing of photos or other files, and d) for synchronizing my Lightroom catalogue across devices, a quite heavy task because of the monolithic sqlite file with > 1 GB. There have only been a few cases where I actually used a shared folder for collaborative work. Computer scientists have better tools for such jobs. ;) So my need for something that is really accepted by many users is again questionable. Hence, I could easily search for a self-hosted solution without many drawbacks. ...

March 23, 2014 · updated April 30, 2021 · 4 min

My own cloud: Tiny Tiny RSS

In the light of the recent NSA issues I have been reconsidering whether I really need to use public cloud services or not. The main benefit that I see in publicly provided services (despite the technical setup) is large amount of users that potentially enhance the service. There needs to be a tradeoff between these benefits and the data that one gives away to the service providers etc. One kind of service I have been using for some time now is a news feed reader / aggregator. First Google Reader and after the shutdown Feedly. I never used any collaborative feature for a news feed reader, so there is really no benefit in using a public service despite the setup overhead. So I started to search for a privately hosted alternative. Basically I had only a few requirements: ...

December 8, 2013 · updated April 30, 2021 · 2 min

Bash alias: Build on all CPU cores

Linux: alias makej="make -j $(cat /proc/cpuinfo | grep processor | wc | sed -r 's/^ +([0-9])+.*//')" Mac: alias makej="make -j $(sysctl hw.ncpu | awk '{print $2}')"

September 5, 2013 · updated April 30, 2021 · 1 min

Sharing the git config across different computers with individual modifications

As I am working on a lot of different computer I wanted to share some of my configuration files across these computers to have similar working environments on all of the machines. An easy solution to do this is e.g. for git to put the .gitconfig file (along with other configuration files) into a folder inside the Dropbox (or other syncing tool), create a symlink to that file in the original location in your home directory and let Dropbox do the syncing. ...

August 26, 2013 · updated April 30, 2021 · 2 min

How to set up a build system in C++, Python and Java

I don’t know why, but setting up the build system for a new software project and maintaining it seems to be something people are always afraid of. I’ve often heard people say “Eclipse does the job. It’s just additional work.” This usually leads to confusion and a lot of bulk and weird solutions several days later when the project starts to evolve, ultimately with much more “additional work”. Also in existing software project I have seen so many weird constructs effectively breaking the intended usage patterns and solutions of tools like CMake or setuptools, ending up with good software that is a nightmare to build and port to different platforms without insider knowledge. ...

May 15, 2013 · updated April 30, 2021 · 1 min

Python logging configuration

In case you ever wondered how to correctly configure the python logging system, e.g. from files and configuration server, this might be a useful link, which I hadn’t see before: Logging Cookbook.

April 29, 2013 · updated April 30, 2021 · 1 min

Difference between comparisons with == and is in Python

In Python, two operators exist to perform equality comparisons: == and is. Often you can read instructions like “When comparing to None, always use is instead of ==”, but the real reason is not explained. However, looking at the language expression specification section of the Python manual you can find the difference: “The operators is and is not test for object identity: x is y is true if and only if x and y are the same object. x is not y yields the inverse truth value.” This means the expressions “a is b” only returns True if both a and b point to the exact same object instance. Hence, you should always use is when you want to compare against specific instances. For the advice about using is to compare with None this means that there is only a single instance of None. The same is true also for Ellipsis. ...

April 8, 2013 · updated April 30, 2021 · 3 min

Android Update to CyanogenMod 10

I finally took the time and updated my “old” Samsung Galaxy S+ (GT i9001) from the Stock 2.3.6 version of Android to CyanogenMod 10, beta 4. I really should have done this earlier. The stock version was getting slower and slower over time without any apparent reason and no update to a newer version was expected from Samsung. It seemed that especially changing cells was wasting CPU like crazy. I always resisted from installing CM because the device is not officially supported and most ROMs I found so far had serious bugs like missing tethering or Bluetooth. The ROM I finally found really works flawlessly and much faster than the stock installation. Everything I tested so far works as expected including Bluetooth and tethering using WiFi and USB. ...

April 2, 2013 · updated April 30, 2021 · 2 min

Website Updates

After serveral years I finally managed to restructure my websites. The blog here was kind of infrequently used and the photography section pointed to my flickr account using a flash viewer. Especially with this photography portfoilio there were several things that I did not like: First of all this wasn’t a portfolio at all with the lack of any selection and reasonable presentation. Essentially I am using flickr now for any kind of photo and not only for selected ones. Also, in line with the ongoing shift to other platforms, I have started putting fine art-like photos to other sites like 500px. Hence, flickr wasn’t the right basis anymore. Second, flash is a dying web technology and has several drawbacks for photography. Most important it doesn’t support color management well. So dropping this viewer was also an important step. ...

March 15, 2013 · updated April 30, 2021 · 2 min