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
# setting 'exports' as alias to global namespace | |
exports = this | |
# creating an empty object to act as a namespace for classes in this file | |
exports.ext = {} | |
# GreeterPanel is a previously defined CoffeeScript class | |
# namespacing and exposing GreeterPanel globally in the ext.GreeterPanel namespace | |
exports.ext.GreeterPanel = GreeterPanel |
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
// modify to collect errors, use Either or whatever floats your boat, just an example that throws | |
// IllegalArgumentException on the first null or empty String it encounters, if there is one. | |
// Works for any case class or collection such as List. | |
def validateProduct[T <: Product](product: T): Unit = product.productIterator foreach { | |
case null => throw new IllegalArgumentException("null attributes are not allowed for " + product) | |
case x: String if x.isEmpty => throw new IllegalArgumentException("Empty strings are not allowed for " + product) | |
case x: Product => validateProduct(x) | |
case _ => {} | |
} |
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
tpl = new Ext.Template ['Hello {firstName} {lastName}!', | |
' Nice to meet you!'] | |
formPanel = new Ext.form.FormPanel |
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
resolvers ++= Seq(Resolver.url("sbt-plugin-releases", | |
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)) | |
addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.0.10") |
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
(add-to-list 'load-path "~/.emacs.d/scala-mode") | |
(add-to-list 'load-path "~/.emacs.d/ensime/elisp") | |
(require 'scala-mode-auto) | |
(require 'ensime) | |
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook) |
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
lazy val tradingDays: List[List[Price]] = prices.groupBy(price => { | |
Days.daysBetween(price.dateTime, prices.last.dateTime) | |
}).values.toList.sortWith((a,b) => a.head.dateTime.isBefore(b.head.dateTime)) |
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
sudo apt-get --yes --force-yes install openjdk-6-jdk |
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
resolvers ++= Seq("sbt-idea-repo" at "http://mpeltonen.github.com/maven/", "sbt-plugin-releases" at "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/", | |
Resolver.url("sbt-plugin-releases", | |
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)) | |
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.7.3") | |
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0") |
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
{"count":2,"items":[{"ref":{"id":"33816cc4c0a8000215a00d2554f8cab8","accountId":"194ad084c0a80002274b8c218ea70268","dateTime":"2011-12-12T18:20:47Z","documentTime":"2011-12-12T18:20:48Z"},"success":true,"url":"http://blog.recursivity.com/post/13499141271/textminr-progress-update","title":"Recursivity - TextMinr Progress Update"},{"ref":{"id":"334fee29c0a8000215a00d2579292428","accountId":"194ad084c0a80002274b8c218ea70268","dateTime":"2011-12-12T17:26:43Z","documentTime":"2011-12-12T17:26:46Z"},"success":true,"url":"http://blog.recursivity.com/post/13499141271/textminr-progress-update","title":"Recursivity - TextMinr Progress Update"}]} |
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
{"name":"documentsimilarity","config":["REQUEST_ID_OF_FIRST_COMPARISON_DOC", "REQUEST_ID_OF_SECOND_COMPARISON_DOC"]} |