This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.potix2.tlp | |
import Bool._ | |
import Nat._ | |
//http://apocalisp.wordpress.com/2010/06/08/type-level-programming-in-scala/ | |
sealed trait Bool { | |
type If[T <: Up, F <: Up, Up] <: Up | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ssh-multi | |
# D.Kovalov | |
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html | |
# a script to ssh multiple servers over multiple tmux panes | |
starttmux() { | |
if [ -z "$HOSTS" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gcj2015; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Scanner; | |
public class C { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gcj2015; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class D { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.SQLContext | |
def etl(sqlContext: SQLContext, source: String, destination: String): Unit = { | |
val df = sqlContext.read.format("com.databricks.spark.csv").option("header", "true").load(source) | |
df.select("year", "model").write.format("com.databricks.spark.csv").save(destination) | |
} | |
// etl(new SQLContext(sc), "cars.csv", "newcars.csv") | |
val testContext = TestSQLContext() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConcatDFSpec extends org.specs2.mutable.Specification { | |
def concat(df: DataFrame, inputColName: String, concatColName: String, outputColName: String, dataType: DataType): DataFrame = | |
df.withColumn(outputColName, callUDF(_ ++ _, dataType, df(inputColName), df(concatColName))) | |
// val paramMap: ParamMap | |
// val inputCol: Param[String] | |
// val outputCol: Param[String] | |
// val concatCol: Param[String] | |
// concat(df, paramMap(inputCol), paramMap(outputCol), paramMap(concatCol), dataType) | |
type A = Map[String, Int] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vbell off | |
autodetach on | |
startup_message off | |
defscrollback 1000 | |
term xterm-256color | |
escape ^La | |
defbce on | |
hardstatus alwayslastline "[%02c] %`%-w%{=b bw}%n %t%{-}%+w" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
export PATH="/usr/local/bin:$PATH" | |
#export PS1='\033k\033\\[\u@\h \W]\$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload colors | |
colors | |
setopt auto_pushd | |
setopt noautoremoveslash | |
bindkey -e | |
autoload -U compinit | |
compinit | |
PROMPT='%39<...<%/%% ' | |
PROMPT2="%_%% " | |
SPROMPT="%r is correct? [n,y,a,e]: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function toRGB(h:Number, s:Number, v:Number):uint { | |
var hi:Number = Math.floor(h / 60) % 6; | |
var f:Number = h / 60 - hi; | |
var p:Number = v * ( 1.0 - s); | |
var q:Number = v * ( 1.0 - f * s); | |
var t:Number = v * ( 1.0 - (1.0 - f) * s); | |
var r:Number; | |
var g:Number; | |
var b:Number; | |
switch(hi) { |
OlderNewer