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
let g:quickrun_config['haxe'] = { | |
\ 'command' : 'haxe' | |
\ , 'args' : '-x' | |
\ , 'cmdopt' : '-main ' . "%{HaxeClssName(expand(\"%S:t:r\"))}" | |
\ , 'exec' : "%c %o %a %s:p" | |
\ } | |
function! HaxeClssName(word) | |
" :rで拡張子が削除されてくれないので関数で対処。後で原因調べて直す | |
return substitute(a:word, '^\v.*\ze\.hx', '\u&', '') |
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
ack :: (Integer, Integer) -> Integer | |
ack (0, n) = n + 1 | |
ack (m, 0) = ack(m - 1, 1) | |
ack (m, n) = ack(m -1, ack(m, n-1)) | |
ackGuard :: (Integer, Integer) -> Integer | |
ackGuard (m, n) | |
| m == 0 = n + 1 | |
| n == 0 = ackGuard(m - 1, 1) | |
| otherwise = ackGuard(m -1, ackGuard(m, n-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
import Debug.Trace | |
fact 0 = 1 | |
fact n = n * fact (n - 1) | |
superFact 0 = 1 | |
superFact n = superFact' (n', n') | |
where | |
n' = fact n | |
superFact' (_, 0) = 1 | |
superFact' (n, o) = n^superFact' (n, o - 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
Select-String -path "*.log" -casesensitive -pattern "変数\s+\w+\s+は初期化されていません。|MERGE\s+ステートメントに\s+BY\s+値を繰り返す|(WARNING|ERROR):|^(WARNING|ERROR)" -Encoding default | format-custom -GroupBy filename |
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
def getEncoding(text: String): Option[String] = { | |
def checkEncoding(encoding: String): Boolean = { | |
try{ | |
text == new String(text.getBytes(encoding), encoding) | |
}catch{ | |
case NonFatal(_) => false | |
case th: Throtable => throw th | |
} | |
} | |
List("ascii", "iso-2022-jp", "utf-8", "euc-jp", "sjis", "utf-16") |
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
def allSeq(c: Collection, p: T => Boolean, removeItemCnt: Int = 0): List[Int] = { | |
c.lastIndexWhere(_.p) match{ | |
case n if n == -1 => Nill | |
case n => (n + removeItemCnt + 1) | |
:: allIndex(c.remove(n), removeItemCnt + 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
def matchLine(file: List[String], pattern: String): List[(Int, String)] = { | |
val pat = pattern.r | |
file.par | |
.zipWithIndex | |
.withFilter(line, _index => pat.line) | |
.flatMap(line, index => ( (index + 1), line) ) | |
} |
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
$reg_exp = [string]::join("|", $problematic_msgs) | |
$target_extension = "log" | |
$directory = "." | |
$path = $directory + "\*." + $target_extension | |
$out_file = "logcheck_result.html" | |
$head = @' |
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
" インサートモードに入るか、入力を行った最後の時間変数に保存 | |
autocmd! InsertEnter,InsertChange * :let s:last_action_time = localtime() | |
autocmd! CursorMovedI * :call s:leave_insert_mode() | let s:last_action_time = localtime() | |
autocmd! InsertCharPre * :call s:leave_insert_mode("call feedkeys('" . v:char . "', 'n')", "let v:char = '' ") | |
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
/* 2個の引数を受け取るsomeFuncの定義で一番お勧めなのはどれなんでしょう? */ | |
funcA a b = a * b + (a + b) | |
a `someFunc` b = a `funcA` b | |
someFunc a b = funcA a b | |
someFunc a b = a `funcA` b | |
a `someFunc` b = funcA a b |