alr

joined 2 years ago
[–] alr@programming.dev 1 points 2 years ago

I'm not sure I want my banking apps to store anything on my phone in the first place. But maybe that's just me. I don't even use banking apps.

[–] alr@programming.dev 1 points 2 years ago* (last edited 2 years ago)

If you use JavaScript, you've probably seen a monad, since Promise is a monad. Unit is Promise.resolve(), bind is Promise.then(). As required, Promise.resolve(x).then(y) === y(x) (unit forms a left identity of bind), y.then(Promise.resolve) === y (unit forms a right identity of bind), and x.then(y.then(z)) === x.then(y).then(z) (bind is essentially associative).

You even have the equivalent of Haskell's fancy do-notation (a form of syntactic sugar to save writing unit and bind all over the place) in the form of async/await. It's just not generalized the way it is in Haskell.

[–] alr@programming.dev 10 points 2 years ago

Rather than messing with the EventListener, wouldn't it be easier to just throttle the function that it calls? You can find a bunch of articles online that will explain how to implement a throttle (and also a debouncer, which is similar, but not quite what you're looking for; a throttle allows a function to be called immediately unless it's already been called too recently, while a debouncer waits every time before calling the function and restarts the wait timer every time someone tried to call the function).

[–] alr@programming.dev 2 points 2 years ago

Me too. I got a MacBook for testing Safari, but sometimes I take it to meetings because it's easier than extricating my usual machine from its dock (which unplugs the Ethernet cable so all my SSH sessions die along with anything running in them). But as somebody who likes having things in full screen (it bothers me if I can see the desktop peeking through), I get very annoyed needing to scroll through every app I've got open until I stumble across the one I want every time I have to switch context.

[–] alr@programming.dev 1 points 2 years ago

Unless you're on a contract. If you're in the US and you're not sure if you're on a contract, you're not on a contract. At-will goes both ways.

[–] alr@programming.dev 6 points 2 years ago* (last edited 2 years ago)

The Danish word for 99 is nioghalvfems, which literally means "nine and half five." Which you could be forgiven for assuming meant 11½. The trick is that a) "half five" actually means 4½, as in half less than five, and b) it's implied that you're supposed to multiply the second part by 20. So the proper math is 9 + (-½ + 5) * 20 = 99.

[–] alr@programming.dev 3 points 2 years ago (1 children)

Of course, the correct way to quit Vi is ^Zpkill vi.

[–] alr@programming.dev 4 points 2 years ago* (last edited 2 years ago) (2 children)

If you think French is bad...

// Danish
farve = "#(9+½+5)FFAA"
[–] alr@programming.dev 1 points 2 years ago

Which surely works only until you need to say 91, which does not start "quatre-vingt-dix."

[–] alr@programming.dev -1 points 2 years ago

I note that the developer in question decided not to comply, instead obscuring "obvious signs of AI" and resubmitting, after which Valve did refuse to publish. Play stupid games, win stupid prizes, I guess.

[–] alr@programming.dev -1 points 2 years ago

Thank goodness.

view more: ‹ prev next ›