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
/** | |
* 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
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
#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 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
before | |
def fib(n) { | |
if (n < 3) { | |
return 1; | |
} | |
return fib(n-1) + fib(n-2); | |
} | |
var a = readInt(); | |
printInt fib(a); |
NewerOlder