.XXXXXXXXX
..XXXXXXXX
.XXXXXXXXX
and if you can put a T piece inside of the gap on the left.505 karma · joined July 11, 2012
.XXXXXXXXX
..XXXXXXXX
.XXXXXXXXX
and if you can put a T piece inside of the gap on the left.The confusions is around people viewing byte strings implicitly as ascii codepoints, and not fully understanding what the things they're looking at actually are.
Specifically, you start with the base field of integers mod 2 and it turns out addition is xor, and multiplication is and. From that, you can create polynomials. Just like you could create a field by considering a set of elements modulo some prime, if you pick a "prime" polynomial and take the set of polynomials modulo your "prime" polynomial, then you get another field. Prime in this case means irreducible, which means you can't factor it.
So what people do is pick an irreducible polynomial of degree 7 and that maps perfectly to a byte. So for example a byte with bit pattern 01100011 would be the polynomial x^6 + x^5 + x + 1. You can then generate some tables that make multiplication and addition of these elements modulo your irreducible polynomial fast, and then apply this interpolation technique.
Hopefully that helps explain it. I was a little loose with terms and details so some stuff might be wrong.
That said, this is just a silly definition issue. You can provide a data structure with no false positives, and some false negatives, but you can't do it in constant space. I'm not aware of if you can absolutely bound the rate of false negatives.
Here's the calculation. It's a little high because we should be getting 1/12th of the 50k per month and compounding, but I'm assuming we got the full 50k up front and got a 5.75% interest compounded per month.
50000*(1.0575 ^ 12)
97799.02314394798212000000
edit: I take it all back. It's super broken. Just mess around with the interest rate and nothing makes any sense. For example, a 0% return still gives you $195,833.33 big co earnings on a 150k salary!edit 2: The bug is in this function and the one below it: https://github.com/vijedi/equity_calculator/blob/master/js/a...
If your interest rate is zero, the calculated interest is 11 * the monthly difference. Then it's added to your base big company salary, which is clearly wrong. It should be 12 * the monthly difference added to the startup salary.
edit 3: Opened a pull request with what I think is the fix: https://github.com/vijedi/equity_calculator/pull/4
Any buffering in the request channels would have the race you've described though.
If they were passed by reference, then we would expect this playground snip to print "false": http://play.golang.org/p/r6naknvzng
Consider this set of programmer "skill levels" where most (80%!) are above average: {10, 10, 10, 10, 1}
typedObj, ok = something.(type)
just like it is with maps, or any other ", ok" thing.I think there are clever solutions to these types of problems that have yet to be explored because most of the focus is on what Go lacks from other languages.