Skip to content

{ Category Archives } programming

md5 vs sha1 in python

If you are interested to know if the myth about MD5 being faster than SHA1 holds for Python, here is the result I got on my box: Result is: MD5 is faster, but only just, in Python 2.7.2. Considering that MD5 is broken, I think I’ll use SHA1…

Tagged , , , ,

sleepsort

to honor the funniest thread in months, here is a lisp implementation of sleepsort!

Tagged ,

javascript templating benchmark

there are many popular libraries to do templating in javascript. the most popular are: JQuery Template Pure Template Resig Template Trimpath Template JQote2 Template I decided to benchmark them, so I created a simple “hello world” test. you can find it here. as usual, the results are interesting. here are, on my box: Firefox 3.6 [...]

time to go home!

better go before I break it…

case sensitive Google search

Google does not support “case sensitive” searches (and here and here). it does seem to return slightly different results depending on the case of the search query, but if you are only interested in the exact “case sensitive” matches you’re on your own. to solve this problem, I’ve written a small JS snippet that shades [...]

Tagged , , , , , ,

get registered domain in Python and Javascript

reg-dom-libs are a set of libraries for C, PHP and Perl to convert an arbitrary domain name to the registered domain name. for simple domains, like www.amazon.com or news.ycombinator.com, the task is trivial. for more complicated ones, like www.ebay.co.uk or www.japantimes.co.jp, handling the second level subdomain is a little painful. for exoteric ones, like nic.com.ai [...]

Tagged , , ,

handling an iframe from the inside

if you’ve ever worked with iframes you’ve certainly run into the same origin policy. from here: The same origin policy basically limits how scripts and frames on different domains can talk to each other. this is particularly bad if you want to resize an iframe to accomodate its content, as this is not doable with [...]

Tagged , , , , ,

twill revived

after reading how to do automated testing in python, I’ve started using twill, by C. Titus Brown twill is a simple language that allows users to browse the Web from a command-line interface. With twill, you can navigate through Web sites that use forms, cookies, and most standard Web features. unfortunately, development on twill seems [...]

Tagged , , ,

year 2038 bug in MySQL

today I hit the “year 2038″ bug. while working on MySQL, I did something like: mysql> create table y2038 (x timestamp); mysql> insert into y2038 values (’1900-01-01′); Query OK, 1 row affected, 1 warning (0.04 sec) mysql> insert into y2038 values (’2050-01-01′); Query OK, 1 row affected, 1 warning (0.04 sec) mysql> select * from [...]

Tagged , , ,

tdaemon for python3

tdaemon is a neat little utility to do continuous testing in python. unfortunately, the original version only works with python2. I’ve spent a little time to make it work with python3. enjoy!

Tagged , , ,