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
use std::boxed::Box; | |
type Callback<U, T> = Box<dyn Fn(&mut U, &T)>; | |
type Condition<U, T> = Box<dyn Fn(&U, &T) -> bool>; | |
type Effect<U, T> = Box<dyn Fn(&mut U, &T)>; | |
fn make_callback<U: 'static, T: 'static>( | |
condition: Condition<U, T>, | |
effect: Effect<U, T>, | |
) -> Callback<U, T> { |
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
#!/usr/bin/env python3 | |
import sys | |
import re | |
points = set() | |
folds = [] | |
for line in sys.stdin: | |
line = line.strip() |
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
using Dates | |
escaped_format = "yyyy-mm-dd\\THH:MM:SS.sss\\Z" | |
Zulu = String | |
Dates.CONVERSION_SPECIFIERS['Z'] = Zulu | |
Dates.CONVERSION_DEFAULTS[Zulu] = "" | |
df = Dates.DateFormat(escaped_format) | |
function convert_date(datestring::String) | |
Dates.parse(DateTime, datestring, df) |