51 karma · joined May 14, 2013 (13y ago) · 35 submissions
comment 12y ago · link · parent
Flaw #1: An Off-by-One Error
The algorithm above tries to iterate over each card in the deck, swapping each card with another randomly chosen card in the deck. However—every programmer has made this mistake before—there's an off-by-one error. The function random(n) returns a number between 0 and (n-1), not between 1 and n as the programmer intends. As a result, the algorithm will never swap the 52nd card with itself; the 52nd card can never end up in the 52nd place. So that is the first reason the "random" card shuffling isn't really random.
The comment refers to the Pascal code:
random_number := random(51)+1;
If the programmer really thought that random was between 1 and n then the random_number variable would be a number between 2 and 52 (1+1 to 51+1). It seems like, instead, a better explanation is that they may have thought random(n) produced a random number between 0 and n, hence the need to increment by one. Another explanation is they just messed up the slicing using 51 instead of 52.The point being that in the writer's explanation of the flaw they actually make the same mistake.
Funnily enough googling "pascal random" points to a stackoverflow article where the best answer makes the same error.
https://stackoverflow.com/questions/4965863/how-to-get-a-ran...
comment 12y ago · link · parent
If your box is more vulnerable on port 22 than port 22221 then your problems run orders of magnitude deeper than which port your ssh server runs on.
comment 12y ago · link · parent
The easiest way to illustrate how this can be a problem is to compare the difference between growing cells in minimal media versus complex media, where they grow much faster.
Soylent is basically a crude minimal media for humans. The proper comparison for soylent will be against someone who is eating a complete diet, not someone who is skipping meals or eating poorly.
comment 12y ago · link · parent
I'm not sure I understand what point you are trying to make above. The argument (as I read it) is that we studied nutrition 70 years ago, Rob isn't a nutritionist, and there is something else you prefer to soylent so it's irrational and no one should use it? That may be an esoteric argument against soylent and Rob but not the idea of soylent.
If you could theoretically develop a solution that you only needed to drink once a day to get all of the nutrients your body needs and feel satiated, why wouldn't you drink that? You could then spend your time doing other things that are more important to you. While for some people they may prefer preparing and cooking food, which is fine, it's not a substantive argument against soylent for those who view eating differently.
The value people get from eating seems a lot fuzzier and humanistic than soylent, which, to me, seems incredibly robotic and rational.
comment 12y ago · link · parent
It's an interesting question, just what nutrients does the human body need in order to sustain itself? We have a good definition of what individual cells need but not a lot of data for how the body copes long term with just those nutrients. My guess is that will power will lose out in the end.
comment 13y ago · link · parent
I am a little sceptical of the claim in the last sentence.
comment 13y ago · link · parent
I don't understand the big deal here. You shouldn't be storing your passwords at all in a browser.
http://raidersec.blogspot.com.au/2013/06/how-browsers-store-...