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
| public interface TheBasics | |
| { | |
| @SqlUpdate("insert into something (id, name) values (:id, :name)") | |
| int insert(@BindBean Something something); | |
| @SqlQuery("select id, name from something where id = :id") | |
| Something findById(@Bind("id") long id); | |
| } |
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 'prettyprint' # for the p function | |
| module Enumerable | |
| alias :fold :inject | |
| end | |
| root = [["root", [ | |
| ["child", [ | |
| ["grandkid", []], | |
| ["grandkid2", []]]], |
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 com.ning.atlas.aws; | |
| import com.amazonaws.auth.BasicAWSCredentials; | |
| import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancingClient; | |
| import com.amazonaws.services.elasticloadbalancing.model.Instance; | |
| import com.amazonaws.services.elasticloadbalancing.model.RegisterInstancesWithLoadBalancerRequest; | |
| import com.ning.atlas.Installer; | |
| import com.ning.atlas.Server; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <scheme name="T2" version="1" parent_scheme="Default"> | |
| <option name="LINE_SPACING" value="1.2" /> | |
| <option name="EDITOR_FONT_SIZE" value="14" /> | |
| <option name="EDITOR_FONT_NAME" value="Menlo" /> | |
| <colors> | |
| <option name="ANNOTATIONS_COLOR" value="3e83e7" /> | |
| <option name="CARET_COLOR" value="ffff99" /> | |
| <option name="CARET_ROW_COLOR" value="" /> | |
| <option name="CONSOLE_BACKGROUND_KEY" value="1a1a1a" /> |
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 org.skife.jdbi.v2.docs; | |
| import org.skife.jdbi.v2.SQLStatement; | |
| import org.skife.jdbi.v2.sqlobject.Binder; | |
| import org.skife.jdbi.v2.sqlobject.BinderFactory; | |
| import org.skife.jdbi.v2.sqlobject.BindingAnnotation; | |
| import org.skife.jdbi.v2.sqlobject.SqlStatementCustomizer; | |
| import org.skife.jdbi.v2.sqlobject.SqlStatementCustomizerFactory; | |
| import org.skife.jdbi.v2.sqlobject.SqlStatementCustomizingAnnotation; |
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
| java.lang.NullPointerException | |
| at org.jruby.util.CodegenUtils.human(CodegenUtils.java:98) | |
| at org.jruby.util.CodegenUtils.prettyParams(CodegenUtils.java:152) | |
| at org.jruby.java.dispatch.CallableSelector.argumentError(CallableSelector.java:462) | |
| at org.jruby.java.dispatch.CallableSelector.argTypesDoNotMatch(CallableSelector.java:436) | |
| at org.jruby.java.invokers.RubyToJavaInvoker.findCallable(RubyToJavaInvoker.java:191) | |
| at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:53) | |
| at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:143) | |
| at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:272) | |
| at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:80) |
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
| @Test | |
| public void testBetterErrorMessage() throws Exception | |
| { | |
| ObjectMapper mapper = new ObjectMapper(); | |
| try { | |
| mapper.writeValueAsString(new Thing()); | |
| fail("should have raised an exception against a private class"); | |
| } | |
| catch (Exception e) { | |
| assertThat(e.getMessage(), containsString("private")); |
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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| int main(int argc, char *argv[]) { | |
| size_t i; | |
| void *mem, *prev; | |
| mem = 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
| @Test | |
| public void testStartDeployedThing() throws Exception | |
| { | |
| // find the deployment url | |
| _Root root = http.prepareGet("http://localhost:25365/") | |
| .setHeader("accept", MediaType.APPLICATION_JSON) | |
| .execute(new JsonMappingAsyncHandler<_Root>(_Root.class)).get(); | |
| _Action deploy = Iterables.find(root._actions, fieldEquals("rel", "deploy")); | |
| // perform a deployment against it |
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
| function setjdk { | |
| local ver=${1?Usage: setjdk <version>} | |
| export JAVA_HOME=$(/usr/libexec/java_home -v $ver) | |
| PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':') | |
| export PATH=$JAVA_HOME/bin:$PATH | |
| } | |
| function _setjdk_completion (){ | |
| COMPREPLY=() |