sudo yum update -y
# mozc関連
sudo yum install -y mozc*
# ibus関連
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 Control.Monad | |
| linearScale :: (Fractional a, Integral b) => (a, a) -> b -> ([a], a) | |
| linearScale (begin, end) n = (xs, dx) | |
| where | |
| dx = (end - begin) / (fromIntegral n) | |
| xs = [(fromIntegral n) * dx + begin | n <- [0 .. ]] | |
| forwardEuler :: (Fractional a, Integral b) => (a, a) -> b -> (a -> a) -> [a] | |
| forwardEuler range n f = ys |
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
| makePyramid :: Int -> [String] | |
| makePyramid h | h < 1 = [] | |
| | otherwise = [makeLine n | n <- numbers] | |
| where | |
| numbers = take h [x | x <- [1..], odd x] | |
| l = last numbers | |
| makeLine n = spaces ++ asters ++ spaces | |
| where | |
| numOfSpaces = (l - n) `div` 2 | |
| spaces = [' ' | _ <- [1 .. numOfSpaces]] |
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
| # Prefix | |
| set-option -g prefix C-z | |
| # 日本語環境 | |
| setw -g utf8 on | |
| set -g status-utf8 on | |
| # 設定の再読み込み | |
| bind C-r source-file ~/.tmux.conf |
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
| -- Initial Hello.cabal generated by cabal init. For further | |
| -- documentation, see http://haskell.org/cabal/users-guide/ | |
| name: Hello | |
| version: 0.1.0.0 | |
| synopsis: Hello world | |
| -- description: | |
| homepage: http://foobar | |
| license: MIT | |
| license-file: LICENSE |
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
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| const uint64_t MAP_ARRAY_LENGTH = 100; | |
| struct map_node { | |
| uint64_t state; | |
| void *value; | |
| struct map_node *next; |
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
| {-# LANGUAGE ScopedTypeVariables #-} | |
| import System.IO | |
| import Control.Monad | |
| import Control.Exception | |
| printFile :: FilePath -> IO () | |
| printFile filePath = do | |
| h <- openFile filePath ReadMode | |
| x <- hGetContents h | |
| putStrLn x |
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 Control.Monad.Trans.Resource(runResourceT, allocate, release) | |
| import Control.Monad.IO.Class(liftIO) | |
| import System.IO | |
| printFile :: FilePath -> IO () | |
| printFile filePath = runResourceT $ do | |
| (releaseKey, resource) <- allocate (openFile filePath ReadMode) hClose | |
| liftIO (hGetContents resource >>= putStrLn) | |
| release releaseKey | |
| return () |
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
| {-# LANGUAGE OverloadedStrings #-} | |
| import Network.HTTP.Conduit | |
| import Data.Conduit | |
| import Data.Conduit.Binary | |
| import Control.Monad.IO.Class (liftIO) | |
| import Data.Conduit | |
| import System.IO |
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
| {-# LANGUAGE RankNTypes #-} | |
| import Data.Conduit | |
| import qualified Data.Conduit.List as CL(consume, filter) | |
| import Data.Conduit.Filesystem | |
| import qualified Filesystem.Path as FP (FilePath, filename) | |
| import Control.Monad.IO.Class(MonadIO) | |
| pickup :: (Monad m) => FP.FilePath -> Consumer FP.FilePath m (Maybe FP.FilePath) | |
| pickup target = await >>= pickup' | |
| where |