Now you know how to say hello in english

January 28th, 2008

I have a love/hate rela­tion­ship against the hello mes­sages shown in all the world lan­guages on flickr. That’s why this morn­ing I was talk­ing with a friend on IRC about this and a bad idea jumped in my mind: do an IRC bot that says hello in many lan­guages when some­one joins a channel.

It’s from sev­eral years that I don’t do any­thing IRC related, but this time I had two spe­cial weapons in my back­pack: python and twisted. The final bot is ~90 lines of code, half of the which are for the hello list and the entire coding process took less than 20 minutes.

(Con­tinue reading…)

0 Comments, tagged with Coding, Geekness, Python

Django and syncdb’s signal processing

January 1st, 2008

One fea­ture of django is worth to note is that it sup­ports sig­nals. In fact, under its skin it imple­ments PyDis­patcher, a python library that allows to emit sig­nals and to dis­patch them.

If at first glance this couldn’t look so useful to you, well, this hasn’t been true for me since it was exactly that kind of stuff I was look­ing for. What I was trying to do was to imple­ment some kind of auto-​installer for an appli­ca­tion that I’m writ­ing, and in order to do so I had to run the set up after that the syncdb com­mand is issued. So the main prob­lem was: how do I know when a user does the syncdb in a non-​intrusive way?

After some googling, I found that in django exists the semi-​hidden fea­ture of sig­nals, so I began explor­ing them. The only thing you can look at on the offi­cial site is a page on their wiki, and addi­tion­ally there are some cool arti­cles over the net. Anyway, if you want to know a fast way to catch the syncdb com­mand just follow up the reading.

(Con­tinue reading…)

0 Comments, tagged with Coding, Django, Python, Web

Microblogging

March 10th

twitter (feed #2)
headache. [krat]
7:17pm via Twitter

March 9th

twitter (feed #2)
I hate scribd. [krat]
7:58pm via Twitter
twitter (feed #2)
Drawing fancy charts for my thesis. For some definitions of "fancy". [krat]
4:34pm via Twitter

March 8th

twitter (feed #2)
it's probably better to have a break now, my eyes feel quite tired [krat]
5:45pm via Twitter

March 7th

twitter (feed #2)
cleaning dead RSS feeds from google reader. Apparently, more than half my feeds are dead. [krat]
9:58am via Twitter

March 6th

twitter (feed #2)
I forget things lately. A lot. Damn stressful life. [krat]
4:28pm via Twitter

March 5th

twitter (feed #2)
Another reason to love LaTeX is that you can put your text under version control [krat]
7:24pm via Twitter

March 4th

twitter (feed #2)
Focaccia and beer as study lunch: absolutely priceless. Only downside is that now it's kinda difficult to stay awake. [krat]
2:21pm via Twitter

March 3rd

twitter (feed #2)
I just decided to buy "Flatland" by Edwin Abbot. Only problem is that I won't have time to read it 'til after my graduation [krat]
3:14pm via Twitter
twitter (feed #2)
I'm probably not gonna make this year's #pycon-it. Awful. [krat]
11:34am via Twitter

March 2nd

twitter (feed #2)
God bless \LaTeX [krat]
6:27pm via Twitter

March 1st

twitter (feed #2)
just wrote almost ten pages for my thesis, I guess I'm on a good rhythm [krat]
7:02pm via Twitter

February 26th

twitter (feed #2)
my thesis writing is interspersed by short killing rounds at sauerbraten. That's a good way to get stressed even more. [krat]
5:26pm via Twitter

Powered by Lifestream.

Search

« Authored by Giuliani Vito Ivan »