Rename Script

Once in a while I have to bulk rename files. For example, when I have holiday photos. The following script helps me to do so: #!/usr/bin/env python # -*- coding: utf-8 -*- """Batch-Rename files in a folder according to some rules.""" import os def rename(rename, starts=None, ends=None, test=False): """ Rename all files which end with ends and start with starts to rename-[Number]. """ files = [f for f in os.listdir('.') if os.path.isfile(f)] # Sort files...

Languages for Back Ends

What programming language would I use for the back end of a big, new project in a startup which wants to offer a web service? Sure, on the client side there is pretty much only JavaScript (including variants like CoffeeScript and TypeScript) in combination with HTML and CSS. I've used MySQL and Redis databases and I'm quite happy with that. But the choice for the server side is not that easy. I've been using PHP...

Increase the maximum file upload size in PHP

Create a test.php with the following content to check your current maximum upload size. <?php phpinfo(); ?> Search your php.ini in the Apache folder: $find /etc -name 'php.ini' /etc/php5/cli/php.ini /etc/php5/apache2/php.ini Edit it. Set upload_max_filesize and post_max_size to whatever you want. Restart the server with$ sudo service apache2 restart

3D Photospheres

I've been to New York City a few months ago. It was an interesting experience. Everything is so big, it is difficult to get a feeling for it if you haven't seen it yourself. For example, the WTC Memorial is overwhelmingly large. I tried to capture that in a photograph with my Panasonic DMC-TZ41, but it just doesn't look that large: WTC Memorial A photosphere captures that much better (it looks great on my Smartphone,...

Getting a Feeling for Energy

Have you heard of GravityLight? It is a gravity-powered lamp designed as an alternative for off-grid families who would otherwise use kersene lamps. It is basically only a 12kg weight, lifted and put on the gravity light. When the weight goes down again it pulls a cord. This cord makes an electric motor which generates electricity for LEDs. If you lift the weight 1.83m, the light lasts for about 20 minutes. I wondered how much...

Python Markov Chain Packages

Markov Chains are probabilistic processes which depend only on the previous state and not on the complete history. One common example is a very simple weather model: Either it is a rainy day (R) or a sunny day (S). On sunny days you have a probability of 0.8 that the next day will be sunny, too. On rainy days you have a probability of 0.6 that the next day will be rainy, too. As you...

Machine Learning 2 - Vorlesung

Dieser Artikel beschäftigt sich mit der Vorlesung „Machine Learning 2“ am KIT. Er dient als Prüfungsvorbereitung. Ich habe die Vorlesungen bei Herrn Prof. Dr. Marius Zöllner im Sommersemester 2015 gehört. Der Artikel wird bis zur mündlichen Prüfung laufend erweitert. Behandelter Stoff Vorlesung Datum Kapitel Inhalt 15.04.2015 Einleitung Wiederholung ML1; Definition 'Machine Learning' 24.04.2015 Semi Supervised Learning (SSL) Transduktives Learnen; Self-Learning; Co-Training; Generative Models; EM-Algorithmus; Low-Density seperation; Transductive SVM 01.05.2015 - Vorlesung fällt aus (vgl. erster...