HNHacker News
TopNewBestAskShowJobs

nulptr

24 karma · joined April 7, 2020

submissionscomments
nulptr··on Simulating the Ladybug Clock Puzzle
The +12 there is so that % works correctly (ie the number never becomes negative)
nulptr··on Google fires 28 employees involved in sit-in protest over $1.2B Israel contract
Hard y… yt = white
nulptr··on BitTorrent Site Magnet Database Archives Available via Torrent and Direct DL
One way is querying the dht
nulptr··on 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond (2001)
If each command would only be executed two communication turns in the future, and a communication turn is ~200ms, isn't there ~600ms of lag for each command?

> For RTS games, 250 milliseconds of command latency was not even noticed -- between 250 and 500 msec was very playable, and beyond 500 it started to be noticeable.

The article mentions this as well, so was ~600ms latency just expected?

Why doesn't it work to execute commands _one_ communication turn in the future?

nulptr··on Where Everything Went Wrong: Error Handling and Error Messages in Rust (2020)
Yeah, this is irritating... one workaround for this is to do:

(in the context of walking a tree...):

    fn get_depth(root_opt: &Option<Box<TreeNode>>) -> usize {
        let root = match root_opt {
            Some(root) => root,
            None => return 0;
        };

        1 + std::cmp::max(get_depth(root.borrow().left), get_depth(root.borrow().right))
    }
nulptr··on Show HN: SharePad.io – A collaborative code editor and compiler
Some starter code for each language that prints hello world would be nice. ALso, you can look to coderpad.io for other features to add for fun.
nulptr··on Who Americans spend their time with, by age
important to note that there's little choice for men or women in the "happy multi generational example"
nulptr··on “I've had to relearn coding to get through the new interviews”
were you applying for a data scientist or software engineer position?
nulptr··on There are only four billion floats, so test them all (2014)
Ahh yes, that's very clever. Thanks for sharing :)
nulptr··on There are only four billion floats, so test them all (2014)
I think I found a way to do it with ~8GB. As you mentioned you only need 2^30 tries due to birthday paradox.

But, instead of using a hash table to store (seed, hash) pairs, we can just use a list of only hashes. To generate the next hash we use current hash. i.e. next_hash = hash("example.com/" + string(int64(cur_hash))). So now, we just store 60-bit hash values which takes up 2^30 * 60 bits = 8gigs.

The only other problem is detecting if a hash already exists, which I think can be done using a space efficient probabilistic hashset like a bloom filter (and when the bloom filter says the hash already exists, we do a linear scan to find where it exists and we have a possible collision).

nulptr··on There are only four billion floats, so test them all (2014)
I have a question about how you generated collisions.

If each seed is a 32-bit int, and each hash is 60 bits, then you'll have to store 92 bits for each (seed, hash) pair.

With 2^32 (~4.3 billion) (seed, hash) pairs, you'd need 2^32 * 92 bits ~= 50 gigabytes.

But you mention only needing 8-12GB. Is my calculation wrong, or have I missed something?

nulptr··on A guide to learning algorithms through LeetCode
I don't think it's just about solving the problem.

It's also about: - how you convinced yourself and the interviewer that your solution was correct (essentially an informal proof of your code)

  - how you test your code after you finish coding

  - what clarifying questions you asked to tease out a concrete question

  - what edge cases you thought of and how you handled them

  - how you handle bugs if they appear in the code

  - what solutions you presented and what their tradeoffs were, and why you decided to use a particular solution

  - whether your code was idiomatic

  - whether you used clean abstractions

  - maybe also comments and variable naming

... and probably others I'm missing.

I don't deny that interviewers have their biases, but I would hope that your interview performance is the major factor in whether you received an offer. There are plenty of people at Google and Facebook who haven't majored in CS at a top school.

nulptr··on Single Page Applications using Rust
rust allows for procedural macros (basically a function that takes a token stream and returns a token stream, and yes you can do parsing in this funciton

https://doc.rust-lang.org/reference/procedural-macros.html

nulptr··on London traders hit $500M jackpot when oil went negative
If you accuse someone of theft, shouldn't the burden of proof be on you?

Also, if two people make a bet, and one person wins, is that theft?

nulptr··on Hindley-Milner Type Inference (2012)
because "ssdf" is a string but B("asd") is user-defined sum type.

So in the original example, you can't unify "ssdf" and the int 33, but in the re-written version B("sfd") and A(33) have the same type and can be unified.

nulptr··on The economics of a VIP party
https://outline.com/k74gf3
nulptr··on What to know to get promoted quickly in Big Tech
https://webcache.googleusercontent.com/search?q=cache:21xq0j...
nulptr··on Uber cuts 3000 more jobs, closes 45 offices
Can someone explain why Uber stock is up 7% today then?

Is it because Uber's expenditure will decrease because of the layoffs?

nulptr··on Launch HN: Edlyft (YC W20) – Paid Support Program for CS College Students
Out of curiosity, what software were they using to catch cheating?

Was it MOSS (https://theory.stanford.edu/~aiken/moss/)?