Better HN
topnewbestaskshowjobs
Log inSign up

devit

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

Submissions

comment 6y ago · link · parent

What is the advantage compared to the traditional method of getting a single Linux system or VM, installing the needed packages via apt/yum, rsyncing over your code (if any) and installing systemd units for anything that needs to run all the time or scheduled?

Are Helm charts easier to use or more prevalent than distribution packages?

842.

Italy PM Conte: 'We are closing down all non-essential businesses.'(translate.google.com ↗)

1 points · by devit · 6y ago · discuss

comment 6y ago · link · parent

The simplest solution is to not buy it, and only buy non-perishable food instead and multivitamin pills if necessary.

comment 6y ago · link · parent

The problem is that businesses have been setup in such a way that they can't just stop spending money when they aren't earning any money.

But this can mostly be fixed by law, with a law that retroactively changes all rent, leasing, mortgage, employment contracts and in general any contract that involves periodic or future payments to be stopped at will, subject to no longer enjoying the service or product.

Then they can just stop paying rent and paying employees and cancel all supply deliveries, since they no longer need those, and they will not lose any money.

Then add a temporary UBI and a ban on actually evicting from rented spaces (since the economy is shut down, and thus there would be no other tenants) so that people can still have a home and food.

comment 6y ago · link · parent

The documentation for crates, modules or struct/enum often contains a "user guide" for the item in question.

I think that's better than a separate book, since in most cases that separate book would never get written.

comment 6y ago · link · parent

Moving to C++ seems wiser than using a dubious hack like this.

comment 6y ago · link · parent

The web is essentially becoming what you propose, with WebAssembly binaries, WebGPU graphics, WebAudio API.

Currently you need an HTML and JavaScript shim to use those, but it's easy to remove it and execute WebAssembly directly.

comment 6y ago · link · parent

> order to manage memory the way the borrow checker wants, the programmer is at best tempted, and at worst forced, to add complexity to the program

Dubious claim; in fact, the opposite seems true, since simpler code passes the borrow checker more easily

comment 6y ago · link · parent

Nothing is lost or vanishes, it's just a change in the ratio at which people are willing to exchange two assets.

comment 6y ago · link · parent

The Italian strategy is simply to try to prevent running out of ICU beds or at least minimize the number of people that can't get IC in the short-term due to the current uncontrolled spread.

As far as I can tell, what to do long-term is still up to debate, and continuing the lockdown only for higher-risk/older people is certainly an option.

Note however that jumping straight to such a differentiated lockdown seems much less likely to work, because behavior changes are easier in a total lockdown with full media and discourse focusing on it, as well as much easier enforcement since you don't have to distinguish the high-risk people.

comment 6y ago · link · parent

I think these claims of "this is not acceptable in the West" are absurd and one of the causes of the current catastrophe.

All you need is to pass a law and enforce it with police and military, it's not hard.

Since there is a good reason for the law, there won't be widespread resistance, and in fact on balance citizen are likely to help enforcement rather than hinder it.

comment 6y ago · link · parent

Note that Rust's "Cow" type is NOT an analogue of copy-on-write C++ strings.

The correct analogue in Rust are the Rc and Arc types, and the "make_mut" method that clones the data if and only if there is more than a reference.

Also the claim that "Rust’s COW implements the Send and Sync traits, which due to Rust safety requirements, means the implementation is designed to be used in multi-threaded applications" is technically true, but highly misleading, since Cow of course doesn't have interior mutability, and so can't be modified if shared between multiple threads (unless put in a Mutex or equivalent container) and it's Send and Sync because all "simple" types do, and not because it's "designed" to be so.

Overall, the author doesn't seem very knowledgeable about Rust.

comment 6y ago · link · parent

VB.net is already equivalent to a subset of C#, and it can mostly be automatically translated.

comment 6y ago · link · parent

The C programming language strikes again.

comment 6y ago · link · parent

People should not handle any package for at least 3 days after reception assuming this paper is correct (unless they manually disinfect it).

EDIT: actually the paper doesn't seem to conclude that 3 days is enough, and instead than an unknown number of days, but at least 3, is required, at least relative to their detection method

comment 6y ago · link · parent

A transmissible disease that has already overwhelmed hospitals in another country and is spreading uncontrollably in yours seems a good criteria.

comment 6y ago · link · parent

I think they are not enough, and that instead everyone should be forced to stay home and only go out if it's essential for their own or for other people's survival (e.g. buying food, working at jobs related to medicine, food, utilities, etc.); furthermore all non-essential travel (i.e. pretty much everything except delivering supplies) should also be blocked.

Currently people are, in part, still going to work even at non-essential jobs, non-essential shops are still open and enforcement is very limited.

comment 6y ago · link · parent

The problems seem to be that the person may not know the information and the information may not be easy to verify.

Wouldn't that make torture potentially effective in cases without those issues, such as torturing someone to get them to reveal a password to an encrypted device that you know they use daily?

comment 6y ago · link · parent

But if users don't care, why do platforms care? Maybe it's actually a reliable signal?

Obviously it's also more reliable in the context of other evaluations by the same reviewer which the platform has easy access to, i.e. if someone always gives 5 stars, then a 4 star review from him is much worse than one from someone who never gives 5 stars.

comment 6y ago · link · parent

Do users really evaluate like that?

For me, it's pretty obvious that rating is arbitrary and depends on how optimistic/perfectionist/obsessive/etc. the reviewer is and that there is not much difference between 4 or 5 stars.

comment 6y ago · link · parent

The problem is that current dating apps consist of choosing people whose in-person behavior (as well as resources in some cases) you care about based on self-selected photos and their ability to write text messages, so it's pretty obvious it doesn't work very well.

comment 6y ago · link · parent

Is there any betting market that is taking bets and has good volume on whether there is going to be a novel coronavirus pandemic?

That seems like the only way to get some clarity on this.

comment 6y ago · link · parent

The purpose of such a team building exercise is not to help the sick kids, but rather to do something that requires a lot of cooperation and interaction with your coworkers, so that you can get to know better their personality and behavior, and create habits and make emotional changes in the way you interact with them, which can in theory make you more effective at later working with them on problems that the company cares about.

Of course, it's not necessarily an effective use of time.

comment 6y ago · link · parent

I don't think it's socially unacceptable to hire someone or purchase something for the benefit of a friend in general, especially if you are in a better position to do so than the friend (e.g. you run a service company in that field or are much wealthier than the friend).

However, in the particular case of moving, a friend might not want an untrusted stranger handling their belongings, so you would need their consent and they might not give it.

comment 6y ago · link · parent

Currently the Linux kernel disables preemption inside spinlocks and interrupt handlers, and these code sections are not necessarily carefully written to be short and constant-time, so you can in theory get in a situation where all cores are running spinlock or interrupt handler code from low priority threads for arbitrarily long times, preventing higher priority realtime threads to run (which in practice means that whatever hardware you are controlling will be uncontrolled, and thus your self-driving car, rocket, plane or industrial machine might be destroyed).

The PREEMPT_RT patch solves this by reimplementing all kernel spinlocks as mutexes with priority inheritance that are fully preemptible and all interrupt handlers as preemptable threads.

The result is that if you have a bunch of real-time process/thread that do not make system calls, it's guaranteed that in a bounded amount time the highest priority set will be running.

If you do however make system calls (or even if you cause page faults because you didn't call mlockall() and accessed non-mlocked memory), with the exception of some system calls that provide better guarantees, then you can still have kernel spinlock contention with other threads that may hold the same spinlock for an unbounded amount of time, so the system is more limited than dedicated real-time OSes that are careful about this.

comment 6y ago · link · parent

Only those that emit LLVM code that can be optimized like this.

In poorly performing languages like Python and Ruby calling a method on a value (like sum() or even the += operator) essentially means looking up the method name in a hash table, and then doing a dynamic function call on the resulting function pointer, so this sort of optimizations cannot be done in an ahead-of-time compiler unless all objects are created locally and thus have known method dictionaries (and even then, it depends on whether they are available to the compiler in IR form, whether the lookup code is inlined and whether the code can actually be simplified).

comment 6y ago · link · parent

In this assembly code it cannot overflow because N is a 32-bit integer and the multiplication gives a 64-bit result, which is converted to 32-bit only after shifting.

I can't figure out why it doesn't use the simpler formula (other than the optimizer being bad).

comment 6y ago · link · parent

As far as I can tell Zig only has C-like malloc/free-based allocation and thus is vulnerable to use-after-free, and so does NOT help you write safe code.

It also doesn't seem capable of safe concurrency.

comment 6y ago · link · parent

As far as I can tell Zig is equivalent to a subset of C++ and thus completely lacks all the guarantees that Rust provides and several of the features that C++ has; so there is no point to use it instead of those languages.

comment 6y ago · link · parent

The reason that it's popular is that it's immediately clear that Rust's model of memory safety without a GC and safe concurrency is the best way to create a programming language since it unifies the memory safety of GC languages like Java, the efficiency of C and the concurrency of message-passing systems like Erlang in a single language that has none of the drawbacks of those systems.

Before Rust, everyone simply assumed that it was impossible to create such a programming language since it would have otherwise been what everyone used, and now that it turns out that it's possible, it's clear that it's the best solution and what should be used in the future whenever possible.

1
282930
51