News for hackers. Stuff that matters.
Re:GvR's Blog by bayareaguy on Thursday October 23, 2008 @03:34AM (#340989)
Someone jokingly asked me how I would sort a million 32-bit integers in 2 megabytes of RAM, using Python [...] obviously this is a joke question -- the data alone would take up 4 megabytes, assuming binary encoding

This question seems to come up a lot at Google - didn't their CEO ask it of Obama and McCain when they visited?

I like that instead of going into a complicated solution to a tricky problem, GvR shows the very simple and general way to solve a slightly easier version more people are likely to encounter. Unfortunately I was sort of hoping he would take the Programming Pearls approach instead of treating it as a joke. Bently showed several ways to do this kind of constrained memory sorting given differing assumptions, but perhaps that kind of thing just isn't interesting for the places Python is used.

Re:GvR's Blog by westside1506 on Wednesday October 22, 2008 @11:38PM (#340874)
I wrote this algorithm to solve a problem for myself one night about 10 years ago (agree - not a very tough problem, but very useful if you don't have enough memory). I told a client about it and he tried to patent it! I never checked to see if it went through...
Re:GvR's Blog by newaccountname on Wednesday October 22, 2008 @11:55PM (#340883)
You didn't need to; unix sort has been able to do this for way more than 10 years =).
Re:GvR's Blog by westside1506 on Thursday October 23, 2008 @12:16AM (#340904)
Well, it was a complicated data format for many 10s of GB of seismic data on machines that probably had 32MB or 64MB of memory. The partial sort and merge did the trick for me.
Re:GvR's Blog by Prrometheus on Wednesday October 22, 2008 @10:34PM (#340832)
So, what did ya'll think of Anathem?
Re:GvR's Blog by jacobolus on Thursday October 23, 2008 @02:43AM (#340976)
Stephenson came to do a reading in Cambridge, MA a few weeks ago, of a couple amusing conversations. I haven't read the rest of it yet, but he writes fantastic dialog.
Re:GvR's Blog by Dobbs on Thursday October 23, 2008 @12:08AM (#340894)
I felt like it was three related but different stories put together. Each 3rd of the book, seemed to have a very unique feel from the others.
Re:GvR's Blog by unalone on Thursday October 23, 2008 @01:57AM (#340955)
I've just started reading it. The first little bit has been rather slow; I'm hoping it picks up considerably.
Re:GvR's Blog by FraaJad on Wednesday October 22, 2008 @10:49PM (#340843)
It was a mind bending exercise.
Re:GvR's Blog by ojbyrne on Wednesday October 22, 2008 @11:08PM (#340853)
It's not a terribly hard exercise, I'd expect that almost any programmer could do the math and figure out that a solution requires files. After that I'd expect a candidate to at least sketch out a logical solution.

It's cool that it's Guido, though. And that it's a complete solution.

Re:GvR's Blog by jacobolus on Thursday October 23, 2008 @02:45AM (#340977)
The point here is to show off (among other things) the buffered I/O in Py3k. It's much easier (i.e. shorter, more readable) in Py3k to implement an efficient solution than in earlier Python versions. If it were a really hard problem, it would be harder to see the benefits of the new language features.
Re:GvR's Blog by newt0311 on Wednesday October 22, 2008 @11:22PM (#340863)
[deleted]
Re:GvR's Blog by nostrademons on Wednesday October 22, 2008 @10:24PM (#340824)
Guido van Rossum. Guy who invented Python.