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
ghc --make todo.hs |
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 System.Random | |
-- getStdGen , newStdGen | |
-- If you use getStdGen 2 times , you can get the same result. | |
-- In this case , you can use newStdGen instead of getStdGen after the first time you use getStdGen. | |
main = do | |
gen <- getStdGen | |
putStrLn $ take 20 (randomRs ('a','z') gen ) | |
gen' <- newStdGen | |
putStrLn $ take 20 (randomRs ('a','z') gen' ) |
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
New-Item -ItemType Directory -Name ディレクトリ名 |
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 System.Environment | |
import Data.List | |
{- | |
>.\arg.exe abc xyz "123 456" | |
The arguments are: | |
abc | |
xyz | |
123 456 | |
The program name is: | |
arg.exe |
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 System.Environment | |
import System.Directory -- openTempFile , removeFile | |
import System.IO | |
import Control.Exception -- bracketOnError | |
import qualified Data.ByteString.Lazy as B | |
{- | |
This code is referenced from "Learn You a Haskell for Great Good!!" | |
-} | |
main = do |
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
{- | |
Reverse Polish Notation | |
>example | |
rpn "10 4 3 + 2 * - " | |
-4.0 | |
rpn "30 4 +" | |
34.0 | |
rpn "4 3 + 10 *" |
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
>runhaskell RoutePath.hs < paths.txt | |
The best path to take is : BCACBBC | |
Time taken: 75 |
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 Translate | |
( toPostFix | |
, translate | |
) where | |
import Data.Char | |
import qualified Data.Map as Map | |
-- ("operator",priority) | |
operators = Map.fromList [ ("+",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
#include<string> | |
#include<iostream> | |
// arg1 : 評価する式 | |
// arg2 : 式の参照位置 | |
// return : std::pair<構文解析結果,次の参照位置> | |
using RESULT = std::pair < int, size_t > ; | |
RESULT expr(const std::string&, size_t); | |
RESULT term(const std::string&, size_t); | |
RESULT factor(const std::string&, size_t); |
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
[merge] | |
tool = WinMerge | |
[mergetool "WinMerge"] | |
cmd = \"C:/Program Files/WinMerge/WinMergeU.exe\" //e //u //wl //wr \"$LOCAL\" \"$BASE\" \"$REMOTE\" //o \"$MERGED\" | |
trustExitCode = true | |
[mergetool "kdiff3"] | |
path = C:/Program Files/KDiff3/kdiff3.exe | |
[diff] | |
guitool = winmerge | |
[difftool "kdiff3"] |
OlderNewer