Skip to content

Instantly share code, notes, and snippets.

@Bean
public WebMvcRegistrations mvcRegistrations() {
return new WebMvcRegistrations() {
@Override
public RequestMappingHandlerAdapter getRequestMappingHandlerAdapter() {
return new ExtendedRequestMappingHandlerAdapter();
}
};
}
[{"id":1,"book_title":"Douglas","isbn":"429571064-4"},
{"id":2,"book_title":"Edward","isbn":"354976882-6"},
{"id":3,"book_title":"Ashley","isbn":"243479125-5"},
{"id":4,"book_title":"Gregory","isbn":"824118644-4"},
{"id":5,"book_title":"Scott","isbn":"873681970-0"},
{"id":6,"book_title":"Benjamin","isbn":"146529795-2"},
{"id":7,"book_title":"Wayne","isbn":"534416261-8"},
{"id":8,"book_title":"Susan","isbn":"382383221-2"},
{"id":9,"book_title":"Keith","isbn":"895009173-9"},
{"id":10,"book_title":"Steven","isbn":"248842877-9"},
{
"teasers": [
{
"format": {
"id": "trust_us_teaser"
},
"tile1": {
"text": "Versandkostenfrei ab €19,95",
"targetLink": "http://www.galeria.de"
},
<style>
div.container {
width: 60%;
margin: 30px auto;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 12px;
background-color: #888;
padding: 10px;
}
final ScheduledExecutorService exec = Executors.newScheduledThreadPool(1);
exec.schedule(new Runnable() {
@Override
public void run() {
System.out.println("=================> Running");
myFunction();
}
}, 5, TimeUnit.SECONDS);
@hoomb
hoomb / GeoGoogleTest.java
Created December 7, 2012 14:40
Parsing and Standardizing an Address using GeoGoogle API
public class GeoGoogleTest {
final static String PROXY_SERVER = "myproxy.com";
final static int PROXY_PORT = 80;
private static GeoAddressStandardizer createGeoAddressStandardizer() {
final HttpClientParams httpClientParams = new HttpClientParams();
final HttpClient httpClient = new HttpClient(httpClientParams);
//enable these 3 lines if you are behind a proxy server.
/*
public class SeleniumTest {
private final static String BASE_URL = "http://localhost:8080";
private final static WebDriver driver = new FirefoxDriver();
@Before
public void startUp() {
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
private ExpectedCondition WaitForAjax(final long timeout) {
return new ExpectedCondition() {
public Boolean apply(WebDriver driver) {
final long startTime = System.currentTimeMillis();
final JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver;
while ((startTime + timeout) &gt;= System.currentTimeMillis()) {
final Boolean scriptResult = (Boolean) javascriptExecutor.executeScript("return jQuery.active == 0");
if (scriptResult)
@hoomb
hoomb / Book.java
Created December 5, 2012 14:30
JAXB : IllegalAnnotationExceptions - Class has two properties of the same name
@Data
@XmlRootElement(name = "book")
@XmlAccessorType(XmlAccessType.FIELD)
public class Book {
@XmlElement(name = "title")
private String name;
private String author;
private String publisher;
private String isbn;
}