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
| sealed trait GHPayload | |
| case class GHIssuePayload(...,...,...) extends GHPayload | |
| case class GHPRPayload(...,...,...) extends GHPayload | |
| case class GHPushPayload(...,...,...) extends GHPayload | |
| // implicits rules defined with validation API for case classes.. | |
| val rule: Rule[JsValue, GHPayload] = From[JsValue] { __ => | |
| import play.api.data.mapping.json.Rules._ |
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
| // I want to parse a json payload to a given type corresponding to an event sent in http headers | |
| // I defined an ADT to modelize the different events | |
| sealed trait GHEvent | |
| object GHEvent extends ADTEnum[GHEvent] { | |
| case object commit_comment extends GHEvent | |
| case object create extends GHEvent | |
| case object delete extends GHEvent | |
| case object deployment extends GHEvent | |
| case object deployment_status extends GHEvent |
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
| Modéliser le règne animal tel que tout animal peut dire qui il est. | |
| Définir: | |
| - les oiseaux (ils ont des plumes) | |
| - les mammifères (ils peuvent allaiter) | |
| - les reptiles (ils ont le sang froid) | |
| - les poissons (ils ont des branchies) | |
| - les ovipares | |
| - les animaux marins | |
| - les animaux volants |
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 HotelQS(hotelId: Option[Long] = None, | |
| country: Option[String] = None, | |
| city: Option[String] = None, | |
| zipcode: Option[String] = None) | |
| object HotelQS { | |
| implicit val hotelMapping: Mapping[HotelQS] = | |
| mapping( | |
| "hotelId" -> optional(longNumber), | |
| "country" -> optional(text), |
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
| def compare = Action.async { | |
| implicit request => | |
| play.Logger.debug("compare branches") | |
| val future: Future[(List[String], List[String])] = for { | |
| newRepo <- Gitweb.branches("reservit") | |
| oldRepo <- Gitweb.branches("components") | |
| } yield (Gitweb.extractBranches(newRepo.body), Gitweb.extractBranches(oldRepo.body)) | |
| future.map { case (newRepo, oldRepo) => |
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
| JBAS014312: Cannot lookup jndi name: java:jboss/datasources/MySQLDS since it doesn't belong to java:app, java:module, java:comp or java:global namespace |
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
| Etant donnée la structure de données T suivante : | |
| (id, type, montant) où type est soit AE (A emporter) ou SP (sur place). | |
| Etant données les régles métiers suivantes pour un calcul de TVA : | |
| RM1 : pout toute donnée T de type AE, la TVA est de 5% | |
| RM2: pour tout donéne T de type SP la TVA est de 10% | |
| 1 - Comment implémentez-vous l'application de ces règles métiers sur |
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
| (function ($) { | |
| "use strict"; | |
| var tokenUrl = "http://localhost/token"; | |
| var token = ""; | |
| // Static method default options. | |
| var _opts = { | |
| clientId : "", |
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
| public class UserMock { | |
| /** | |
| * Create instance {@Link User} | |
| * | |
| * @param custid | |
| * @param hotelid | |
| * @since 1.0 | |
| */ | |
| public final static User createUser(Integer custid, | |
| Integer hotelid) { |
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
| val futures = for { | |
| o <- Future.sequence(list.map(Jira.getIssue)) | |
| } yield o | |
| futures.map(results => { | |
| val jsonIssues: List[Option[Issue]] = results.map(result => { | |
| result.json.validate[Issue] match { |