Imagine you're a browser...

Technologies and protocols

An example of technologies encountered when a browser requests a page from a server. In this case the browser is running on a laptop connected by Wi-Fi. Forming a request User types a URL into the browser: Host performs DNS resolution to convert the URL into an IP address (the web server) The DNS server (and host IP) could be set manually but it will probably be part of a DHCP offer The application (browser) attempts a TCP connection with the server IP If no protocol is specified (http, https, ftp) the browser will default to 80 The browser must now work out how to reach the server The netmask is ANDed with the host IP address, if they’re on the same network then the request can be emitted immediately Otherwise, the host must send the packet via the default gateway (also configured by DHCP) The information makes its way down the TCP stack Layer two adds the MAC header Frame is transmitted between devices Frame is encrypted as it is transmitted through the air At the gateway the request makes its way back up to the TCP layer where it can be forwarded to the next gateway The browser will probably be running from a private network so the router must translate the local to the WAN network (NAT) Reaching the server Upon reaching the destination the server will probably send a redirect to the HTTPS version of the website (. [Read More]


The conventional wisdom when to use a linked list over contiguous storage hasn’t applied for years: you have to test. If everything is in a cache a vector might outperform a linked list for insertion. Algorithm patterns Brute Force Divide and Conquer Decrease and Conquer The Greedy Method Dynamic Programming Backtracking Branch and Bound Hill Climbing Particle Swarm Optimisation Las Vegas Monte Carlo Reduction (Transformation) Preprocessing See algorithm patterns. [Read More]


The blockchain is an irrefutable/immutable database. Rather than using a single point of truth like the traditional centralised model, in the blockchain there are multiple copies of the transactions and the protocol ensure that they are synchronised and makes it difficult to exploit.


Small amounts of unusually fast memory (Data D$, Instruction I$, Translation Lookaside Buffer TLB), cache misses, speculatively prefetch, does it fit in cache (small is fast), no time/space tradeoff at hardware level, locality counts (stay in the cache), predictability helps. A modern multi-core machine will have a multi-level cache hierarchy, where the faster and smaller caches belong to individual processors. When one processor modifies a value in its cache, other processors cannot use the old value anymore. [Read More]

Cloud computing

Play With Docker Amazon Web Services Digital Ocean Google Cloud Hybrid Cloud Cloud9 versus Google Cloud SSH Google’s is slightly slicker, more tightly integrated with the instance browser. The Google web SSH client is so close to the real thing that you quickly forget what’s going on. Cloud9 IDE is quite nice, Sublime-style editor. But slightly odd ctrl codes remind you that you’re not actually typing into a real terminal. [Read More]


Symmetric versus asymmetric encryption The most widely used symmetric algorithm is AES-128, AES-192, and AES-256. The main disadvantage of the symmetric key encryption is that all parties involved have to exchange the key used to encrypt the data before they can decrypt it. With asymmetric keys the server generates a pair of keys: public and private. The private key is kept safe but the public key can be sent in the clear to the client. [Read More]

Data structures

Heaps In a max heap, for any given node C, if P is a parent node of C, then the key (the value) of P is greater than or equal to the key of C. In a min heap, the key of P is less than or equal to the key of C. The node at the “top” of the heap (with no parents) is called the root node. [Read More]


Technologies and terminology

HFT A type of algorithmic trading characterized by high speeds, high turnover rates, and high order-to-trade ratios. HFT firms make up the low margins with incredibly high volumes of trades, frequently numbering in the millions. Sophisticated algorithms Co-location Short-term investment horizons Sophisticated technological tools and computer algorithms to rapidly trade securities Proprietary trading strategies carried out by computers to move in and out of positions in seconds or fractions of a second Finance Value at risk (VaR) A derivative is a price guarantee Buyer/seller (counterparties), underlier, future price, future date, Forward, futures, swap, option Liquid - more traded on a single day Fungible - one is as good as another A financial instrument is a standard agreement (contract) that bestows certain financial rights and/or responsibilities to its parties Zero sum games Hedging, manage uncertainty Speculation, wager on uncertainty Taking a view - gambling Financial leverage Market makers, merchants of derivatives arbitrageurs, mispriced security search Trading protocols FIX - Financial Information eXchange OUCH - a digital communications protocol that allows customers of the NASDAQ (National Association of Securities Dealers Automated Quotations) to conduct business in the options market. [Read More]


Generative Adversarial Networks

Forger and expert analogy

  • Expert is presented with alternate real images and fakes generated by the forger.
  • Forger receives feedback on quality of fakes.
  • When the expert can no longer tell if an example is fake then our work here is done.

Modern C++

lvalues and rvalues An lvalue refers to an object that persists beyond a single expression. You can think of an lvalue as an object that has a name. All variables, including nonmodifiable (const) variables, are lvalues. An rvalue is a temporary value that does not persist beyond the expression that uses it. A function call can be an lvalue if and only if the return value is a reference. [Read More]