Live data from Hacker News

A Competitive Programmer's Handbook

cses.fi

161–170 of 171 posts

Re: A Competitive Programmer's Handbook

#161
post #146

Earlier quoted context omitted.

>>degree-less candidates, companies that filter out depressed candidates, companies that filter out transgender candidates, etc. Sorry, these are completely different things and frankly sounds like nonsense.

Would you say that there is no discrimination along these lines, and that most companies aren't biased against, say, transgender candidates when making hiring decisions? I'm just curious.

I've no doubt that tech is discriminatory - as a minority myself I've definitely experienced odd feedback at interviews "the team were impressed by your abilities but we've decided to proceed with someone else" etc. I just mean to compare rejecting degree-less candidates is not equivalent to discrimination against "non-fit" groups (gender, ethnic, sexuality minorities) as a degree is a technical qualification and not a protected characteristic.

Re: A Competitive Programmer's Handbook

#162

I really like this. I don't like how you handle array indices though. The book is written in C++, yet you initialize all arrays where the first element is at index 1, which makes things really confusing, or at least annoying to think about when converting from your text to an IDE.

Agreed, like it as well except hate the 1-based indexing. The first element of an array in C++ has index 0 and the last has index "for(int i = 0; i In this book all for loops are alien: "for(int i = 1; i Very weird in an otherwise fine book.

The main point imho is that if you have a range starting at some index a, then the first element of that range is at a+0, not a+1, and if n is the amount of element of the range and a is the index of its first element, the last will be at a+n-1, not a+n. The start and end of an array is the same, an array's indexes are also a range. You may want to make it feel all natural by setting a to 1 instead of 0 for arrays, but it then becomes all messy as soon as you work with multiple ranges, especially sub ranges of an existing range since you then really need to add 0, not 1, to get the first one of that sub range, so if you want to treat your arrays the same, easiest is to also have them also start at 0. The least messy solution requiring the least subtracting of 1 to fix things is to use 0-based indexing, inclusive start index and exclusive end index such that end - start = size. But probably somebody like Dijkstra can explain it better:

"E.W. Dijkstra Archive: Why numbering should start at zero (EWD 831)": https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...

Re: A Competitive Programmer's Handbook

#163

Earlier quoted context omitted.

wait, I broke the "the tier of blunt criticism"? Ha ha. Not only are you accusing me of breaking some arbitrary rule you invented but that is definitely the pompous phrase I have ever read on HN.

"Horribly written" is blunt criticism, like it or not. The parent post is saying that because you delivered blunt criticism, you should be prepared to take it too.

If you actually read what I wrote I said "This seems to be horribly written." Note the word "seems" that is not the same thing as saying "it is." I then go on to ask a question for clarification which some folks were kind of enough to point out helpful and corrected interpretations. Asking a question and admitting something wasn't making sense to you are not at all the same thing as "dishing out criticism."

Re: A Competitive Programmer's Handbook

#164

Earlier quoted context omitted.

"Horribly written" is blunt criticism, like it or not. The parent post is saying that because you delivered blunt criticism, you should be prepared to take it too.

If you actually read what I wrote I said "This seems to be horribly written." Note the word "seems" that is not the same thing as saying "it is." I then go on to ask a question for clarification which some folks were kind of enough to point out helpful and corrected interpretations. Asking a question and admitting something wasn't making sense to you are not at all the same thing as "dishing out criticism."

> Note the word "seems" that is not the same thing as saying "it is."

Like one of the parents said, the reason why it "seems" to you is your reading comprehension.

Re: A Competitive Programmer's Handbook

#165

This seems to be horribly written. Example: >"In the German Lotto you have to select 6 numbers from the set {1,2,...,49}. A popular strategy top lay Lotto - although it doesn’t increase your chance of winning — is to select a subset S containing k (k > 6) of these 49 numbers, and then play several games with choosing numbers only from S. For example, for k = 8 and S = {1, 2, 3, 5, 8, 13, 21, 34} there are 28 possible…

We detached this subthread from https://news.ycombinator.com/item?id=14116263 and marked it off-topic.

Re: A Competitive Programmer's Handbook

#166

Earlier quoted context omitted.

I've always looked at internet conversations as gentleman's agreements in politeness and respect. What I mean by this is that any given internet comment can be a hate filled flexbox of bile and swear words, but most aren't, because that would be a violation of the agreement. But once the agreement is broken (or one of the tiers of the agreement is broken) then no subsequent discussion is beholden to that level. So in…

wait, I broke the "the tier of blunt criticism"? Ha ha. Not only are you accusing me of breaking some arbitrary rule you invented but that is definitely the pompous phrase I have ever read on HN.

When discussions get to this level they automatically don't belong on HN. Please don't, regardless of how wrong other people are.

Re: A Competitive Programmer's Handbook

#167

I really like this. I don't like how you handle array indices though. The book is written in C++, yet you initialize all arrays where the first element is at index 1, which makes things really confusing, or at least annoying to think about when converting from your text to an IDE.

Agreed, like it as well except hate the 1-based indexing. The first element of an array in C++ has index 0 and the last has index "for(int i = 0; i In this book all for loops are alien: "for(int i = 1; i Very weird in an otherwise fine book. The main point imho is that if you have a range starting at some index a, then the first element of that range is at a+0, not a+1, and if n is the amount of element of the range…

Nice explanation, very in depth. I had to check one of the algorithms a number of times, thinking I was missing something as I couldn't see why it wouldn't iterate beyond the array. Figured it out as the initial arrays are labeled with the 1 as the first index, but as you pointed out the whole iterator changes subtley and looks alien.

Re: A Competitive Programmer's Handbook

#168

I really like this. I don't like how you handle array indices though. The book is written in C++, yet you initialize all arrays where the first element is at index 1, which makes things really confusing, or at least annoying to think about when converting from your text to an IDE.

Agreed, like it as well except hate the 1-based indexing. The first element of an array in C++ has index 0 and the last has index "for(int i = 0; i In this book all for loops are alien: "for(int i = 1; i Very weird in an otherwise fine book. The main point imho is that if you have a range starting at some index a, then the first element of that range is at a+0, not a+1, and if n is the amount of element of the range…

Looks like the indexing will be changed to 0-based in the next draft. https://github.com/pllk/cphb/commit/35d53d39d494cdc2d8f884c3...

Re: A Competitive Programmer's Handbook

#170

Earlier quoted context omitted.

Being good at programming competitions correlates negatively with being good on the job - Peter Norvig http://www.catonmat.net/blog/programming-competitions-work-p...

This has been circulated around HN and Reddit several times, and it's disappointing that someone of Norvig's stature would present the data in such a misleading way. Here's a good explanation posted by "tedsanders" the last time this came up on HN: """ All of these claims from Google that say competition performance hurts or that GPA doesn't matter are missing one huge thing: selection bias. Google only sees the perf…

https://en.wikipedia.org/wiki/Berkson%27s_paradox
Post reply on HN