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
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 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 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 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 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 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 gwt.example01firstlight.client; | |
import com.google.gwt.user.client.rpc.AsyncCallback; | |
public interface Example01FirstLightServiceAsync { | |
void getMessage(String msg, AsyncCallback<String> async); | |
} |
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 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 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 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 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
/** | |
* 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 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 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" |
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 Project | |
attr_reader :supervisor | |
# assume supervisor looks like: | |
# ["Harry", "Henderson", "[email protected]"] | |
def initialize(supervisor) | |
@supervisor = supervisor | |
end |
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
require 'hamster' | |
require 'hamster/experimental/mutable_hash' | |
# a bunch of threads with a read/write ratio of 10:1 | |
num_threads = 100 | |
num_reads_per_write = 10 | |
num_loops = 500 | |
hsh = Hamster.mutable_hash | |
puts RUBY_DESCRIPTION |
OlderNewer