11:10-11:55 Jason R Clark Extending Gems - Patterns and Anti-Patterns of Making Your Gem Pluggable Salon 2
1:10-1:55 Casey Rosenthal Fault Tolerant Data: Surviving the Zombie Apocalypse
import java.util.Scanner; | |
public class SudokuBacktracker { | |
/** | |
* Reads Sudoku Puzzle from STDIN in the following format. | |
* First number, should be N, which is the value for this board configuration N^2 * N^2 = N^4 size board | |
* Prints answer to STDOUT | |
* <p/> | |
* 3 | |
* 4 0 0 0 0 0 0 0 5 |
java.lang.RuntimeException: Error scanning file PingController.class | |
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:705) | |
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686) | |
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686) | |
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686) | |
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686) | |
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821) | |
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:111) | |
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:472) | |
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) |
package quickcheck | |
import common._ | |
import org.scalacheck._ | |
import Arbitrary._ | |
import Gen._ | |
import Prop._ | |
import Math._ |
import java.util.List; | |
import java.util.ArrayList; | |
import java.util.BitSet; | |
/** | |
* Error free (non probabilistic) Set membership | |
*/ | |
public final class WorldPartyRsvp { | |
private static final long DESIRED_REGION_SIZE = Integer.MAX_VALUE; | |
private static final long MAX_INVITE_SIZE = DESIRED_REGION_SIZE * DESIRED_REGION_SIZE; |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ConcurrentMap; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; | |
import java.util.concurrent.ThreadLocalRandom; |
# Input: vertex1 (integer), vertex2 (integer), weight (integer) | |
require 'set' | |
edges = ARGF.readlines | |
edges.shift # Ignore first line if it has n, m don't need them | |
edges.map! {|a| a.split.map! {|j| j.to_i} } | |
vertices = Set.new(edges[0][0,1]) | |
mst = [] | |
until edges.empty? | |
min_edge = edges.min_by {|e| vertices.include?(e[0]) || vertices.include?(e[1]) ? e[-1] : Float::INFINITY} | |
vertices.merge(min_edge[0,2]) |
import java.math.BigInteger; | |
import java.util.Map; | |
import java.util.HashMap; | |
public class FasterFib { | |
public static void main(String[] args) { | |
if (args.length != 1) { | |
System.err.println("Usage: a single positive java integer representing Fibonacci sequence number"); | |
System.exit(1); | |
} |
import java.math.BigInteger; | |
public class SimpleFib { | |
public static void main(String[] args) { | |
if (args.length != 1) { | |
System.err.println("Usage: a single positive java integer representing Fibonacci sequence number"); | |
System.exit(1); | |
} | |
int n = Integer.parseInt(args[0]); | |
System.out.println("Recursive: " + recursiveFib(n)); |
class Animal | |
def makeSpeak(method, block) | |
self.class.send(:define_method, method.to_sym, &block) | |
end | |
end | |
a = Animal.new | |
woof = Proc.new { puts "Woof!" } | |
chirp = Proc.new { puts "Chirp!" } | |
yelp = Proc.new { puts "Yelp!" } |