This file contains hidden or 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
--- ReadFileJavaApplicationBufferedReader3.java 2019-01-05 20:40:01.000000000 -0800 | |
+++ ReadFileJavaApplicationBufferedReader4.java 2019-01-05 20:40:05.000000000 -0800 | |
@@ -45,7 +45,7 @@ | |
Instant commonNameStart = Instant.now(); | |
ArrayList<String> firstNames = new ArrayList<>(); | |
- var namePat = Pattern.compile(", \\s*(([^ ]*), |([^ ]+))"); | |
+ var namePat = Pattern.compile(", \\s*([^, ]+)"); | |
System.out.println("Reading file using " + Caller.getName()); |
This file contains hidden or 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
--- ReadFileJavaApplicationBufferedReader4.java 2019-01-05 20:40:05.000000000 -0800 | |
+++ ReadFileJavaApplicationBufferedReader5.java 2019-01-05 20:40:11.000000000 -0800 | |
@@ -46,6 +46,8 @@ | |
ArrayList<String> firstNames = new ArrayList<>(); | |
var namePat = Pattern.compile(", \\s*([^, ]+)"); | |
+ char[] chars = new char[6]; | |
+ StringBuilder sb = new StringBuilder(7); | |
System.out.println("Reading file using " + Caller.getName()); |
This file contains hidden or 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
--- ReadFileJavaApplicationBufferedReader5.java 2019-01-05 20:40:11.000000000 -0800 | |
+++ ReadFileJavaApplicationBufferedReader6.java 2019-01-05 20:40:15.000000000 -0800 | |
@@ -115,16 +115,9 @@ | |
} | |
} | |
- LinkedList<Entry<String, Integer>> list = new LinkedList<>(map.entrySet()); | |
+ Entry<String, Integer> common = Collections.max(map.entrySet(), Entry.comparingByValue()); | |
- Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() { |
This file contains hidden or 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
// https://twitter.com/stuartmarks/status/1304654956146745344 | |
import java.lang.reflect.Field; | |
public class StillAlive { | |
@SuppressWarnings("deprecation") // oh shut up | |
static Boolean truе = new Boolean(true); | |
static void WearMask() { } | |
static void Stay6ftApart() { } |
This file contains hidden or 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.*; | |
public class EmptyFinalizer { | |
static class A { | |
protected void finalize() { | |
System.out.println(this + " was finalized"); | |
} | |
} | |
static class B extends A { |
OlderNewer