Live data from Hacker News

What are the books banned in camp Guantanamo?

reprieve.bsd.net

21–30 of 43 posts

Re: What are the books banned in camp Guantanamo?

#21

#DeveloperFail Funny, the page asks for your name, and if you have ' like Irish names, it marks the name in Red (invalid) and doesn't let you move forward with finding out the books. I tested it with the following names. James O'Keefe Mullah O'Mar

Getting names right is very hard: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...

Re: What are the books banned in camp Guantanamo?

#25
post #13

#DeveloperFail Funny, the page asks for your name, and if you have ' like Irish names, it marks the name in Red (invalid) and doesn't let you move forward with finding out the books. I tested it with the following names. James O'Keefe Mullah O'Mar

Why can't a name simply be a string of length X? All this work of checking for "correct" names is so pointless.

Badly written SQL generation often prompts single quotes being forbidden in input. "Having single quotes there breaks my queries," one sometimes hears said. "I don't know why."

This is a great opportunity to mentor one's juniors. An injection attack is trivial to demonstrate in the local dev environment, and the result strongly motivates anyone worth working with to learn how not to do that again.

Re: What are the books banned in camp Guantanamo?

#27
post #9

There is a gift shop in Guantanamo bay? What's next, one in fucking Auschwitz?

I live right next to Auschwitz and can confirm that indeed, it has a gift shop. It only sells books and dvds about the camp though, so it's not your traditional gift shop selling all sorts of tat.

Re: What are the books banned in camp Guantanamo?

#28
post #13

Earlier quoted context omitted.

Why can't a name simply be a string of length X? All this work of checking for "correct" names is so pointless.

Badly written SQL generation often prompts single quotes being forbidden in input. "Having single quotes there breaks my queries," one sometimes hears said. "I don't know why." This is a great opportunity to mentor one's juniors. An injection attack is trivial to demonstrate in the local dev environment, and the result strongly motivates anyone worth working with to learn how not to do that again.

For the 10,000 who might be learning about this today, the answer is prepared statements with placeholders for the values, like this pseudocode:

   stmt = driver.prepare("insert into names 
      (firstname, lastname) values (?, ?)");
   stmt.execute("Flannery", "O'Connor");
Syntax varies among database interfaces but this ensures that any odd strings are properly stored by the driver and the application does not need to worry about them. There is also no risk of someone rewriting the SQL statement.

Re: What are the books banned in camp Guantanamo?

#29

#DeveloperFail Funny, the page asks for your name, and if you have ' like Irish names, it marks the name in Red (invalid) and doesn't let you move forward with finding out the books. I tested it with the following names. James O'Keefe Mullah O'Mar

Sounds like a very hacky way to avoid little Bobby Tables...

But it also forbids characters like ñ or í

Re: What are the books banned in camp Guantanamo?

#30
post #15
post #7

I don't get it. What're they afraid of?

What if the prisoners draw inspiration from Sirius Black or Edmond Dantes and attempt an escape? Banning these books ensures that such thoughts never occur to the inmates. Clearly the wardens have learned the correct lessons from the Shawshank Redemption [1] [1] - https://youtu.be/_359l_9Wyhg?t=48s

I hope you're not serious.
Post reply on HN