If you are a Google Scholar user, you will notice that it now allows you to search for similar articles: do a query and then look for an hyperlink below one of the returned paper. I don’t usually like these fuzzy similarities queries, but sometimes, there is no other way to mine for interesting articles.
For the types of algorithms I implement these days, I need a fast FIFO-like data structure. Actually, I need a double-ended queue. Python has a list type, but it is somewhat a misnomer because its performance characterics are those of a vector. Recently, I found mxQueue which is a separate (non-free) download. Unfortunately, mxQueue has a non-Pythonic interface and, to make matters worse, I found out that Python comes by default with a really nice Queue of its own, called deque: you can find it in the new collection module.
Thus, as a good scientist, I decided to test these 3 implementations. As it turns out, Queue.deque is a perfectly good FIFO data structure:
Python class
time (s)
list (Python’s default)
2.26
Queue.deque
0.42
mx.Queue.mxQueue
0.42
Through other tests, I was able to verify that both Queue.deque and mx.Queue.mxQueue have constant time deletion from both the head and the tail, unlike Python’s list.
from collections import deque
from time import time
from mx.Queue import *
def deleteFromHead(t):
for i in xrange(1000): t.append(1)
for i in xrange(1000000):
t.append(10)
del t[0]
def deleteFromHead2(t):
for i in xrange(1000): t.push(1)
for i in xrange(1000000):
t.push(10)
t.pop()
before=time()
t=Queue()
deleteFromHead2(t)
after=time()
print after-before
before=time()
t=deque()
deleteFromHead(t)
after=time()
print after-before
before=time()
t=[]
deleteFromHead(t)
after=time()
print after-before
(…) India, which accounts for a quarter of the developing world’s population and has the third largest higher education system in the world. Today, 23 percent of all higher education enrollments in India are in distance education–specifically in 13 national and state open universities and 106 institutions, mostly public, that teach both on campus and by correspondence. The government’s target is that by 2010, 40 percent of all higher education participation will take place using distance education.
Google has done it again! Spreadsheets.google.com offers free (as in “no money”) shareable, online spreadsheets. The UI feels a lot like Excel and you can save and load Excel documents. Unfortunately, it does not appear to support the Open Document Format. Unlike Excel, you can easily share your Google spreadsheet.