Map [1]
Operation | Time Complexity |
---|---|
Access | O(log n) |
Search | O(log n) |
Insertion | O(n) for <= 32 elements, O(log n) for > 32 elements [2] |
Deletion | O(n) for <= 32 elements, O(log n) for > 32 elements |
CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.
Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file
subprojects { | |
ext { | |
compileSdk = 25 | |
buildTools = "25.0.1" | |
minSdk = 19 | |
targetSdk = 25 | |
} | |
afterEvaluate { project -> | |
if (!project.name.equalsIgnoreCase("app") |
module.exports = function (canvas, data, color, maxStep = 1000) { | |
var ctx = canvas.getContext('2d') | |
if (color) ctx.fillStyle = color | |
var width = canvas.width | |
var height = canvas.height | |
var step = Math.ceil(data.length / width) | |
var amp = height / 2 | |
for (var i = 0; i < width; i++) { | |
var neg = 0 |
When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.
I like to follow working example code so this is how the boilerplate will look like:
import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))
import Http
// Which HTML element is the target of the event | |
function mouseTarget(e) { | |
var targ; | |
if (!e) var e = window.event; | |
if (e.target) targ = e.target; | |
else if (e.srcElement) targ = e.srcElement; | |
if (targ.nodeType == 3) // defeat Safari bug | |
targ = targ.parentNode; | |
return targ; | |
} |
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 |