Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
building stuff

Viliam Simko vsimko

💭
building stuff
View GitHub Profile
@vsimko
vsimko / scala-test-example.scala
Created Oct 7, 2016
example of a test in scala
View scala-test-example.scala
// taken from: http://www.scalatest.org/user_guide/selecting_a_style
class TVSetSpec extends FeatureSpec with GivenWhenThen {
info("As a TV set owner")
info("I want to be able to turn the TV on and off")
info("So I can watch TV when I want")
info("And save energy when I'm not watching TV")
feature("TV power button") {
scenario("User presses power button when TV is off") {
View graphhopper.md
View dist-wmat-computation.R
library(raster)
# global config
INPUT_FNAME <- "/home/vlx/Work/biggis/data-julian/Auto150_georef.tif"
BAND <- 1
AGGREG_FACT <- 150
AGGREG_FUNC <- mean
# here comes the code
View corel-asp3-dng-bug.md
View tupper-in-r.R
## Load the library after installing GMP
library(gmp)
library(raster)
plot_tupper <- function(k) {
## The tupper's formula
tupper = function(x, y, k){
z1 <- as.bigz(y + k)
z2 <- as.bigq(z1/17)
View sparklyr-is-working.R
# if (!require('devtools')) install.packages('devtools')
# devtools::install_github('apache/spark@v2.0.2', subdir='R/pkg')
library(SparkR)
library(sparklyr)
library(dplyr)
# use specific version of spark/hadoop
sc <- spark_connect("local", version = "2.0.2", hadoop_version = "2.7")
View alex-shell-stuff.sh
# convert ";" to ","
tr ";" "," < input.csv > output.csv
# list of columns with associated numbers
head -1 commadata.csv | tr ',' '\n' | nl
# project columns 1,2,163-174 into a new file
cut -d',' -f 1,2,163-174 commadata.csv > SOC.csv
# random subsample of 100 rows (not tested)
View sparklyr-is-working2.R
library(SparkR)
library(sparklyr)
library(dplyr)
# use specific version of spark/hadoop
sc <- spark_connect("local", version = "2.0.2", hadoop_version = "2.7")
# assuming comma-separated input
spark_read_csv(
sc, "bmw", "~/SOC.csv",
View thesis-margins.tex
\usepackage[outerbars,xcolor]{changebar} % due to \cbcolor, \cbstart ... \cbend
\setlength{\changebarwidth}{3pt}
\setlength{\changebarsep}{20pt}
\definecolor{ChangebarColor}{rgb}{0.75,0.85,0.95}
\cbcolor{ChangebarColor}
% ==============================================================================
% Marking the changebark using a margin note
% ==============================================================================
You can’t perform that action at this time.