- Install IntelliJ + Scala Plugin
- Don’t do the Coursera courses yet.
- Don’t do the “red book” Functional Programming in Scala yet.
- Do: http://underscore.io/books/
- Essential Scala
- Essential Play
- Essential Slick
- Do Scala for the Impatient: https://www.amazon.com/Scala-Impatient-Cay-S-Horstmann/dp/0321774094
- The Neophyte’s Guide to Scala http://danielwestheide.com/scala/neophytes.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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() |
(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.
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
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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Task { | |
| public String getAction() {...} | |
| public LocalDateTime getDueDate() {...} | |
| public boolean isOverdue(Clock clock) { | |
| return LocalDateTime.now(clock).isAfter(getDueDate()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Check whether --offline was passed to gradle and set it in the test configuration's system properties | |
| test { | |
| if(gradle.startParameter.isOffline()) { | |
| systemProperties 'TESTS.ARE.OFFLINE' : '1' | |
| } | |
| } |