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 BROWSER(){ | |
var userAgent = window.navigator.userAgent.toLowerCase(); | |
var appVersion = window.navigator.appVersion.toLowerCase(); | |
var BROWSER; | |
if (userAgent.indexOf("msie") > -1) { | |
if (appVersion.indexOf("msie 6.0") > -1) { | |
BROWSER = "IE6"; | |
} | |
else if (appVersion.indexOf("msie 7.0") > -1) { | |
BROWSER = "IE7"; |
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 OS(){ | |
var OS, ua = navigator.userAgent; | |
// Windows 7 | |
if (ua.match(/Win(dows )?NT 6\.1/)) { | |
OS = "Windows 7"; | |
} | |
// Windows Vista | |
else if (ua.match(/Win(dows )?NT 6\.0/)) { | |
OS = "Windows Vista"; | |
} |
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 send_data_to_new_window(){ | |
// about:blankとしてウィンドウを開く | |
var target = 'TageName'; | |
window.open('', target); | |
// form生成 | |
var form = document.createElement('form'); | |
form.action = 'TageURL'; | |
form.target = target; |
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 addFigure(str){ | |
return String(str).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); | |
} |
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
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/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
javascript:(function(){ | |
/* 読み込み時に実行 */ | |
(function(){ | |
/** | |
* convertType = 変換方向タイプ | |
* true : 文字列を2進数に変換 | |
* false : 2進数を文字列に変換 | |
*/ | |
var convertType = true; | |
/* 変換対象のオブジェクト */ |
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
パスを次のように代入していると仮定する | |
PATH="/Users/batako/Download/pantsu.zip" | |
【フルファイル名取得】 | |
echo ${PATH##*/} |
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
# 指定ディレクトリの最後の「/」は省略可能 | |
DIRECTORY_PATH="/Users/batako/Download/" | |
for FILE_PATH in `echo $DIRECTORY_PATH/ | sed -e "s/\/\//\//g"`* | |
do | |
echo ${FILE_PATH##*/} | |
done |
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
# 指定ディレクトリの最後の「/」は省略可能 | |
PATH="Download/pantsu.zip" | |
if [ -d $PATH ] | |
then | |
echo `cd ${PATH%/*};pwd` | |
else | |
echo `cd ${PATH%/*};pwd`/${PATH##*/} | |
fi |
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
set ns [new Simulator] | |
set f [open out.tr w] | |
$ns trace-all $f | |
set nf [open out.nam w] | |
$ns namtrace-all $nf | |
set n0 [$ns node] | |
set n1 [$ns node] |
OlderNewer