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 static Calendar getBeginningOfMonth(Calendar date) { | |
| date.set(Calendar.DAY_OF_MONTH, 1); | |
| date.set(Calendar.HOUR_OF_DAY, 0); | |
| date.set(Calendar.MINUTE, 0); | |
| date.set(Calendar.SECOND, 0); | |
| date.set(Calendar.MILLISECOND, 0); | |
| return date; | |
| } |
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.futureprocessing.scala_sugar | |
| object StringsScala { | |
| def padStart(string: String, minLength: Int, padChar: Char) = | |
| padChar.toString * (minLength - string.length) + string | |
| } |
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.futureprocessing.scala_sugar | |
| object StringsScalaLikeJava { | |
| def padStart(string: String, minLength: Int, padChar: Char): String = { | |
| if (string.length >= minLength) { | |
| return string | |
| } | |
| val sb: StringBuilder = new StringBuilder(minLength) | |
| for (i <- string.length until minLength) { |
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 scala.concurrent.duration._ | |
| import scala.concurrent.{Await, Future} | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import org.scalatest.FunSuite | |
| class ErrorsTest extends FunSuite { | |
| test("Future can recover from error") { | |
| val numberFuture: Future[Int] = generateNumber() | |
| val addedFuture: Future[Int] = numberFuture.map(addThree).recover({ | |
| case exception: IllegalStateException => -1 |
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 CardTransactionEntity AS ct WHERE (EXISTS(FROM TravelProductOnCardEntity AS prod WHERE ct.travelProductOnCard = prod AND prod.smartCard.smartCardId = :smartCardId) OR EXISTS(FROM ProfileOnCardEntity AS prof WHERE ct.profileOnCard = prof AND prof.smartCard.smartCardId = :smartCardId)) ORDER BY ct.transactionDate DESC |
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.concurrent.Semaphore | |
| import scala.concurrent.Future | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import org.scalatest.FunSuite | |
| class CallbacksTest extends FunSuite { | |
| test("Callback are complicated") { | |
| var result: Int = 0; val semaphore = new Semaphore(1, true) | |
| generateNumber(generatedNumber => addThree(generatedNumber, |
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 concurrent.duration._ | |
| import concurrent.{Await, Future, Promise} | |
| import org.scalatest.FunSuite | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| class Snippets extends FunSuite { | |
| test("Promise can be fulfilled") { | |
| val numberPromise = Promise[Int]() | |
| val addedFuture = addThree(numberPromise.future) |
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 pl.baza.gui.controllers.tasks; | |
| import javafx.beans.value.ChangeListener; | |
| import javafx.beans.value.ObservableValue; | |
| import javafx.fxml.FXML; | |
| import javafx.fxml.Initializable; | |
| import javafx.scene.layout.AnchorPane; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.Days; | |
| import org.springframework.beans.factory.InitializingBean; |
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
| -Xms512m | |
| -Xmx512m | |
| -classpath | |
| "C:\Java\MavenRepo\com\parkeon\gto\transfolio\product\transfolio-address-interface\2.10.0-SNAPSHOT\transfolio-address-interface-2.10.0-SNAPSHOT.jar;C:\Java\MavenRepo\com\parkeon\gto\core\gto-core\2.10.0-SNAPSHOT\gto-core-2.10.0-SNAPSHOT.jar;C:\Java\MavenRepo\org\springframework\spring-beans\3.1.0.M2\spring-beans-3.1.0.M2.jar;C:\Java\MavenRepo\org\springframework\spring-core\3.1.0.M2\spring-core-3.1.0.M2.jar;C:\Java\MavenRepo\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\Java\MavenRepo\org\springframework\spring-context\3.1.0.M2\spring-context-3.1.0.M2.jar;C:\Java\MavenRepo\org\springframework\spring-expression\3.1.0.M2\spring-expression-3.1.0.M2.jar;C:\Java\MavenRepo\org\springframework\spring-asm\3.1.0.M2\spring-asm-3.1.0.M2.jar;C:\Java\MavenRepo\org\springframework\spring-aop\3.1.0.M2\spring-aop-3.1.0.M2.jar;C:\Java\MavenRepo\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Java\MavenRepo\org\aspectj\aspectjweaver\1.5.4\aspectjweaver-1.5.4.jar;C:\Java\Mave |
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.futureprocessing.fpcommunity.controllers.event; | |
| import java.security.Principal; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Controller; | |
| import org.springframework.web.bind.WebDataBinder; | |
| import org.springframework.web.bind.annotation.ExceptionHandler; | |
| import org.springframework.web.bind.annotation.InitBinder; | |
| import org.springframework.web.bind.annotation.PathVariable; | |
| import org.springframework.web.bind.annotation.RequestMapping; |