Scenic viewpoint looking out over the whole Dunedin area. Short drive from the CBD
https://www.dunedin.govt.nz/community-facilities/walking-tracks/skyline-walks/mt-cargill
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 |
Scenic viewpoint looking out over the whole Dunedin area. Short drive from the CBD
https://www.dunedin.govt.nz/community-facilities/walking-tracks/skyline-walks/mt-cargill
nvm
via Homebrewlet rootPromise = new Promise((resolve, reject) => reject('Bad promise')); | |
rootPromise | |
.then(_ => { | |
console.log("Promise resolved"); | |
return Promise.resolve(30); | |
}, error => { | |
console.log("Error", error); | |
// return Promise.resolve(55); // prints Result 55 | |
return Promise.reject(44); // prints Catch 44 |
defmodule MySpawn do | |
def spawn_monitor(mod, func, args) do | |
root_pid = self() | |
spawn(fn -> | |
{pid, ref} = :erlang.spawn_monitor(mod, func, args) | |
send(root_pid, pid) | |
start_time = :calendar.local_time | |
receive do | |
{:DOWN, ^ref, :process, ^pid, why} -> print_on_exit(start_time, why) | |
end |
open System | |
open System.Windows.Forms | |
open System.Drawing | |
let count (a: _ [,]) x y = | |
let m, n = a.GetLength 0, a.GetLength 1 | |
let mutable c = 0 | |
for x in x-1..x+1 do | |
for y in y-1..y+1 do | |
if x>=0 && x<m && y>=0 && y<n && a.[x, y] then |
defmodule NonBlockingCache do | |
use GenServer | |
def start_link do | |
GenServer.start_link(__MODULE__, [], name: :ets_page_cache) | |
end | |
def init(_) do | |
:ets.new(:ets_page_cache, [:set, :named_table, :protected]) | |
Process.flag(:trap_exit, true) |