Tips and Tricks
Programming is a field where tips and tricks are abundant.
IT Hares proudly present their own bag of programming tips and tricks.
War on Clones, Part I. IP-based (non-)Identification. Identifying PCs and Macs
July 11, 2016 by • “No Bugs” Bunny
Quote:
NEVER EVER use IPv4 for long-term bans
Another Quote:
If using MAC addresses to identify devices, you SHOULD gather stats on repeating MAC addresses within your DB
Filed under: Book: D&D of MOGs1st beta of Vol. IV-VI1st beta of Vol. VII-IXOn.ProgrammingTips and TricksNetwork ProgrammingOn.SecurityFraud Prevention
Read moreRandom Number Generation
June 21, 2016 by • “No Bugs” Bunny
Quote:
even if your RNG is statistically perfect, people will still complain🙁
Another Quote:
On modern x86 CPUs, single core can generate 150M+ random bytes/second this way (and this is a Damn Lot).
Filed under: Book: D&D of MOGs1st beta of Vol. IV-VIOn.ProgrammingTips and TricksOn.SecurityBest Practices
Read moreImplementing Queues for Event-Driven Programs
June 13, 2016 by • “No Bugs” Bunny
Quote:
full queues SHOULD NOT happen during normal operation
Another Quote:
With queues-implemented-over-mutexes like the ones we’ve written above, the most annoying thing performance-wise is that there is a chance that the OS’s scheduler can force the preemptive context switch right when the thread-being-preempted-is-owning-our-mutex.
Filed under: Book: D&D of MOGs1st beta of Vol. IV-VIOn.System Architecture(Re)ActorsOn.ProgrammingTips and Tricks
Read moreC++ Performance: Common Wisdoms and Common “Wisdoms”
May 30, 2016 by • “No Bugs” Bunny
Quote:
over(ab)using C++ features is a different story, we’ll discuss these features below on case-by-case basis
Another Quote:
Compiler will use all its Next-to-Divine Wisdom to show you that it is smarter than you are, and to ignore most of those inline specifications you carefully wrote.
Filed under: Book: D&D of MOGs1st beta of Vol. IV-VIOn.ProgrammingTips and TricksProgramming LanguagesOptimizations
Read more



