This file contains hidden or 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
# startup.sh | |
#bin/bash | |
if [ ! -z $1 ] | |
then | |
mkdir -p ~/.[appname] | |
nohup java -Xmx[heapsize] -jar -D[system-property]=$1 [appname].jar > [appname].log & | |
ps -ef | grep java | grep [startup class] | awk '{print $2}' > ~/.[appname]/[appname].pid | |
else | |
echo "startup failed, no [parameter] argument passed" |
This file contains hidden or 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
object WordAbbrevationPermutations extends App{ | |
val list = "FOOO" :: "BAR" :: "BAZ" :: Nil //FBB, FBA, FBZ, FAB.. | |
abbrevations(list).foreach(println) | |
def abbrevations(list: List[String]): List[String] ={ | |
list match{ | |
case head :: Nil => head.map(_.toString).toList | |
case head :: tail => head.flatMap(c => abbrevations(tail).map(s => c.toString + s)).toList | |
} |
This file contains hidden or 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 sbt._ | |
import Keys._ | |
object TemplateBuild extends Build { | |
val description = SettingKey[String]("description") | |
resolvers ++= repos | |
val parentSettings = Defaults.defaultSettings ++ Seq( | |
parallelExecution := false, |
This file contains hidden or 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
(defdata MyDataType [name age] | |
{:name non-empty-string? :age number?} ;; map with validation functions for each key in a concrete instance | |
SomeProtocol ;; optional protocol/interface implementations | |
(some-protocol-fn-impl [a] (println a)) ;; implementation of protocol functions | |
) |
This file contains hidden or 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
ubuntu@ip-10-29-141-177:~/dist/Geekbench-2.4.2-Linux$ ./geekbench_x86_64 | |
Geekbench 2.4.2 : http://www.primatelabs.com/geekbench/ | |
System Information | |
Operating System Ubuntu 12.10 3.5.0-17-generic x86_64 | |
Model | |
Motherboard | |
Processor Intel Xeon E5-2665 @ 2.40 GHz | |
1 Processor, 8 Threads | |
Processor ID GenuineIntel Family 6 Model 45 Stepping 7 |
This file contains hidden or 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
046334981291/UbuntuQuetzal_64_py27 (Ubuntu 64bit image), m1.large instance, zone: us-east-1d | |
Geekbench Score: 3047 | |
ubuntu@ip-10-85-131-166:~/dist/Geekbench-2.4.2-Linux$ ./geekbench_x86_64 | |
Geekbench 2.4.2 : http://www.primatelabs.com/geekbench/ | |
System Information | |
Operating System Ubuntu 12.10 3.5.0-17-generic x86_64 | |
Model | |
Motherboard |
This file contains hidden or 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
rsync -rtvucz --delete from/ to/ |
This file contains hidden or 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
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . | |
"http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
(setq indent-tabs-mode nil) | |
(setq tab-width 2) | |
(add-to-list 'load-path "~/.emacs.d/ensime_2.10.0-0.9.8.9/elisp/") | |
(require 'ensime) |
This file contains hidden or 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
{-# LANGUAGE DeriveGeneric, TypeOperators, FlexibleContexts #-} | |
-- Use GHC 7.4's Generic class for creating Monoid instances | |
import GHC.Generics | |
import Data.Monoid | |
import Data.Map (Map) | |
-- Generic version of Monoid. We'll need to create an instance for each of the | |
-- Generic types. | |
class GMonoid f where | |
gmempty :: f a |
This file contains hidden or 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 net.java.quickcheck.Generator; | |
import net.java.quickcheck.generator.PrimitiveGenerators; | |
import net.java.quickcheck.generator.iterable.Iterables; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
public class QuickcheckTest { | |
@Test |