This file contains 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
#!/bin/bash | |
# WORKAROUND (2014-07-16, Marc): Avoids "No scala version specified or detected" | |
# error when Play 2.0.x and 2.3.x projects are both built by same local user. | |
if [ -e "${HOME}/.sbt/boot/other" ]; then | |
rm -rfv ~/.sbt/boot/other | |
rm -v ~/.ivy2/cache/org.scala-sbt/sbt/ivy-0.13.5.xml | |
fi | |
export SBT_OPTS="-Dsbt.repository.config=/etc/sbt/repositories -Dsbt.override.build.repos=true" |
This file contains 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
// In response to Slack post "Please explain why Doubles work this way" | |
// | |
// For doubles... | |
// 1.001484375 - 1 = 0.0014843749999999822 | |
// 0.001484375 + 1 = 1.001484375 | |
// | |
// To run, start the repl with `sbt console`, then paste all this in | |
// | |
import java.lang.Double.doubleToRawLongBits | |
import java.lang.Long.{toBinaryString, toHexString} |
This file contains 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
How do we test TIM controllers from the html parameters? | |
Rails: | |
test "should create post" do | |
assert_difference('Post.count') do | |
post :create, :post => { :title => 'Hi', :body => 'This is my first post.'} | |
end | |
assert_redirected_to post_path(assigns(:post)) | |
assert_equal 'Post was successfully created.', flash[:notice] |
This file contains 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 from research resource (https://timdev.youdevise.com:443/TIMHead/services/company/4028ae8d2fedb469013026db4847036c/research?from=2011-10-01&to=2011-11-21&author=4028ae8d303589ad013056ecb93a5efe&ratingLabel=Neutral): | |
<?xml version="1.0" standalone="yes" ?> | |
<error>could not load an entity: [com.youdevise.ids.sector.ReutersSubIndustry#101]</error> | |
Excerpt from Application.log on Defence: | |
2011-11-21 20:02:32,166 tbrown (REST request) ERROR [ajp-192.168.43.5-8009-69] rest3.RequestInvoker$ResourceWriter (RequestInvoker.java:89) - Unhandled exception in Rest3 Request. | |
org.hibernate.exception.JDBCConnectionException: could not load an entity: [com.youdevise.ids.sector.ReutersSubIndustry#101] | |
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97) |
This file contains 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 gwt.example01firstlight.client; | |
import com.google.gwt.core.client.EntryPoint; | |
import com.google.gwt.user.client.rpc.AsyncCallback; | |
import com.google.gwt.user.client.ui.Label; | |
import com.google.gwt.user.client.ui.RootPanel; | |
import com.google.gwt.user.client.ui.TextBox; | |
import static gwt.example01firstlight.client.Example01FirstLightService.App; |
This file contains 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 gwt.example01firstlight.server; | |
import com.google.gwt.user.server.rpc.RemoteServiceServlet; | |
import com.google.inject.Singleton; | |
import gwt.example01firstlight.client.Example01FirstLightService; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
@Singleton |
This file contains 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 gwt.example01firstlight.client; | |
import com.google.gwt.user.client.rpc.AsyncCallback; | |
public interface Example01FirstLightServiceAsync { | |
void getMessage(String msg, AsyncCallback<String> async); | |
} |
This file contains 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 gwt.example01firstlight.client; | |
import com.google.gwt.core.client.GWT; | |
import com.google.gwt.user.client.rpc.RemoteService; | |
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; | |
@RemoteServiceRelativePath("ex1") | |
public interface Example01FirstLightService extends RemoteService { | |
String getMessage(String msg); |
This file contains 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
/** | |
* Without worrying about concurrency, we can simply cache the return value, | |
* using null to indicate that it has not yet been calculated... | |
*/ | |
public class Memoize1 extends Original { | |
private Integer total; | |
@Override | |
public int total() { | |
if (total == null) { |
This file contains 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 play.api._ | |
import mvc._ | |
import controllers.Info.VERSION_PROPERTY | |
import controllers.Info.DEFAULT_VERSION | |
object Global extends GlobalSettings { | |
val VERSION_PROPERTY = "my.property.name" | |
val DEFAULT_VERSION = "0.0.0" |
OlderNewer