Skip to content

Instantly share code, notes, and snippets.

View netdance's full-sized avatar

Jim Driscoll netdance

View GitHub Profile
@netdance
netdance / keybase.md
Created April 16, 2014 01:45
keybase.md

Keybase proof

I hereby claim:

  • I am netdance on github.
  • I am netdance (https://keybase.io/netdance) on keybase.
  • I have a public key whose fingerprint is CFC9 CBE6 E5D6 76EA 9A26 17AF B6ED A125 0E60 685D

To claim this, I am signing this object:

@netdance
netdance / TestBacon.java
Created January 11, 2014 23:50
Find Bacon Numbers with JDK 8.
package testbacon;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@netdance
netdance / TestLargestArray.java
Created January 4, 2014 19:33
JDK 8 CompletableFuture and Stream example to get the largest subarray sum.
package testlargestarray;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.stream.*;
/*
Problem: Given a list of random numbers, both positive and negative, find the
largest sum of a sublist.
@netdance
netdance / TestSortedListStreams.java
Created January 3, 2014 01:31
Various Java methods to create one sorted list from two sorted lists
package testsortedliststreams;
import java.util.*;
import java.util.stream.*;
/*
Sample output on late-2013 MacBook Pro:
Starting Naive List Sort, via Collections
Total number of sorted values: 40000000
@netdance
netdance / TestPalindrome.java
Created January 3, 2014 01:26
Writing a palindrome program with Java 8 Streams and Method Expressions
package testpalindrome;
import java.nio.file.*;
import java.util.stream.Stream;
public class TestPalindrome {
// system dependant path of dictionary - this is where it is on Mac
private static final String dictpath = "/usr/share/dict/words";