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
#!/bin/sh | |
# | |
# emerge -vp hoogle の後,hoogle-build-localdbを走らせろと言われるが, | |
# それを無視してコッチのスクリプトを走らせるとローカルにインストールしたパッケージのhaddock等を参照するhoogle DBが作られる. | |
# そのままで hoogle server すると file:/// とローカルドキュメントへのファイルURLが検索結果に出るようになる. | |
# また, hoogle server -l すると http://localhost:port/file//usr/share/doc のような,hoogle serverがstatic fileとして処理ってくれるURLになって, | |
# Haskell環境はVMの中(でホストからputty等で接続してるだけ)だけどブラウザはホストから使いたいようなケースでもOKになる. | |
# | |
ROOT="/" |
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
main = interact $ 値を文字列に変換する . | |
最大値だけを取りだす . | |
最大値プラスアルファを求める . | |
各文字を数値に変換する . | |
各行の文字列を一つに繋げる | |
各行の文字列を一つに繋げる = concat . lines | |
各文字を数値に変換する = map 文字一つを数値に変換する |
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
@echo off | |
REM どうすんだこれ;; | |
REM for /f "delims=" %%i in ( %~1 ) do ( | |
REM if "%%i" == "@echo off" ( | |
REM echo @echo on | |
REM ) else ( | |
REM echo %%i | |
REM ) | |
REM ) |
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 RecordWildCards, TupleSections #-} | |
module Main where | |
import Data.List(partition) | |
import GTA.Data.JoinList(Semiring, JoinList, JoinListAlgebra(..), | |
joinize, dejoinize, maxsumsolutionWith) | |
import GTA.Core(GenericSemiring(..), CommutativeMonoid(..), Bag(..), | |
hom, oplus, identity, (<.>), filterBy, aggregateBy) | |
import Data.Vector.Bit(packInteger, pad) | |
import Data.Bits(bit, (.|.), (.&.)) |
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
module Main where | |
import Data.List(sortBy) | |
import Data.Ord(comparing) | |
main :: IO () | |
main = interact $ unlines . take 1 . map (show . uncurry enumFromTo) . zzubzzif . lines | |
zzubzzif :: [String] -> [(Int,Int)] | |
zzubzzif [] = [] |
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
#define Q(X)p=#X;X | |
Q(char s[999];n;main(i){for(sprintf(s,"#define Q(X)p=#X;X\nQ(%s)",p);s[n];p&&putchar(s[n]),n++)for(p=n<2,i=1;++i<n;p+=!(n%i));}) |
NewerOlder