(by @andrestaltz)
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.
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 |
''' | |
BEGIN GPL LICENSE BLOCK | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
as published by the Free Software Foundation; either version 2 | |
of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
/** | |
* ``` | |
* Does JDK8's Optional class satisfy the Monad laws? | |
* ================================================= | |
* 1. Left identity: true | |
* 2. Right identity: true | |
* 3. Associativity: true | |
* | |
* Yes, it does. | |
* ``` |
#!/bin/bash | |
function getpage() | |
{ | |
nodejs <<HEREDOC | |
// npm install request cheerio | |
var request = require("request"); | |
var cheerio = require("cheerio"); | |
request({ uri: "http://www.epicbundle.com/game" }, function(error, response, body) { |
(by @andrestaltz)
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.
Should be work with 0.18
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
Upon completion you will have a sane, productive Haskell environment adhering to best practices.
sudo apt-get install libtinfo-dev libghc-zlib-dev libghc-zlib-bindings-dev
import dns.resolver #dnspython | |
my_resolver = dns.resolver.Resolver() | |
#Cloudflares DNS Server | |
my_resolver.nameservers = ['1.1.1.1'] | |
#Get IP from cloudflare chaosnet TXT record | |
#https://community.cloudflare.com/t/can-1-1-1-1-be-used-to-find-out-ones-public-ip-address/14971/6 | |
result = my_resolver.resolve("whoami.cloudflare","TXT", "CH", tcp=True, lifetime=15) | |
response = result.response | |
answer = response.answer | |
ExternalIP = str(list(answer[0])[0]).replace('"', '') |