Better HN
topnewbestaskshowjobs
Log inSign up

sluukkonen

173 karma · joined Mar 28, 2013 (13y ago) · 60 submissions

Submissions

comment 1mo ago · link · parent

It’s easier just to use a proper decimal type than to remember all of the ways where using floats will bite you in the ass. The behavior is unintuitive even in trivial examples. Code like

  amount_due = 0.10 + 0.20
  amount_paid = 0.30
  
  if amount_paid >= amount_due:
      print("PAID")
  else:
      print("OUTSTANDING")
will print “OUTSTANDING”.

comment 5y ago · link · parent

Isn’t that kind of implementation blatantly illegal, though?

comment 8y ago · link · parent

Would've making regular assignment an expression broken too much existing code?

comment 9y ago · link · parent

There is some work underway.

https://github.com/tc39/proposal-bigint/blob/master/README.m...

comment 9y ago · link · parent

I have no idea why the C++ designers chose those particular names, but at least Scala uses the same Promise/Future dichotomy, where you resolve (or reject) a Promise into a Future. Perhaps they drew from the same well?

comment 9y ago · link · parent

There's also an updated version of the episode that they aired this year.

http://www.radiolab.org/story/update-crispr/

comment 10y ago · link · parent

I have no experience with SQS, but there is definitely space for a simpler queue implementation (or even a standard) than AMQP. I think it's needlessly complex for many problem domains.

comment 10y ago · link · parent

Here's one example. Web browsers often use bloom filters or similar data structures to check for malicious URLs. They first check the URL against the local bloom filter, and if a match is found, they double check against an online API to make sure it wasn't a false positive.

Shipping a full list of malicious URLs would be too expensive, but a bloom filter fits in a fraction of the space and can still eliminate a vast majority of the API calls.

comment 10y ago · link · parent

That's Norway. The other Nordic countries weren't lucky enough to have significant numbers of oil.

comment 10y ago · link · parent

Not the American pronounciation!

comment 10y ago · link · parent

The y is pronounced like the ü in über.

comment 10y ago · link · parent

> Imagine if that lone guy at Microsoft didn't figure out trick with 286 protected mode that allowed Windows to survive and wasn't heard by top management - we would all be running OS/2 10 now.

I haven't heard this story before. Got a link?

comment 10y ago · link · parent

CSGO does as well.

comment 10y ago · link · parent

Going above 32G doesn't kill performance per se, it just means that there is not point in using heap sizes between 32G and 48G due to the larger pointers. If you go above that, it's all good again.

comment 10y ago · link · parent

It's a nice tool, I use it daily. Right now my only gripe is that it doesn't format (PostgreSQL) JSON columns in any way, so if you're storing a lot of JSON data, it can be difficult to view.

comment 12y ago · link · parent

During the hottest days of the summer (it very rarely goes above 28C or so - average maximum temperature is around 22C during the hottest summer months in southern Finland), yes, but not that often.

comment 12y ago · link · parent

Music isn't obviously not the focus of any Twitch stream, but nevertheless, people are breaking copyright laws by playing copyrighted music on their streams. And if Twitch becomes a part of YouTube, they might have to crack down on copyrighted music on streams, due to pressure from the copyright holders.

comment 12y ago · link · parent

All major Ruby implementations use OS threads, but the GIL still limits parallelism in MRI.

comment 12y ago · link · parent

Looks like it's clear now. Colin Watson voted for Upstart[1], so systemd wins.

[1] https://lists.debian.org/debian-ctte/2014/02/msg00332.html

comment 12y ago · link · parent

> Without concurrent request dispatch, jruby's hypothetical greater thread parallelism is unlikely to effect requests-per-second benchmarks. Also, the benchmarking test would have to be willing to issue requests concurrently!

That's a good point.

That said, JRuby would most likely benefit from a concurrent test, as the thread-per-request model of JRuby can scale much higher than the process-per-request model which is used a lot in the MRI world.

comment 12y ago · link · parent

I'd wager that it's the TB/Undertow code running most of the time on that benchmark. On real-world benchmarks the difference is going to be a lot smaller. Not saying that you shouldn't run your JRuby apps on Torquebox - it's a great choice.

comment 12y ago · link · parent

Looks like it's running with the threadsafe mode off. That would probably give JRuby an edge, as it's able to take advantage of greater thread parallelism than MRI. No idea if he's letting the JVM warm up enough either.

comment 12y ago · link · parent

Ah, that's too bad. It would be nice if setting user-scalable=no was all you had to do to disable the delay. And anyway, despite using an iPhone for god knows how many years, I didn't even know that a double tap on iOS scrolls the page!

Edit: I mean double tapping on an unzoomable page.

comment 12y ago · link · parent

> For what it's worth, this delay was already removed for sites that had user-scalable=no set. Most mobile "apps" used this.

Is this true for mobile Safari as well?

comment 12y ago · link · parent

Each String in Ruby has their own encoding. But by default, it is UTF-8 these days.

comment 12y ago · link · parent

Now I'm interested in seeing the whole Harry Caudill documentary. I wonder what it's called...

comment 12y ago · link · parent

But the JVM not having reified generics is a mostly a blessing for Scala. With reified generics, your language's type system can essentially be only as powerful as the VM's type system, and I think it's clear that Scala today wouldn't be the same if Sun had gone the reified generics route.

(Still, it would be nice to have specialized generic containers for some primitive types in the JVM)

comment 12y ago · link · parent

Reified generics is one of the reasons why Scala on the .NET is effectively dead. The VM's type system isn't powerful enough to support some features of Scala, such as higher-kinded types.

comment 12y ago · link · parent

It does highlight implicit conversions by default (they're underlined and have a light blue background colour). I don't think it does anything special w.r.t. macros, but I might be wrong.

As far as I know, they use their own compiler for highlighting type errors in the editor etc. and SBT for the "actual" compilation. The presentation compiler didn't exist when they started Scala support, so they rolled their own solution.

12