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
http://stackoverflow.com/questions/17452045/syntaxerror-invalid-character-u8220 | |
Mac のテキストエディットでプレーンテキストでコードを書いてたら jsc での実行時にエラー。 | |
テキストエディットでは、プレーンテキストでも引用符があかんやつにされてしまいます。 | |
コードは vi とかで書こう。 | |
http://stonedsoul.org/post/116226943/javascript | |
JS の配列操作について。 | |
splice とか shallow copy について触れられてる。 |
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
# defaults commands with com.apple.iphonesimulator | |
# usage in detail will show with `defaults` without any arguments | |
# this sets default simulator device to iPhone | |
defaults write com.apple.iphonesimulator SimulateDevice -string "iPhone" | |
defaults write com.apple.iphonesimulator SimulateSDKRoot -string "${SDKROOT_iphonesimulator}" | |
# this sets default simulator device to iPad | |
defaults write com.apple.iphonesimulator SimulateDevice -string "iPad" | |
defaults write com.apple.iphonesimulator SimulateSDKRoot -string "${SDKROOT_iphonesimulator_ipad}" |
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 obj = {"a":1, "b":2, "c":3 }; | |
Object.keys(obj); // this will return a list of keys in obj | |
for (var k in obj) | |
{ | |
// this will iterate over the keys in obj | |
process.stdout.write(k); | |
} |
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 deg2binTable(num, pow) { | |
var result = []; | |
var maxNum = Math.pow(2, pow - 1); | |
for(var i = 0; i <= num; i++) | |
{ | |
var target = i; | |
var nesNum = maxNum; | |
var packing = ""; | |
var str = ""; |