Archive for the 'Tecnologí­a' Category

django, change language settings dynamically

Friday, August 7th, 2009

After some failed attempts, I just found how to change the language settings dynamically in django, and I thought it could be useful to someone. Just use function activate() from django.utils.translation. For example: from django.utils.translation import activate activate(’es-ES’) will change global language settings to ‘es-ES’ (Spain spanish). I use it because I have two forms [...]

can we merge now, pleeease ?

Tuesday, July 21st, 2009

Three months after I began to write sympy.queries, I feel it’s about time to include it in sympy’s trunk, so today I sent for review 4 patches that implement the complete query module. It’s been a lot of fun, but it has also caused me some headaches … specially last month trying to have the [...]

Refine module, proof of concept

Thursday, July 9th, 2009

The 0.6.5 release of SymPy is taking longer than expected because some bugs in the testing framework, so my query module is not merged into trunk (yet). In the meantime, I am implementing a refine module (very little code is available yet). The refine module implements a refine() function (better names accepted) that would work [...]

Preparing a new release

Tuesday, June 30th, 2009

Last days I’ve been busy preparing the first public beta of SymPy 0.6.5. Most of the time was spent solving a bug that made documentation tests fail under python2.4, but now that this is solved, I hope that by the end of the week we could have a final release. When this release is published, [...]

Queries and performance

Tuesday, June 23rd, 2009

After some hacking on the queries module, I finally got it right without the limitations of past versions. You can check it out from my repo http://fseoane.net/git/sympy.git, branch master. It now relies even more on logic.inference.satisfiable(), which is just an implementation of the DPLL algorithm. Bad news is that (my implementation of ) dpll_satisfiable() is [...]

Reading CNF files

Saturday, June 20th, 2009

The DIMACS CNF file format is used to define a Boolean expression, written in conjunctive normal form, that may be used as an example of the satisfiability problem. The new logic module (sympy.logic) can read the content of a cnf file and transform it into a boolean expression suitable for use in other methods. For [...]

Logic module merged

Friday, June 19th, 2009

Yesterday I finally merged the logic module in sympy’s official master branch, and should be released together with SymPy 0.6.5. Next thing to do: profile the code and write some docs before the release.

The boolean satisfiability problem

Monday, June 15th, 2009

Most annoying problem in my implementation of the query system is that it will not solve implications if the implicates are far away from each other. For instance, if the graph of known facts is something like this Integer —-> Rational –> Real –> Complex ^ ^ | | | ——- | | Prime Even [...]

Initial implementation of the query system

Friday, June 12th, 2009

I sent some patches to sympy-patches with an initial implementation of the query system. You can check it out by pulling from my branch: git pull http://fseoane.net/git/sympy.git master into your sympy repo. Some examples of what you can do (sample isympy session): In [1]: query(x, positive=True) Returns None, as we do not know whether x [...]

Assumption system and automatic theorem proving. Should I be learning LISP ?

Wednesday, June 3rd, 2009

This is the third time I attempt to write the assumption system. Other attempts could be described as me following the rule: “For any complex problem, there is always a solution that is simple, clear, and wrong.” My first attempt (although better than the current assumption system) did use very rudimentary logic and was not [...]

Fun with the new Logic module

Sunday, May 31st, 2009

The logic module is slowly becoming useful. This week I managed to get some basic inference in propositional logic working. This should be enough for the assumption sysmtem (although having first-order inference would be cool). You can pull from my branch: git pull http://fseoane.net/git/sympy.git logic Here are some examples of what it can do: First, [...]

Boolean algebra, first steps

Friday, May 15th, 2009

The first task for my Summer of Code project is to write a nice boolean algebra module. I wanted a clean module that follows SymPy’s object model and that plays well with other objects. In practice this means that it should inherit from Basic and that it should behave well with python’s boolean values (True, [...]

Logic modules in python

Monday, May 11th, 2009

As a prerequisite of my GSOC project I have to do some modifications on sympy’s current logic module (see previous post), so I decided to go out and take a look at what others are doing in this area. aima-python is a project that tries to implement all algorithms found in the excellent book AI: [...]

Google Summer of Code

Thursday, April 23rd, 2009

First post on my GSOC adventure. This year I got accepted in Google’s summer of code program as student, and my job will be to implement the assumptions framework in SymPy. Although the project officially is only about implementing an assumptions framework, I have to prepare the ground before the official start of the program [...]

Django and request.POST

Saturday, January 24th, 2009

I spent a lot of time trying to figure out why django removed the ‘+’ character from the POST data retrieved via request.POST. Still don’t know the reason of this behaviour, but using request.raw_post_data saved my day …

OSWL 2008

Thursday, October 23rd, 2008

La verdad, me parece una suerte tener la Open Source World Conference tan cerquita. Este año estuvo genial, sobre todo las exposiciones en el hall. Lo peor, que a algunas charlas no pude asisitir por falta de espacio … bueno, eso y que perdí el autobús de vuelta. Sigo en Málaga esperando a que se [...]

Cambiar el color de ls para terminales con fondo oscuro

Thursday, October 23rd, 2008

Por fin encontré la manera para no dejarme la vista intentando distinguir azul oscuro sobre negro. Añade el siguiente código a tu .bash_profile y los directorios se te colorearán de un verde mucho más legible alias ls=’ls –color’ LS_COLORS=’di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35′ export LS_COLORS

Pretty printing

Sunday, April 29th, 2007

Thanks to a patch by Jurjen Bos (with some additions & modifications by me) we now got pretty printing in sympy. To see some examples, running it from isympy (you need sympy from svn): In [1]: pprint x**2 +x +1 ——> pprint(x**2 +x +1) 2 1+x+x In [2]: pprint limit(x, x, oo, evaluate=False) ——> pprint(limit(x, [...]

Hashing

Thursday, April 19th, 2007

Today I spent some time thinking about hashing in SymPy. Hashing is a central part of sympy and is implemented in the core. Now you might be thinking why is hashing so important in a CAS (Computer Algebra System) … I’ll try to explain: when you do things like “x+1 == 1+x” actualy you are [...]

SymPy 0.3

Sunday, March 25th, 2007

No lo he comentado aquí­, pero llevo cerca de un mes trabajando en un proyecto de software libre llamado SymPy. Pretende convertirse en un sistema de algebra, tal como Mathematica o Maple, pero escrito en Python y, por supuesto, para ser utilizado desde Python.