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
before | |
def fib(n) { | |
if (n < 3) { | |
return 1; | |
} | |
return fib(n-1) + fib(n-2); | |
} | |
var a = readInt(); | |
printInt fib(a); |
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 math._ | |
import collection.mutable._ | |
object Main { | |
def main(args: Array[String]) { | |
val sc = new java.util.Scanner(System.in) | |
val T = sc.nextInt() | |
for (t <- 1 to T) { | |
val H = sc.nextInt() | |
val W = sc.nextInt() |
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
#include <dispatch/dispatch.h> | |
int main() { | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{puts("gcd! gcd!");}); | |
sleep(1); | |
} |
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 java.util.Random | |
object HelloWorld extends App { | |
println(randomString(748171626L) +" "+ randomString(31718954746L)) | |
println(randomString2(748171626L) +" "+ randomString2(31718954746L)) | |
def randomString(i :Long) :String = { | |
val rand = new Random(i) | |
val sb = new StringBuilder() | |
rs(rand.nextInt(27)) |
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
/** | |
* Scalaコンパイラを使ってクラスやメソッドの行数をチェックしてみようのテスト | |
* | |
* コンパイラプラグインの使い方は以下のサイトを参考にしています。 | |
* http://www.ne.jp/asahi/hishidama/home/tech/scala/cplugin/index.html | |
* | |
* 使い方 | |
* 1. scalac-plugin.xmlをclassesに置く | |
* 2. コンパイル | |
* scalac -d classes CompilerPluginSample.scala |
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
// clang hoge.m -o hoge -framework Foundation -fobjc-arc | |
#import <Foundation/Foundation.h> | |
@interface A : NSObject { | |
double dummy; | |
} | |
@property (strong, nonatomic, setter=setDummyNumber:, getter=dummyNumber) NSNumber *number; | |
@end |
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
git log --shortstat --since "2 days ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}' |
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 sbt._ | |
import Keys._ | |
import play.Project._ | |
object ApplicationBuild extends Build { | |
val appName = "test" | |
val appVersion = "1.0-SNAPSHOT" | |
/*lazy*/val main = play.Project(appName, appVersion, appDependencies).settings() // cause NullPointerException! |
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.specs2.mutable.Specification | |
class HogeSpec extends Specification { | |
"One" should { | |
"Two test" in { | |
2 === 2 | |
} | |
"Two" in { | |
"Three test" in { | |
3 === 3 |
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
00101100110001101010101010101100011011001011001001101100000111001010101010101100100111000000101000101100100001101100101001101100100111000001001011101100000011001011001010101100100111000101101010101100111011000001001000101100110011001110101010101100100001101001101000101100001011001010101010101100111011001010101000101100011011001110001001101100111011001011001001101100001001101110101010101100101011000011001010101100011011001110101001101100000111000000101010101100100111000011001000101100100001100100101001101100100111000100101010101100100011000001001001101100100111000011001010101100100011001001101000101100111011001010101000101100010011000110101001101100111011000100101000101100110011001110001001101100111011000101001011001100001001100000101011001100001001100001001000001100100001101100101001010000 |
OlderNewer