Archive for January, 2008

Chemistry - FAILED

Tuesday, January 22nd, 2008

I failed in “Chemical Principles I”… Hopefully I have better luck this autumn.. ;)

The goal of the course is to help students develop “chemical insight” - the ability to see matter through chemists’ eyes, and to make connections between chemical principles, theory, experimentation, and the world around us.

Bah…

Casio LCD datasheets

Sunday, January 13th, 2008

Dear Lazy Web, where could I get a datasheet for following Casio 2.8″ LCD?
Casio 2.8\

It originates from Olympus SP-550UZ camera, seems to be 2.8″ and has 2653 written on it :)

Django with Git

Friday, January 4th, 2008

I decided to take a peek into Django world and while playing around with tutorial project I decided to use also git for version control.
As basic Django project layout is following:

project/
    __init__.py
    manage.py
    settings.py    # < -- Contains sensitive information
    urls.py

Where settings.py contains sensitive information like usernames/passwords and other data one doesn’t actually want to save in the repository.
But fortunately it’s possible to use external configure file which is included by main configuration file and thanks to Python’s clever exception system, or ImportError exception, we can simply make following modification to settings.py:

diff --git a/project/settings.py b/project/settings.py
index 641c97f..9019d9e 100644
--- a/project/settings.py
+++ b/project/settings.py
@@ -84,4 +84,9 @@ INSTALLED_APPS = (
     'django.contrib.sites',
 )
-
+
+try:
+	import sys
+	from settings_local import *
+except ImportError, e:
+	print "Unable to load local settings: %s" % e
+	sys.exit(1)

Then we create settings_local.py which contains all these defines you do not want to appear inside the repository.