Monday, January 17, 2011

View your Google calendar in Outlook 2007

I was looking for a way to see my google calendar from work and I found this: View your Google calendar in Outlook 2007. It seems to work.

Tuesday, November 16, 2010

Chararcter set detection python script

Charset detection script exctracted from the mozilla detection script: chardet
I tried it and it works.

Tuesday, October 19, 2010

Re-creating user 0 fixes inaccessible Drupal site

Devbee explains why user 0, the default user is so important in Drupal. A missing user 0 can mean that your site cannot be reached from the outside!

If you find yourself having trouble accessing cotent or using your site as an anonymous user, you can safely run the following queries against your Drupal DB (4.6/4.7):

INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
INSERT INTO users_roles (uid, rid) VALUES (0, 1);
INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);

If any of the queries above returns a "duplicate entry" error, that means a row already exists, and that table is already OK.

Wednesday, October 13, 2010

Googlification

Science can’t accept technical barriers of content use!:
But I have a different worry. The worry’s called Google and I have a great fear that we are being "googlified". The great simplicity and the enormous quantitative search results that Google produces are being seen uncritically. This might result in a tendency to no longer use documents, articles and books, but to solve all our information problems using Google. There, information is not really indexed deeply enough and the algorithms behind the ranking are unclear. "Googlification" should create great concern for everybody in the information as well as education sector, including parents of children.

Thursday, October 07, 2010

Nice way to insert a stylesheet in an HTML doc

I find this is a nice way to insert a stylesheet in a HTML document. Just specify it in the <HEAD> section, between <STYLE> mark-ups.
like this:


<STYLE>
<!--
BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
-->
</STYLE>


I used this tool to convert the html code in HTML entities.

Monday, September 27, 2010

World map with users in real time

This site has a worldmap showing users in real time: http://www.worldcorrespondents.com/google-doodle-happy-12th-birthday-google/8812323

Thursday, September 16, 2010

MD5 checksum utility

A little MD5 CHeck sum utility to check the integrity of a downloaded file is available at fourmilab.
I just pasted the md5.exe in my download folder. And from a DOS command prompt, the command "md5.exe filetoanalyse" will return the checksum. For example:
C:\user\Downloads>md5.exe py2exe-0.6.9.win32-py2.6.exe

Returns
F05FD1F17B1473A13E1919D6D7FA0B08 py2exe-0.6.9.win32-py2.6.exe

Tuesday, September 07, 2010

Virtual Python

What It Does

virtualenv is a tool to create isolated Python environments.

The basic problem being addressed is one of dependencies and versions, and indirectly permissions. Imagine you have an application that needs version 1 of LibFoo, but another application requires version 2. How can you use both these applications? If you install everything into /usr/lib/python2.4/site-packages (or whatever your platform's standard location is), it's easy to end up in a situation where you unintentionally upgrade an application that shouldn't be upgraded.

Or more generally, what if you want to install an application and leave it be? If an application works, any change in its libraries or the versions of those libraries can break the application.

Also, what if you can't install packages into the global site-packages directory? For instance, on a shared host.

In all these cases, virtualenv can help you. It creates an environment that has its own installation directories, that doesn't share libraries with other virtualenv environments (and optionally doesn't use the globally installed libraries either).

Monday, September 06, 2010

Google Map competitor

Map24 Looks very similar to google maps. The interface makes it possible to move the point of view, much like in Google earth.

The same company also has a different interface on the website Navteq.com in my region it shows traffic data for a lot more roads than google map does. I wonder how this is possible.

Wednesday, August 25, 2010

Make the Tab bar visible in FIrefox full screen mode

According to Tweak Firefox 3 full screen mode • Mozilla Links, in about:config, you need to change the value of browser.fullscreen.autohide to "False".

Pour afficher la barre des tabs en mode plein écran, d'après Tweak Firefox 3 full screen mode, vous devez changer un réglage en entrant about:config dans la barre d'adresse, puis modifier la valeur de browser.fullscreen.autohide à "False".

Tuesday, August 17, 2010

When software patents become conter-productive

Oracle attacks Google and Android developers
The way the US patent system is currently set up, it’s difficult if not impossible to write a sizable body of code without unknowingly infringing on somebody’s patent. Your best hope seems to be to waste a lot of time filing as many patents as you can of your own, and hoping that anybody who sues you is unknowingly infringing on one of yours. That gives you a bargaining chip so you can do some kind of cross licensing deal. It’s a stupid, wasteful, unproductive government-created system that achieves the exact opposite of what was intended when it was first started. But, what can you do.

Friday, August 06, 2010

Python CGI scripts under wamp

If you want to run cgi script using wamp server on windows, you need to edit the Apache configuration file httpd.conf. Use the command line as administrator and run
C:\wamp\bin\apache\Apache2.2.11\conf>notepad httpd.conf
Then search for the line containing "addhandler" and write:
AddHandler cgi-script .py
For python scripts (for any other scripting language, just use the relevant extension).
Then the first line of your script should contain the path to the python program:
#!c:/Python26/python.exe -u
According to python cgi on windows.
Place your script in C:\wamp\bin\apache\Apache2.2.11\cgi-bin\myscript.py and you're done.
The output of the script can be accessed at
http://localhost/cgi-bin/myscript.py

The script works but there are restrictions on the modules I can import. I can import native python modules, but not the module I made myself in other places outside the cgi-bin folder. I don't know how to solve that yet. (This is probably a security restriction)

pyodbcs connection strings

Pyodbc conncetion strings gives a useful piece of advice concerning ODBC connection to Excel.
The Excel driver does not support transactions, so you will need to use the autocommit keyword:
cnxn = pyodbc.connect('DSN=test', autocommit=True)

DSN (Data Source Names) are defined in the ODBC data source administrator of the control pannel in windows (in the section administrative tools).

I wasn't able to establish a DSN-less connection.

Tuesday, August 03, 2010

Link to a specific part of a YouTube video

Matt cuts blog
If you want to link to a specific part of a video on YouTube, you can. For example, http://www.youtube.com/watch?v=PjDw3azfZWI#t=31m08s
Notice the “#t=31m08s” on the end of the url? That link will take you 31 minutes and 8 seconds into that video.

Monday, August 02, 2010

Write tests in programming

In this lecture, Richard Buckland says that tests should be written before the functions.

Tuesday, July 20, 2010

To model or not to model?

How not to model autonomus behavior: "Models and instantiations are very different things. An instantiation is supposed to be a proper member of the class of phenomena under study. By contrast, a model need not be; it can be crude – almost ignoring the majority of interested aspects of the phenomenon of interest – and yet be extremely useful. In general, simple models tend to be scientifically very powerful. This is because the purpose of a model is not to replicate a phenomenon, but to help explain it. There are lots of ways in which this can happen that do not involve producing an instantiation: models can show us the mistake in our assumptions, they can be explanatory rich in the way they actually fail to capture the phenomenon of interest, they can act as proofs of concept, they can generate novel hypotheses, and generally they can help re-organize complex ideas by exercising and questioning our intuitions."
[...]
"Evolutionary robotics (ER) is still proving a useful and open-ended method for exploring this increasingly less constraining role of the designer that may be required to achieve strong artificial autonomy. ER hands in the task of filling in design specifications pertaining to mechanisms, morphology, structural and functional organization to an automatic process of artificial evolution (Harvey et al. 1997, Nolfi & Floreano, 2000). Thus, instead of designing a robot that must explore the environment but should go to the green light when the battery is down, one can attempt to design a robot that more generally must keep the battery up during its explorations, or more implicitly, a robot that explores indefinitely."

Monday, July 19, 2010

The command line as administrator

To use the comand line as an administrator in windows, you can go the the C:\WINDOWS\system32 folder and click on "run as". Here is a screenshot:

Wednesday, July 14, 2010

Django running

I wanted to test one of the python web frameworks. I installed Django on Ubuntu. Here is the Django server running on my machine:


Now I'd like to know how I can use it to show the extracts of a table of metadata ! :-)

I don't know weather this was a stand-alone server or not. It's also possible to use Django on a standalone server. django-wsgiserver installs a web server for Django using CherryPy's WSGI server.