openpgp4fpr:341C10EB7FD6648F30AFBC32D049DB6CD0B0C436
View dnscrypt-proxy.service.hardened
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
[Unit] | |
Description=DNSCrypt client proxy | |
Documentation=https://github.com/DNSCrypt/dnscrypt-proxy/wiki | |
Requires=dnscrypt-proxy.socket | |
After=network.target | |
Before=nss-lookup.target | |
Wants=nss-lookup.target | |
[Install] | |
Also=dnscrypt-proxy.socket |
View keybase.md
Keybase proof
I hereby claim:
- I am cobratbq on github.
- I am dannyvanheumen (https://keybase.io/dannyvanheumen) on keybase.
- I have a public key whose fingerprint is 341C 10EB 7FD6 648F 30AF BC32 D049 DB6C D0B0 C436
To claim this, I am signing this object:
View Test.java
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 Test { | |
public static void main(String[] args) { | |
final ArrayList<Double> list = new ArrayList<>(); | |
list.add(1.3); | |
list.add(1.4); | |
list.add(1.7); | |
list.add(2.3); | |
flexibleSum(list); | |
} |
View Test.java
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 Test { | |
public static void main(String[] args) { | |
final ArrayList<Double> list = new ArrayList<>(); | |
list.add(1.3); | |
list.add(1.4); | |
list.add(1.7); | |
list.add(2.3); | |
naiveSum(list); | |
} |
View CollectionUtils.java
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 CollectionUtils { | |
public static <E extends Object> E getLast(final Collection<E> col) { | |
if (col.isEmpty()) { | |
throw new IllegalArgumentException("cannot retrieve last element from empty collection"); | |
} | |
if (col instanceof LinkedList) { | |
return ((LinkedList<E>) col).getLast(); | |
} else if (col instanceof List) { | |
return ((List<E>) col).get(col.size() - 1); |
View Representable.java
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 Representable { | |
String representation(); | |
default String reverse() { | |
final StringBuilder builder = new StringBuilder(this.representation()); | |
return builder.reverse().toString(); | |
} | |
} |
View UtilNoState.java
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 thirdcomponent; | |
import java.math.BigDecimal; | |
import java.math.MathContext; | |
public class UtilNoState { | |
public static void main(String[] args) { | |
System.out.println(calculate(BigDecimal.ONE, | |
BigDecimal.valueOf(3L), MathContext.DECIMAL32)); |
View UtilWithStatics.java
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 thirdcomponent; | |
import java.math.BigDecimal; | |
import java.math.MathContext; | |
public class UtilWithStatics { | |
// Predefined math context for use in calculation. | |
private final static MathContext C = MathContext.DECIMAL32; |
View ExpectationsExample.java
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 thirdcomponent; | |
import java.math.BigDecimal; | |
import java.math.MathContext; | |
public class ExpectationsExample { | |
public static void main(String[] args) { | |
final BigDecimal one = BigDecimal.ONE; | |
final BigDecimal three = BigDecimal.valueOf(3L); |
NewerOlder