I Got a Knuth Check for 0x$3.00
91–100 of 149 posts
Re: I Got a Knuth Check for 0x$3.00
#92I wonder if anyone cashes these things? We should all gang up and cash these checks together and overdraw him. Or at least really screw up his check book balance.
Re: I Got a Knuth Check for 0x$3.00
#93I wonder if anyone cashes these things? We should all gang up and cash these checks together and overdraw him. Or at least really screw up his check book balance.
Re: I Got a Knuth Check for 0x$3.00
#94Earlier quoted context omitted.
I bought an international edition of a text in college because it was priced significantly cheaper. And indeed, it had all the same problems, but they had been re-arranged, so when the professor assigned problems "5-15", I needed to know the mapping from the US 5-15 to the international version's numbers. Which, by quickly thumbing through another student's copy, I could generate pretty rapidly, but boy was that anno…
We had a professor that kept mappings for 2-3 versions behind and basically allowed you to buy the used book on Amazon for about $12 compared to $200 for the new one. It's these little things that make your professors stand out.
That's the moment I fire up libgen
Re: I Got a Knuth Check for 0x$3.00
#95> People also say that TAOCP is irrelevant or outdated or otherwise inapplicable to “real programming”. This also wrong. For instance, the first section after the chapter intro deals with the basic problem of searching for an item in an unsorted array. The simplest algorithm should be familiar to all programmers. Start your pointer at the head of the array, then do the following in a loop: Check if the current item i…
The point is that the book is written from the perspective of an actual programmer writing actual code and thinking about how it will run. Granted, he's writing in a pixie assembly language for an imaginary machine, but still, the thought process is similar to writing real code. He doesn't just figure out the big-O and call it a day, he works out the low-level details. The lesson in this case is that a lot of extra work can be done in a loop, even for the simplest of algorithms.
Now you might think, that's a truism, duh, any programmer knows that loops need to be fast. But what can I say? I read that section and spent a few hours thinking about it (even writing out some old-timey flowcharts), and I came out the other side writing better, faster code.
Re: I Got a Knuth Check for 0x$3.00
#96Earlier quoted context omitted.
We had a professor that kept mappings for 2-3 versions behind and basically allowed you to buy the used book on Amazon for about $12 compared to $200 for the new one. It's these little things that make your professors stand out.
>$200 for a textbook with borderline extorsion sale tactics That's the moment I fire up libgen
Re: I Got a Knuth Check for 0x$3.00
#97Earlier quoted context omitted.
I had to try it myself but it looks like you are right! http://codepad.org/tw6EJMr4 i5-2500K: naive search found: 0, took 1856721 ns found: 0, took 1799554 ns found: 0, took 1908483 ns found: 0, took 1921622 ns found: 0, took 1856173 ns found: 0, took 1812736 ns found: 0, took 1819938 ns found: 0, took 1846232 ns found: 0, took 1821858 ns found: 0, took 1898503 ns average: 1854182.00 ns knuth search found: 0, took 19…
Kudos to you for actually doing the experiment! With a control case even! I wish I could give you ten upvotes.
That trick might still be useful in the embedded space - I had to try it on my samr21-xpro too (with only an 8kiB array and slightly modified code - http://codepad.org/aPOZraI2)
samr21 (Cortex M0+)
naive search
found: 0, took 1714 ticks
found: 0, took 1713 ticks
found: 0, took 1714 ticks
found: 0, took 1714 ticks
found: 0, took 1714 ticks
found: 0, took 1713 ticks
found: 0, took 1714 ticks
found: 0, took 1713 ticks
found: 0, took 1714 ticks
found: 0, took 1714 ticks
average: 1713 ticks
knuth search
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
found: 0, took 1372 ticks
average: 1372 ticksRe: I Got a Knuth Check for 0x$3.00
#98> People also say that TAOCP is irrelevant or outdated or otherwise inapplicable to “real programming”. This also wrong. For instance, the first section after the chapter intro deals with the basic problem of searching for an item in an unsorted array. The simplest algorithm should be familiar to all programmers. Start your pointer at the head of the array, then do the following in a loop: Check if the current item i…
Certainly I'm not saying that this is the algorithm to use in all cases. It's not even obvious how you would implement the sentinel algorithm in a language like Python, not in idiomatic code anyway. The point is that the book is written from the perspective of an actual programmer writing actual code and thinking about how it will run. Granted, he's writing in a pixie assembly language for an imaginary machine, but s…
Sure, I don't dispute that in the least. All I'm saying is that if you want to argue that TAOCP is not dated you could have chosen a better example.
Re: I Got a Knuth Check for 0x$3.00
#99Earlier quoted context omitted.
We had a professor that kept mappings for 2-3 versions behind and basically allowed you to buy the used book on Amazon for about $12 compared to $200 for the new one. It's these little things that make your professors stand out.
>$200 for a textbook with borderline extorsion sale tactics That's the moment I fire up libgen
Re: I Got a Knuth Check for 0x$3.00
#100> People also say that TAOCP is irrelevant or outdated or otherwise inapplicable to “real programming”. This also wrong. For instance, the first section after the chapter intro deals with the basic problem of searching for an item in an unsorted array. The simplest algorithm should be familiar to all programmers. Start your pointer at the head of the array, then do the following in a loop: Check if the current item i…