This file contains hidden or 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.onload = function(){ | |
//ネストしたObjectから望みの値を取り出す | |
var a = { | |
"a":{ | |
"aa":0, | |
"ab":1, | |
"ac":2, | |
"ad":3}, | |
"b":{ | |
"aa":10, |
This file contains hidden or 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 = { | |
"a":{ | |
"aa":0 | |
, "ab":1 | |
, "ac":2 | |
, "ad":3 | |
, "exa":{ | |
"exaa":"asdf" | |
} | |
}, |
This file contains hidden or 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
/* *** ship ***************************************************************** */ | |
function ship(){ | |
var slot1 = new equip(); | |
var slot2 = new equip(); | |
var slot3 = new equip(); | |
var slot4 = new equip(); | |
this.firepower = 0; | |
this.topedo = 0; | |
this.antisubmarine = 0; | |
this.equipments = { |
This file contains hidden or 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
@charset "utf-8"; | |
@font-face { | |
font-family: mplus-1m-regular; | |
src: url('http://mplus-fonts.sourceforge.jp/webfonts/mplus-1m-regular.ttf') | |
format("truetype"); | |
} | |
/* Color scheme at Solarized | |
base03: #002b36; |
This file contains hidden or 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 line; | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function (chunk) { | |
line = chunk.split(""); | |
}); | |
process.stdin.on('end', function () { | |
var result = line.map(function(x, y){ |
This file contains hidden or 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
c <- c(0,1,2,3,4) | |
s <- c("A","B","A","A","B") | |
d <- data.frame(num = c, str = s) | |
for(i in d$str){ | |
cat(paste("i = ", i, "\n", sep = "")) | |
} | |
t <- table(d$str) | |
for(i in t){ | |
cat(paste(i/sum(t), "\n", sep = "")) | |
} |
This file contains hidden or 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
/* | |
fold(reduce, inject)を定義するまでの足跡 | |
JavascriptのArray.prototype.reduce()はちょっと定義がおかしい。 | |
引用元(MDN[https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce]) | |
>>構文 | |
>>var result = array.reduce(callback[, initialValue]); | |
>>引数 | |
>>callback:4つの引数をとって、配列内の各値に対し実行するコールバック関数 | |
>> previousValue:現在処理されている配列要素の 1 つ前の要素。もしくは、initialValue。 initialValue については、後で述べます。 |
This file contains hidden or 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
'use strict'; | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
let line = ''; | |
process.stdin.on('data', chunk => { | |
line += chunk; | |
}); | |
process.stdin.on('end', () => { | |
const str = getInput(line), |
This file contains hidden or 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
{ | |
# 制御文字はダメっぽいので^Mで代用する | |
/^M$/!b loop | |
/^M$/s/^M//g | |
b done | |
:loop | |
N | |
/^M$/!b loop | |
s/\n//g |
This file contains hidden or 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
pandoc \ | |
--from=markdown \ | |
--to=latex \ | |
--output=${OUTPUT_FILE} \ | |
--pdf-engine=lualatex \ | |
--variable=lang:ja \ | |
--variable=documentclass:ltjsbook \ | |
--variable=papersize:b5 \ | |
--variable=classoption:oneside \ | |
--variable=classoption:openany \ |