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
<New id="tmjndi" class="org.eclipse.jetty.plus.jndi.Resource"> | |
<Arg></Arg> | |
<Arg>java:/TransactionManager</Arg> | |
<Arg> | |
<New class="com.atomikos.icatch.jta.UserTransactionManager"/> | |
</Arg> | |
</New> | |
<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction"> | |
<Arg> |
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
/* | |
Sample Datasources.groovy file for datasources 0.5 plugin with grails 1.3.x | |
*/ | |
datasources = { | |
datasource(name: 'db2') { | |
domainClasses([com.sheetsj.domain.db2.MyObj, com.sheetsj.domain.db2.MyObj2]) | |
services(['myDb2Stuff']) | |
driverClassName('com.ibm.db2.jcc.DB2Driver') | |
dialect(org.hibernate.dialect.DB2Dialect) |
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 com.sheetsj.spring.async.test | |
import org.springframework.context.annotation.Bean | |
import org.springframework.context.annotation.Configuration | |
import org.springframework.scheduling.annotation.Async | |
import org.springframework.scheduling.annotation.AsyncResult | |
import org.springframework.scheduling.annotation.EnableAsync | |
import org.springframework.test.context.ContextConfiguration | |
import org.springframework.util.concurrent.ListenableFuture | |
import org.springframework.util.concurrent.ListenableFutureCallback |
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 org.springframework.web.servlet.handler | |
import org.springframework.web.context.WebApplicationContext | |
/** | |
* Workaround to register a controller with the WebAppContext because detectHandlerMethods is protected | |
* | |
* This allows our Mvc Unit tests to use the wired up Spring Jackson converters and mappers, | |
* without having to specify them individually in every test | |
* |
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 org.apache.commons.pool2.ObjectPool | |
import org.apache.log4j.Logger | |
class PoolHelper { | |
static Logger log = Logger.getLogger(PoolHelper) | |
/** | |
* Executes a closure using the object from the passed | |
* in Commons Pool, invalidating the object if an error is returned, | |
* and always returning it to the pool. Similar to how Groovy Sql methods work. | |
*/ |
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
class BinarySearch { | |
def bfs(def node, def result=[]) { | |
Queue queue = new LinkedList() | |
queue.add(node) | |
while (queue) { | |
def it = queue.poll() | |
result << it.val |
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
//See full source with HTML at jsfiddle: | |
// https://jsfiddle.net/jeffsheets/ry2ns0s7/4/ | |
function node(val, left, right) { | |
return {val: val, left: left, right: right, visited: false}; | |
} | |
/* |
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
//Filed Spring Data Rest bug | |
//https://jira.spring.io/browse/DATAREST-1034 | |
//so check there for answers | |
@RepositoryRestResource(path='emUsers', exported = false) | |
interface EMUserRepository extends EnversRevisionRepository<EMUser, Long, Integer>, JpaSpecificationExecutor<EMUser> { | |
//Attempting, as an example, to expose only this /search/findByAuth0UserId endpoint | |
//but with @RepositoryRestResource(exported=false) this endpoint is not exported | |
//but with @RepositoryRestResource(exported=true) this endpoint is exported | |
@RestResource(exported = 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
import java.util.Arrays; | |
public class WorstFizzBuzzEver { | |
public static final String BUZZ = "Fizz"; | |
public static final String FIZZ = "Buzz"; | |
/* | |
* This does Fizz Buzz | |
*/ |
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 com.sheetsj.myapp.client.widget.fancy | |
import com.google.gwt.event.dom.client.KeyUpEvent | |
import com.google.gwt.user.client.ui.Widget | |
import com.google.gwtmockito.GwtMockito | |
import com.sheetsj.myproj.client.AppController | |
import com.sheetsj.myproj.client.widget.ErrorWidget | |
import org.mockito.Mockito | |
import spock.lang.Specification |