web developer & system programmer

coder . cl

ramblings and rants on software development...


Print Article R -a +A

comparing redis and memcached

by Daniel Molina Wegener on 2011.05.13
posted in: development, programming, python, tips

Key/Value and on-memory databases are widely used to store cached objects or documents. I am currently developing some Python/Django applications which are subject of strong data writing. For some tasks, I must choose between two Key/Value stores, and both are well known and widely used: redis and memcached. Instead of asking for benchmarks, I have prepared some simple tests to see which one will offer me the best performance in similar conditions.

unit testing in django

by Daniel Molina Wegener on 2011.05.10
posted in: development, programming, python, tips

Django is a very flexible Python framework to develop Web Applications. One of its features is the unit testing that it provides. When you start an application, inside a project, it provides an initial file to place unit tests. It is called tests.py. Having only one file to place your tests per application can lead you to have a huge test files. If you follow the Zen of Python, you may know that modularity is mandatory to develop Python applications. You can use some tricks to keep well organized your Django unit tests and you can provide enough parameters to them to build more reliable and robust unit tests.

[ann] pyxser-1.5.2-r2.win32 was released

by Daniel Molina Wegener on 2011.03.26
posted in: c, development, programming, projects, python, pyxser

Dear pyxser users, I’m pleased to announce that I have released pyxser-1.5.2r-r2.win32. This is the same release as 1.5.2-r2, but for Win32 platform. It does not add new features or similar stuff, it’s just a compiled binary distribution for Windows machines. You can download this release build for Python 2.7 and Win32 machines on SourceForge. Please follow the following link to download the pyxser-1.5.2-r2.win32 package. It uses the Windows Installer and it’s an executable. You just need to download an official Python 2.7 distribution to use this release.

abstract views in django

by Daniel Molina Wegener on 2011.03.18
posted in: development, programming, python, tips

As we have seen, decorators in Python are a good approach on functional programming abstraction. On Django you can use decorators to wrap your views, and there are well known decorators which can make your Django applications more stable and reliable. For example you have the @login_required() decorator and the @require_http_methods() decorator, the first one to allow you to create views with previous login required or authenticated user and the second one to restrict the HTTP methods that will be used to access the view.

functional rut validator

by Daniel Molina Wegener on 2011.03.11
posted in: development, haskell, programming, python, tips

Functional programming is great, even if you can handle pure functions or not. I have found a well known site with RUT validation routines written in various languages, all of them seem to be very small implementations. I took the Python implementation on this site and I modified it to be a pure functional implementation, just for fun, and to practice a little functional programming.