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

Steam Locomotive, an annoying little ASCII art film to punish you for typos. Funny exactly once.


It's saying "modern, maintained", implying that ls is either not maintained (wrong), or ls is not modern (can be argued to be true). Only one of those two properties need to hold for the entire label to fit.


> Going from 1 install to 270 installs is a 270% increase

No, it's a 270x increase. In percent that's much higher.


Sorry, it was a brain fart on my part.

If we do the 270% increase from 1, the stats become funnier.


These kind of things are also why four colours are actually _not_ always enough, in the real world. Countries can have exclaves :)


> any generator. For example, the classic range

`range` is not a generator.

Regarding number 8, instead of `Counter` you can also use dicts:

`unique = list(dict.from_keys(iterable))`


Maybe not a regular customer, but there's other reasons you might have a phone field:

> In Israel, certain advertising numbers start with a *.

> In New Zealand, non-urgent traffic incidents can be reported by calling *555 from a mobile phone.


The counter-proposal is: don't do it. This comment by the Apple guy sums it up well IMHO:

> Colleagues and I have discussed this and don't see a way to grant write access to the end user's local file system in a way that safeguards the end user's interests.


So they can make it to work for platform-specific apps that they tax 30%, but can't make it to work for interoperable web apps which they can't tax. How convenient.


Safari already supports a permission-less file system API with a very similar security model to iOS's filesystem access.

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

https://webkit.org/blog/12257/the-file-system-access-api-wit...

It's able to support this because the 'file system' is scoped specifically to that origin, and doesn't allow access to any aribtary location on the file sytem, just like iOS.


Your parent comment point still valid.

If Apple made arbitrary file access work for apps [1], surely they could make it work for Safari. But apps pay 30% and websites don't, so it's easy to conclude why they don't want to.

[1] https://developer.apple.com/documentation/uikit/view_control...


Because there's typically at least a minimum of safety checks before an app can go into the app store, whereas a website can do whatever it wants (and can).


Almost all of these APIs still require a user to approve their use in the browser for a given origin.


Next next next finish


Likewise. I _did_ sell those stellar tokens they gave to (longtime?) users for about 50 bucks though, before deleting my account.


Probably because the string is so short.


Yeah, it's not great with long strings. f-strings seem to be great just about always though. Highly recommend.

  $ python3.12 -m timeit -s 'import string' -s 'x = string.printable * 50' 'f"Welcome to {x}."'
  2000000 loops, best of 5: 106 nsec per loop
  $ python3.12 -m timeit -s 'import string' -s 'x = string.printable * 50' '"Welcome to {}.".format(x)'
  2000000 loops, best of 5: 200 nsec per loop
  $ python3.12 -m timeit -s 'import string' -s 'x = string.printable * 50' '"Welcome to %s." % x'
  2000000 loops, best of 5: 169 nsec per loop
  $ python3.12 -m timeit -s 'import string' -s 'x = string.printable * 50' '"Welcome to " + str(x) + "."'
  1000000 loops, best of 5: 214 nsec per loop
  $ python3.12 -m timeit -s 'import string' -s 'x = string.printable * 50' '"Welcome to " + x + "."'
  1000000 loops, best of 5: 198 nsec per loop
len(string.printable * 50) = 5000


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

Search: