Hacker News new | past | comments | ask | show | jobs | submit | abhishekjha's comments login

Aren't floating point comparisons frowned upon? https://github.com/google/pebble/blob/main/src/libc/math/flo...

I guess you can freeze some compiler options to give you consistent results.


This case looks okay. It's converting a double to an int64_t and then back to double for comparison. It doesn't really suffer from the typical reason why floating point comparison is frowned upon, such as catastrophic cancellation.

I've once optimized a function to be faster, and in a unit test asserted that the old slower version gives exactly the same floating point answer as the new optimized version. It's doable in some cases.


I've only done a little bit of arduino programming, but for that you had to import a whole library for floating point math which took a huge amount of space, and many chips didn't even have hardware support for it.


How do these things work with devices inside a NAT gateway? Most of our devices are inside a LAN. Even if a server gets started, it won't be visible to the outside world, unless we play with the modem settings.

Now, a hacker/state who has penetrated a device can do an upload of data from the local decice to a CNC server.

But that seems risky as you need to do it again and again. Or do they just get into your device once and upload everything to CNC?


This particular feature doesn’t rely on network connectivity or lack thereof.

Here’s some info about how some spyware works:

https://www.kaspersky.com/blog/commercial-spyware/50813/


What are you even talking about?


Is there an example?



Do you have an example?


Not OP but also wrote a similar thing for mpv.

https://github.com/ftk/mpv-confluence/tree/torrserver



Is there a more general reading for software engineers?

Seems like jumping right into the code can be a bit overwhelming if you have no background on the topic.


Always worth a mention:

https://use-the-index-luke.com/

Markus Winand (the website's author) has also written a book on the subject targeted at software developers which is decent for non-DBA level knowledge.


Not exactly reading but I would recommend the database engineering courses by Andy Pavlo that are freely available on YouTube.


PostgreSQL Query Optimization: The Ultimate Guide to Building Efficient Queries, by Henrietta Dombrovskaya and Boris Novikov Anna Bailliekova, published by Apress in 2021.


You may discover this if you go to the Apress site, but there is a second edition [1] out.

[1] https://hdombrovskaya.wordpress.com/2024/01/11/the-optimizat...



I am digging into postgres source code past few weeks. This project seems like a good way to see how plugins integrate. I may reach out later if I have questions


There are many Postgres internals that people are usually not aware of, with more than one way to develop your module. I have a repo that’s a set of plugin templates here, that should be handy for your studies: https://github.com/michaelpq/pg_plugins


Wait, so which is better? Stateful or stateless? How do you decide?

Very new to these APIs and their usages.


Stateless is simpler to implement and easier to scale across multiple nodes, but comes with additional overhead. When polling the kernel for sockets, the overhead was a bigger cost than implementation complexity and horizontal scaling. (Implementation complexity is still a problem – see the discussions regarding the quality of epoll; and horizontal scaling is just not something desktop kernels do.)


Why is it that compilers don't do this? They have a parse tree for how the sysmbols connect.

Would it not be appropriate to extend the compiler for visualising relationships between software components with zoom-in and zoom-out facilities. Zoom-in takes you to Assembly and zoom-out to the CTO.


Not sure if sarcasm or not.



Why do you think it's sarcasm?


Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: