Skip to content

Instantly share code, notes, and snippets.

@theomega
theomega / gist:ca3fce61dd2552d7af37
Created July 29, 2014 14:02
Fails because of the life cycle of abstract classes
public class AnonInnerClass {
private final List<Job> jobsCache = new ArrayList<>();
private Class<? extends Job> getClass(final String s) {
final Job job = new Job() {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
System.out.println(s);
}
};
package com.company;
public class Main {
public static void main(String[] args) {
executeNTimes(10, ((currentIndex, maxIndex, wisdom) -> {
System.out.println("Executed run "+currentIndex+" of "+maxIndex+" Wisdom: "+wisdom);
}));
}
package com.company;
public class Main {
public static void main(String[] args) {
ThreeParameterFunction<Integer, Integer, String> cbi = ((currentIndex, maxIndex, wisdom) ->
System.out.println("Executed run " + currentIndex + " of " + maxIndex + " Wisdom: " + wisdom)
);
SomeOtherPackageThreeParameterFunction<Integer, Integer, String> socbi = ((currentIndex, maxIndex, wisdom) ->
System.out.println("This is similar; run " + currentIndex + " of " + maxIndex + " Wisdom: " + wisdom)
package com.company;
import java.util.Optional;
/**
* Created by dominik on 11/01/16.
*/
public class OptionalTest {
public static void main(String[] args) {
// Very ugly
### Keybase proof
I hereby claim:
* I am theomega on github.
* I am theomega (https://keybase.io/theomega) on keybase.
* I have a public key whose fingerprint is 742F 1072 DE04 67DA F62C 9654 85D1 CEB6 E6B6 8EB0
To claim this, I am signing this object:
#!/usr/bin/env python
# Circle runs from 0 to 99
CIRCLE_SIZE = 100
FIX_POINTS = [
(10, 50),
(25, 25),
(30, 25),
(40, 1025),
(75, 525),
#!/usr/bin/env python
def get_fixpoint_before(fixpoints, x):
"""
Find the fix point directly before the provided position.
"""
assert len(fixpoints) > 0
assert x >= 0
return filter(lambda f: f[0] <= x, fixpoints)[-1]
./bad/359632103061427-221882741.txt-[id] 254362918
./bad/359632103061427-221882741.txt-[start] 2020-03-31T04:37:42 Δs: 0 [✓] | (48.626103, 12.492780) Δm: 21 [✓]
./bad/359632103061427-221882741.txt-[end] 2020-03-31T05:09:23 Δs: 0 [✓] | (48.525070, 12.189710) Δm: 19 [✓]
./bad/359632103061427-221882741.txt-[dist] 0 Δm: -37653 [✕]
./bad/359632103061427-221882741.txt:[Verdict] ✅ Trip can be automatically fixed.
--
./bad/359632103061427-221882741.txt-[id] 254362919
./bad/359632103061427-221882741.txt-[start] 2020-03-31T06:43:05 Δs: 0 [✓] | (48.525070, 12.189710) Δm: 19 [✓]
./bad/359632103061427-221882741.txt-[end] 2020-03-31T07:12:00 Δs: 0 [✓] | (48.626103, 12.492780) Δm: 16 [✓]
./bad/359632103061427-221882741.txt-[dist] 0 Δm: -36521 [✕]
./358480081710636-246974466.txt-[id] 255921646
./358480081710636-246974466.txt-[start] 2020-04-01T11:37:40 Δs: 0 [✓] | (50.817710, 06.440072) Δm: 0 [✓]
./358480081710636-246974466.txt-[end] 2020-04-01T11:57:42 Δs: 0 [✓] | (50.821205, 06.486142) Δm: 0 [✓]
./358480081710636-246974466.txt-[dist] 8294 Δm: 0 [✓]
./358480081710636-246974466.txt-[Verdict] ✅ Trip can be automatically fixed.
./358480081710636-246974466.txt:[Comment] Trip is long and missing from TT response. Should be removed or set a distance of 0;
--
./358480080976659-145867485.txt-[id] 254095995
./358480080976659-145867485.txt-[start] 2020-03-30T15:41:14 Δs: 0 [✓] | (48.090138, 12.217752) Δm: 0 [✓]
./358480080976659-145867485.txt-[end] 2020-03-30T15:42:14 Δs: 0 [✓] | (48.090138, 12.217752) Δm: 0 [✓]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.