Compile Python 3.4 on Raspbian

Recently I had to install Python 3.4 on the Raspberry Pi, which is not part of the current distribution as it is based on Debian Wheezy which includes Python 3.2.3.

The following steps allow you to install Python 3.4 with pip and sqlite support, without messing with your other Python versions.

First you have to install some prerequisites packages:

sudo apt-get install libssl-dev libsqlite3-dev libexpat1-dev build-essentials

Then download the tgz from the python website, extract and cd to the directory, then use the following commands to compile it properly:

./configure '--prefix=/usr/local' '--enable-ipv6' '--with-dbmliborder=bdb:gdbm' '--with-system-expat' '--with-system-ffi' '--with-fpectl' 'CC=gcc' 'CFLAGS=-D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-z,relro'
make
sudo make altinstall

This should also work on other linux distribution based on Debian Wheezy.

Fix Gradle warnings after Android Studio 1.3 update

Have you just updated Android Studio to version 1.3 Beta and have you found yourself overwhelmed by all the warnings in the Gradle files?

Screen Shot 2015-06-21 at 17.48.51

Gradle warnings

‘dependencies’ cannot be applied to ‘(groovy.lang.Closure)’
‘defaultConfig’ cannot be applied to ‘(groovy.lang.Closure)’
and so on….

Feeling desperate?¬†Now you’re wondering why you press that update button… Don’t worry!
To fix the issue simply close the project (File / Close project), then select “Open an existing Android Studio project” on the start menu and select the folder that contains your Android project. Beware, select the folder, not the .iml project file.

Android Studio would take care to upgrade the project files and some extra xml files.
Now you should only need to accept to add the folder as VCS root (you’re versioning your code, right??), update the main build.gradle file (the one shown in the image that resides in the root project folder) to use Gradle 1.2.3 and you are reading to go!

Happy coding!

new Blog()

Once every while I feel the need to publish something on the web… a futile website, a lonely forum, a new blog… but since I am a software developer, i finally (eureka!) came to the conclusion that it’s better if I spend my (little) free time with my real vocation: develop!
So… why am I starting again another blog? well, I’d like to start sharing pieces of code of what I’m working on, not with the haughtiness to have something useful you can use, but just to help me to focus on small workload ready to share… ’cause I use to aim at too giant project that will never see the light! :)