Scala does not have checked exceptions like Java, so you can't do soemthing like this to force a programmer to deal with an exception:
public void stringToInt(String str) throws NumberFormatException {
Integer.parseInt(str)
}
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/test | |
curl -X PUT localhost:9200/test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
#A simple Slideshow module wrapped in a Backbone View
Viewable in action in this jsfiddle
import org.codehaus.jackson.JsonNode; | |
import play.libs.WS; | |
import play.libs.F.Promise; | |
import play.libs.WS.WSRequestHolder; | |
/** | |
* Refer | |
* http://goo.gl/HXhJG | |
* Javadoc api/2.1.0/java/play/libs/WS.WSRequestHolder : http://goo.gl/AXmBY |
public class Application extends Controller { | |
public static void index() { | |
render(); | |
} | |
public static void uploadPicture(Picture picture) { | |
picture.save(); | |
index(); | |
} |
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
// | |
// Permission is hereby granted, free of charge, to any person |