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
subprojects { | |
apply plugin: 'eclipse' | |
apply plugin: 'java' | |
// 全ソースがUTF-8であることを指定する、 | |
// この記述であればsourceSetが増えても対応可能。 | |
def defaultEncoding = 'UTF-8' | |
tasks.withType(JavaCompile) { | |
options.encoding = defaultEncoding | |
} |
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
subprojects { | |
apply plugin: 'eclipse' | |
apply plugin: 'java' | |
// 全ソースがUTF-8であることを指定する、 | |
// この記述であればsourceSetが増えても対応可能。 | |
def defaultEncoding = 'UTF-8' | |
tasks.withType(JavaCompile) { | |
options.encoding = defaultEncoding | |
} |
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
package org.tiqwab.util; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Objects; | |
import org.apache.commons.io.FilenameUtils; | |
public class FileUtils { |
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
const dataSet = [ | |
[ 5, 20 ], | |
[ 480, 90 ], | |
[ 250, 50 ], | |
[ 100, 33 ], | |
[ 330, 95 ], | |
[ 410, 12 ], | |
[ 475, 44 ], | |
[ 25, 67 ], | |
[ 85, 21 ], |
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
const dataSet = [ | |
{ timepoint: '2016-06-08T12:00:00Z', temperature: 15.2 }, | |
{ timepoint: '2016-06-08T13:00:00Z', temperature: 16.1 }, | |
{ timepoint: '2016-06-08T14:00:00Z', temperature: 19.2 }, | |
{ timepoint: '2016-06-08T15:00:00Z', temperature: 21.5 }, | |
{ timepoint: '2016-06-08T16:00:00Z', temperature: 12.8 }, | |
{ timepoint: '2016-06-08T17:00:00Z', temperature: 15.3 }, | |
{ timepoint: '2016-06-08T18:00:00Z', temperature: 15.0 }, | |
{ timepoint: '2016-06-08T19:00:00Z', temperature: 15.1 }, | |
{ timepoint: '2016-06-08T20:00:00Z', temperature: 14.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
import Control.Monad.Reader | |
-- do構文でReaderモナド | |
-- runReader addStuffD 3 = 19 | |
addStuffD :: Reader Int Int | |
addStuffD = do | |
x <- reader (*2) | |
y <- reader (+10) | |
return (x+y) |
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 Data.List | |
import Control.Monad.Reader | |
import Control.Monad.Writer | |
import Data.Maybe | |
-- Pair of row and column | |
type Position = (Int, Int) | |
-- Pair of Position and possible numbers | |
type Cell = (Position, [Int]) | |
-- List of Cell |
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 | |
import Control.Monad.State hiding (modify') | |
{- | |
newtype State s a = State { runState :: s -> (a, s) } | |
instance Monad (State s) where | |
return x = State $ \s -> (x, s) | |
(State h) >>= f = State $ \s -> let (v, newState) = h s | |
(State g) = f v |
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 Text.Parsec | |
import Text.ParserCombinators.Parsec hiding (try) | |
{- | |
Implement calculator with `Parsec` package. | |
-} | |
{- | |
# EBNF |
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 Text.Parsec | |
import Text.Parsec.Expr | |
import qualified Text.Parsec.Language as L | |
import qualified Text.Parsec.Token as T | |
import Text.ParserCombinators.Parsec hiding (try) | |
{- | |
Implement calculator with `Text.Parsec.Expr`. | |
Use `Text.Parsec.Token` to make parsing simple. |
OlderNewer