- 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
| -- Resource: https://github.com/timotta/wrk-scripts/blob/master/multiplepaths.lua | |
| -- Initialize the pseudo random number generator | |
| -- Resource: http://lua-users.org/wiki/MathLibraryTutorial | |
| math.randomseed(os.time()) | |
| math.random(); math.random(); math.random() | |
| -- Shuffle array | |
| -- Returns a randomly shuffled array | |
| function shuffle(paths) |
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
| var My = (function() { | |
| var privates = new WeakMap; | |
| return function(a) { | |
| privates.set(this, a); | |
| this.setter = function(a) { | |
| privates.set(this, a) | |
| }; | |
| this.getter = function() { | |
| return privates.get(this) | |
| }; |
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
| /* | |
| Overview | |
| -------- | |
| To run a query using anorm you need to do three things: | |
| 1. Connect to the database (with or without a transaction) | |
| 2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator | |
| 3. Call one of the methods on `SqlQuery` to actually run the query |
Movies Recommendation:
- MovieLens - Movie Recommendation Data Sets http://www.grouplens.org/node/73
- Yahoo! - Movie, Music, and Images Ratings Data Sets http://webscope.sandbox.yahoo.com/catalog.php?datatype=r
- Jester - Movie Ratings Data Sets (Collaborative Filtering Dataset) http://www.ieor.berkeley.edu/~goldberg/jester-data/
- Cornell University - Movie-review data for use in sentiment-analysis experiments http://www.cs.cornell.edu/people/pabo/movie-review-data/
Music Recommendation:
- Last.fm - Music Recommendation Data Sets http://www.dtic.upf.edu/~ocelma/MusicRecommendationDataset/index.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
| import com.newrelic.api.agent.NewRelic | |
| import collection.mutable.{HashMap, SynchronizedMap} | |
| import com.yammer.metrics.{Timer, MetricsGroup} | |
| trait Measurable { | |
| protected lazy val metricsGroup = new MetricsGroup(this.getClass) | |
| private val timers = new HashMap[String, Timer] with SynchronizedMap[String, Timer] |
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
| #!/bin/sh | |
| policy=${HOME}/.jstatd.all.policy | |
| [ -r ${policy} ] || cat >${policy} <<'POLICY' | |
| grant codebase "file:${java.home}/../lib/tools.jar" { | |
| permission java.security.AllPermission; | |
| }; | |
| POLICY | |
| jstatd -J-Djava.security.policy=${policy} & |
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
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
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
| class A | |
| class A2 extends A | |
| class B | |
| trait M[X] | |
| // | |
| // Upper Type Bound | |
| // | |
| def upperTypeBound[AA <: A](x: AA): A = x |