Showing posts with label Scala (programming language). Show all posts
Showing posts with label Scala (programming language). Show all posts

Saturday, October 29, 2016

MacOS Sierra: Installing wisp (Wisp Is Scala Plotting) Console-centric Plotting Library for Scala

Command:

$ git clone https://github.com/quantifind/wisp.git


Result:

Cloning into 'wisp'...
remote: Counting objects: 1470, done.
remote: Total 1470 (delta 0), reused 0 (delta 0), pack-reused 1470
Receiving objects: 100% (1470/1470), 423.22 KiB | 382.00 KiB/s, done.
Resolving deltas: 100% (521/521), done.


Command:

$ cd wisp
$ sbt 'project wisp' coonsole


Result:

[info] Loading project definition from /Users/USERNAME/wisp/project
[info] Set current project to default-e392df (in build file:/Users/USERNAME/wisp/)
[info] Set current project to Wisp (in build file:/Users/USERNAME/wisp/)
[error] Not a valid command: coonsole
[error] Not a valid project ID: coonsole
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: coonsole (similar: console, consoleQuick, console-quick)
[error] coonsole
[error]         ^
photino:wisp USERNAME$ sbt 'project wisp' console
[info] Loading project definition from /Users/USERNAME/wisp/project
[info] Set current project to default-e392df (in build file:/Users/USERNAME/wisp/)
[info] Set current project to Wisp (in build file:/Users/USERNAME/wisp/)
[info] Updating {file:/Users/USERNAME/wisp/}wisp...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.11.6!scala-library.jar (9714ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-jackson_2.11/3.2.10/json4s-jackson_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-jackson_2.11;3.2.10!json4s-jackson_2.11.jar (516ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-filter_2.11/0.8.3/unfiltered-filter_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-filter_2.11;0.8.3!unfiltered-filter_2.11.jar (573ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-jetty_2.11/0.8.3/unfiltered-jetty_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-jetty_2.11;0.8.3!unfiltered-jetty_2.11.jar (541ms)
[info] downloading http://repo1.maven.org/maven2/com/quantifind/sumac_2.11/0.3.0/sumac_2.11-0.3.0.jar ...
[info] [SUCCESSFUL ] com.quantifind#sumac_2.11;0.3.0!sumac_2.11.jar (637ms)
[info] downloading http://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.4.1/commons-math3-3.4.1.jar ...
[info] [SUCCESSFUL ] org.apache.commons#commons-math3;3.4.1!commons-math3.jar (1566ms)
[info] downloading http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar ...
[info] [SUCCESSFUL ] commons-io#commons-io;2.4!commons-io.jar (560ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-core_2.11/3.2.10/json4s-core_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-core_2.11;3.2.10!json4s-core_2.11.jar (720ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.3.1/jackson-databind-2.3.1.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-databind;2.3.1!jackson-databind.jar(bundle) (824ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-ast_2.11/3.2.10/json4s-ast_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-ast_2.11;3.2.10!json4s-ast_2.11.jar (517ms)
[info] downloading http://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.6/paranamer-2.6.jar ...
[info] [SUCCESSFUL ] com.thoughtworks.paranamer#paranamer;2.6!paranamer.jar (503ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scalap/2.11.0/scalap-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scalap;2.11.0!scalap.jar (829ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.0/scala-compiler-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.0!scala-compiler.jar (5789ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.0/scala-reflect-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.0!scala-reflect.jar (2677ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.1/scala-xml_2.11-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.1!scala-xml_2.11.jar(bundle) (783ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.1/scala-parser-combinators_2.11-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.1!scala-parser-combinators_2.11.jar(bundle) (645ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.3.0/jackson-annotations-2.3.0.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-annotations;2.3.0!jackson-annotations.jar(bundle) (511ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.3.1/jackson-core-2.3.1.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-core;2.3.1!jackson-core.jar(bundle) (558ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered_2.11/0.8.3/unfiltered_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered_2.11;0.8.3!unfiltered_2.11.jar (793ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-util_2.11/0.8.3/unfiltered-util_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-util_2.11;0.8.3!unfiltered-util_2.11.jar (511ms)
[info] downloading http://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.jar ...
[info] [SUCCESSFUL ] commons-codec#commons-codec;1.4!commons-codec.jar (515ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-webapp/8.1.13.v20130916/jetty-webapp-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-webapp;8.1.13.v20130916!jetty-webapp.jar (531ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-xml/8.1.13.v20130916/jetty-xml-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-xml;8.1.13.v20130916!jetty-xml.jar (510ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlet/8.1.13.v20130916/jetty-servlet-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-servlet;8.1.13.v20130916!jetty-servlet.jar (532ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util/8.1.13.v20130916/jetty-util-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-util;8.1.13.v20130916!jetty-util.jar (589ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-security/8.1.13.v20130916/jetty-security-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-security;8.1.13.v20130916!jetty-security.jar (527ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-server/8.1.13.v20130916/jetty-server-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-server;8.1.13.v20130916!jetty-server.jar (606ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.jar(orbit) (567ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-continuation/8.1.13.v20130916/jetty-continuation-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-continuation;8.1.13.v20130916!jetty-continuation.jar (501ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-http/8.1.13.v20130916/jetty-http-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-http;8.1.13.v20130916!jetty-http.jar (530ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-io/8.1.13.v20130916/jetty-io-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-io;8.1.13.v20130916!jetty-io.jar (529ms)
[info] downloading http://repo1.maven.org/maven2/org/scalatest/scalatest_2.11/2.2.1/scalatest_2.11-2.2.1.jar ...
[info] [SUCCESSFUL ] org.scalatest#scalatest_2.11;2.2.1!scalatest_2.11.jar(bundle) (3044ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.2/scala-reflect-2.11.2.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.2!scala-reflect.jar (2710ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.2!scala-xml_2.11.jar(bundle) (945ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.6/scala-compiler-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.6!scala-compiler.jar (9882ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.6/scala-reflect-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.6!scala-reflect.jar (2726ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.3/scala-xml_2.11-1.0.3.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.3!scala-xml_2.11.jar(bundle) (792ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.3/scala-parser-combinators_2.11-1.0.3.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.3!scala-parser-combinators_2.11.jar(bundle) (685ms)
[info] downloading http://repo1.maven.org/maven2/jline/jline/2.12.1/jline-2.12.1.jar ...
[info] [SUCCESSFUL ] jline#jline;2.12.1!jline.jar (575ms)
[info] Done updating.
[info] Compiling 14 Scala sources to /Users/USERNAME/wisp/core/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.6. Compiling...
[info]   Compilation completed in 6.847 s
[warn] there were 9 feature warnings; re-run with -feature for details
[warn] there was one inliner warning; re-run with -Yinline-warnings for details
[warn] two warnings found
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_91).
Type in expressions to have them evaluated.
Type :help for more information.


Command:

scala> import com.quantifind.charts.Highcharts._


Result:

import com.quantifind.charts.Highcharts._


Command:

scala> line((1 to 10), (1 to 10))


Result:

serving resources from: file:/Users/USERNAME/wisp/index-1477712248460.html
2016-10-29 12:37:28.864:INFO:oejs.Server:jetty-8.1.13.v20130916
2016-10-29 12:37:28.899:INFO:oejs.AbstractConnector:Started SocketConnector@0.0.0.0:55135
Server started: http://192.168.0.3:55135/index-1477712248460.html
Output written to http://192.168.0.3:55135 (CMD + Click link in Mac OSX).
res0: com.quantifind.charts.highcharts.Highchart = Highchart(List(Series(Vector(DataPair(1,1,None,None), DataPair(2,2,None,None), DataPair(3,3,None,None), DataPair(4,4,None,None), DataPair(5,5,None,None), DataPair(6,6,None,None), DataPair(7,7,None,None), DataPair(8,8,None,None), DataPair(9,9,None,None), DataPair(10,10,None,None)),None,None,None,Some(line),None,None,None,None,series)),Some(Title(,None,None,None,None,None,None,None,title)),Some(Chart(Some(xy))),None,Some(Credits(None,,None,None,)),Some(Exporting(chart,None,None,None,None,None,None)),None,Some(PlotOptions(None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,plotOptions)),None,true,None,Some([Lcom.quantifind.charts.highcharts.Axis;@3a5792a6),Some([Lcom.quantifind.charts.hi...


Graphical output:

Wisp Is Scala Plotting Example on macOS Sierra




macOS Sierra: Installing Scala

Command:

$ brew install scala


Result:

==> Downloading https://homebrew.bintray.com/bottles/scala-2.11.8.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring scala-2.11.8.sierra.bottle.tar.gz
==> Caveats
To use with IntelliJ, set the Scala home to:
  /usr/local/opt/scala/idea

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/scala/2.11.8: 51 files, 30.9M


Command:

$ scala -version


Result:

Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL


Command:

$ scalac -version


Result:

Scala compiler version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL


Command:

$ fsc -version


Result:

Fast Scala compiler version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL