|Latency Comparison Numbers (~2012)|
|L1 cache reference 0.5 ns|
|Branch mispredict 5 ns|
|L2 cache reference 7 ns 14x L1 cache|
|Mutex lock/unlock 25 ns|
|Main memory reference 100 ns 20x L2 cache, 200x L1 cache|
|Compress 1K bytes with Zippy 3,000 ns 3 us|
|Send 1K bytes over 1 Gbps network 10,000 ns 10 us|
|Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD|
Falsehoods programmers believe about time
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
|# to generate your dhparam.pem file, run in the terminal|
|openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048|
The introduction to Reactive Programming you've been missing
This tutorial as a series of videos
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Markdown and reStructuredText
GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.
This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:
I would recommend looking at that first! After that, read on...
|# Tom Hale, 2016. MIT Licence.|
|# Print out 256 colours, with each number printed in its corresponding colour|
|# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163|
|set -eu # Fail on errors or undeclared variables|