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
resolver: lts-3.19 | |
packages: | |
- '.' | |
- location: | |
git: [email protected]:bos/hdbc-mysql.git | |
commit: d43ea057019ff683f278f36af410f4d3cbc731bc | |
extra-deps: | |
- relational-record-0.1.2.0 |
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
```bash | |
$ brew update | |
``` | |
##Scalaのインストール | |
```bash | |
$ brew install scala | |
$ brew install sbt | |
``` |
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 Data.List (sortOn) | |
import qualified Data.MultiSet as MultiSet | |
main :: IO () | |
main = do | |
contents <- concat . map words . lines <$> readFile "dagon.txt" | |
mapM_ print . take 10 . reverse . sortOn snd . MultiSet.toOccurList . MultiSet.fromList $ contents |
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
flags: {} | |
packages: | |
- '.' | |
extra-deps: | |
- GLURaw-1.5.0.2 | |
- GLUT-2.7.0.3 | |
- JuicyPixels-util-0.2 | |
- ObjectName-1.1.0.0 | |
- OpenGL-2.12.0.1 | |
- OpenGLRaw-2.5.5.0 |
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 GHC.Int | |
validateMyNumber :: Int64 -> Bool | |
validateMyNumber myNumber | |
| length (show myNumber) <= 12 = | |
let (x:pn) = take 12 . map (`mod` 10) . iterate (`div` 10) $ myNumber | |
qn = [if n <= 6 then n + 1 else n - 5 | n <- [1..11]] | |
y = (`mod` 11) . sum . zipWith (*) qn $ pn | |
in x == if y <= 1 then 0 else (11 - y) | |
| otherwise = False |
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.Maybe | |
import Control.Monad.IO.Class | |
import Data.List | |
env :: [(String, Int)] | |
env = [("x", 1), ("y", 2), ("z", 3)] | |
main :: IO () | |
main = do | |
result <- runMaybeT $ do |
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
resolver: lts-3.11 | |
packages: | |
- '.' | |
extra-deps: | |
- HDBC-2.4.0.1 | |
- HDBC-session-0.1.0.0 | |
- names-th-0.1.0.1 | |
- persistable-record-0.1.0.1 | |
- relational-schemas-0.1.0.2 | |
- sql-words-0.1.3.1 |
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 Data.Binary (Binary) | |
import qualified Data.Binary as Bin | |
import qualified Codec.Compression.GZip as GZip | |
import qualified Data.ByteString.Lazy.Char8 as BL | |
pickle :: Binary a => FilePath -> a -> IO () | |
pickle path = BL.writeFile path . GZip.compress . Bin.encode | |
unpickle :: Binary a => FilePath -> IO a | |
unpickle path = Bin.decode . GZip.decompress <$> BL.readFile path |
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 Data.List (sortOn) | |
import Data.Traversable (for) | |
import Github.Data | |
import Github.Repos | |
organizations :: [String] | |
organizations = [ "aws", "google", "facebook", "Microsoft", "cookpad", "CyberAgent" | |
, "DeNADev", "pepabo", "gree", "hatena", "kayac", "mixi-inc", "naver" | |
, "niftycloud", "pixiv", "rakuten-ws", "airbnb", "adobe-webplatform" | |
-- |