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 lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<script> | |
function stepRK(h,f,x,y) { | |
var tmp=[],k1=[],k2=[],k3=[],k4=[]; | |
var n = f.length; // n == f.length == y.length | |
for (var i=0;i<n;i++) tmp[i] = y[i]; | |
for (var i=0;i<n;i++) k1[i] = h*f[i](x, tmp); |
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 lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<script> | |
function stepRK(h,f,x,y) { | |
var tmp=[],k1=[],k2=[],k3=[],k4=[]; | |
var n = f.length; // n == f.length == y.length | |
for (var i=0;i<n;i++) tmp[i] = y[i]; | |
for (var i=0;i<n;i++) k1[i] = h*f[i](x, tmp); |
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 lang="ja"> | |
<head> | |
<script> | |
function rungekutta(n,xn,f0,f1,x0,y00,y10) { | |
var h = (xn - x0) / n; | |
var xi = x0, obj = [y00,y10]; | |
function step(x,obj) { | |
var y0 = obj[0], y1 = obj[1]; |
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 lang="ja"> | |
<head> | |
<script> | |
function rungekutta(n,xn,f,x0,y0) { | |
var h = (xn - x0) / n; | |
var xi = x0, yi = y0; | |
function step(x,y) { | |
var k1 = f(x, y), | |
k2 = f(x+h/2, y+h*k1/2), |
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 lang="ja"> | |
<meta charset="UTF-8" /> | |
<title>こんにちは世界</title> | |
<script> | |
'use strict'; | |
var canvas, ctx; | |
window.onload = function () { | |
canvas = document.getElementById('canvas'); |
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> | |
// Reference: R(mat,i,j) -> mat[i][j] | |
#define R(mat,i,j) (mat).m[(i)*(mat).c+(j)] | |
typedef struct { | |
int r, c; | |
double *m; | |
} mat; |
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 <ctype.h> | |
//////////////////////////////////////////////////////////////// | |
// types | |
//////////////////////////////////////////////////////////////// | |
enum exp_tag { | |
exp_var, exp_lam, exp_app |
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 Data.Maybe (fromMaybe) | |
data Turtle = Turtle { turtleX :: Double | |
, turtleY :: Double | |
, turtleD :: Double | |
, turtleLine :: [(Double,Double,Double,Double)] | |
} deriving Show | |
moveTurtle a c t | |
| c == '+' = turn a 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
l=[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."];toM=fmap unwords.mapM(`lookup`zip['A'..]l);toA=mapM(`lookup`zip l['A'..]).words | |
main=maybe(return())putStrLn$toA"... --- ..." | |
-- or | |
-- main=maybe(return())putStrLn$toM"HOGE" |
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> | |
typedef long item; | |
typedef struct { | |
int max_size; | |
int head, length; | |
item *items; | |
} queue; |
NewerOlder