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 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 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 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 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 REGMATCH(target As String, pattern As String, Optional g As Boolean = False, Optional ignoreCase As Boolean = False, Optional multiLine As Boolean = False) As Boolean | |
If Len(pattern) = 0 Then | |
REGMATCH = False | |
Exit Function | |
End If | |
Dim r As New RegExp | |
With r | |
.multiLine = multiLine | |
.Global = 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
{- | |
summary : | |
odds比を計算 | |
detail : | |
与えられた群Aと、(全体-群A)との発生率との比を計算 | |
args : | |
total --全体の数 | |
incidence --全体の発生数 | |
a_total --群Aの全体数 | |
a_incidence --群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
class InvalidateCurrencyUnitError < RuntimeError; end; | |
module CurrencyUnit | |
USD = 1 | |
EURO = 2 | |
YEN = 3 | |
def validate_currency_unit(currency_unit) | |
if currency_unit == USD; return true; end; | |
if currency_unit == EURO; return true; 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
command! -range=% | |
\ OverCommandLine | |
\ call over#command_line( | |
\ g:over_command_line_prompt, | |
\ ( <line1> == 1 && <line2> == line('$') | |
\ ? '%' | |
\ : <line1> != <line2> | |
\ ? printf("%d,%d", <line1>, <line2>) | |
\ : '.' | |
\ ) . 's/\v' |
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
let s:is_loaded_flg = 's:' . substitute(expand('<sfile>:p'), '\W', '_', 'g') | |
if exists(s:is_loaded_flg) | |
finish | |
else | |
execute 'let ' . s:is_loaded_flg . ' = 1' | |
endif |
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
command! FullToHalf call s:full_to_half.substitute() | |
let s:full_to_half = {} | |
let s:full_to_half.table = { | |
\ ' ' : ' ' | |
\ , '(' : '(' | |
\ , ')' : ')' | |
\ , ':' : ':' | |
\ , '0' : '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
function! Init_lightline() | |
call lightline#init() | |
call lightline#colorscheme() | |
call lightline#update() | |
endfunction | |
augroup Init_lightLine.vim | |
autocmd! | |
autocmd BufWritePost * call Init_lightline() | |
augroup end |
NewerOlder