Better HN
topnewbestaskshowjobs
Log inSign up

slashdev

17,493 karma · joined May 14, 2013 (13y ago) · 5,498 submissions

Founder of revscope.co

Revenue focused web analytics to help you quickly identify where to focus your effort to best increase revenue.

And embersofvictory.com

Retro turn-based strategy game.

Submissions

comment 6y ago · link · parent

It doesn't seem like a relational database, and eventual consistency is going to make relational constraints problematic.

comment 6y ago · link · parent

As usual, it depends. I was doing binary search within btree nodes, which means small arrays that fit into the cache. Branchless search performed best there. Actually even the btree search itself was branchless (if nodes were in memory) until the end, as the pointer to the next node was just loaded via an index calculation and the loop continued with a binary search of the next node. I did a little software prefetching as well once I had the pointer to the next node.

comment 6y ago · link · parent

Binary search can be implemented using conditional move instructions instead of branching. Given the branches are unpredictable, this yields a huge speedup. It can be implemented like this in pure C, if written in a way the compiler can recognize. In my experience this is the fastest binary search.

[1] https://pvk.ca/Blog/2012/07/03/binary-search-star-eliminates...

comment 6y ago · link · parent

Go uses this technique internally for generating random numbers in a range. I don't remember if it's used in the map implementation or not, just that I found this code and the link to Daniel Lemire's blog post.

comment 6y ago · link · parent

I think you're letting the alarmist journalism alarm you too much.

This is still a slow motion train wreck. It won't affect your life much depending on where you live. Your children and your grandchildren might well be less lucky.

comment 6y ago · link · parent

Maybe. You have a massive capital outlay, so it becomes a tradeoff between saving money on electricity by running only when it's below a certain price and running all the time.

Usually electricity cost doesn't dominate the equation, so it makes sense to run 24/7 (or as close to that as you can get).

Aluminium refining is different, but usually those plants buy dedicated electric capacity from a hydro station at special wholesale rates. It does not lend itself to starting and stopping.

comment 6y ago · link · parent

Yeah, it is a pain with all smelters currently in use. There is maybe an alternative deign that could change that. But the idea here is not to store the energy, but to export it as chemical energy via aluminum.

comment 6y ago · link · parent

> They can't package solar-harvested energy and export it to China

Essentially that's what aluminum refining from bauxite does.

It's also not impossible to build long distance transmission lines that far, but that's a big infrastructure project across an unstable region and the highest mountain range on earth.

comment 6y ago · link · parent

You're right, I didn't think about the difference in terminal velocity.

comment 6y ago · link · parent

We came uncomfortably close sometimes. Like the Russian submarine commander who defied his "party supervisor" when ordered to launch his nuclear weapons during the Cuban missile crises. It was not an isolated incident either. We've been lucky so far.

comment 6y ago · link · parent

> The downside is that your downward speed also increases

You're saying the down component of the velocity vector also increases with the velocity itself. Not that heavier objects fall faster, which we know to be untrue from Galileo's famous experiment. I think you understand that, but I thought I'd clarify it.

comment 6y ago · link · parent

I think my edit and your comment passed each other on the wire.

That makes sense, it gives hardware protection from privilege escalation between VMs on the same host. Be it through a hardware exploit or hypervisor vulnerability.

comment 6y ago · link · parent

I don't see how it protects against meltdown, wouldn't the memory still get decrypted by the escalated access?

Edit: If each VM has it's own key, then they couldn't read each other's memory with meltdown. I think that must be the angle.

comment 6y ago · link · parent

So what does SEV actually protect against?

Something like heartbleed would still happily decrypt and transmit confidential data.

Something like speculative side channel attacks would still speculate on the unencrypted memory right?

Rowhammer would still flip bits, but now one bit flipping would turn an entire 128 bit block into garbage when decrypted? It seems like that would at least make rowhammer a lot harder to exploit into a privilege escalation. ECC memory already gave some limited protection here.

comment 6y ago · link · parent

Yeah, I know, shocking.

I don't know Rust, I've just read the book before and played around with it a little. So using C or C++ would have been a more natural choice - but I like having an opportunity to add another tool to my belt. Compared to learning Go it's been a slog.

comment 6y ago · link · parent

Exactly. How can you have a fair trial if the defence lawyer won't give his best? Just look at the sham justice served if a person can't afford counsel and has to use a public defender. In the US being rich or poor can make the difference in whether or not a person goes to jail for a crime.

I understand people get upset when they help a very likely guilty person get off (OJ Simpson anyone? see the point about being rich above.)

But defence lawyers have an important job, irrespective of who they're representing or what they're alleged to have done.

comment 6y ago · link · parent

This mirrors my experience with Rust. That said, I'm currently creating a shared library in Rust because it seems to be the best tool for the job.

If it needs to run in the browser, or React native, I use TypeScript.

Else if it needs to run on the JVM I use Kotlin.

Else if performance doesn't matter and the project is small, I use Python.

Else if I can use a garbage collector, I use Go. Because why manually manage memory with the borrow checker in Rust if I can let the runtime handle it?

Else Rust. Because I don't want to mess with C++ anymore.

comment 6y ago · link · parent

Immigration is a must if you don't have a high enough birthrate to sustain economic growth - because we don't know how to manage a declining economy - and why would you accept that when you have the tool of immigration? Not because there is any fundamental need for a racially or culturally diverse population. Those things seem like they would be beneficial in my opinion, but not required.

comment 6y ago · link · parent

There was no alternative really, China would have just seized HK by force. Jolly good show by the Brits to standby the people of Hong Kong though with this immigration offer. Politicians rarely do the right thing instead of the self-interested thing, but you have to hand it to Johnson's government on this one.

comment 6y ago · link · parent

We're warming about 0.2C per decade. So, even assuming that accelerates we're going from a current 1 C change since per-industrial times to 2 C change in average temperatures. I'm going to call that a little compared to what's coming over the next couple centuries.

comment 6y ago · link · parent

This is true, but the relative magnitude of the change does matter, and it's very low over the last century, just 1.0 F.

Even if it goes up 2.0 F in the next 40 years, it's still a relatively small change that is not likely to reduce forest cover in any measurable way.

I'd worry more about human activities that are reducing forest cover at a serious rate.

comment 6y ago · link · parent

> At the current pace of warming, much of the world will be inhospitable to forests as we know them within decades. The extinction of some tree species by direct or indirect action of drought and high temperatures is certain. And some recent research suggests that, in 40 years, none of the trees alive today will be able to survive the projected climate.

That is so ridiculous. Temperatures within 40 years aren't going to change by much more than they've already changed over the past 100 years. Did most forests die off and vanish? No, in fact the extra C02 in the atmosphere, and warmer climate is beneficial for tree growth - if only we weren't clearing the forests we'd have more trees today. The earth has been hotter than where we're headed with global warming. It was heavily forested at that time. To be extra clear, none of that is saying global warming isn't a huge problem, just that forests dying off probably isn't the part to worry about.

Articles like this do climate science a serious disservice and give people reason to doubt climate change - they're counter productive.

3533.

Fake kelp walls to prevent shark attacks(theguardian.com ↗)

1 points · by eloff · 6y ago · discuss

3534.

Which CPUs, if any, had an 8-bit address space?(retrocomputing.stackexchange.com ↗)

1 points · by slashdev · 6y ago · discuss

comment 6y ago · link · parent

Or fly it out of a private airport without as much irritating stuff, much like private jets do today.

comment 6y ago · link · parent

That you can't capture all constraints in s type system does not make a type system unnecessary.

You still drive value based on how much of the correctness checking you can offload to the compiler.

I don't really get why programmers better than anyone understand the value of automating work with a computer, but fail to grasp that value applied to their own craft. Let the computer do more of the work in making sure your program is correct.

comment 6y ago · link · parent

So, basically where AWS is headed.

I joke, but there's a grain truth there.

comment 6y ago · link · parent

I just implemented an iterator in rust yesterday. After having done it in c++ back in the day, I was blown away by how easy and powerful it is.

comment 6y ago · link · parent

That it can be done doesn't mean is the optimal approach.

I was a diehard fan of dynamic languages for a decade, but eventually I saw the light.

I still use dynamic languages daily, but the bigger the project the more I want proper static typing. None of that mypy stuff, the real deal.

comment 6y ago · link · parent

> But if you're absolutely sure you need to be planning to run at close to Twitter or Facebook scale one day, then yep, you'd better architect from the beginning not to use joins.

No, both of them started with MySQL. If you make it, you have plenty of resources to throw at the scaling problem, it's a good problem to have. A bad problem to have is running out of money and shutting down because you over engineered from the start. Don't do that. Most startups fail, and you're no exception. Build one to throw away, and if you're lucky enough to succeed, you can use your new-found resources to rebuild what needs to be rebuilt.

1
117118119
184