How some big companies manage their infrastructure. A list of great inteviews and articles on the matter
Using the fact that case
is a syntax sugar for goto
in C. This macro created by Tom Duff while working for Lucasfilm in 1983 is a clever trick to unroll loops for buffers that have a size multiple of 8 (a byte) on low powered devices.
A riff on strongly typed. Used to describe an implementation that needlessly relies on strings when programmer & refactor friendly options are available.
For example:
Method parameters that take strings when other more appropriate types should be used. On the occasion that a string is required in a method call (e.g. network service), the string is then passed and used throughout the rest of the call graph without first converting it to a more suitable internal representation (e.g. parse it and create an enum, then you have strong typing throughout the rest of your codebase). Message passing without using typed messages etc. Excessively stringly typed code is usually a pain to understand and detonates at runtime with errors that the compiler would normally find. -- http://www.codinghorror.com/blog/2012/07/new-programming-jargon.html
For security consideration, consider picking no more than two between:
Online book co-written by A. Jesse Jiryu Davis and Guido van Rossum on how to implement a web crawler using python asyncio in a very throughout explaination.
TLDR: Multiple processes can bind to the same port using SO_REUSEPORT
flag.
int sfd = socket(domain, socktype, 0);
int optval = 1;
setsockopt(sfd, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval));
bind(sfd, (struct sockaddr *) &addr, addrlen);
As of Linux 3.9 (might have changed a lot since), the requests are distributed evenly using a hash of the connection tuple (sip, sport, dip, dport). It can be quite unbalanced depending on the type of load and has the caveat that the connection might change destination when starting or stopping processes. It might be fixed today using a lookup table.
The Dark Arts of Advanced and Unsafe Rust Programming
Incredible talk about the Apollo Guidance Computer, it goes in such detail in just an hour. The speakers talk fast, but the slides are superb to help follow along. Blown out by this presentation!