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 func = function(args) { | |
var pub = {}; | |
var pri = args || {}; | |
pub.get = function(name) { | |
return pri[name]; | |
}; | |
return pub; |
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 isIE() { | |
return false; | |
} | |
function isMoz() { | |
return false; | |
} | |
function isOpera() { | |
return true; | |
} | |
var fn = isIE() ? function() { |
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 closure() { | |
var count = 0; | |
return function(plus) { | |
return count += plus; | |
}; | |
} | |
var close = closure(); | |
var plus1 = close(1); | |
var plus2 = close(2); | |
console.log(plus1); // 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
function baisu(a, b) { | |
var closure = function(x) { | |
return (x % a == 0 && x % b == 0); | |
}; | |
return closure; | |
} | |
function check(list, func) { | |
for (var i = 0; i < list.length; i++) { | |
if (func(list[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
import java.io.BufferedReader; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* info.txtの中身 | |
* a,い |
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 java.io.IOException; | |
import java.io.InputStream; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.JAXBException; | |
import javax.xml.bind.Unmarshaller; |
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
/** | |
* ゲットパラメータ形式の文字列からハッシュオブジェクトを取得、デリミタは&とホワイトスペース | |
* @param {String} str 処理対象パラメータ文字列 | |
* @param {Boolean} [duplicateToArray] 重複パラメータを配列化する | |
* @returns {Object} ハッシュオブジェクト | |
*/ | |
parameterToHash=function(str,duplicateToArray){ | |
if(str===void 0)str=location.search; | |
var params = str.replace(/^\?/g,"").replace(/\s/g,"&").replace(/&+/g,"&").match(/[^&]*/g); | |
var ret = {}; |
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
/** | |
* HTMLエスケープ(replace方式) | |
* @param {String} str 処理対象文字列 | |
* @returns {String} エスケープ済み文字列 | |
* @private | |
*/ | |
escapeHTML1=function(str){ | |
return str.replace(/&/g,"&") | |
.replace(/</g,"<") | |
.replace(/>/g,">") |
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
/** | |
* 関数遅延実行 | |
*/ | |
deferred=(function(){ | |
var _w=window,_d=window.document; | |
var deferred_default=function(func){_w.setTimeout(function(){func()},0);}; | |
var deferred_faster_way_readystatechange=((location.protocol==="http:")&&!_w.opera&&/\bMSIE\b/.test(navigator.userAgent))&&function(func){ | |
var script = _d.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "javascript:"; |
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
/** | |
* 配列ならそのまま、非配列なら要素1の配列として返す | |
*/ | |
MAPION.lang.Snippets.asArray=function(o){ | |
if(o===null||o===void 0)return []; | |
if(o instanceof Array)return o; | |
else return [o]; | |
}; |
OlderNewer