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 controllers; | |
import play.*; | |
import play.mvc.*; | |
import views.html.*; | |
public class Application extends Controller { | |
/** |
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
/** map **/ | |
1 to 100 map { | |
case i if i % 15 == 0 => "fizzbuzz" | |
case i if i % 3 == 0 => "fizz" | |
case i if i % 5 == 0 => "buzz" | |
case i => i | |
} foreach println | |
/** for **/ | |
for(i <- 1 to 100) println( |
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 com.github.daiksy.play2.ATND | |
import play.api.libs.ws.WS | |
import collection.mutable.ListBuffer | |
import play.api.libs.json.JsValue | |
/** | |
* ATNDのイベントを検索し、取得する。 | |
* | |
* ・使い方 |
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 com.github.daiksy.play2.ATND | |
import play.api.libs.ws.WS | |
import collection.mutable.ListBuffer | |
import play.api.libs.json.JsValue | |
/** | |
* ATNDのイベントを検索し、取得する。 | |
* https://gist.github.com/2584254を | |
* http://blog.rafaelferreira.net/2008/07/type-safe-builder-pattern-in-scala.html を参考に |
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 com.github.daiksy.play2.ATND | |
import play.api.libs.ws.WS | |
import collection.mutable.ListBuffer | |
import play.api.libs.json.JsValue | |
/** | |
* ATNDのイベントを検索し、取得する。 | |
* | |
* https://gist.github.com/2585850 を |
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
000100 IDENTIFICATION DIVISION. | |
000200 PROGRAM-ID. HELLOWORLD. | |
000300 DATE-WRITTEN. 05/06/12 00:45. | |
000400* AUTHOR DAIKSY | |
100000 PROCEDURE DIVISION. | |
100100 | |
100200 MAIN-LOGIC SECTION. | |
100300 BEGIN. | |
100500 DISPLAY "HELLO, WORLD." | |
100600 STOP RUN. |
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 com.github.gist.daiksy | |
/** | |
* エドウィン・モーガンという現代詩人の作品に | |
* "message clear"というものがあります. | |
* http://www.elgin.free-online.co.uk/misc/message.htm | |
* | |
* これは,1968年の彼の詩集に含まれている作品で, | |
* コンピュータが文章を書いたらどうなるか, | |
* という当時流行した議論をテーマに作られた作品です. |
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
case class Hentai(val smKind: SMKind.Type) { | |
def slap = { | |
smKind match { | |
case SMKind.S => "てめぇ、なにするんだ!" | |
case SMKind.M => "もっと!!!" | |
} | |
} | |
} | |
object SMKind extends Enumeration { |
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
object Hentai { | |
def slapToS = "てめぇ、なにするんだ!" | |
def slapToM = "もっと!!!" | |
} |
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
object jojo extends App { | |
def isPrime(n: Int) = { | |
if (n < 2) { | |
false | |
} else { | |
(2 to n - 1).exists(n % _ == 0) == false | |
} | |
} |
OlderNewer