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
open Js | |
let f1 c = | |
c##prop1 <- true | |
(* | |
Val: val ff1 : < prop1 : < set : bool -> unit; .. > Js.gen_prop; | |
prop2 : < get : < prop1 : < set : bool -> unit; .. > | |
Js.gen_prop; | |
.. > | |
Js.t; |
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 class Foo { | |
public static void main(String[] args) { | |
try { | |
if (new javax.script.ScriptEngineManager().getEngineByExtension("js").eval( | |
"var i = 1\n" + | |
"while (i < 100) {\n" + | |
"if (i % 15 == 0) println('FizzBuzz')\n" + | |
"else if (i % 3 == 0) println('Fizz')\n" + | |
"else if (i % 5 == 0) println('Buzz')\n" + | |
"else println(i)\n" + |
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
module A { | |
export module B { | |
export var C:any = {} | |
} | |
} | |
module A { | |
export module B { | |
console.log("1", C); | |
function f(B) { |
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
let f a = | |
let t0 = Unix.gettimeofday() in | |
let acc = ref a in | |
for j = 1 to 10000000 do | |
acc := !acc +. (float_of_int j) | |
done; | |
let t1 = Unix.gettimeofday() in | |
Printf.printf "Time: %.3f %f\n%!" (t1-.t0) !acc | |
let _ = |
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 class Nan { | |
static void f(double a) { | |
long t0 = System.nanoTime(); | |
double acc = a; | |
for (int i = 0; i < 100000000; i++) { | |
acc += i; | |
} | |
long t1 = System.nanoTime(); | |
System.out.println("time:" + (t1 - t0) / 1000000 + " " + acc); |
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
// http://d.hatena.ne.jp/nowokay/20140330#1396177524 | |
import java.util.*; | |
import java.util.function.*; | |
import java.util.stream.*; | |
public class LoopBench2 { | |
public static void main(String[] args) { | |
List<Integer> list = IntStream.range(0, 100_000).boxed().collect(Collectors.toList()); | |
array = list.toArray(new Integer[0]); | |
for (int i = 0; i < 10; i++) { |
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
int code_execcmd( void ) | |
{ | |
//... | |
try { | |
while(1) { | |
if ( GetTypeInfoPtr( type )->cmdfunc( val ) ) { // タイプごとの関数振り分け | |
if ( hspctx->runmode == RUNMODE_RETURN ) { | |
cmdfunc_return(); | |
} else { | |
hspctx->msgfunc( hspctx ); |
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 type _JQueryAjaxSettings = object | |
method accepts : Ts.any Js.prop | |
method async : Ts.typeReference Js.prop | |
method beforeSend : (Ts.typeReference -> Ts.typeReference -> Ts.any) Js.prop | |
method cache : Ts.typeReference Js.prop | |
method complete : (Ts.typeReference -> Ts.string -> Ts.any) Js.prop | |
method contents : Ts.typeLiteral Js.prop | |
method contentType : Ts.string Js.prop | |
method context : Ts.any Js.prop | |
method converters : Ts.typeLiteral Js.prop |
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
RewriteEngine on | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{REQUEST_FILENAME}\.gz -s | |
RewriteRule .+ %{REQUEST_URI}.gz | |
<FilesMatch "\.js\.gz$"> | |
ForceType application/x-javascript | |
AddEncoding x-gzip .gz | |
</FilesMatch> |
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 A { | |
private m = 123; | |
func(ev: Event) { | |
console.log(this); | |
console.log(this.m); | |
} | |
} | |
var a = new A(); |
OlderNewer