switch 2 pages
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 fakes = [].slice.call(document.getElementsByClassName("lightgray")), fake; | |
while (fake = fakes.shift()) { | |
fake.parentNode.insertBefore(document.createTextNode(" "), fake); | |
fake.parentNode.removeChild(fake); | |
} |
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 a = {x: 10, y: 580}; | |
var b = {x: 1990, y: 580}; | |
// 描画サイズ |
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 download(url, filename) { | |
var a = document.createElement("a"); | |
a.href = url; | |
a.download = filename || url.split("/").slice(-1)[0]; | |
a.click(); | |
} |
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
# ロジスティック写像 | |
# 周期倍加分岐図 | |
require(compiler) | |
# 設定 | |
x0 <- 0.1 | |
aR <- 29000:40000 / 10000 | |
tR <- 1900:2000 |
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
// test1 | |
console.log(getLineNumber()); | |
// test2 | |
var test = (function test() { | |
console.log(getLineNumber()); | |
return test; | |
})(); | |
var obj = { |
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
### | |
GeneticAlgorithm Class | |
### | |
Gene = require "./Gene" | |
class GA | |
# 個体数, 評価関数 | |
constructor: (@population, @gene_size) -> | |
@genes = (new Gene(null, @gene_size) for x in [0...population]) |
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 <windows.h> | |
#include <assert.h> | |
#define EXITIF(COND) if (COND) { assert(!(COND)); exit(EXIT_FAILURE); } | |
void server(short port) | |
{ | |
WSADATA wsaData; | |
int sock, newsock, sinlen, r, result, num; | |
u_long ulnum; | |
struct sockaddr_in sinme, sinhim; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
// 配列シャッフル | |
void shuffle(void*, size_t, size_t); | |
// funcs | |
char _a(void) {return 'A';} | |
char _b(void) {return '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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>WebSocket</title> | |
</head> | |
<body> | |
<h1>Hello</h1> | |
<script> | |
var event_src = new EventSource("http://localhost:3000/"); | |
event_src.onopen = function (e) { |