Skip to content

Instantly share code, notes, and snippets.

View visenger's full-sized avatar

Dr. Larysa Visengeriyeva visenger

View GitHub Profile
# encoding: utf-8
Script to convert the weltmodell into the conceptnet.
@author: Michael A. Huelfenhaus
import sys
import csv
import hashlib
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.")
  1. General Background and Overview
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.*;
visenger / intellij-scala-sbt.txt
Last active December 16, 2015 22:19
Scala - Sbt - IntelliJ saga ;)
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>
visenger / sbt-intellij-build.txt
Last active December 19, 2015 04:58
Solving "shared output path" - problem
gen-idea no-sbt-build-module
/*This will enable IntelliJ's default building mechanism for Scala, which won't cause these problems.*/
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)
import java.util.Scanner;
visenger /
Last active January 31, 2023 19:10
Scala and sbt installation on ubuntu 12.04
# 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