HNHacker News
TopNewBestAskShowJobs

Ded7xSEoPKYNsDd

384 karma · joined September 14, 2014

submissionscomments
Ded7xSEoPKYNsDd··on Useful GCC warning options not enabled by -Wall -Wextra
Unless you enable -Wsystem-headers, GCC doesn't warn about things in system headers, so for noisy headers it's easiest to mark them as such (with -isystem <dir>).
Ded7xSEoPKYNsDd··on Std::visit is everything wrong with modern C++
The OOP pattern dfox is referring to would look something like this:

    class AbstractChoice:
        # defines all common operations on choices
        # plus potentially some useful stuff on top of those
        pass
    class Good(AbstractChoice):
        # conatins the code specific to good things
        pass
    class Bad(AbstractChoice):
        pass
    class Ugly(AbstractChoice):
        pass
This isn't a straight-on replacement though. It's especially bad when you want to separate your concerns not along the good-bad-ugly-axis but something different (which is when you'd e.g. go on to use mixins, or that ugly visitor pattern we've seen in the OP).
Ded7xSEoPKYNsDd··on What's So Bad About Posix I/O?
Ntfs-3g uses FUSE and directly accesses block devices.
Ded7xSEoPKYNsDd··on C compiler undefined behavior: calls never-called function
It might be what you expect for that particular compiler, but there's no guarantee. A different compiler might decide that because `Do` has only two possible values, that it should replace the dynamic function call with an if condition deciding between two static function calls like I did here manually, to trigger the bug again: https://godbolt.org/g/kWcvvb
Ded7xSEoPKYNsDd··on Puppeteer: Headless Chrome Node API
If I'm reading [1] right, you want to use getBoundingClientRect() instead of clientHeight, which does not account for borders and margins.

1: https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_...

Ded7xSEoPKYNsDd··on Don’t ruin streaming by turning it into cable
I think gp is talking about DSL, not satellite internet.
Ded7xSEoPKYNsDd··on The world in which IPv6 was a good design
There is a straight-forward mapping of the IPv4 address space into IPv6 (you can do ping6 "::ffff:127.0.0.1"), and for new development that is also by far the easiest way to support both protocols: the application does everything in IPv6, and without writing a single line of code, the OS takes care of transparently using IPv4 when needed.

There is no mapping back from IPv6 to IPv4 (so IPv6 is backwards compatible, but not forwards compatible), but it can't be because the whole point is to have a larger address space.

Ded7xSEoPKYNsDd··on Tinychain: a pocket-sized implementation of Bitcoin
Yes, if the next block by an honest miner is very quick it will pick a timestamp of (wrong_timestamp + 1) instead of the actual time, but after a few blocks they will certainly able to use the correct time again.

But even if all miners decide to do as you say and always pick a date slightly in the future but inside the wiggle room, all that they achieve is a one-time very slight difficulty decrease, but by the next difficulty adjustment that's already lost because by then both the start date and end date of the period are offset by the same amount into the future.

Ded7xSEoPKYNsDd··on Tinychain: a pocket-sized implementation of Bitcoin
In my toy blockchain implementation, I just went with two constraints: 1) every timestamp must be strictly larger than the one of the previous block (this makes difficulty calculation easier) 2) timestamps may not be in the future (except for a little wiggle room for unsynchronized clocks)

My reasoning was roughly as follows:

Miners are incentivized to pick very large timestamps, because the longer it takes to mine X blocks, the easier becomes the proof of work they need to solve, giving them more block rewards and transaction fees in the long run. But if they want the network to accept their blocks, they can't pick timestamps in the future, so the best they can do is pick the current time as their timestamp.

Ded7xSEoPKYNsDd··on How I implemented my own crypto
The ARM Architecture Reference Manuals are full of "if you do X, the instruction is UNPREDICTABLE".
Ded7xSEoPKYNsDd··on How I implemented my own crypto
Random delays do not protect against timing attacks. Best thing it can do, is to force the attacker to collect a few more timing samples. (To the point where the the random noise averages itself out.)
Ded7xSEoPKYNsDd··on Startcom CA applies for inclusion in Mozilla
> After acquisition it is now in-house...

I first parsed this differently, too, but I think they just bought some software for PKI services, not the software company.

Ded7xSEoPKYNsDd··on ZFS on Linux v0.7.0 released
For each chunk of on-disk data, the fs stores which devices it is stored on and the used parity configuration. You can take one such chunk of data, and clone it into a new chunk with identical contents but a different parity configuration in the free space of the devices that are part of the file system. (Just like you'd allocate new chunks for storing new files in the same parity configuration). Once that copy is created, all references to the old chunk are changed to point to the new chunk and so the old chunk is now free space. Repeat this process for all chunks in the file system, and the whole file system is converted to use a different parity configuration.
Ded7xSEoPKYNsDd··on OpenBSD switches the default compiler on amd64 and i386 to clang
Correct me if I'm wrong, but I think a compiler that doesn't do link-time-optimization has to assume that the _spinlock() function can write to mutexp (e.g. through a global variable), and therefore it cannot reorder anything around it.
Ded7xSEoPKYNsDd··on ZFS on Linux v0.7.0 released
Btrfs supports it. The parity stays exactly where it is, but new files will use the new device. You can (and far too often have to, when btrfs decides there is no free space left) also perform a 'balance' operation, which recreates all the b-trees on the disks, optionally with different parity options.
Ded7xSEoPKYNsDd··on Android Killed Windows Phone, Not Apple
Back then, it was said they earned more money per device from OEMs making Android through patents (e.g. FAT) than OEMs making Windows phones.
Ded7xSEoPKYNsDd··on Fedora Loves Python
Yes, venv is supposed to be part of the stdlib in Python 3. But that is not the case on Debian. You need to install the python3-venv package to get it. That's what I and that Fedora page are talking about.
Ded7xSEoPKYNsDd··on Avery’s laws of Wi-Fi reliability
How warm is it at your place? I've been quite successful avoiding router lock ups by adding some active cooling: take an old PC fan, solder it to the power wires of an old USB cable, connect that cable to the router (assuming your router has an active USB port).
Ded7xSEoPKYNsDd··on Fedora Loves Python
It's a subtle stab at Debian-based distributions, where pip and venv are only available as optional, non-default packages. (I think Debian really wants people to use apt to install things.)
Ded7xSEoPKYNsDd··on Return to abort() – Using code introspection to prevent stack-smashing
The problem with per-function cookies are dynamic calls. The only feasible options I can think of is are either a) a secondary cookie that is allowed from all functions or b) a shadow stack with the cookies.
Ded7xSEoPKYNsDd··on Everybody lies: how Google search reveals our darkest secrets
Incognito mode doesn't do anything to hide your location or IP (basically the same thing on non-mobile). It's really just meant as a porn mode: nothing you do is saved to disk.
Ded7xSEoPKYNsDd··on OpenBSD Will Get Unique Kernels on Each Reboot
You could just feed the individual kernel symbols in a canonical order (i.e. sorted) to the checksum algorithm. It's a bit more involved, but since boot loaders like Grub already have ELF parsers, it shouldn't be too hard.
Ded7xSEoPKYNsDd··on Systemd can't handle the process privilege for username startswith number
If you read the whole bug, you'd see that's not true. The parse for a number fails, and therefore the directive is ignored (with a warning in the journal). Without a (valid) user setting, services are started as root.
Ded7xSEoPKYNsDd··on Reasons to Switch from Chrome to Firefox
FWIW, when you middle-click the back button (to go back in a new tab) in Firefox, history is cloned, too. (At least on Nightly.)
Ded7xSEoPKYNsDd··on Getting compilers right: a reliable foundation for secure software
The compiled code is also a lot slower. https://www.cis.upenn.edu/acg/softbound/
Ded7xSEoPKYNsDd··on D Language accepted for inclusion in GCC
I don't think web servers clarifies much, though. The most important web servers (Apache, nginx, ISS, etc.) are all written in C or C++, and they try to squeeze out every bit of performance they can. I guess we're talking about applications communicating over HTTP, but that's not my first thought when I hear someone talking about web servers without any more context.

(I'm aware of Caddy, but my understanding is that it's aiming for ease of use over performance.)

Ded7xSEoPKYNsDd··on Important security vulnerabilities in OpenVPN
Why not change asserts (they are macros after all) to tell the fuzzing library that it found an error? Finding bugs is the whole point of the exercise, isn't it?
Ded7xSEoPKYNsDd··on Amazon Said to Plan Cuts to Shed Whole Foods' Pricey Image
"Change inventory": it's not the same food.
Ded7xSEoPKYNsDd··on Debian 9 Stretch released
I'd expect most packages to be EOL from the perspective of upstream by then. It's a normal thing for distributions to backport fixes, sometimes even develop them themselves when required.
Ded7xSEoPKYNsDd··on America’s new tobacco crisis: The rich stopped smoking, the poor didn’t
I don't think your numbers for Germany are right. According to [1], the rate is 25% for people aged 15+. It's twice as high for people of low social status compared than people of high social status [2].

[1] https://en.wikipedia.org/wiki/Smoking_in_Germany [2] http://edoc.rki.de/oa/articles/reEi8wDOV3B1g/PDF/25UH9cUwefu... page 4

← PreviousPage 2 of 8Next →