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 net.seibertmedia; | |
import java.util.Map; | |
import java.util.WeakHashMap; | |
import java.util.concurrent.TimeUnit; | |
public class WeakHashmapExample { | |
public static void main(String[] args) throws InterruptedException { | |
Map<Person, String> map = new WeakHashMap<Person, String>(); | |
Person p1 = new Person("Jeff1"); |
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.hascode.sample; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.time.ZonedDateTime; | |
public class Main { |
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
@Provider | |
public class CustomExceptionMapper implements ExceptionMapper<CustomException> { | |
@Override | |
public Response toResponse(final CustomException exception) { | |
return Response.status(Status.BAD_REQUEST).entity(exception).type(MediaType.APPLICATION_JSON).build(); | |
} | |
} |
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
<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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.hascode.tutorial</groupId> | |
<artifactId>hamcrest-tutorial</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<dependencies> | |
<dependency> | |
<groupId>org.hamcrest</groupId> | |
<artifactId>hamcrest-all</artifactId> |
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 fib = function(n){ | |
return (n<2) ? 1 : fib(n-1) + fib(n-2); | |
} | |
var calc = function(numbers){ | |
var self = this; | |
numbers.forEach(function(n){ | |
if(!self.cache){ | |
self.cache = {}; | |
} |
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
Function.prototype.curry = function(){ | |
var func = this, args = Array.prototype.slice.call(arguments); | |
return function(){ | |
return func.apply(this, args.concat(Array.prototype.slice.call(arguments))); | |
} | |
}; | |
var add = function(a,b){ | |
return a+b; | |
} |
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
<plugin> | |
<groupId>com.atlassian.maven.plugins</groupId> | |
<artifactId>maven-jira-plugin</artifactId> | |
<version>${amps.version}</version> | |
<extensions>true</extensions> | |
<configuration> | |
[...] | |
<productDataPath>src/test/xml/generated-test-resources.zip</productDataPath> | |
</configuration> |
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
<plugin> | |
<groupId>com.github.klieber</groupId> | |
<artifactId>phantomjs-maven-plugin</artifactId> | |
<version>0.2.1</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>install</goal> | |
</goals> | |
</execution> |
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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>2.16</version> | |
<configuration> | |
<excludes> | |
<exclude>it/**</exclude> | |
</excludes> |
NewerOlder