HNHacker News
TopNewBestAskShowJobs

kevinnk

799 karma · joined March 25, 2012

[ my public key: https://keybase.io/kkiningh; my proof: https://keybase.io/kkiningh/sigs/i245-gK_dv4Qc5VWTlErrKFhl9_TEsxfD3WbLDeD4As ]
submissionscomments
kevinnk··on Hidden backdoor API to root privileges in Apple OS X
It's an optimization. Virtual methods that don't dereference this (by not accessing any non static member variables for example) don't have to check if this is null. For example,

  class Example {
  public:
    static bool do_it;
    virtual void do_it_if() {
       if (g_do_it) return;

       /* otherwise do something that dereferences this... */
    }
  };

  void test1() {
    Example::do_it = false;
    static_cast<Example *>(NULL)->do_it_if();
  }

  void test2() {
    Example::do_it = true;
    static_cast<Example *>(NULL)->do_it_if();
  }
In the above code, only test2 crashes (clang 6.0). If crashing was defined behavior you would need an extra check in the code generated for do_it_if.

EDIT:

Also, it's worth explaining why test1 works even though do_it_if is virtual. Since there aren't any methods that override do_it_if, the virtual method lookup can be elided and you don't have to dereference this to find the vtable. If do_it_if had been overridden and the runtime type was unknown, you would need to dereference this to lookup do_it_if in the vtable, which would segfault in both tests.

kevinnk··on NSA Spy Cam Blocker
Fear mongering has the connotation of making people irrationally afraid for your own benefit, which, yes, I am against in all instances on principle.
kevinnk··on NSA Spy Cam Blocker
"I'm okay with the ends justifying the means when the ends are something I like."
kevinnk··on How to Sell Excellence
Do you have a link for the Oil & Gas DSL? A search for "Haskell oil gas dsl" didn't turn up much.
kevinnk··on ZeroDB, an end-to-end encrypted database
How is that different than cryptDb then? CryptDb only reveals ordering as well (and only if the client requests it.)
kevinnk··on ZeroDB, an end-to-end encrypted database
> Evil admin? They can just monitor the web server instead of the db.

That's exactly the use case. The idea is that the data isn't decrypted until the client.

kevinnk··on ZeroDB, an end-to-end encrypted database
If it knows what pieces you access, how do you prevent the sever from learning ordering?
kevinnk··on Why salaries don’t rise
If you're living in the Bay Area and are competent enough to be hired by a big tech company you can absolutely command a 100k+ salary pretty much regardless of seniority. There are Google interns getting paid almost 90k (~7500 monthly.)
kevinnk··on Why salaries don’t rise
High end at Google for UI designer is ~160k according to Glassdoor. That's in line with what I've heard from friends as well. UI design does have lower salaries than other types of software development, in some cases much lower, so I doubt you're going to be getting 150k+ unless you're pretty senior.
kevinnk··on My Roommate, the Darknet Drug Lord
Yes. For the first murder he spent $500,000 and for the second $80,000
kevinnk··on Why GNU grep is fast (2010)
> Does "not looking at every byte" really matter when the strings being searched for are typically so short that you're gonna hit every cache line anyway?

You're not skipping bytes of the search string, you're skipping bytes of the file being searched.

kevinnk··on FCC Passes Strict Net Neutrality Regulations on 3-2 Vote
> I'm not up to speed on Bittorrent, but are they specifically blocking Bittorrent, or is coming under the ruberic of "thou shall not run a server behind your cable modem"?

Maybe try googling before you comment? Comcast would inject forged TCP rst packets to inbound bittorrent connections. It did not send these packets to people running servers or other peer-to-peer protocols. In fact, people complained that the resets would sometimes prevent Windows Remote Desktop from working and Comcast adjusted their system to prevent it from jamming.

https://www.eff.org/wp/packet-forgery-isps-report-comcast-af...

> I'm interested to know what other sorts of things/applications ISPs may be blocking. Is there a name-and-shame site out there listing various ISPs and what they don't allow.

The current issue isn't really blocking, it's throttling. There are a couple of sites that do this sort of measurements. Look at http://www.measurementlab.net/

> Is it 10% of the population who can't get DSL, wireless, satellite or some other form of competition of some kind?

The FCC's current definition of broadband is 25mbps.

Vast majority of DSL isn't broadband speed (Avg is 10Mbps.) 4g isn't broadband speed (~12Mbps). Satellite isn't broadband speed (~15Mbps and usually expensive compared to wired.)

At 25mbps, 20% have no service and 55% have only one service.

http://arstechnica.com/business/2014/09/most-of-the-us-has-n...

kevinnk··on Chicago police detain Americans at abuse-laden 'black site'
Look, Chicago has corruption problems, but calling it an "extra-legal government zone" is so hopelessly hyperbolic that it hurts any sort of real argument. The police have had literally thousands of lawsuits paying out hundreds of millions of dollars over just the last 5 years. Police officers, a police chief, mayors and even governors have been arrested and jailed over everything from bribery to brutality. If lawyers aren't suing on what looks like a slam-dunk case of civil rights violations, why have they sued (and won) so many other times?
kevinnk··on Introducing Pebble Time
Those regulations were essentially removed in a lot of cases by the JOBS act in 2012. The rules are still under review but crowdfunding of equity will be possible sometime in early 2016.
kevinnk··on Is Blockchain Really the Killer App?
Perhaps I don't really understand the idea here. What prevents a farmer from only accepting votes from their friends (or themselves) and generating as much FarmerCoin as they please?
kevinnk··on Why OccupyGPL is wrong
There are plenty of dual licensed codebases that make a profit with no additional value add (other than not having to respect the GPL.) For example, the popular C++ gui framework JUICE[1]

[1] http://www.juce.com/faq#t78n75645

kevinnk··on Ross Ulbricht Convicted of Running Silk Road as Dread Pirate Roberts
He tried to murder 5 rivals. To me, it seems like he demonstrated almost the exact opposite.
kevinnk··on Ross Ulbricht Convicted of Running Silk Road as Dread Pirate Roberts
There were people arguing Han Reiser was innocent and "coerced" all the way up to when he lead the police to her body...
kevinnk··on Ross Ulbricht Convicted of Running Silk Road as Dread Pirate Roberts
"I see a story about a protagonist who was not only supremely arrogant, he was supremely incompetent at opsec"

Ever seen Catch Me If You Can?

Also, I agree a true to life story would be pretty boring. Thankfully, truth isn't exactly a requirement in hollywood storytelling.

kevinnk··on Ross Ulbricht Convicted of Running Silk Road as Dread Pirate Roberts
redandwhite was almost certainly a scammer and got paid to kill friendlychemist and tony76 + three roommates. Nob was an undercover agent who got paid to kill "The Employee" aka flush aka cronicpain aka Curtis Green. Two different incidences.
kevinnk··on Gangnam Style breaks YouTube viewer count
> int is cross-platform and forward compatible whereas uint32_t, uint64_t, uint8_t, uint16_t, etc. will all always be unsigned within a specified bound, so whenever we have 128-bit or 256-bit registers, we'll have to go back and update all this code

uintN_t (and intN_t) are MORE portable and cross platform than int in the sense that you get much better guarantees about it's size and layout.

Furthermore, int is NOT the size of the register (x64 commonly has an int of 32 bits) so any updating you'd have to do to uintN_t, you'd have to do to int as well. Regardless, I can't imagine why you'd need to do any updating in the first place - it's perfectly valid to stick a uint32_t in a 64 bit register.

> nevermind the fact that int is usually more optimized than uint these days

Where are ints more optimized than uint? Not in the processor, not in the compiler (modulo undefined behavior on overflow) and not in libraries.

kevinnk··on You could have invented Parser Combinators
I don't have experience with yacc, but bison can generate errors with almost that exact form. It's even possible to do Clang style underlining, although it takes some hand holding.

That said, usually recursive descent gives better errors but in my experience it's mostly from better recovery.

kevinnk··on Real-Time Garbage Collection Is Real
Maybe you're referring to something else, but std::allocator was in c++98
kevinnk··on IBM Chip Processes Data Similar to the Way Your Brain Does
>>> Why are we doing this to ourselves when we have SO much chip area available now and could scale performance linearly with cost?

Multicore performance doesn't scale linearly because 1) adding more cores has rapidly diminishing returns on performance for most problems (http://en.wikipedia.org/wiki/Amdahl's_law) and 2) the cost of coherency is exponential with the number of cores.

kevinnk··on IBM Chip Processes Data Similar to the Way Your Brain Does
>>> No. This is only true if every instruction tries to access memory.

Every instruction must be loaded from memory in order to execute it. Hence instruction caches.

kevinnk··on Concurrency is the New Memory Management
> Can you safely replay arbitrary C, C++, etc.? No, because side-effecting code could run at any time and occur in any context. So that is one problem that has to be solved first.

With few restrictions, it's actually possible to replay arbitrary assembly. Namely, don't care about timing and no system calls that can't be replayed and you basically have what "checkpoint" does in gdb.

kevinnk··on The Dyslexic Programmer
> "I read quite quickly (though only somewhat accurately) through pure pattern-recognition. I can look at, say, "word" and identify that the second letter is an ‘o’, but if I want to understand it as a concept I ignore the letters involved all together"

Isn't that how pretty much everyone reads? No one looks at every individual letter of each word!

kevinnk··on Software performance is counterintuitive
That's called loop fusion and most optimizing compilers have it.

http://en.wikipedia.org/wiki/Loop_fusion

kevinnk··on The day I left my son in the car
How can you say it's a Western thing when places like Singapore have fines for not flushing the toilet?
kevinnk··on Elm's Time-Traveling Debugger
For C, you could use something like GDB's checkpoint which uses fork to save the current state.
← PreviousPage 6 of 8Next →