HNHacker News
TopNewBestAskShowJobs

zeeboo

505 karma · joined July 11, 2012

[ my public key: https://keybase.io/zeebo; my proof: https://keybase.io/zeebo/sigs/pUgbWKGyeX4DCJKX05K8nPmSd_MKsHZZElgYcAm29qw ]
submissionscomments
zeeboo··on The Mathematics of Tetris (2011)
That's not a T piece. It has 5 blocks. The subtlety is about a board like

    .XXXXXXXXX
    ..XXXXXXXX
    .XXXXXXXXX
and if you can put a T piece inside of the gap on the left.
zeeboo··on Why Python 3 Exists
Nobody has a problem with encode/decode when talking about, say, json. You have some semantic object that you want to encode to some bytes representation, and some bytes representation that you want to decode into some semantic object.

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.

zeeboo··on It Probably Works: Probabilistic algorithms are all around us
I don't have an article but my intuition is that it reduces variance. It smears the probability of getting "unlucky" with the hashes across all of the buckets.
zeeboo··on OpenBSD errata
Neither did the people writing it, or merging it. Security isn't an obvious property of code or there would be no security bugs. You have to rely on heuristics, and in this case the heuristics were right.
zeeboo··on Create your own erasure code
In math a field is a structure with enough properties to be able to do polyoninals, meaning addition and multiplication. If you pick a field appropriately, you end up with some properties that guarantee that this interpolation trick works. If you pick it even more appropriately you can have the elements and operations efficient on computers. Turns out that a Galois Field has all those properties.

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.

zeeboo··on Show HN: BoomFilters – Probabilistic data structures for processing streams
Then it doesn't do it in constant space. Constant space is the property that makes it not a true inverse bloom filter, and instead is just a cache with an interesting hashed based eviction method.

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.

zeeboo··on Slack was hacked
Update the hash when the user logs in because you have the password. You can tell if it's been applied by having another column, or prepending/suffixing the output with something that scrypt can't output.
zeeboo··on Who Can Name the Bigger Number?
But the super Turing machines busy beaver numbers vastly outgrow your iterated busy beaver very quickly. It doesn't take that many states to write a program that can do an iterated function application, and to a super Turing machine, it's easy to write the busy beaver function.
zeeboo··on The Road to Rust 1.0
Actually, that Go bug is the scanning code getting confused about an incorrectly stored stack pointer value during a very small race between returning from a FFI call into Go and generating a traceback for scanning. I'm not familiar enough with the internals to comment on if that can lead to freeing FFI memory, but I don't think so. Not that crashing the process is much better. :)
zeeboo··on G()('al')
I made this Go one that might be cheating because instead of the ("al") call returning a string, you get a value that implements the String method. Works with fmt.Println :)

http://play.golang.org/p/zrp2sO6ZLU

zeeboo··on Just how much is that 2% really worth?
It appears to apply the interest rate monthly. I'd love to have a 5.75% interest every month.

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

zeeboo··on Sane Concurrency with Go
Since the channels are unbuffered, theres no way to read from the error channel until the loop has accepted your request for the transaction. Also, since it won't accept another transaction request until it has sent an error (it always sends an error value), you always read the error for your transaction.

Any buffering in the request channels would have the race you've described though.

zeeboo··on The Space Monkey Upgrade Scam
Space Monkey said they would give refunds with shipment at their cost to anyone who requests them.
zeeboo··on The Space Monkey Upgrade Scam
Of course it's not unreasonable. Space Monkey said many times that they are unhappy about the clarity of the issue and thus offered a full refund with shipment at their cost to anyone who wanted it.
zeeboo··on The Space Monkey Upgrade Scam
Under the lease model ($10/mo) or under the 1yr warranty for the ownership model, yes.
zeeboo··on The Space Monkey Upgrade Scam
But they offered to give the money back and he didn't take it.
zeeboo··on The Space Monkey Upgrade Scam
When you lease the device if the hardware fails then Space Monkey replaces it. If you own the device and it fails outside of the 1yr warranty, then you have to replace it. The difference is about recouping hardware costs over the lifetime of the device.
zeeboo··on The Space Monkey Upgrade Scam
You'll either be paying $10/month or $49/year. Those are the only two subscription models the company has ever offered for a 1TB device.
zeeboo··on Dijkstra: On the cruelty of really teaching computer science (1988) [pdf]
His page numbers are zero indexed. Cute. I would have loved to take his proposal for an introduction to computer science course.
zeeboo··on Efficient String Concatenation in Python
Note these tests were run on Python 2.2 which makes the results old enough to almost certainly be invalid. Last time I checked, straight string concatenation was faster than everything else for the types of inputs I was dealing with.
zeeboo··on Go After 2 Years in Production
You can have multiple packages in one repo. All of our code consisting of dozens of packages is in one repo.
zeeboo··on Twelve Go Best Practices
Less than 5% of your coworkers understand decorators? I don't want to sound snooty but this is a pretty trivial application of higher order functions.
zeeboo··on Impressions of Go
The problem is that even those are boring. I've used Go for an extended period of time on a large project and there's nothing to report. It works just like what everyone else already says.
zeeboo··on Things I Wish Someone Had Told Me About Go
Everything in Go is passed by value, even the "reference types". Those types are called reference types because they hold a reference to some value in memory, exactly like a pointer.

If they were passed by reference, then we would expect this playground snip to print "false": http://play.golang.org/p/r6naknvzng

zeeboo··on Things I Wish Someone Had Told Me About Go
Nope, looks like you don't understand pointers. You're still modifying the passed-by-value pointer to a pointer, and not the thing that it points to.
zeeboo··on Ten predictions (2004)
It's not my fault the definition of average is very narrow.
zeeboo··on Ten predictions (2004)
> A tautology if I ever heard one.

Consider this set of programmer "skill levels" where most (80%!) are above average: {10, 10, 10, 10, 1}

zeeboo··on Why I Like Go
It's

    typedObj, ok = something.(type)
just like it is with maps, or any other ", ok" thing.

http://play.golang.org/p/I-5kD88knC

zeeboo··on Function types in Go
You can abstract the channel operations behind interfaces and regain type safety. Inspired by the sort package, I wrote http://thegoods.biz/broadcast for doing broadcast type patterns safely. To use it you implement two trivial methods on a channel type and away you go, single producer multiple consumer channels.

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.

zeeboo··on Go: a nice language with an annoying personality
No you can't: http://play.golang.org/p/I_pu9oG1uF
← PreviousPage 4 of 5Next →