Python

Changes that caught my eye in Python 3.2

Auteur: 
Samat Jain

Python 3.2 was released a few days ago. Reading the What’s New document, some of the stuff that caught my eye…

gpxsplitter: Split GPX files with their waypoints

Auteur: 
Samat Jain

gpxsplitter splits multi-track GPX files, containing waypoints, into individual one-track GPX files with their respective waypoints.

Efficient log processing

Auteur: 
mailletf

I’ve recently learned a couple of neat tricks to process large amounts of text files more efficiently from my new co-worker @nicolaskruchten. Our use-case is efficiently going through tens of gigabytes of logs to extract specific lines and do some operation on them. Here are a couple of things we’ve done to speed things up.

Pyramid and Mako: how to do i18n the Pylons way

In reply to this post about the Pylons way to do translation using Pyramid, here is my code snippet so that you don't need to put the request object in, each time you want to translate something:

__init__.py:

My new Blogofile blog

Hello all.

With every New Year comes new resolutions, and mine was to revamp my blog. So here it is, shining new, and all with flat files. It's computed using the awesome little blogging engine called Blogofile. It's updated using Emacs and git, with a hook that automatically rebuilds every file from source files and Mako templates.

I migrated from a Zine blog which was leaking to death (probably due to a bad/weird paster setup of mine). The whole operation took about 5 hours, including the migration of my 20 other blog posts.

How to create standalone python apps?

Auteur: 
fraka6

You might have to run your applications in your customer infrastructure but you might not want to give your recipes (python source code) so here are the alternatives depending on your OS:

On linux, pyinstaller works quite well but you have to generate

Newton’s method for square root

Auteur: 
cyril

A while back, my friend Yannick showed me that the source code for Return to Castle Wolfenstein had been made public.

The part that interested him the most was the way they (he knew the name of the developer, I forgot it, sorry) calculated square roots.

I’ll let you have a look at it first:

simple multivariate classifier example using python & numpy

Auteur: 
fraka6

I was wondering how long it could take to write a multivariate classifier in python. With python and numpy it isn't long. We simply need to be able to compute the covariance matrix, the determinant and to inverse a matrix (covariance matrix). Even if the matrix is singular, which mean it can't inverse it, you can compute the pseudo-inverse (Moore-Penrose) easily (i.e.: numpy.linalg.pinv). As expected, assuming too much about the data lead to poor classification.

Syndiquer le contenu