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
#define BIT(n) ((uint32_t)1 << (n)) | |
#define BITMASK(n) (BIT(n) - 1) | |
// code from: spidermonkey.h |
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
#ifdef DEBUG | |
void _Assert(char*, unsigned); | |
#define ASSERT(f) \ | |
if(f) \ | |
NULL; \ | |
else \ | |
_Assert(__FILE__, __LINE__) | |
#else | |
#define ASSERT(f) NULL | |
#endif |
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
window.requestAnimFrame = window.requestAnimationFrame | |
|| window.webkitRequestAnimationFrame | |
|| window.mozRequestAnimationFrame | |
|| window.oRequestAnimationFrame | |
|| window.msRequestAnimationFrame | |
|| function(callback) { | |
window.setTimeout(callback, 1000 / 60); // fps:60 | |
}; |
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
// initialize when DOM content is loaded | |
var domReady = function() { | |
var fns = []; | |
var init = function() { | |
if (!arguments.callee.done) { // run init functions once | |
arguments.callee.done = true; | |
for (var i = 0; i < fns.length; i++) { | |
fns[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
@echo off | |
cls | |
echo 开始获取动态IP :) | |
echo. | |
echo 正在设置自动获取IP地址... | |
netsh interface ip set address "本地连接" dhcp | |
echo 正在设置自动获取DNS... | |
netsh interface ip set dns "本地连接" dhcp |
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
org 07c00h ; tell the complier put this code to 0x7c00 | |
%endif | |
mov ax, cs | |
mov ds, ax | |
mov es, ax | |
call DispStr ; call sub-func | |
jmp $ ; while(1); $ means current address; | |
DispStr: | |
mov ax, BootMessage | |
mov bp, ax |
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 row,column; | |
row = column = 7; // setup the size of game | |
var map = [1,1,1,0,0,1,1]; // setup first column | |
for(i=row;i<row*column;i++) | |
map[i] = 0; // insure others tile are ZERO | |
display(map); | |
function tapByCoor(map,r,c){ | |
index = r*column+c; |
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
function circumcircle(a, b, c) { | |
this.a = a | |
this.b = b | |
this.c = c | |
var A = b.x - a.x, | |
B = b.y - a.y, | |
C = c.x - a.x, | |
D = c.y - a.y, | |
E = A * (a.x + b.x) + B * (a.y + b.y), |
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 load, execute, loadAndExecute; | |
load = function(a, b, c) { | |
var d; | |
d = document.createElement("script"), d.setAttribute("src", a), b != null && d.addEventListener("load", b), c != null && d.addEventListener("error", c), document.body.appendChild(d); | |
return d | |
}, execute = function(a) { | |
var b, c; | |
typeof a == "function" ? b = "(" + a + ")();" : b = a, c = document.createElement("script"), c.textContent = b, document.body.appendChild(c); | |
return c | |
}, loadAndExecute = function(a, 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
abstract class Node { | |
Node left; | |
Node right; | |
Object element; | |
int height; | |
private Node() { | |
} |
OlderNewer