a job for sagittarians

I have always felt that Sagittarians (of which I am one, December 6) make the best programmers. It seems that someone from Germany agrees and hence, this job posting.


By: igwe  |  On: February 21, 2007  |  Filed under: code  random  life   |  0 comments



the uniform

"There was a sense of disappointment, as we left the mall.
All the young people looked, the same."

This lyrical gem is from the new Bloc Party album, A Weekend in the City. Whenever I listen to it, I am reminded of a statistic I once came across at a much younger age. Being that, there is a one in fifty billion chance that another exact copy of yourself will ever exist. The tragedy is that every human being is unique but many do not seem to be. Much of this stems from the communist mindset. We know that some people have more discernable talent than others. In other not to hurt the latters feelings, an attempt is made to make everyone the same.
This has resulted in a group of people I would much rather call, “The Scaredy Cats” being in the majority. This group is made up of people who want to “belong”. Nothing wrong with belonging of course but you are much more useful to a group if you can contribute something unique. As the old saying goes, “Too many cooks spoil the broth”.
The urge to belong leads to the situation Chad Fowler laments about in his book, My Job went to India. Basically, software engineers in third world countries like India and China tend to play it safe. They are only concerned with well known, well established technologies like Java and .NET. If these are the only technology platforms you are good at, then you are a very good candidate for outsourcing. Your skillset can be bought at a third of its current value in these countries. So why not learn other technologies to supplement it? Why not program in Ocaml, Erlang, Ruby or any other language which can help you establish a niche. Why not practise Test Driven Development or dump CVS for Subversion? In your private life, why not try watching a film from Korea (even if it is subtitled) or listen to Folk music?

I have been fascinated with history from a very young age and one of the most important things I have learnt from it is that societies with a focus on uniforms tend to crumble very quickly, and almost without a trace. We don’t tend to hear much about Sparta, Soviet Russia or Communist China today. Much of their history and achievments have all being swept under the carpet. No one cares if art was produced during the soviet era and the writing of communist China doesn’t elicit much nostalgia these days.

Take off your uniform. Be a part of the group which can proudly proclaim that:

We're fighting hard to break the mold
We're fighting hard to be alone
We're fighting hard to atone ourselves
We have something important to say


By: igwe  |  On: February 20, 2007  |  Filed under: life   |  0 comments



killer snack


By: igwe  |  On: February 20, 2007  |  Filed under: random   |  0 comments



another take on lightbox

Any developer familiar with Lokesh Dhakars’ Lightbox will know that it’s image sizing and resizing capabilities are largely inadequate. Many attempts have been made at fixing it. However, I believe I have created the ultimate solution.

Behold, the mighty mightbox


By: igwe  |  On: February 20, 2007  |  Filed under: code   |  0 comments



yellow fever

My love for Asia extends beyond it’s women. However, for those of you still stuck on a primal level, this flickr group should prove helpful.


By: igwe  |  On: February 20, 2007  |  Filed under: life   |  0 comments



what happened to british humor?

I keep moaning about the good old days even though I am still in my twenties. And who can blame me? In the olden days, the Brits gave us Benny Hill, Monty Python and Frank Spencer to name but a select few. Now we have ........, we have….. ??? I guess, as Marie Antoinette would have preferred, we have cake. The only remotely funny program I have seen in recent years is “My Family” on BBC Prime. And it’s not even that funny.

Blame it on the Labour party. The conservatives, with their numerous sex scandals and slightly robotic prime ministers (Thatcher and Major), were more inspiring to comedians. Labour PM’s on the other hand, tend to focus on making everyone more “equal”. The result is that the Brits have gotten desperate and try very hard to stand out. A modern britons idea of humour is getting drunk, and screaming at the top of his lungs, “I am so drunk!”.

Yeah, whatever.

And sorry girls, but pulling down your skirt in public is more likely to turn me on than make me laugh (assuming you’re hot of course).

Perhaps Ian Wilmut should clone Benny Hill as his next assignment. I am doubtful this will make much difference though. The members of Monty Python are still alive but haven’t told a joke in years. Might as well be dead then.


By: igwe  |  On: February 20, 2007  |  Filed under: life   |  0 comments



handling error pages in django

Handling 404/500 errors in your Django application is a lot easier than you might think. All you need to do is:

* Create two template files, 404.html and 500.html
* Then place them in the root of your templates directory

You’ll be pleased to know that template inheritance is fully supported.

{% extends 'journal/base.html' %}
{% block title %}Dojo - Page not found{% endblock %}
{% block sidebar %} {% include 'journal/page_sidebar.html' %} {% endblock %}
{% block content %}Sorry, page not found{% endblock %}

From the codelisting above, you can see that the sample error page extends a template, base.html. Base.html is used within the installed application, journal. You can use a base template from any installed application and thus keep the look and feel of your error pages consistent with the rest of your site.

Try this broken link to see what I mean.

One more thing to note is that the variable DEGUG (from settings.py) shoud be set to False. In development mode, DEGUG is usually set to True, and unknown requests and errors are displayed within a seperate, django specified template.


By: igwe  |  On: February 20, 2007  |  Filed under: code   |  0 comments



the skyfish project

About three years ago, a youthful environmentalist named Severn Cullis-Suzuki, authored a website called the skyfish project to help educate the public about climate change and other forms of environmental devastation.

I cannot say for certain if the website remains active since it’s bulletin board has been offline for almost two years. However, on one of the remaining active portions of the site, there is an interesting manifesto called “The recognition of responsibility”. This is basically a list of activities we can all take part in to reduce the impact of our existence on planet earth.

I have always felt that there is great beauty in individual efforts to try and make the world a better place. Mohandas Gandhi’s campaign of non-violence and Steve Jobs uneding innovation readily come to mind. Only time will tell if Ms. Cullis-Suzuki’s Skyfish project will have the same degree of impact.


By: igwe  |  On: February 20, 2007  |  Filed under: life   |  0 comments



global warming is here, it seems

Womens underwear has continually shrunk from the 18th century to the present, perhaps reflecting the increasing warming of our atmosphere. It seems to me that, much as a ruler can be used to measure length, the dimensions of womens underwear can be equally useful in measuring climate change.


By: igwe  |  On: February 20, 2007  |  Filed under: life   |  0 comments



django on win32 with lighttpd and fastcgi

If you do not have a UNIX box and desperately wish to run your Django applications on Windows with Lighttpd, here is your recipe.

List of Ingredents

1. A copy of Lighttpd for Windows (I am using version 1.4.11)

2. Flup for your Python installation


Preparation

1. Open the settings.py file for your project. The variable DEBUG should be set to False because Lighttpd assumes you are running in production mode and setting DEGUG to True will use up a lot of memory. If you are using sqlite, the variable, DATABASE_NAME should be set to the absolute path of your database file. For example, my django project uses the value “C:/prog/DjangoApps/campdojo/db/campdojo.sqlite3” rather than “db/campdojo.sqlite3” for DATABASE_NAME. The same rule applies to your MEDIA_ROOT variable. In my case, I have set it to “C:/lighttpd/htdocs/assets” because I prefer to have my static files (css, images, javascript) served from Lighttpd. This rule also applies to the TEMPLATE_DIRS setting since every directory in the tuple should be an absolute path.

2. Next, you will need to edit lighttpd.conf which is found in LIGHTTPD_HOME\etc. LIGHTTPD_HOME basically refers to the absolute path of your Lighttpd installation. Mine is C:\lighttpd so my lighttpd.conf file will be found in C:\lighttpd\etc. Now, for your server_modules setting, you should have mod_rewrite, mod_redirect, mod_access, mod_fastcgi and mod_accesslog commented out. server.document-root should be “C:/lighttpd/htdocs/”.

Let’s assume the name of your django project is campdojo. You will then have to add in the following:

fastcgi.server = (
    "/campdojo.fcgi" => (
        "main" => (
            # Use host / port instead of socket for TCP fastcgi
             "host" => "127.0.0.1",
             "port" => 3033,
            #"socket" => "/home/user/mysite.sock",
            "check-local" => "disable",
        )
    ),
)

alias.url = (
”/assets/” => “C:/lighttpd/htdocs/assets/”,
)

url.rewrite-once = (
”^(/assets.*)$” => ”$1”,
”^(/.*)$” => ”/campdojo.fcgi$1”,
)

Basically what this means is that your fastcgi server will run on port 3033 and all of your media assets will be accessed via the url /assets/. So I can view my JQuery.js file by entering http://www.campdojo.com/assets/js/latest.js in my browser.

3. The next step is to start lighttpd and Flup. To start Flup, simply navigate to the root directory of your project and type this into a command prompt:

python manage.py runfcgi method=threaded host=127.0.0.1 port=3033

Open Firefox, type in http://localhost and voila, your django project is up and running.

It is worth noting that lighttpd is very fast. Indeed a lot faster than the basic server that comes with Django. However if you want even more speed, you can add the following to your list of MIDDLEWARE_CLASSES:

'django.middleware.http.ConditionalGetMiddleware',
'django.middleware.gzip.GZipMiddleware',


By: igwe  |  On: February 18, 2007  |  Filed under: code   |  0 comments



valentines day is upon us

I remember a story my father told me once. He had just returned from England and had a girlfriend in PortHarcourt. A day before valentines day, he bought her the finest Belgian chocolates he could find.
When presented with this gift however, the girl quipped:

This one is for my younger brother. Where is my present?

I believe chocolates are not held in high regard here. Next time try a cheque.

Moving on, for the geeks amongst us, here is a classic program for proclaiming your love in Ruby.

puts "In how many ways do I love thee?"
puts "Let me count the ways"
love_count = 1
loop { puts love_count ; love_count += 1 }

But don’t forget to buy her a present. A DOS screen probably won’t be enough.


By: igwe  |  On: February 14, 2007  |  Filed under: life  code   |  0 comments



i am not dead

My apologies to anyone who made an attempt to visit this site between late December and early January. As I was overburdened with work in late 2006, I made the decision to slightly extend my holiday and fully recharge my batteries for the coming year. In the meantime, a planned migration of my database to postgres was not completed and this was responsible for the error page you unfortunately saw.

Moving on, you should expect a lot more articles this year as I have set a minimum target of twelve for each month. Also, there will be many more software related articles as I equally intend to step-up my contribution to open source this year.

Wishing you all a happy and successful new year. Rather late and belated, I know, but at least it is genuine.


By: igwe  |  On: February 11, 2007  |  Filed under: life   |  0 comments



Next page