March 9th, 2010 by Rodrigo
Don’t you wish you just could type the text of a link and then press enter to follow it on a web page? It would save tons of time! Well, there is a chrome extension that allows you to do that. My favorite extension to date by far.
Chrome type ahead
Enjoy
February 25th, 2010 by Rodrigo
I had this use case where I have to check which elements of a list of words where available in another list of words. So I decided to use the operator in. Just for further reference a tried the following:
# common code for all test
base_list = [...]
query_list = [...]
- Pretty simple method:
for word in query_list:
if word in base_list:
# do something
For a list of 4284 elements against a list of 107 it took 9 seconds. Using simple lists, this method is the most straight forward of all, and also the slowest one.
- Sorting things:
base_list.sort()
for word in query_list:
if word in base_list:
# do something
After sorting the list, guess what? Yeap, nothing changed, same 9 seconds
- What about sets?
bs = set(base_list)
for word in query_list:
if word in bs:
# do something
Using sets this is another history, 0.6 seconds for the same amount of data; but… if this could be achived turning one of lists into a set, what if…
- Using more sets
bs = set(base_list)
qs = set(query_list)
solution = bs.intersection(qs)
0.02 seconds.
Well, as you can see, sets are great.
September 27th, 2008 by Rodrigo
I’ve received some feedback about this site and I had made a few modifications
-
Feeds now work properly (no longer example.com domain).
-
The code font is now smaller.
-
Gravatar support for comments.
-
Comments links on the main page are now clickable.
-
Better sitemaps.xml.
-
Deleted testing images from the photoblog.
A warning has been added for all IE 6 users, because the page will render completely wrong, and fixing the CSS to work with that browser is something I will not do.
This is getting better 