Friday, September 5th, 2008

Speed up Python without effort using generator expressions

Filed under: Science and Technology — Daniel Lemire @ 7:48

Here are two ways to count the numbers from 1 to 1000000 in Python. First, the classical way:

sum([i for i in xrange(1000000)])

Runs 0.8s on an old Linux box. It uses quite a bit of memory.

Second, the better way:

sum((i for i in xrange(1000000)))

Runs 0.2s on the same box. It uses a tiny amount of memory.

That is right. The second option is 4 times faster! According to my tests, the second option remains better even if you only sum the numbers between 1 and 1000, though the benefits are then tiny.

Disclaimer: Yes, I am aware that I could simply do 1000000*(1000000-1)/2.

Source: Parand.

Thursday, September 4th, 2008

My blog got hacked

Filed under: Science and Technology — Daniel Lemire @ 8:28

Google just told me my blog is being taken out of their index. I investigated. Spammers took over my blog footer, inserting a large set of invisible hyperlinks. They did even worse: they created a large set of PHP files (hundreds!) that were serving spam from my blog without my knowledge.

I upgraded Wordpress, changed my passwords, and I removed the offending files.

At least, Google was nice enough to warn me.

Monday, August 25th, 2008

If you claim high scalability…

Filed under: Academia/Research — Daniel Lemire @ 14:56

I just reviewed a paper where the authors come up with a nice highly scalable algorithm. And it is really scalable too! But to prove just how fast it is, they process 2,000 data points.

This is correct, strictly speaking. Their algorithm runs in O(n) time, so to know how long it would take to process 1000 times more data, just multiply by 1000.

But where is the fun in that?

The insane world of academic publishing

Filed under: Academia/Research — Daniel Lemire @ 8:24

Stephen Few few wrote a post on how insane academic publishing is. If you publish academic papers, his post is worth your time. Don’t miss the comments!

Stephen is not in academia. From his point of view, what is required of him makes no sense:

  • While he does not expect to get paid for publishing a paper, he expects some kind of symbolic reward like a few subscription to the journal: Is there really any question that someone who takes the time to write an article and go through the lengthy process of working with a publisher, deserves a gesture of thanks equaling the cost of postage?
  • Stephen is surprised that reviewers remain anonymous through the entire process: Cloaking the process in anonymity seemed to indicate a level of discomfort with critique that I didn’t expect to find to this degree in academia.
  • He is upset with how IEEE handles copyright:”I have worked with several publishers and I have never had to give up my rights as author. Most modern publishers know that they don’t need to strip authors of their rights in order to do their job.

My own answers:

  • Anonymous review is just a system we refuse to question. Speaking your mind is certainly a dangerous thing—more so in some countries than others. However, I believe a scholar should have the backbone to speak out in the open. Do something else with your life if you are afraid to sign your opinion pieces.
  • The copyright issue is a shame. However, Stephen should also ask why so many employers ask for non-compete clauses. He should also ask why musicians sign away their soul routinely. I have always been puzzled at how easily TV series are killed: clearly the authors lose their copyright along the way. Fortunately, scholars are pretty bad at reading the contracts they sign…

Proceedings of the Large-Scale Recommender Systems workshop

Filed under: Science and Technology — Daniel Lemire @ 7:50

We have made available a PDF copy of the proceedings for the second Netflix/Large-Scale KDD Recommender workshop. It includes the following papers:

  • Jinlong Wu and Tiejun Li. A Modified Fuzzy C-Means Algorithm For Collaborative Filtering
  • Gavin Potter. Putting the collaborator back into collaborative filtering
  • Andreas Toescher, Michael Jahrer and Robert Legenstein. Improved Neighborhood-Based Algorithms for Large-Scale Recommender Systems
  • Oscar Celma and Pedro Cano. From hits to niches? or how popular artists can bias music recommendations
  • Domonkos Tikk, Gabor Takacs, Istvan Pilaszy and Bottyan Nemeth. Investigation of Various Matrix Factorization Methods for Large Recommender Systems

Friday, August 22nd, 2008

Cool software design insight #4

Filed under: Science and Technology — Daniel Lemire @ 15:27

Mathematicians and philosophers often make terrible programmers. They also tend to write gibberish even in English. (Ok, I do not know if it is a fact, but stay with me.)

A terrible way of programming is to try to hold the entire problem in your head and to put it into code in one shot. Why? Because you are almost certainly overestimating your brain. Your mind can only cope with few parameters at a time.

Here is how you have to program:

  • If you have the luxury to start fresh, start small. Otherwise, make sure you understand and respect the code you start with.
  • Identify specific changes you want to implement. Small changes! Then implement them. Then test them!

You should never redesign working software from the ground up without incremental testing. Never. Even if you work alone.

Interestingly, I also write my papers incrementally, fixing small things one after the other. No other way works for me.

How to select even or odd rows in a table using CSS 3

Filed under: Science and Technology — Daniel Lemire @ 14:08

CSS 3 is around the corner. Already we are seeing some benefits. The latest versions of Safari and Opera, as well as the beta version of Firefox allow you to select even or odd rows in a table using only CSS:


tr:nth-child(2n+1) {
background-color: blue;
}
tr:nth-child(2n) {
background-color: red;
}

See? No ECMAScript, no server-side programming. Alas, no sign of support for this in Internet Explorer.

Next Page »
5 Sep News - Order Now Ultram 50mg, tramadol in us pharmacy pay by, buy tramadol online consultation us, Cheap tramadol NO RX, cheap tramadol overnight free, cheapest tramadol available online, buy tramadol cheap medication, buy cheap tramadol, Tramadol orders C.O.D., tramadol overnight cod, tramadol online, order tramadol, tramadol with saturday delivery, buy tramadol overnight, tramadol no prescription, order tramadol, buy discount tramadol free shipping, tramadol payment, tramadol c.o.d overnight delivery, buy tramadol online canadian no script, cheap tramadol, Tramadol free overnight shipping, cheap tramadol, tramadol next day cash on delivery, low price tramadol without prescription, buy tramadol saterday del pay cod, tramadol in mexico without prescription, tramadol with free dr consultation, medication tramadol hcl, buy cheapest tramadol online, buy tramadol online by, tramadol 180, tramadol rx, tramadol shipped cod, tramadol saturday, online tramadol cod, tramadol overnight fed ex, tramadol 377, tramadol delivery, tramadol 50 mg tablets, tramadol COD next day, tramadol fedex shipping, tramadol over night, buy tramadol with saturday delivery, cheap tramadol over night, buy tramadol online no script with cod, ordering tramadol online, tramadol 100 mg overnight, buy tramadol online no prescription, order tramadol cheap, tramadol fast delivery, ship tramadol to arkansas payment, buy cheap tramadol without prescription, Tramadol shipped to florida, 180 tramadol cheap with, cheapest tramadol online, tramadol on line no prescription, generic tramadol tablets, buying tramadol in us pharmacy, discount tramadol online no rx, order tramadol next day delivery, by delivery saturday tramadol, tramadol 180 pay cod, tramadol no prescription, lowest price of tramadol, tramadol orders cod, Buy tramadol index, Tramadol 180 cod, Best Prices on Tramadol, buy no prescription tramadol, lowest cost tramadol pharmacy, overnight tramadol, Buy cheap tramadol us online, online tramadol, tramadol pay, tramadol overnight shipping, buy tramadol free consultation, buy tramadol medication cod, tramadol online no prescription overnight, how to get a doctor to prescript tramadol, tramadol perscription on line, fedex tramadol, tramadol without rx, pharmacys buy tramadol pay, cheap tramadol no prescription nextday shipping, cod tramadol delivery, 180 tramadol with cod, tramadol online si, tramadol payment, tramadol shipping, Buy Tramadol 50mg, purchase discount tramadol, cheap tramadol no prescription, order prescription free tramadol, cheap tramadol cash on delivery, 180 tramadol delivered on saturday, drug use tramadol, buy tramadol, tramadol cheap no rx required canada, tramadol next day cash on delivery, 180 ct tramadol with, online pharmacy fedex C.O.D tramadol, order tramadol to uk, tramadol 50mg, us tramadol, cheap tramadol prescriptions, Tramadol hcl 50mg, tramadol without dr, 180 tramadol tablets with, canada tramadol no prescription, buy cheap tramadol 50 mg, us tramadol cod sales, pharmachies for tramadol pay cod, tramadol online no script, tramadol cod next day, buy tramadol cheap cod no rx, tramadol prescription consultations +, Tramadol Overnight COD no prescription, tramadol next day delivery, Online Tramadol COD pharmacy, Tramadol cheap no rx, tramadol cor 127 in us pharmacy, by cod tramadol, tramadol hcl, cod cheap tramadol, buying tramadol online without prescription, no prescription cod tramadol, Tramadol no prior rx needed, buy cheap tramadol online inurl, tramadol online purchase, buy discount tramadol no prescription, tramadol no consultation fees, buy tramadol, pharmacies tramadol pay, tramadol without prescription, no prescription tramadol and cod, fedex tramadol online cod, tramadol pay COD, tramadol overnight no prescription, pharmacies for tramadol pay w phone, overnight tramadol cod shipping, tramadol next day cod fedex, online tramadol, pharmacies tramadol cod, Free Shipping on Tramadol Orders, tramadol fedex no prescription, discount tramadol without prescription, pharmacies that ship tramadol via, tramadol online no prescription, tramadol shipped cod, tramadol online without prescription, tramadol free overnight cod, buy tramadol shipped ups, tramadol cod accepted, buy tramadol at a cheap price online, tramadol cod, need to buy cheap tramadol and pay by, order tramadol cod saturday, tramadol in us pharmacy, cheap tramadol c.o.d., how to get prescription of tramadol, tramadol prescription drug, buy payment tramadol, buy tramadol cheap, tramadol no doctors consult, tramadol cod overnight delivery, buy cheap tramadol online with cod, buy discount tramadol now, by money order order tramadol, tramadol pay by, tramadol free fedex shipping, how to get tramadol without, by tramadol online for cod, Buy tramadol with american express, cheap tramadol without prescription overnight delivery, cheap tramadol online, buy cheap tramadol overnight, buying tramadol without a prescription, cod tramadol no prescription, cheap tramadol free fedex, online pharmacy fedex cod tramadol, tramadol without prescription overnight shipping, tramadol ultram, buy tramadol order cod, free shipping tramadol, tramadol overnight COD, tramadols overnighted cod, tramadol with cash on delivery, cheap tramadol next day delivery, cheap tramadol without prescription, no prescription required for tramadol, cheap tramadol no rx, buy cheap tramadol no Prescription, tramadol free overnight fedex delivery, 180 ct tramadol payment with, tramadol fedex overnight, us tramadol fedex, 180 ct tramadol, tramadol fedex, generic tramadol no prescription overnight, buy tramadol overnight cod, tramadol without a presciption, Tramadol no prescription pharmacy discounter, tramadol cod saturday delivery, buy tramadol online overseas, ordering tramadol online no membership overnight delivery, order tramadol online with cod, discount tramadol online, pharmacy tramadol no prescrption, order tramadol online without prescription, tramadol overnight fedex, no prescription next day delivery tramadol, tramadol free consultation, online tramadol with delivery, tramadol shipped COD on saturday delivery, tramadol medication online, tramadol without a prescription, tramadol shipped, discount tramadol, buy discount tramadol, cheap tramadol no prescription next day delivery, online prescription for tramadol, Tramadol oral, tramadol on delivery, buy tramadol cod, tramadol overnight, tramadol overnight no script mastercard accepted, low price tramadol, tramadol online cash on delivery, tramadol overnight, 100 mg tramadol, tramadol no prescription drug, order tramadol cod next day delivery, tramadol xr buy online cheap, tramadol online fed ex, get discount tramadol now, buy tramadol tablets without prescription, only tramadol free consult, tramadol cod online, very cheap tramadol, tramadol pharmacy cod saturday delivery, order tramadol hcl with cod, real tramadol in us pharmacy, tramadol prescription from doctors online, order tramadol online, buying tramadol without a script, buy tramadol no prescription, Tramadol cheap no rx free from india, buy discount tramadol online, tramadol buy in UK, cheap tramadol cod, tramadol next day delivery, order discount tramadol, tramadol hcl 50 mg, tramadol ultracet, Tramadol on sale, overnight buy tramadol, buy cod guestbook.html inurl tramadol, Tramadol prescription, 180 tramadol cod, tramadol 120, buy tramadol online cash on delivery, tramadol without a prescription and cod delivery, purchase tramadol shipping, tramadol online no perscription, tramadol india, online pharmacies tramadol, purchase tramadol cod, tramadol for sale cod, tramadol without presciption, Tramadol and description, tramadol with next day delivery without prescription with free shipping, pharmacies tramadol pay by, tramadol pay by cod, tramadol cheap, buy tramadol overnight delivery, tramadol saturday delivery, tramadol overnight without prescription, tramadol, buy tramadol online cod, buy tramadol, tramadol cheap next day, tramadol medicine pay, tramadol pay COD, shipping tramadol, tramadol online next day, tramadol with, tramadol withdraw, tramadol fed ex, pharmacy tramadol, Cash on deliver Tramadol overnight, online doctor consultation for tramadol, tramadol no rx, cod tramadol 120, buy tramadol and pay by cod, Tramadol great buy, tramadol cod delivery next day, buy tramadol online, order tramadol online by fedex, buy cheapest tramadol, order tramadol cod, buy tramadol without a prescription overnight delivery, cod delivery tramadol, no prescription cod tramadol, buy tramadol pay, tramadol no prescription required, tramadol with free fedex overnight, TRAMADOL ONLINE FEDEX COD FREE CONSULT, order tramadol online pharmacies cash on delivery, pharmacies pay by cod tramadol, tramadol no prescription overnight cod delivery, next day tramadol, tramadol cash on delivery, Order Now Ultram, where to buy tramadol, tramadol hydrochloride, cod delivery tramadol, tramadol sales, tramadol online cheap, tramadol cheap, 180 ct tramadol payment options, tramadol cod shipping, no prescription tramadol fedex delivery, discount tramadol fast delivery, tramadol shipped on saturday, buying tramadol cod, tramadol ship to 50 states, buy tramadol with cod, order tramadol by, buy tramadol overnight via electronic check or, tramadol no prescription cash on delivery, buy tramadol online without dr approval, cheap tramadol overnight delivery, tramadol shipped with, buy tramadol no rx, tramadol without a rx, buy cheap tramadol online, cheapest tramadol, tramadol overnight delivery cheap, cheap tramadol, online pharmacy tramadol, cheap tramadol fedex overnight, overnight tramadol cod, TRAMADOL ONLINE FEDEX COD FREE CONSULT, tramadol med pay cod, Tramadol medication, cod tramadol, no prescription tramadol, tramadol cash delivery, tramadol next day, tramadol online with no prescription or membership, buy tramadol for saturday delivery, order tramadol online no prescription, pharmacies for tramadol pay, tramadol overnight online, tramadol ups, tramadol fedex delivery, buy tramadol overnight cod, buy tramadol cash on delivery, tramadol drug, More News wholesale phentermine, phentermine no prescription, phentermine without prescription, extra cheap phentermine, cheap phentermine no prescription, phentermine no prescription fast delivery, no prescription phentermine, Buy Phentermine Adipex 37.5mg, cheapest phentermine, cheap phentermine, phentermine hydrochloride, discount phentermine, phentermine no rx, order phentermine online, phentermine very cheap, phentermine 37 5mg, phentermine 30mg, cheap 37 5 phentermine, generic phentermine, phentermine 37.5 mg, phentermine diet pills, phentermine cod, cheap phentermine without a prescription, phentermine 37 5mg online, phentermine at discount prices, order phentermine online no prescription, phentermine order cheap, Buy phentermine online, where to buy phentermine, phentermine hcl,

41 queries. 0.626 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.