Next power of two in Processing

20.04.2015 by Michael

If you’ll ever need the next power of two of a number in #Processing:

int next = (int)pow(2, ceil(log(n) / log(2)));

Drosselt da jemand?

17.04.2015 by Michael

tl;dr: Die Arte Mediathek ist über den Telekom DNS langsam, über den Google DNS normal schnell.


Seit ein paar Wochen kann ich die Arte Mediathek nur noch mit Modemgeschwindigkeit nutzen. Das Konzert mit Chilly Gonzales lädt z.B. mit knapp 50 kb/sec. Das dauert gut 8 Stunden bei 1.45GB.

Das Problem haben auch andere. Es gibt einen längeren Thread auf (Das Bild ruckelt beim abspielen), in dem die arte-Mitarbeiter regelmäßig antworten, das daran gearbeitet wird. Sie verweisen auf eine Testseite, mit der man Browser und Verbindung testen kann:


An meinem DSL Anschluss scheint es nicht zu liegen. Der T-Online Speedtest zeigt für meinen Anschluss passable Werte. 13,94 Mbit/s.


Wenn ich als DNS Server den von Google ( in den System Preferences von OS X eintrage, dann lädt das Konzert von Chilly Gonzales auch schnell!
(Über VPN übrigens auch.)

Scheinbar liefert der T-Online DNS einen anderen Server als der von Google:

DNS Server: (T-Online)

DNS Server: (Google)

Update: Nicht nur die letzte Zahl unterscheidet sich. Auch die dritte Stelle.

Traceroute zeigt das man abhängig vom verwendeten DNS bei einem anderen Server rauskommt.
Telekom DNS:
Google DNS:

traceroute: Warning: has multiple addresses; using
traceroute to (, 64 hops max, 52 byte packets
 1 (  4.854 ms  2.307 ms  2.914 ms
 2 (  33.046 ms  21.533 ms  19.431 ms
 3 (  21.334 ms  29.100 ms  22.587 ms
 4 (  23.222 ms  23.137 ms  23.116 ms
 5 (  30.860 ms  37.566 ms *
 6 (  31.426 ms  32.228 ms *


traceroute: Warning: has multiple addresses; using
traceroute to (, 64 hops max, 52 byte packets
 1 (  1.429 ms  1.389 ms  1.182 ms
 2 (  19.631 ms  19.814 ms  19.343 ms
 3 (  25.084 ms  28.825 ms  22.290 ms
 4 (  23.072 ms  40.082 ms  24.064 ms
 5 (  31.605 ms  32.852 ms  30.741 ms
 6 (  35.035 ms  33.565 ms  35.642 ms

Woran das nun liegt und ob Arte oder die Telekom daran schuld sind kann ich nicht sagen. Nach dem Drosselkom Skandal richten sich die Augen aber zuerst auf die Telekom. “Told you so”.

Update 18.04.2015:
Winki hat ähnliche Probleme bei 1&1
Und er schreibt, das die meisten öffentlich-rechtlichen Mediatheken den CDN Limelight in den USA nutzen. Na Bravo.

wput: Upload to FTP subdirectory

23.08.2014 by Michael

Uploading a file via wget to a FTP subdirectory without mentioning the absolute path didn’t work.

$f = /home/my/files/image.jpg
wput -B -v –basename=/home/my/files $f ftp://user:password@

Logging in as user … Logged in!
==> CWD images/
==> TYPE I … done.
==> SIZE /image.jpg … failed.
==> PASV … done.
==> STOR /image.jpg … Send Failed (/image.jpg: Permission denied.) Skipping this file

It seems wput needs the absolute path name on the FTP server.


basename does the trick. It strips the path from the passed absolute url.

$f = /home/my/files/image.jpg
wput -B -v –basename=/home/my/files $f ftp://user:password@$(basename $f)

¯\_(?)_/¯ running through all installed fonts via #Processing

02.08.2014 by Michael



Convert x3db to obj

19.07.2014 by Michael

Yvonne describes a quick way to convert x3db files from Shapewys’ 2D-to-3D tool to obj via InstantPlayer’s aopt:

aopt -i test.XXX -e test.obj

Facedetection: Clones in Aldi’s ads (Photoshop Desaster)

20.04.2014 by Michael

I saw Aldi’s (german grocery chain) ad on the last Süddeutsche Jetzt magazine and wondered if they’ve got the approval of all the people / employees on the image. Then i recognized that they are not that many. Because it’s just some people photoshopped all over the seats. Picasa and Processing helped me to analyze the image and find duplicate images.


(Image Aldi Süd, Süddeutsche Jetzt)
Link to the Brochure


Some people are up to 9 times on the image. And could only recognize the first 9 rows.

Misfit Shine Adventures

12.04.2014 by Michael


Here’s the answer from Misfit support:
“I am terribly sorry about the misunderstanding we might of had. Only bluetooth is required to sync your data to the app, however, an internet connection is needed to link your Shine to your email address. The data your Shine will provide to us will lead to improving our algorithm and increase accuracy of data. I ensure you that your privacy information will not be shared with any third party companies.”

Remember. The first information was:

“Therefore after that you wouldn’t need the internet anymore of syncing data and viewing your progress.”


I sold my Fitbit Flex because the activity tracker’s data was encrypted and i was forced to upload my data to Fitbit’s cloud in order so see it. My next try was Misfit Shine.

My question to Misfit’s support was:

“Do i need an online account to use the app? Do i need to upload the data to your server? Can i use the app offline?”

Misfit’s support told me that

“You would need an email address to sign in to the app/link the Shine to an email account. The data is sync via Bluetooth. Therefore after that you wouldn’t need the internet anymore of syncing data and viewing your progress. Hope that helps, thanks for your support.”

So i ordered one. But unfortunately that information was not true. Misfit’s Android App does not work at all without internet access. Either when there’s no internet connection or it’s blocked by Privacy Guard or Android Firewall. It does not even sync the tracker via Bluetooth without going online (see the Android Wifi icon).


mitmdump shows that it’s connecting to Misfit’s server to store the data. It doesn’t even calculate the graph on the phone but gets it from the cloud. That’s the output when touching the sync icon: PUT
<< 210 nginx/1.2.6 413B POST
<< 200 OK 2B GET
<< 200 OK 836B GET
<< 200 OK 2.83kB GET
<< 200 OK 264B GET
<< 200 OK 4.66kB GET
<< 200 OK 266B GET
<< 200 OK 264B GET
<< 200 OK 274B


That’s my motion data! I payed 120 € for the device. I don’t get it why you can’t simply add steps in the app as you told me.

What about my privacy?
Privacy is very important to us here at Misfit. We do not share any of your personal information with anyone without your approval.

I asked the support guy what he thinks about it. I’ll keep you updated.

Arduino UNO on Synology Diskstation DS213j

04.04.2014 by Michael

Finally i got an Arduino UNO connected to a Synology Diskstation DS213j. It took me some time and i had to try several tutorials. I’ll try to document the necessary steps.

1. There’s no optware / IPKG installer for DS213j. Thus you have to build it yourself which is straight forward:

2. Add package sources:

3. Modify /root/.profile:
#export PATH

4. Install the modules:
ipkg install kernel-module-usbcore
ipkg install kernel-module-usbserial
ipkg install kernel-module-ftdi-sio

5. There are not all usb packages available for DS213j. Thus i had to install the precompiled SynoZWave. But don’t enable it:

6. Now usbserial works and Arduino shows up in dmesg. But it didn’t work. It took me a while to remember that Arduino UNO does not have a FTDI chip but its own. Thus i had to enable the cdc-acm module:
insmod /lib/modules/cdc-acm.ko
mknod /dev/ttyACM0 c 166 0

7. Yeah! It reads my temperature sensor. It’s quite warm in my office. Good i’m outside.
cat /dev/ttyACM0
22 Celsius, 71 fahrenheit -> 22 Max, 22 Min

My Joy Division 3D print made it to London Science Museum!

03.03.2014 by Michael

My Joy Division 3D print made it to London Science Museum! “3D: printing the future”

Open Data Mashup: Windpower in Bavaria / Windstrom in Bayern

13.02.2014 by Michael

Where are the wind power plants located in Bavaria? Seems there are not that many in Oberbayern and Niederbayern.
Wo wird Windstrom in Bayern produziert? Scheinbar nicht viel in Ober- und Niederbayern.

Screen Shot 2014-02-13 at 12.24.32

Screen Shot 2014-02-13 at 12.24.24