View gist:233d6c88ed73a0ba3c3b
  1. General Background and Overview
View JSONSample.scala
import scala.util.parsing.json._
val result = JSON.parseFull("""
{"name": "Naoki", "lang": ["Java", "Scala"]}
result match {
case Some(e) => println(e) // => Map(name -> Naoki, lang -> List(Java, Scala))
case None => println("Failed.")
# encoding: utf-8
Script to convert the weltmodell into the conceptnet.
@author: Michael A. Huelfenhaus
import sys
import csv
import hashlib
View all_yzt.sql
select numerator.x, numerator.num/denominator.denom, numerator.y, numerator.z, numerator.t
(select sum(x) as num, x, y, z, t from table group by x, y, z, t) numerator
(select sum(x) as denom, y, z, t from table group by y,z,t) denominator
on (numerator.y=denominator.y and numerator.z=denominator.z and numerator.t=denominator.t)
View sbt-intellij-build.txt
gen-idea no-sbt-build-module
/*This will enable IntelliJ's default building mechanism for Scala, which won't cause these problems.*/
View intellij-scala-sbt.txt
how-to: Scala for INtellij installation:
how-to: create IntelliJ Idea project from existing github project:
git clone <scala_project_from_git_built with_sbt>
cd <to project root>
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.node.Node;
import java.util.Date;
import static org.elasticsearch.node.NodeBuilder.*;
import static org.elasticsearch.common.xcontent.XContentFactory.*;
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update