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 puts = console.log, | |
p = require("util").print, | |
cin = parseInput(); | |
// ここに処理を記述 | |
function parseInput(useSplitSpace) { | |
var index = 0, | |
ret = [], | |
input = require("fs").readFileSync("/dev/stdin", "utf8"), |
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
/** | |
* 標準入力のパースと汎用関数を提供する | |
* @method parseInput | |
* @param {Boolean} [useSplitSpace] スペースを区切り文字として利用する | |
* @default true | |
*/ | |
function parseInput(useSplitSpace) { | |
var index = 0, | |
ret = [], |
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
(function(window, undefined) { | |
"use strict"; | |
var map; | |
var domUtil = { | |
byId: function(id, context) { | |
context = context || document; | |
return context.getElementById(id); | |
}, |
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
function parse(str) { | |
/** | |
演算子順位解析 | |
http://fujimura2.fiw-web.net/java/mutter/operator-precedence/index.html | |
-1: x(パースエラー) | |
0: shift | |
1: reduce | |
2: pop | |
3: end |
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
/** | |
JS:島の多いエーゲ海 | |
https://codeiq.jp/challenge.php?challenge_id=381 | |
*/ | |
(function(global, undefined) { | |
"use strict"; | |
// 縦か横に隣接する島をすべて沈める(0にする) | |
// 沈められる島が無くなったら終了 | |
function sink(field, 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
<?php | |
define("READ_START_SYMBOL", "# ---auto update---"); | |
define("READ_END_SYMBOL", "# ---/auto update---"); | |
// | |
function notify_update($name, $from, $to) { | |
echo "updated '".$name."' from ".$from." to ".$to."\n"; | |
} |
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
# encoding: utf-8 | |
# このお店とこのお店は同じ店?! | |
# https://codeiq.jp/ace/fshin2000/q391 | |
searches = [ | |
"中目黒いぐち", | |
"まるかつ水産 東京ミッドタウン店", | |
"寿司寿" | |
] |
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
# encoding: utf-8 | |
require "twitter" | |
Twitter.configure{ |conf| | |
conf.consumer_key = CONSUMER_KEY | |
conf.consumer_secret = CONSUMER_SECRET | |
conf.oauth_token = OAUTH_TOKEN | |
conf.oauth_token_secret = OAUTH_TOKEN_SECRET | |
} |
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
/** | |
############# | |
webテンプレ | |
############# | |
1. undefinedは値ではなくグローバル変数なため書き換えができる | |
=> 確実にundefinedとなる書き方 | |
2. 他のファイルに影響する可能性がある | |
=> 無闇にグローバルを汚染しないために即時関数で囲う | |
=> 関数内のみ適用されるstrictモードを使用 | |
=> グローバルstrictは他の非strictコードに影響を与えてしまう |
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
(function(global, undefined) { | |
"use strict"; | |
var Pocket = (function() { | |
var https = require("https"); | |
function Pocket(opt) { | |
this.consumer_key = opt.consumer_key; | |
this.access_token = opt.access_token; | |
} |