Recent submissions

Comment · 10 months ago
I'm confused by this:

  String operations in Python are fast as well. f-strings are the fastest formatting style, while even the slowest style is still measured in just nano-seconds.
  
  Concatenation (+)   39.1 ns (25.6M ops/sec)
  f-string            64.9 ns (15.4M ops/sec)
It says f-strings are fastest but the numbers show concatenation taking less time? I thought it might be a typo but the bars on the graph reflect this too?
Comment · 1 year ago
In the case of multiple base classes wouldn't it be more sensible for the derived class to forego the lexical convenience of super() and simply call each base explicitly? i.e.

        BaseEstimator.__init__(self, **kwargs)
        ServingMixin.__init__(self, **kwargs)
If one wants to inherit from multiple classes then they should be responsible for specifying the details of how that happens. Why should a base class be expected to add boilerplate just in case some external consumer comes along and wants to use it in some unforeseeable context?

That super() has a "method resolution order" seems like a fudge. Now 'super' doesn't necessarily mean 'superclass' anymore at the point of use. Am I missing some other hypothetical situation in which super()'s MRO brings more value for the price of having to know about this extra, implicit behaviour?

And what's funny is that in the example given, the first base class not calling super() leads to the bad consequence that the other base class doesn't get to set some internal state (self.mode). Yet in the next section, "When to use a Mixin", it advises: "A mixin is a class that [...] does not contain state"

Comment · 1 year ago
Comment · 1 year ago
'n' -> [chrome or firefox autocomplete] -> news.ycombinator.com I have often been thinking about what this reflex does to my mind.
Comment · 2 years ago
Comment · 2 years ago
This inspires me as a programmer and delights me as a player. Surprising variety in the stages and lovely precise feel to the car handling. 3 or 4 goes before I started to beat it, first with keyboard then with a pad. Fired up some smooth techno to accompany me in the background :)

Could do with 3 more stages ;P

Comment · 2 years ago
Lovely. Unexpectedly I feel more immersed with the sound off. When it's on it's like I'm watching just another video on the Internet, and the wind blusters through the mic in a way that sounds different to actually being there; whereas when it's off the unnaturally complete peacefulness meshes with the sound of my actual surroundings and the images seem to pop more.
Comment · 2 years ago
Intriguing and fun. I haven't played it enough to confidently suggest changes to the game mechanics, but I think they're strong enough on their own that any/all added UI comfort would be welcome - like others have been saying, a less clunky dictionary (maybe right-click on a word on the board to look it up?), and maybe a preview of whether your attack is going to succeed or not (maybe just on 'easier' levels, since there is an element of not making a 'simple' miscalculation while you overthink a complex board position, like in Chess. Also, think of a game like Puzzle Bobble / Bust-a-Move where the first few levels give you a line showing you exactly where your bubble is going to land).
Comment · 2 years ago
Comment · 2 years ago
CSS is 'logical' in the same way that a pseudorandom number generator is 'predictable'.
Comment · 2 years ago
Is it one Gil Trythall piece in particular? I'm browsing the album and can only find quite casual resemblances. (Album sounds fabulous btw.)
Comment · 3 years ago
Comment · 3 years ago
In conjunction with the power of Magit this is going to make cranking out those pesky commit messages so much easier.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton