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
[play-kibana] $ compile | |
[info] Updating {file:/home/gbougeard/git/IT/play-kibana/}play-kibana... | |
[info] Resolving com.clever-age#play2-elasticsearch;0.8-SNAPSHOT ... | |
[warn] module not found: com.clever-age#play2-elasticsearch;0.8-SNAPSHOT | |
[warn] ==== local: tried | |
[warn] /usr/local/mystuff/play-current/repository/local/com.clever-age/play2-elasticsearch/0.8-SNAPSHOT/ivys/ivy.xml | |
[warn] ==== Maven2 Local: tried | |
[warn] file:/home/gbougeard/.m2/repository/com/clever-age/play2-elasticsearch/0.8-SNAPSHOT/play2-elasticsearch-0.8-SNAPSHOT.pom | |
[warn] ==== public: tried | |
[warn] http://repo1.maven.org/maven2/com/clever-age/play2-elasticsearch/0.8-SNAPSHOT/play2-elasticsearch-0.8-SNAPSHOT.pom |
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 models.Place | |
import models.Place._ | |
import org.specs2.mutable._ | |
import org.specs2.ScalaCheck | |
import play.api.libs.json.Json | |
import org.scalacheck._ | |
import Gen._ |
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 models.Place | |
import models.Place._ | |
import org.specs2.mutable._ | |
import org.specs2.ScalaCheck | |
import play.api.libs.json.Json | |
import org.scalacheck._ | |
import Gen._ |
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 sbt._ | |
import play.Project._ | |
import sbt.Keys._ | |
import com.typesafe.sbt.packager.Keys._ | |
object Library { | |
// Versions | |
val akkaVersion = "2.2.0" |
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
hotels.groupBy(x => (x._1, x._2, x._4, x._5)).mapValues(x => x.map(_._3.text).mkString) | |
=> ?? | |
hotels.groupBy{ case(hotel, star, descr, cust, email) => (hotel, star, cust, email)} | |
.mapValues{x => x.map(_.descr.text).mkString} |
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
{ | |
"title": "Logstash Search", | |
"services": { | |
"query": { | |
"idQueue": [ | |
1, | |
2, | |
3, | |
4 | |
], |
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
case class Page[A](items: Seq[A], page: Int, offset: Long, total: Long) { | |
lazy val prev = Option(page - 1).filter(_ >= 0) | |
lazy val next = Option(page + 1).filter(_ => (offset + items.size) < total) | |
} | |
object Page { | |
implicit val writes: Writes[Page[A]] = ( | |
(__ \ 'items).write[Seq[A]] ~ | |
(__ \ 'page).write[Int] ~ | |
(__ \ 'offset).write[Long] ~ |
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
> run | |
[info] Running com.reservit.Ghf | |
15:05:23.598 GHF [run-main] INFO com.reservit.Ghf$ - Hello, ghf | |
15:05:24.476 GHF [run-main] WARN com.reservit.Ghf$ - There is not the same Hotels amount in EN and FR | |
15:05:24.476 GHF [run-main] WARN com.reservit.Ghf$ - This ids are not EN list : 2424 | |
15:05:24.476 GHF [run-main] INFO com.reservit.Ghf$ - Creating XML object for lang en and 2 hotels | |
15:05:24.484 GHF [run-main] INFO com.reservit.Ghf$ - File saved to ./google-local_en.xml | |
15:05:24.485 GHF [run-main] INFO com.reservit.Ghf$ - load resource hotel_list.xsd | |
15:05:24.485 GHF [run-main] INFO com.reservit.Ghf$ - lnew schema file:/home/gbougeard/git/IT/ghf-deschotels/target/scala-2.10/classes/hotel_list.xsd | |
15:05:24.515 GHF [run-main] INFO com.reservit.Ghf$ - newValidator |
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
def noneIfEmpty(str:Option[String]) = { | |
str match { | |
case Some(s) => s match { | |
case s.trim.isEmpty => None | |
case s => s | |
} | |
case None => None | |
} | |
} |
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
object GhfBuild extends Build { | |
lazy val ghf = Project( | |
id = "ghf", | |
base = file("."), | |
settings = Project.defaultSettings ++ Seq( | |
name := "ghf", | |
organization := "com.reservit", | |
version := "0.1-SNAPSHOT", | |
scalaVersion := "2.10.2", |