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
#!/usr/bin/env stack | |
-- stack --resolver lts-9.14 script --package array | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import System.Environment | |
import Data.Array.IArray | |
captchaPairs :: (IArray a e, Ix i, Num i) => a i e -> ((i, i) -> i) -> [(e, e)] | |
captchaPairs es getPairIndex = |
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 Color | |
import Debug | |
import Effects exposing (..) | |
import Graphics.Collage exposing (..) | |
import Graphics.Element exposing (..) | |
import Html exposing (div, Html) | |
import Keyboard exposing (..) | |
import Random | |
import StartApp | |
import Text |
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
#!/usr/bin/env stack | |
-- stack --resolver lts-7.9 --install-ghc script --package QuickCheck --package either --package parsec | |
module Roman where | |
import Control.Applicative hiding ((<|>)) | |
import Data.Either.Combinators | |
import Text.Parsec.Prim | |
import Text.Parsec.Combinator | |
import Text.Parsec.Error |
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
# Encoding: UTF-8 | |
module KanjiToNumber | |
MULTIPLIERS = {'十' => 10, '百' => 100, '千' => 1000, '万' => 10000} | |
NUM_FOR_NUM = {'壱' => 1, '一' => 1, '1' => 1, | |
'弐' => 2, '二' => 2, '2' => 2, | |
'参' => 3, '三' => 3, '3' => 3, | |
'四' => 4, '4' => 4, | |
'五' => 5, '5' => 5, | |
'六' => 6, '6' => 6, |
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
UPDATE table | |
SET col1 = CASE id | |
WHEN id1 THEN id1_v1, | |
WHEN id2 THEN id2_v1 | |
END | |
col2 = CASE id | |
WHEN id1 THEN id1_v2, | |
WHEN id2 THEN id2_v2 | |
END | |
WHERE id IN (id1, id2) |
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 IndentedPutser | |
attr_accessor :level | |
def initialize(size) | |
@level = 0 | |
@size = size | |
end | |
def indent | |
self.level += 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
[2011-11-16 01:35:03] make | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c array.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c bignum.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c class.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c compar.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c dir.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c dln.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c enum.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c error.c | |
gcc -g -O2 -fPIC -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c eval.c |