Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Larysa Visengeriyeva visenger

🎯
Focusing
  • Berlin, Germany
Block or report user

Report or block visenger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ExternalJson.java
package de.bhtb.data.formats;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.net.URL;
import java.util.Scanner;
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.")
}
View wm-cn-conversion.py
# 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
join
(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)
@visenger
visenger / sbt-intellij-build.txt
Last active Dec 19, 2015
Solving "shared output path" - problem
View sbt-intellij-build.txt
sbt
gen-idea no-sbt-build-module
/*This will enable IntelliJ's default building mechanism for Scala, which won't cause these problems.*/
@visenger
visenger / intellij-scala-sbt.txt
Last active Dec 16, 2015
Scala - Sbt - IntelliJ saga ;)
View intellij-scala-sbt.txt
how-to: Scala for INtellij installation:
http://stackoverflow.com/questions/9563342/how-to-run-scala-code-on-intellij-idea-11
--------------------------------------------------------------------------------
how-to: create IntelliJ Idea project from existing github project:
git clone <scala_project_from_git_built with_sbt>
cd <to project root>
View EsTest.java
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.node.Node;
import java.io.IOException;
import java.util.Date;
import static org.elasticsearch.node.NodeBuilder.*;
import static org.elasticsearch.common.xcontent.XContentFactory.*;
@visenger
visenger / install_scala_sbt.sh
Last active Feb 14, 2019
Scala and sbt installation on ubuntu 12.04
View install_scala_sbt.sh
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
You can’t perform that action at this time.