Better HN
topnewbestaskshowjobs
Log inSign up

devit

4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions

Submissions

comment 4y ago · link · parent

I think the biggest issue is the lack of arithmetic with overflow checking, especially with a variant that calls a location in a control register on overflow.

This makes it very inefficient to compile languages that would like overflow checks on all arithmetic.

comment 4y ago · link · parent

How can a Bitcoin transaction be fraudulent?

They are irreversible and if the Bitcoin is stolen that's not the merchant's problem.

The whole point of Bitcoin is to eliminate the possibility of chargebacks and thus the need for merchant to care about whether the buyer is in good faith and whether the money is stolen.

comment 4y ago · link · parent

PageRank-like system, ideally based on real identities? (i.e. depending on how often the recipe is linked from Facebook, etc.)

Also if you are specifically doing it for recipes, just select manually websites that have precise ingredient amounts, very detailed and explicit recipes, that explain the reasoning behind each step, provide photos of how things should and shouldn't look like, why the proposed technique is optimal and/or the tradeoff of alternative techniques, the chemistry involved, comparison with other recipes, etc. (although in my experience most or all recipe sites are horrible and aren't even vaguely close to something like this)

comment 4y ago · link · parent

Here's a gift for you:

inotifywait -m -e create "$(xdg-user-dir DOWNLOAD)"|while read d e f; do chmod +x "$d/$f"; done

You can add "-r" if you want to also do it on subdirectories, and you can specify another directory instead of the default downloads directory.

Though I don't really recommend doing this since you should not be executing downloaded binaries often enough for this to be worth doing.

comment 4y ago · link · parent

I think Google should just remove all pages with affiliate links from its index (which of course includes detecting all the ways to defeat that like URL shorteners, redirect pages, JavaScript hackery, giving a different version to the crawler, etc.)

Every time you search for "best X" you'll find a page with low-effort copied or write-for-hire content design to get you to click on Amazon affiliate links as opposed to what you are looking for, which is an actual review by someone who is an X enthusiast, personally bought and tested all the options and is eager to share their findings.

comment 4y ago · link · parent

> What if I want to play with my friends who aren’t on Linux? Oops we removed cross platform capabilities.

You can play with them just fine, but if you use match making you would only be matched with other groups where there is at least one person running Linux.

> Also making all the players who can’t run anti cheat play together means almost any individual non-cheating player will be overrun by the cheaters and essentially pushed out of the game.

Just because people can cheat doesn't mean they will in significant enough numbers.

Also the so-called "cheating" is just a perfectly normal way to use a general-purpose computer to run code of your choosing and to automate tasks, so you can do it as well if you want, and it's perfectly normal that if you refuse to automate your performance may suffer since you are using an inferior strategy.

comment 4y ago · link · parent

There's a very simple solution for the anti-cheat problem: make Linux users play only with each other (this also applies to other platform users who refuse to run the anti-cheat).

I'm quite skeptical about their argument though, since on Windows you can also disable secure boot and then run a custom kernel or a custom hypervisor, so it's only valid if their anti-cheat rejects all Windows hypervisors and also checks the integrity of the Windows kernel (in this case it's still of course not secure, but the anti-cheat itself would need to be patched to defeat it).

comment 4y ago · link · parent

The normal non-Google way is to configure initramfs to start an SSH server on a non-default port, and then you log in (from your secure workstation with a dedicated public/private key, of course) and use systemd-tty-ask-password-agent to enter the disk encryption key.

You can then monitor whether your service is up, and if you get a notification that it's down use the hosting service's management interface to reboot the machine/VM and then do the SSH thing.

comment 4y ago · link · parent

Not sure why it would be so hard.

All you need is a centralized authentication server (preferably including access logging) and a simple way to use it for all applications (the simplest is to have the app listen on localhost and expose it via nginx configured to use the authentication service).

I guess for real security you also need to forbid logins from non-secure devices, which is trivial if you can trust employees and only hire security-competent engineers, and otherwise needs dedicated devices, secure boot and remote attestation (which is also easy but will take some work to do).

comment 4y ago · link · parent

An hosting service is the only solution since otherwise the website will be down when the Mac is rebooted or moved if it's a laptop.

The service in this article is either for development purposes or for people who are running dedicated home servers (which means they have a Linux desktop that they keep on 24/7 without rebooting and are usually programmers and/or system administrators).

comment 4y ago · link · parent

For new flags, this is easily solved by generating and compiling (via generic monomorphization, macros or build-time code generation) two versions of all the relevant code (including of course any loops calling the relevant code) and switching the one that is executed depending on the value of the flag.

comment 4y ago · link · parent

I read it, and it seems to work like this:

1. First, make all memory ABA-free, which the paper does in two ways. The first, for CPUs with 128-bit compare-and-swap, is to simply use a 64-bit counter and 64-bit value; the second appears to use a 16-bit epoch and 48-bit pointer value and seems to work by delaying freeing until nobody is in the middle of an operation using that epoch

2. Then, to execute an operation on a data structure using this scheme, a compare-and-swap is used to register a "descriptor" consisting of a pointer to the function performing the operation, its arguments, and then a "log" of values that are initially empty

3. To perform a read, the value is read for memory, and then a compare-and-swap from empty of a log entry is done (incrementing the current log position for the current thread), returning the value from the log entry if someone had already recorded it

4. To perform a write, first a read is performed as described above, and then the write to memory is done with a compare-and-swap from the value read as above

5. If when performing an operation a descriptor already exists, then the operation in that descriptor is executed, and then a compare-and-swap with the empty descriptor is done, and the operation is retried.

So basically at the cost of turning all memory into tagged values and significantly higher overhead, any algorithm with locks can be made lock-free (as long as there are no external interactions such as system calls or MMIO access, or they are idempotent).

The way it works is that the compare-and-swap on the descriptor and the log positions effectively create a global order on all memory writes, and the tagging of all memory locations and stores with compare-and-swap result in a write having no effect if that write has already been performed. The system is lockless because if another thread is in the middle of operation, then it's safe to have the current thread run it as well from the begining.

However, it appears there is no guarantee of a single thread making progress, i.e. a thread could indefinitely find another operation in progress and execute it and never find a window to register and execute its own. This might fixable by allowing threads to queue operations even if some other operation is in progress.

As expected, their experiments show that this scheme is slower than simply taking locks unless there are significantly more threads than cores, in which case this scheme avoids the problem of having to wait on another thread that has been preempted while holding the lock, and thus potentially have very frequent context switches.

comment 4y ago · link · parent

The document uses a monospace font, and the redacted name can be seen to be 10 characters long.

Based on the 2019 Fortune 500 list, that gives these possible candidates: Activision, Alaska Air, Albertsons, Altice USA, Amazon.com, Ameriprise, AutoNation, BB&T Corp., Bed Bath &, Blackstone, Booz Allen, BorgWarner, Burlington, CBRE Group, Chesapeake, CMS Energy, CVS Health, Dean Foods, DTE Energy, Enterprise, Eversource, Expeditors, Fannie Mae, First Data, Ford Motor, Home Depot, Huntington, JM Smucker, Jones Lang, Laboratory, Mastercard, McDonald's, Murphy USA, Nationwide, News Corp., NGL Energy, NRG Energy, Occidental, PBF Energy, Prudential, PulteGroup, S&P Global, State Farm, Unum Group, US Bancorp, WEC Energy, Windstream, World Fuel, WR Berkley, Yum Brands

comment 4y ago · link · parent

Not clear how a lower bound on the absolute value of the difference of any two of the square roots would help give a lower bound on the absolute value of the difference of the two sums of square roots.

comment 4y ago · link · parent

Does that actually work?

It seems that the degree of minimal polynomial having as root the sum of N square roots might be up to 2^N, and if you then apply the bound at https://en.wikipedia.org/wiki/Geometrical_properties_of_poly... (where n = 2^N) you get a bound on the order of at least 2^N digits (more precisely 2^N (N + D)).

So it doesn't seem to lead to a proof of a subexponential number of equal digits, unless the degree of the minimal polynomial is actually subexponential.

comment 4y ago · link · parent

Currently it's 50x slower than JavaScript ([https://benchmarksgame-team.pages.debian.net/benchmarksgame/...], look at n-body which is just straightforward math), and apparently they are looking to achieve 2x speedup and maybe 5x later, so not very useful.

comment 4y ago · link · parent

Would also be nice to create a TypeScript variant with a sound type system, and this might be a better project for creating it than tsc.

comment 4y ago · link · parent

Yeah, the current problem is that Idris code is far less efficient than Rust code, because Idris boxes everything and erases all types, and also Idris's support for borrowing seems less powerful than Rust (it lacks first-class mutable borrows as far as I can tell).

It seems that fixing this is a research problem, which would lead to the holy grail of programming languages, i.e. an ultimate language that is as expressive as Idris and as efficient as Rust, and is thus essentially perfect.

comment 4y ago · link · parent

It's the minority of the total spend, but it seems the hosting costs are too high.

For example, they are paying $266/month for 16 thread 128GB 3.8TB SSD, but you can rent a better machine for 99$/month from Hetzner (AX61-NVME).

They are also spending $40k/year on "data protection services" (?!?) and 60k for "site moderation" (they could instead not moderate or rely on third-party forums and messaging services they don't need to moderate).

comment 4y ago · link · parent

The concept is cool but the implementation seems to be completely wrong.

For example, look at New York City around dusk, and if you zoom out it's mostly yellow, but if you zoom in it's mostly black.

comment 4y ago · link · parent

It's surprising to me how software developers, supposedly very rational, cannot come to the obvious conclusion that the correct coding style is to have unlimited line length and using tabs for indent.

The reason that's the best choice is that it's the approach that provides logical data rather than a specific visual style, allowing people can just configure their editors to do word wrapping to whatever line length they prefer and set tab width to whatever value they prefer (including fractional values!), so it's strictly better than all alternatives.

And if someone doesn't like the editor word wrapping, they can always write an extension or patch for the editor to wrap in whatever syntax-aware way they want.

Also, while for some other bizarre reason it's traditional to program with monospace fonts, there is in fact no reason at all to use them instead of the more efficient proportional fonts, and if you use proportional fonts the concept of a length limit is meaningless.

comment 4y ago · link · parent

Is this secure? (i.e. does this prevent a malicious VM from fully taking over the host, writing arbitrary GPU memory, reading arbitrary GPU memory, corrupting other GPU memory or state, crashing the GPU)

Apparently the web people decided to create WebGPU instead of adopting Vulkan in part due to security issues, and I see no mention of security on the Mesa documentation.

comment 5y ago · link · parent

Looks like only transactions are "slow", where "slow" means 2ms, which is perfectly acceptable since it needs to wait for disk commit.

So the problem is that the author is using it wrong, since you only need to wait for transaction commit when you need guaranteed durability, and you only need guaranteed durability when you are communicating success to the user or some other system, which only needs to happen every frame, which is 16ms at 60fps which is plenty of time to wait for a 2ms transaction commit (network communication can also be throttled to the framerate).

So in practice all you need to do is batch writes in a single transaction per frame and there is no problem.

And of course if you don't need durability you can just keep the data in the JavaScript heap (and use inter-tab communication if needed).

comment 5y ago · link · parent

As weird as it may seem, it looks like that there may be people willing to pay positive sums of money to go to Mars even without a return ticket.

comment 5y ago · link · parent

I believe most BIOSes don't let you boot partitions, but only disk MBRs.

You can however install GRUB to USB stick and boot the USB stick from the BIOS. This also protects your Linux install against any Windows malware that doesn't change the BIOS if you are careful to remove the stick before booting Windows, put /boot on the USB stick as well and encrypt the Linux partition.

comment 5y ago · link · parent

Probably best to use a subdirectory, and probably even better to loop mount ext4 on a file instead of using ntfs directly.

comment 5y ago · link · parent

The point of dithering was simply that old graphics cards (e.g. VGA) only supported 16 or 256 colors.
1
131415
51