Testing Dajaxice Views in Django

If you want to test Dajaxice views from the Django test client, this might be your first approach: url = ‘/dajaxice/apps.front.add_vote/’ data = {‘vote’: ‘yes’, ‘primary_key’: ‘1’} response = self.client.post(url, data=data) This doesn’t work for several reasons. First of all, we need to simulate an AJAX request. Therefore the HTTP_X_REQUESTED_WITH header needs to be set. […]

Read More

Programming a Perceptron in Python

At HSR, I’m currently enrolled in a course about neural networks and machine learning. One of the simplest forms of a neural network model is the perceptron. Background Information A perceptron classifier is a simple model of a neuron. It has different inputs ($x_1$…$x_n$) with different weights ($w_1$…$w_n$). $$s = sum_{i=0}^n w_i cdot x_i$$ The […]

Read More

LibreQDA public release

A news worthy of The Tryolabs’ Herald:  We have just proudly released to the public LibreQDA, a Qualitative Data Analysis tool that we have developed alongside with the Universitat Autónoma de Barcelona and the Universidad de la República Oriental del Uruguay. LibreQDA is what is commonly know in the psychology area as Computer Assisted Qualitative Data […]

Read More

The Story of Pillow

On March 4, 2013 I got an email from the Python Software Foundation On March 4, 2013 I got an email from the Python Software Foundation (PSF): This email notification is being sent to you to inform you of the PSF Board’s decision to fund the facilitation of a Python 3 compatible release of the […]

Read More

d3.js and X-Requested-With

Most JavaScript frameworks set the X-Requested-With HTTP Header to XMLHttpRequest when sending non-cross-domain XHR requests. Many web frameworks like Django or Flask use this to detect AJAX requests. Because of issues with X-Requested-With and cross-domain XHR requests, d3.js does not set that header by default. Therefore Django’s request.is_ajax() and Flask’s request.is_xhr() break. In order to […]

Read More

Python 3 Porting

The 3 in 2013 is for Python 3 I tend to like projects that everyone else hates, e.g.: Removing persistent Python objects associated with missing classes in ZODB. Making new releases for old software that is still useful but unmaintained. Running flake8 on 10s or 100s of source files and hand-fixing the results. Part of […]

Read More

Pillow Python 3

PIL is on its way to Python 3 via Pillow. Support from Brian Crowell and others has been merged into master here: https://github.com/python-imaging/Pillow/pull/35 And work continues toward a pre PyCon 2013 release! Please help if you can: Ubuntu users, read through https://github.com/python-imaging/Pillow/issues/18 and provide assistance with testing this Ubuntu package: https://launchpad.net/~pythoneers/+archive/ppa. Git experts, please comment […]

Read More