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 _Main { | |
static function main(args:string[]): void { | |
var v = JSON.parse('["a", "b", "c"]'); | |
var i: int; | |
i = (v as Array.<int>)[0]; | |
log 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
/* Smooth scrolling | |
Changes links that link to other parts of this page to scroll | |
smoothly to those links rather than jump to them directly, which | |
can be a little disorienting. | |
sil, http://www.kryogenix.org/ | |
v1.0 2003-11-11 | |
v1.1 2005-06-16 wrap it up in an object | |
*/ |
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
var check = function(digits) { | |
var make_equations = function(digits, strict) { | |
var numbers = digits.length; | |
var equations = {}; | |
var current = []; | |
var make_recursive = function(num_list, nums, operations) { | |
if(num_list.length == 0 && operations == 0) { | |
equations[current.join("")] = true; | |
return; |
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
package com.example.hellogl; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; | |
import java.nio.FloatBuffer; | |
import java.nio.ShortBuffer; | |
import javax.microedition.khronos.egl.EGLConfig; | |
import javax.microedition.khronos.opengles.GL10; |
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
<!doctype html> | |
<html><head><title>escape sample</title></head> | |
// http://www.vector.co.jp/soft/other/java/se342855.html | |
<script src="ecl.js"></script> | |
<script> | |
onload = function() { | |
var xhr = new XMLHttpRequest(); | |
xhr.overrideMimeType('text/plain; charset=x-user-defined'); // binary | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState == 4) { // 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
var mkdir = function(dir) { | |
// making directory without exception if exists | |
try { | |
fs.mkdirSync(dir, 0755); | |
} catch(e) { | |
if(e.code != "EEXIST") { | |
throw e; | |
} | |
} | |
}; |
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
while(offset >= 0) { | |
switch(offset) { | |
case 0: // "PUSH 10" | |
stack.push(10); | |
case 2: // "PUSH 8" | |
stack.push(8); | |
case 4: // "LESS" | |
var a = stack.pop(); | |
var b = stack.pop(); | |
stack.push((a < b)? 1: 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
var fs = require("fs"); | |
var path = require("path"); | |
var rmdir = function(dir) { | |
var list = fs.readdirSync(dir); | |
for(var i = 0; i < list.length; i++) { | |
var filename = path.join(dir, list[i]); | |
var stat = fs.statSync(filename); | |
if(filename == "." || filename == "..") { |
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
var canvas = document.createElement("canvas"); | |
canvas.width = canvas.height = 300; | |
document.body.appendChild(canvas); | |
var ctx = canvas.getContext("2d"); | |
var m = document.createElement("canvas"); | |
m.width = m.height = 100; | |
var mctx = m.getContext("2d"); | |
mctx.fillStyle = "#f00"; | |
mctx.fillRect(0, 0, 100, 100); |
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
var o = {a: 0, b: 1, c: 2, d: 3}; | |
var a = []; var i = 0; | |
for(a[i++] in o); |