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
extern crate collections; | |
use collections::TrieMap; | |
fn main() { | |
let workers = vec!( | |
("Jack", vec!((0000, 200), (500, 1200))), | |
("Jackie", vec!((0000, 600), (800, 1300))), | |
("Marty", vec!((400, 600), (1100, 1600), (1700, 2359))), | |
("Ronald", vec!((600, 1200), (1300, 1800), (1900, 2359))), |
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
extern crate core; | |
use core::cmp::min; | |
enum Tree { | |
EmptyTree, | |
BranchTree(int, Box<Tree>, Box<Tree>) | |
} | |
fn path_length(tree: &Tree, first: int, second: int) -> int { |
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
#![feature(unsafe_destructor)] | |
use std::io; | |
fn main() { | |
match test_scope() { | |
Ok(_) => println!("Main: test scope succeeded"), | |
Err(err) => panic!("Main: file error: {}", err), | |
}; | |
} |
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
class BatchAccumulator { | |
// ... | |
private Long append(int epoch, List<T> records, boolean isAtomic) { | |
if (epoch != this.epoch) { | |
return Long.MAX_VALUE; | |
} | |
ObjectSerializationCache serializationCache = new ObjectSerializationCache(); | |
int batchSize = 0; | |
for (T record : records) { |