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
#!/usr/bin/env groovy | |
import groovy.grape.Grape | |
import groovy.sql.Sql | |
import com.csvreader.CsvReader | |
@Grab(group='net.sourceforge.javacsv', module='javacsv', version='2.0') | |
class Import {} | |
Grape.grab( |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-beautifyeclipse-plugin</artifactId> | |
<packaging>maven-plugin</packaging> | |
<version>1.0</version> |
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 fm.setlist.client; | |
import java.net.URL; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.Unmarshaller; | |
import fm.setlist.api.model.Setlist; | |
public class 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
package org.example; | |
import java.io.Serializable; | |
import org.springframework.social.web.connect.AccountIdExtractor; | |
import org.springframework.web.context.request.RequestAttributes; | |
import org.springframework.web.context.request.WebRequest; | |
// your own User class | |
import org.example.User; |
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
<dependencies> | |
<dependency> | |
<groupId>at.molindo.social</groupId> | |
<artifactId>spring-social-security</artifactId> | |
<version>1.0.0.BUILD-SNAPSHOT</version> | |
</dependency> | |
<dependency> | |
<groupId>at.molindo.social</groupId> | |
<artifactId>spring-social-facebook-security</artifactId> | |
<version>1.0.0.BUILD-SNAPSHOT</version> |
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.io.IOException; | |
import java.io.StringReader; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class ScannerTest { | |
public static void main(String[] args) throws IOException { | |
int chars = (37 * 1000 * 1000); | |
StringBuilder buf = new StringBuilder(chars); |
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
public class StringLiterals { | |
public static void main(String[] args) { | |
String s1 = "abc"; // interned by default | |
String s2 = new String(new char[] {'a', 'b', 'c'}); // no chance to intern here | |
System.out.println(s1 == s2); // false | |
System.out.println(s1 == s2.intern()); // true - uses interned s1 | |
} | |
} |
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
{ | |
"city" : { | |
"properties" : { | |
"country" : { | |
"properties" : { | |
"code" : { | |
"type" : "multi_field", | |
"path" : "just_name", | |
"fields" : { | |
"code" : { |
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
"analysis": { | |
"char_filter": { | |
"my_mapping": { | |
"type": "mapping", | |
"mappings": [ /* snip */ ] | |
} | |
}, | |
"filter": { | |
"my_stop": { | |
"type": "stop", |
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.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Future; | |
import com.google.common.base.Function; | |
import com.google.common.cache.CacheLoader; | |
public class AsyncCacheLoader<K, V> extends CacheLoader<K, Future<V>> { | |
private final ExecutorService _executor; |
OlderNewer