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
scriptencoding=utf-8 | |
function! objects#font#New() | |
let font = {} | |
let font.name = '' | |
let font.encoding = 'DEFAULT' | |
let font.iconv_to = 'utf-8' | |
let font.size = 12 | |
let font.options = '' |
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! -nargs=1 -bar -complete=customlist,Favorite_Color FavoriteColor call Set_Favorite_Color(<q-args>) | |
" colorschemeとそれに関連するGui情報を格納したobject | |
function! s:color_dict_object(colorscheme, transparency, ...) | |
let l:color_dict = {} | |
let l:color_dict.colorscheme = a:colorscheme | |
let l:color_dict.background = get(a:, '1', '') | |
let l:color_dict.transparency = a:transparency | |
return l:color_dict | |
endfunction |
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
(defun calc_bmi (height weight) | |
(float | |
(flet ( | |
(twice (number) | |
(* number number)) | |
(divid-100(number) | |
(/ number 100)) | |
) | |
(/ | |
weight |
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
// Exercise1.2 | |
var calc = function(f){ | |
return function(){ | |
var tmp; | |
for (var i = 0; i < arguments.length; i++){ | |
var num = arguments[i]; | |
if (typeof tmp === 'undefined'){ | |
tmp = num; | |
}else{ | |
tmp = f(tmp, num); |
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 Duck where | |
class Duck a where | |
quack :: a -> String | |
feathers :: a -> String | |
data Person = Person deriving(Show) | |
data DomesticDuck = DomesticDuck deriving(Show) |
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! Aif(a, ope, b) | |
let a = a:a | |
let ope = a:ope | |
let b = a:b | |
execute 'return ' . a . ope . b . ' ? ' . a . ' :' . b | |
endfunction | |
function! Bigger(a, b) | |
return Aif(a:a, '>', a:b) | |
endfunction |
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! -nargs=0 -bar FontReSize call s:changeFontSize() | |
function! s:changeFontSize() | |
let font_size_pat = '(.{-}\S:h)(\d+\.?\d*)(.{-})' | |
let valid_num_pat = '\d+(\.(0|5))?' | |
let current_font_size = substitute(&guifont, '\v^' . font_size_pat . '$', '\2', '') | |
if current_font_size !~ '\v^' . valid_num_pat . '$' | |
return | |
endif | |
" disalbe ime |
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
Algol | |
B | |
C | |
D | |
Erlang | |
F# | |
Go | |
Haskell | |
io | |
Java |
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 Data.List | |
data Sex = Male | Female deriving (Show, Eq, Ord) | |
data Customer = Customer{ sex :: Sex, age :: Int } deriving(Show, Eq, Ord) | |
(|>) :: a -> (a -> b) -> b | |
x |> f = f x |
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
--haskell | |
foldl (+) 0 $ filter (<5) [1,2,3,4,5,6] | |
--elixiri | |
[1,2,3,4,5,6] |> Enum.filter(&(&1 < 5)) |> List.foldl(0, &(&1 + &2)) |