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
| [package] | |
| name = "ch7" | |
| version = "0.0.1" | |
| authors = ["UEHARA Junji <[email protected]>"] |
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
| /* | |
| http://nabetani.sakura.ne.jp/hena/ord27raswi/ | |
| */ | |
| #![feature(collections)] | |
| #![feature(core)] | |
| extern crate core; | |
| use std::string::String; | |
| use std::collections::BTreeSet; | |
| use core::iter::FromIterator; |
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
| class ShowTestTarget { | |
| static void main(args) { | |
| "git log -10 --numstat --pretty=<@>%s".execute().text.split(/<@>/).drop(1).collect{it.split(/\n/).drop(2)}.flatten().collectMany { def m= (it=~ /(\d+)\W+(\d+)\W+(.*)/); m.matches()?[(m.collect{it}[0][1..-1])]:[] }.sort{-(Integer.parseInt(it[0])+Integer.parseInt(it[1]))}.each { | |
| println it[2] | |
| } | |
| } | |
| } |
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 Graphics.Input (..) | |
| import Signal | |
| import Signal(Channel) | |
| import Graphics.Element (..) | |
| import Text(..) | |
| import List(..) | |
| type Keys = Number Int | Add | Sub | Mul | Div | Clear | Enter | |
| keys : Channel Keys |
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 groovy.transform.SourceURI | |
| class UriTest { | |
| static main(String[] args) { | |
| @SourceURI String src | |
| println src | |
| } | |
| } |
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
| FROM onesysadmin/gvm | |
| # [Build] | |
| # cd /path/to/grails/project | |
| # docker build -t you/product . | |
| # [Run] | |
| # docker run -it -v /path/to/grails/project:/app --link pg:db you/project:latest | |
| # docker run -d -v /path/to/grails/project:/app --link pg:db you/project:latest run-app | |
| ENV PROXY_HOST 1.2.3.4 # proxy address/hostname | |
| ENV PROXY_PORT 18080 # proxy port |
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 java.util.function.* | |
| import groovy.transform.TypeChecked | |
| import static Util.* | |
| /* Type Classes */ | |
| @TypeChecked | |
| interface Semigroup<T> { | |
| def T mappend(T t1, T t2); | |
| } | |
| @TypeChecked |
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 java.util.function.*; | |
| interface Functor<T,R> { | |
| public R fmap(Function<T,R> func, T t); | |
| } | |
| interface Applicative<A,T,R> extends Functor<T,R> { | |
| public A<T> pure(T t); | |
| public A<T> ap(A<Function<T,R>> func, A<R> a); // <*> :: f (a -> b) -> f a -> f b | |
| } |
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 Window | |
| thickLine = { defaultLine | width <- 20 } | |
| roundLine = { thickLine | cap <- Round } | |
| smoothLine = { thickLine | join <- Clipped, cap <-Round } | |
| main = let | |
| disp w h = collage w h | |
| [ move (-100,250) <| outlined thickLine <| ngon 5 100 | |
| , move (-100,250) <| outlined thickLine <| polygon [(200, 0),(250,100),(150,100)] |
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 Mouse | |
| import Window | |
| data Event = MouseUp | MouseDown | MouseMove Int Int | |
| type Status = { mouseDown:Bool, points:[(Int, Int)] } | |
| initialState : Status | |
| initialState = Status False [] | |
| nextState : Event -> Status -> Status |
NewerOlder