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.awt.*; | |
import java.awt.geom.AffineTransform; | |
import java.applet.*; | |
public class Text extends Applet { | |
@Override | |
public void paint(Graphics g) { | |
Graphics2D g2 = (Graphics2D)g; | |
AffineTransform affine = new AffineTransform(); | |
g2.setColor(Color.BLACK); |
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 _ = | |
for i = 0 to 6 do | |
let result = try Some (List.find (fun s -> s = 1049) [1; 2; 5]) with Not_found -> None in | |
result | |
done |
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 window = Dom_html.window;; | |
let foo i = | |
let result = try Some (List.find (fun s -> s = i) [0; 1; 5]) with Not_found -> None in | |
match result with | |
Some(n) -> window##alert(Js.string (Printf.sprintf "foo Some(%d)" n)) | |
| None -> window##alert(Js.string "foo None");; | |
for i = 0 to 3 do | |
foo 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
diff -rN -u old-js_of_ocaml/compiler/driver.ml new-js_of_ocaml/compiler/driver.ml | |
--- old-js_of_ocaml/compiler/driver.ml 2012-09-05 19:02:07.000000000 +0900 | |
+++ new-js_of_ocaml/compiler/driver.ml 2012-09-05 19:02:07.000000000 +0900 | |
@@ -20,7 +20,7 @@ | |
let debug = Util.debug "main" | |
-let f ?standalone p = | |
+let f ?standalone (p, d) = | |
if debug () then Code.print_program (fun _ _ -> "") p; |
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 _ = | |
<?php | |
for ($i = 1; $i <= 100; $i++) { | |
if ($i % 3 == 0) { | |
?> | |
print_string "Fizz"; | |
<?php | |
} | |
if ($i % 5 == 0) { | |
?> |
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 Batteries_uni | |
let (>>=) = Lwt.bind | |
let http_get url = | |
Printf.printf "sleep\n"; | |
Lwt_unix.sleep 2.0 >>= (fun () -> | |
Printf.printf "wake up\n"; | |
Lwt.return ("data '" ^ url ^ ""));; |
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
///<reference path='..\typescript\src\harness\harness.ts'/> | |
///<reference path='..\typescript\src\harness\baselining.ts'/> | |
///<reference path='..\typescript\src\harness\external\json2.ts'/> | |
///<reference path='..\typescript\src\compiler\optionsParser.ts'/> | |
class Dumper { | |
constructor (public ioHost: IIO) { | |
} |
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
// | |
// Generated by the J2ObjC translator. DO NOT EDIT! | |
// source: AO.java | |
// | |
// Created by mac on 12/11/09. | |
// | |
@class IOSIntArray; | |
@class IOSObjectArray; | |
@class Intersection; |
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
(defun fix-ocaml-cursor-position (byte-pos) | |
(let ((len (lambda (p) | |
(length (encode-coding-string | |
(buffer-substring 1 p) buffer-file-coding-system))))) | |
(let* ((pos (/ byte-pos 4)) | |
(b (funcall len pos))) | |
(while (< b (- byte-pos 1)) | |
(setq pos (+ pos 1)) | |
(setq b (funcall len pos))) | |
pos))) |
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 hoge; | |
export function f() { | |
hoge = 0; | |
var b = 0; | |
return b; | |
} | |
} | |
} |