Hacker Newsnew | past | comments | ask | show | jobs | submit | more EvilTerran's commentslogin

> python came up without a platform to support it

What about numpy (+ its ecosystem, scipy/pandas/etc)? I get the impression that's contributed a lot to Python's growth over the years.


Those are probably the only reason Python still exists.


So I changed the z-index of Div A to be 5 or something. But it didn’t work! In Firefox, div A was on top, but in Chrome, Div B was on top. Argh! Why?

... why indeed? I can't think of any (presumably fairly simple) scenario where that would happen.


I got a bit nerdsniped by this so here's a simple reproduction of the original issue (which I still don't fully understand tbh) https://codepen.io/jvns-css-fun/pen/zYGVLXj


So this is a bit of a spec oddity. It seems like the transform is forcing a stacking context here, but for some reason in Chrome the z-index of this stacking context is not getting assigned -- the z-index is left at 0. You can see this by running this in DevTools console:

>>> getComputedStyle(document.getElementById('prev')).zIndex

"0"

I think this is a bug in Chrome, where it's short-circuiting the new stacking context when a transform is specified, and not propagating the z-index to the new stacking context. The CSS spec says ( https://www.w3.org/TR/css-transforms-1/ ):

> If an element with a transform is positioned, the z-index property applies as described in [CSS2], except that auto is treated as 0 since a new stacking context is always created.

This element is positioned, so z-index should be affecting it.

You can fix it by moving the transform to the child here, but it requires a bit of finagling. Nice catch!


Perfect example of how Chrome is the new IE. When something behaves differently in FF and Chrome, I presume Chrome is wrong until I can prove it otherwise.


> Hoogle doesn't seem to find me a function like Rust's .get() in the standard library

In practice, you don't really need one - the safe alternative to "xs !! n" is pattern-matching on the result of "drop n xs", as that's [] if xs has ≤n elements:

https://www.haskell.org/onlinereport/standard-prelude.html#$...


Sure, that seems syntactically more cumbersome than 'if let Some(foo) = xs.get(n)' or 'xs.get(n).map(|foo| ...)' in Rust, but yes, you can do it. As I said, because both the Rust and Haskell versions are more cumbersome than using the version that raises an exception/panics, both Rust and Haskell's standard libraries choose to give you a syntactically-easier alternative that isn't a total function.

All I'm saying is that Haskell doesn't seem to do anything different here - Rust has incorporated the lessons from Haskell's type system. (As someone who fell in love with Haskell a long time ago but never got to use it professionally, this is basically why I like Rust.) Is there something Haskell does that Rust does not do? I'm not trying to say Haskell is insufficient - I'm just refuting the claim that Rust is insufficient and should act more like Haskell.


Sure, I don't disagree - I meant only to add context for anyone reading who was unfamiliar with Haskell, lest they come away with the impression that the lack of a .get()-equivalent was some kind of egregious oversight.


> In practice, you don't really need one - the safe alternative to "xs !! n" is pattern-matching on the result of "drop n xs", as that's [] if xs has ≤n elements:

Great so instead of `xs !! n` you're supposed to write

    case drop n xs of
        [] -> …
        x :: _ -> …
that seems… less than likely?


> if you're reducing the list to a scalar, you lose all the benefits this article wants to claim.

Not quite - for example, these both benefit from foldr, despite each producing a scalar:

  and, or :: [Bool] -> Bool
  and = foldr (&&) True
  or = foldr (||) False
... as they can both "bail out early" without evaluating the entire list (if they find a False or a True, respectively).

The distinction lies not so much in "are you reducing to a scalar?" as "can your binary operation be productive without evaluating its second parameter?" - or, if you prefer, "is it ever lazy in its second parameter?". If so, then foldr may be appropriate.


Neat! I can see myself using several of these.

Erratum: the link meant for "openssl-hook" actually takes you to "otherport".


Fixed; thanks for the feedback.


Speaking of "concise", in modern browsers you can replace el.parentNode.removeChild(el) with just el.remove():

https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/r...


The point, as I understand it, is that we've found cases of galaxies that look like they should be about the same mass as each other based on the light they're putting out themselves, but gravitational lensing measurements indicate a significant mass discrepancy. That's what's hard to explain without "maybe there's a bunch of matter we can't see" - if it was more of a "maybe gravity just works differently at galactic scales" situation, that scenario would be impossible.


I understand the motivation for dark matter. My point is that as long we have a full density distribution to play with, we can explain almost anything with the model. And the start of this thread was me disagreeing with how much it actually proved that observations matched "really really well " with the model.

I don't see why the scenario "gravity works differently at large scales" couldn't explain the observations until we have some idea how gravity would work differently.

Don't forget that each of these observations rely on a quite large sets of assumptions about everything from how much luminosity from galaxies with a certain (normal) mass can vary to how we estimate distances to very far away objects. We don't have that many observations of e.g. gravitational lensing. And, if we realize we actually don't know how to calculate things correctly with GR, or our theory of GR is wrong, that will have implications for all of those assumptions.

The dark matter hypothesis might very well be right. It is a very reasonable guess. But so far I think the proofs for it have been overstated.


Nobody says it's proven. It's just the best what we have so far. Any theory that would work just as good and explain anything on top would be welcome.

And I can say myself that not everyone agrees with that discovery: http://www.astronomy.com/news/2019/09/astronomers-cant-agree...

Well, people still debate about the Bullet cluster. But if it's correct then it's actually a good (relatively) confirmation for some sort of dark matter. It two similar galaxies look the same but have dramatically different mass distribution then there's some mass we don't see yet.


There's Hoogle, for Haskell: https://hoogle.haskell.org/

I don't know if it implements any techniques from that paper, but it does let you search for definitions by type signature. Of note, it also does a pretty good job of finding results with different-but-compatible types, which is very valuable in a Haskell context given all the polymorphism.


Here's one: https://www.jneurosci.org/content/25/38/8593

Abstract:

Nicotine is the major neuroactive compound of tobacco, which has, by itself, weak reinforcing properties. It is known that levels of the enzymes monoamine oxidase A (MAO-A) and MAO-B are reduced in the platelets and brains of smokers and that substances, other than nicotine, present in tobacco smoke have MAO-inhibitory activities. Here, we report that inhibition of MAO dramatically and specifically increases the motivation to self-administer nicotine in rats. These effects were more prominent in rats selected for high responsiveness to novelty than in rats with low responsiveness to novelty. The results suggest that the inhibition of MAO activity by compounds present in tobacco smoke may combine with nicotine to produce the intense reinforcing properties of cigarette smoking that lead to addiction.


That list is wrong. I'm in the UK, we don't need ID to register or vote here.


That's not exactly correct.

ID is required in some places like Northern Ireland. Iirc, the UK poll card isn't 'typically' or ID required in England, Whales, Scottland)

But as of 2018 that's changing when some districts required ID for the first time. Although last I heard, laws suits on that were still going on.


Very well. In the vast majority of the UK, you don't need ID. That checkmark on your list remains misleading at best.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: