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.File; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.core.io.ClassPathResource; |
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
try { | |
// something | |
} catch (Exception ex) { | |
// something | |
} finally { | |
if (is != null) { | |
try { | |
is.close(); | |
} catch (IOException ie) { | |
// seriously |
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
var Manufacturer = sequelize.define('manufacturer', { | |
name:DataTypes.STRING | |
}); | |
var GraphicsCard = sequelize.define("graphics_card", { | |
model:DataTypes.STRING, | |
RAM:DataTypes.INTEGER | |
}); | |
GraphicsCard.belongsTo(Manufacturer); |
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
// | |
// functional | |
// | |
http.request(url, function(req, res) { | |
var html = ''; | |
res.on('data', function(chunk) { | |
html += chunk; | |
}); | |
res.on('end', function() { |
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
2012-04-17 21:05:57.347:WARN:oejd.DeploymentManager:Unable to reach node goal: started | |
java.lang.StackOverflowError | |
at java.lang.String.indexOf(String.java:1534) | |
at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:144) | |
at sun.net.www.protocol.file.Handler.parseURL(Handler.java:67) | |
at java.net.URL.<init>(URL.java:612) | |
at java.net.URL.<init>(URL.java:480) | |
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1034) | |
at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1024) | |
at sun.misc.URLClassPath$1.next(URLClassPath.java:222) |
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.InputStream; | |
import java.io.Serializable; | |
import java.net.URL; | |
import java.net.URLConnection; | |
public class CustomHttpUrlConnection implements Serializable, AutoCloseable { | |
private final URLConnection conn; | |
public CustomHttpUrlConnection(String url) throws IOException { |
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 interface GenericDao { | |
public <T> T find(Class<T> entityClass, Object identifier); | |
public <T> T merge(T entity); | |
public <T> T persist(T entity); | |
public <T> List<T> query(String query, Map<String, Object> parameters); | |
public <T> List<T> query(String query, Map<String, Object> parameters, int firstResult, int maxResults); | |
public <T> List<T> namedQuery(String query, Map<String, Object> parameters); | |
public <T> List<T> namedQuery(String query, Map<String, Object> parameters, int firstResult, int maxResults); | |
public <T> List<T> nativeQuery(String query, Map<String,Object> parameters, Integer maxResults); | |
public <T> T namedQuerySingle(String query, Map<String, Object> parameters); |
NewerOlder