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
#include <stdio.h> | |
#include <errno.h> | |
#define LINE_SEP "\r\n" /* 改行コード */ | |
static int G_iWriteErrFlg = FALSE; | |
static int G_iWriteErrNo = 0; | |
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
MODULE = hogehoge | |
OBJS = $(MODULE).o | |
CFLAGS = -g | |
$(MODULE): $(OBJS) | |
$(CC) -o $@ $(OBJS) | |
.c.o: | |
$(CC) $(CFLAGS) -c $< |
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
#!/bin/sh | |
TIMES=3 | |
# 複数コマンドを平行して実行 | |
idx=0 | |
while test $idx -lt $TIMES | |
do | |
./hoge.sh $idx & | |
eval pid$idx=\$! # プロセスID | |
idx=`expr $idx + 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
Sub OpenCsv() | |
Const MAX_COLS = 256 '最大列数 | |
Dim strFileName As String | |
Dim vrnFieldInfo(MAX_COLS - 1) As Variant | |
Dim i As Integer | |
'ファイル名入力 | |
strFileName = Application.GetOpenFilename( _ | |
"テキストファイル,*.txt,CSVファイル,*.csv") | |
If strFileName = "False" Then |
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.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.StringReader; | |
/** | |
* Javaソースのコメントを削除 | |
* 行コメントとブロックコメントがネストしているような場合はうまくいかない時があるので注意 | |
* 使用例: java CommentDelete < Test.java > Test.txt |
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
'単語を「_」(アンダーバー)で連結している文字列を | |
'Java変数名風に変換します。 | |
'「_」の次の文字を大文字にし、それ以外を小文字にします。 | |
'例)to_java_name→toJavaName | |
'セルに以下のように数式として記述することで使用できます。 | |
'例)=ToJavaName(A1) | |
Function ToJavaName(ByVal Name As String) | |
Dim NewName As String | |
Dim I As Integer | |
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
// ==UserScript== | |
// @include http://www.google.co.jp/* | |
// ==/UserScript== | |
alert(1); setTimeout(function() { alert(2) }, 0); |
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
set LIST_FILE=list.txt | |
set TARGET_PROC=sample.bat | |
rem カレントディレクトリを保存 | |
for /F %%a in ('cd') do set ROOT_DIR=%%a | |
rem ファイルの行数分繰り返し | |
for /F %%i in (%LIST_FILE%) do call :loop %%i | |
goto :end |
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
置換前:(\d{4}/\d{2}/\d{2}) (\d{2}:\d{2}) +(<DIR>|[\d,]+) +([^ ]+)$ | |
置換後:\4\t\1 \2\t\3 |
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
mkdir result | |
for FILE in *.txt; do sed -e '1,3d' -e 's/\b9999\b/0001/g' -e '/^REM\b/d' $FILE > result/$FILE; unix2dos result/$FILE; done | |
# カレントディレクトリの「*.txt」ファイルが対象 | |
# 「-e '1,3d'」1行目から3行目を削除 | |
# 「-e 's/\b9999\b/0001/g'」正規表現に合致する文字列を置換 | |
# 「-e '/^REM\b/d'」正規表現に合致する行を削除 |