Hacker Newsnew | past | comments | ask | show | jobs | submit | znpy's favoriteslogin

The brown M&M test is: can you call poll() on a terminal device?

This lack of functionality has been in existence since Mac OS X's inception. It's the reason why a cross-platform software _always_ has to support both select() and poll() to check if a user is typing on the terminal -- select() just for Mac OS X, and poll() for every other system. Wouldn't it be nice if we could standardise on poll()?

Compare what macOS manpages say:

https://developer.apple.com/library/archive/documentation/Sy...

> BUGS: The poll() system call currently does not support devices.

with the requirements for certification:

https://pubs.opengroup.org/onlinepubs/9799919799.2024edition...

> The poll() and ppoll() functions shall support regular files, terminal and pseudo-terminal devices, FIFOs, pipes, and sockets.

Is the bug fixed in macOS 15 or is this certification yet another load of horseshit?


Because I don't think a lot of people know about it, I'll mention pelias here. If you have 16 GB RAM and 600 GB of disk, you can have a free, open source, pre-populated geo database that covers the entire planet.

https://github.com/pelias/pelias

Pelias does geocoding (turns addresses, POIs, and administrative regions into coordinates), reverse geocoding (given coordinates, finds nearby POIs, addresses, neighborhood, city, county, state, country), full-text search, and autocompletion. You can also import CSV to use your own custom data.

I run it on an extra PC, where it powers about 20 twitter bots that turn lat/lon coordinates of aircraft into descriptions like "flying over Silver Lake, Los Angeles, 0.5 miles from Circus Liquor."

There are docker configs for the whole-planet DB as well as various countries or metro areas if you don't need the whole Earth. https://github.com/pelias/docker/tree/master/projects


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

Search: