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
Dependency | |
========== | |
http://github.com/downloads/xetorthio/jedis/jedis-1.3.0.jar/qr_code | |
Client | |
========= | |
logback-test.xml |
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
// scalac -unchecked -optimise ConsistentHash.scala && scala CHApp | |
import scala.collection.immutable.LinearSeq | |
import java.util.{TreeMap => JTreeMap} | |
import java.util.{SortedMap => JSortedMap} | |
/** | |
* Inspired by http://www.lexemetech.com/2007/11/consistent-hashing.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
/* | |
(1) The findOne method stopped working | |
(2) I get a weird ClassCastException from MegaPoll to MegaPoll, even though I use a custom context and define dao as a val. | |
Polls now get persisted as: | |
*/ | |
{ | |
"_id":ObjectId("4fe18acb286f6aca172f95bb"), | |
"_typeHint":"util.mongo.MegaPoll", |
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
// see http://stackoverflow.com/questions/11130684/modify-xml-in-scala-without-mutation | |
import scala.xml._ | |
import scala.xml.transform._ | |
object BlankReplacer extends BasicTransformer { | |
override def transform(n: Node): NodeSeq = n match { | |
case <blank/> => { | |
<input name={ "blank.%d" }/> | |
} |
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 ResponsePoll( | |
id: Long, | |
name: String, | |
created: Option[Long], | |
question: String, | |
option_a: Option[String], | |
option_b: Option[String], | |
image_a: Option[String], | |
image_b: Option[String], | |
expires: Option[Long], |
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
// <snip> | |
lazy val libratoUsername = Play.maybeApplication.flatMap(_.configuration.getString("librato.username")).getOrElse("[email protected]") | |
lazy val libratoAPIkey = Play.maybeApplication.flatMap(_.configuration.getString("librato.apikey")).getOrElse("blanked-out") | |
lazy val libratoFrequency = Play.maybeApplication.flatMap(_.configuration.getInt("librato.frequency")).getOrElse(120) | |
LibratoReporter.enable(LibratoReporter.builder(libratoUsername, libratoAPIkey, "yack"), libratoFrequency, java.util.concurrent.TimeUnit.SECONDS) | |
// </snip> |
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
Index: archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java | |
=================================================================== | |
--- archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java (revision 1374285) | |
+++ archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java (working copy) | |
@@ -36,7 +36,7 @@ | |
import org.apache.maven.archetype.metadata.FileSet; | |
import org.apache.maven.archetype.metadata.ModuleDescriptor; | |
import org.apache.maven.archetype.metadata.RequiredProperty; | |
-import org.apache.velocity.VelocityContext; | |
+import org.apache.velocity.tools.ToolManager; |
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 e412c574bb581b003736591bea4d197e086d32cf Mon Sep 17 00:00:00 2001 | |
From: Juan Uys <[email protected]> | |
Date: Tue, 28 Aug 2012 21:54:25 +0100 | |
Subject: [PATCH] capped collection support | |
--- | |
.../scala/se/radley/plugin/salat/SalatPlugin.scala | 26 +++++++++++++++++++- | |
.../scala/se/radley/plugin/salat/package.scala | 11 ++++++++ | |
2 files changed, 36 insertions(+), 1 deletions(-) |
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 SMSParserSpec extends Specification { | |
// one hundred characters | |
val h = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" | |
// MORE than one hundred characters | |
val h1 = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + "!" | |
// -- | |
"SMS Parser" should { |
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
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 10. Exception: null | |
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 9. Exception: null | |
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 8. Exception: null | |
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 7. Exception: null | |
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 6. Exception: null | |
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 5. Exception: null | |
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 4. Exception: null | |
[error] c.j.b.h.AbstractConne |
OlderNewer