Ben Chuanlong Du's Blog

It is never too late to learn.

Unit Test for Scala

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Both ScalaTest and spec2 are good unit testing frameworks. ScalaTest is more flexible is recommended.

ScalaTest

only assert is supported.

assert(expr1 === expr2, optional_msg)

The JUnit methods assertTrue, assertEquals and assertArrayEquals …

Speed Up sbt in China

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Currently sbt uses https by default. However, the Great Firewall of China makes https visits to websites out of China slow.

Proxy

If you have access to proxy server, it is …

Scala Dependencies for SBT

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Joda Time

    "joda-time" % "joda-time" % "2.9.9"
    
  2. Scala XML Support

    "org.scala-lang.modules" %% "scala-xml" % "1.0.6"
    
  3. Scala Parser Combinators

    "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
    
  4. Scala Swing

    "org.scala-lang …

Install ITypescript/IJavascript for Jupyter Notebook

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

https://github.com/nearbydelta/itypescript

https://github.com/n-riesco/ijavascript/

wajig install nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node

sudo npm install -g itypescript
sudo its --hide …

Install GNU Utils Using MacPorts

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Configuration

Run the following command after installation.

export PATH=/opt/local/libexec/gnubin/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH

Installation

sudo port install …

Building Tool for Scala

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. The recommended building tool for Sclas is Gradle > Maven > sbt. Maven is too verbosal while sbt is too hard to use.

References

http://www.hammerlab.org/2017/04/06/scala-build-tools/