Things you shouldn't do: Two pointers in one field.
en.wikipedia.org
Things you shouldn't do: Two pointers in one field.
1–10 of 21 posts
Re: Things you shouldn't do: Two pointers in one field.
#2Brilliant and deadly. Gotta love it.
Re: Things you shouldn't do: Two pointers in one field.
#3Re: Things you shouldn't do: Two pointers in one field.
#4Use half the memory -> buy a smaller memory chip per unit -> spend less per unit -> profit more per unit.
But maybe you should stick with the Ruby. I hear there's money in that.
Re: Things you shouldn't do: Two pointers in one field.
#5Someday you might have to program in an actual resource-constrained environment, and you'd understand why sometimes you have to do stupid things to meet your constraints. Use half the memory -> buy a smaller memory chip per unit -> spend less per unit -> profit more per unit. But maybe you should stick with the Ruby. I hear there's money in that.
The number of situations where this particular solution is the best solution is really small!
Re: Things you shouldn't do: Two pointers in one field.
#6Someday you might have to program in an actual resource-constrained environment, and you'd understand why sometimes you have to do stupid things to meet your constraints. Use half the memory -> buy a smaller memory chip per unit -> spend less per unit -> profit more per unit. But maybe you should stick with the Ruby. I hear there's money in that.
Or: use twice the memory -> buy a bigger memory chip per unit, adding one dollar to the cost -> charge $1 extra for your $300 unit -> spend less money defusing "your product sucks because it crashes all the time" support calls -> profit more per unit.
But maybe you should stick to hand-rolled assembly. I hear there's geek cred in that.
(But actually, there is a middle ground -- something like Atom: http://hackage.haskell.org/package/atom. You get type safety guarantees at compile time, and you get a minimal runtime, lowering hardware requirements.)
Re: Things you shouldn't do: Two pointers in one field.
#7Someday you might have to program in an actual resource-constrained environment, and you'd understand why sometimes you have to do stupid things to meet your constraints. Use half the memory -> buy a smaller memory chip per unit -> spend less per unit -> profit more per unit. But maybe you should stick with the Ruby. I hear there's money in that.
Obviously, you can't really do it so I first pre-sorted the hotels with some common criteria in large chunks, then sampled random bits from the rest of the criteria to fill the memory based portion of the index. When a query would come in a mask was made for the various criteria in the same way as during the indexing, and this mask was then used to get the indices of hotels that might be right, candidates so to speak. Then the candidates would be loaded from disk and checked against all the criteria and an answer would be returned to the caller. It worked pretty good, the disk block caching mechanism really saved the day.
This was on a QnX system before they had a 32 bit/large model version...
That's when programming is fun!
Of course 64K is still not really 'constrained' ;)
Re: Things you shouldn't do: Two pointers in one field.
#8Another reason not to do it is that in the modern era, computed pointers tend to stall pipelines.
Re: Things you shouldn't do: Two pointers in one field.
#9Re: Things you shouldn't do: Two pointers in one field.
#10Someday you might have to program in an actual resource-constrained environment, and you'd understand why sometimes you have to do stupid things to meet your constraints. Use half the memory -> buy a smaller memory chip per unit -> spend less per unit -> profit more per unit. But maybe you should stick with the Ruby. I hear there's money in that.
Last time I actually needed to do this, I allocated memory in larger chunks instead, and made a linked list of those chunks. The number of situations where this particular solution is the best solution is really small!