I hereby claim:
- I am dmydlarz on github.
- I am dmydlarz (https://keybase.io/dmydlarz) on keybase.
- I have a public key ASBWpjF_o-mj0hbfz92oU83e6FFunYYPIqsqjljk5sCUIwo
To claim this, I am signing this object:
| # install fortune | |
| brew install fortune | |
| # backup current fortunes | |
| mv -r /usr/local/Cellar/fortune/9708/share/games/fortunes /usr/local/Cellar/fortune/9708/share/games/fortunes.bak | |
| # download bash.org.pl quotes | |
| curl -s http://bash.org.pl/text > bash_text | |
| # create random access file |
| # jupyter notebook --generate-config | |
| # vim .jupyter/jupyter_notebook_config.py | |
| import os | |
| import sys | |
| spark_home = os.environ.get('SPARK_HOME', None) | |
| sys.path.insert(0, spark_home + "/python") | |
| # FIXME make sure you have got correct py4j version | |
| sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.9-src.zip')) |
| public class Task { | |
| public String getAction() {...} | |
| public LocalDateTime getDueDate() {...} | |
| public boolean isOverdue(Clock clock) { | |
| return LocalDateTime.now(clock).isAfter(getDueDate()); | |
| } | |
| } |
| void prejava8() throws MalformedUrlException { | |
| Map<String, Cluster> clusters = Maps.newHashMap(); | |
| for (final Map<String, Object> clusterYml : clustersListYml) { | |
| Cluster cluster = new HystrixCluster(clusterAdapter.fromMap(clusterYml)); | |
| clusters.put(cluster.name(), cluster); | |
| } | |
| return clusters; | |
| } | |
| void java8() { |
I hereby claim:
To claim this, I am signing this object:
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
(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.
| // vavr (aka javaslang) | |
| public Set<Integer> usersIds() { | |
| return managerNode.descendants() | |
| .flatMap(Node::userIds); | |
| } | |
| // (POJ8) Plain Old Java 8 | |
| public java.util.Set<Integer> usersIds() { | |
| return managerNode.descendants() | |
| .stream() |
| import SimpleHTTPServer | |
| import SocketServer | |
| from time import sleep | |
| PORT = 5000 | |
| SLEEP_TIME = 6 | |
| class SlowHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| def do_GET(self): |