Skip to content

Instantly share code, notes, and snippets.

View nex3's full-sized avatar

Natalie Weizenbaum nex3

  • Google
  • Seattle
View GitHub Profile

Define two sets of intervals to be equivalent relative to a set of numbers (the base) if both sets' intervals cover the exact same set of numbers in the base. For example, given the base [0, 1, 3, 4, 6], {[0, 1], [3, 6]} is equivalent to {[0, 3], [4, 6]} but not to {[1, 3], [4, 6]} because the latter doesn't cover 0.

Define a set of intervals to be maximal relative to a base if there's no equivalent set with fewer intervals. Equivalently, a set of intervals is maximal iff, for any two intervals in the set, there exists at least one number in the base between the upper bound of one interval and the lower bound of the other.

For example, given the base [0, 1, 3, 4, 6], the set of ranges {[0, 1], [4, 6]} is maximal because 3 is between 1 and 4, but {[0, 1], [3, 6]} is not because there's nothing in the base between 1 and 3.

Level 1

You are given a (potentially very large) ordered list of floats—the base—and a list of intervals, each of which may be open or closed.

@nex3
nex3 / soi.md
Last active April 3, 2016 17:38
  • Archangel Avayn
  • Thing in the Ice
  • Geralf's Masterpiece
  • Jace, Unraveler of Secrets
  • Asylum Visitor
  • Falkenrath Gorger
  • Goldnight Castigator
  • Duskwatch Recruiter
  • Traverse the Ulvenwald
  • Nahiri, the Harbinger
class VMIsolateRef {
Stream<VMExtensionEvent> get onExtensionEvent;
}
class VMExtensionEvent {
String get kind;
Map get data;
}
import 'package:path/path.dart' as p;
class NoNormalizeContext implements p.Context {
final p.Context _inner;
NoNormalizeContext(this._inner);
String normalize(String path) => path;
get style => _inner.style;
@nex3
nex3 / choir.md
Last active October 12, 2015 07:25

For half a year during middle school, I was in the school choir. I joined because I thought singing sounded like fun, but as it turned out I was the only "boy" on the choir. And that meant a huge amount to me. I couldn't say why, but I did realize on some level that being there relieved me of some of the pressures of masculinity that chased me everywhere else.

Unfortunately, I was deeply shy, so I didn't really make any friends. Or talk a whole lot at all. I particularly remember one day when we were sitting around waiting for something, and someone started singing In My Life. Gradually everyone else joined in, except for me. I was just too shy, and I still feel a pang of regret when I think about it.

I don't really sing much in public anymore—I'm very rusty, it's a lot harder with my new voice, and I'm still plenty shy. But one of the most important side effects of coming out for me has been finally feeling comfortable among groups of women. I'm very lucky to be able to do that—I have great friends, and I

@nex3
nex3 / SassMeister-input.scss
Created June 5, 2015 20:41
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
[type=checkbox] {
@extend %checkbox;
}
%checkbox {
@nex3
nex3 / SassMeister-input.scss
Created May 23, 2015 01:53
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
/* one.css */
@media screen and (min-width:0\0) {
.bar {
width: 12px;
}
/// "call/cc" implemented in terms of eevee's "fuckit" operator.
///
/// See https://twitter.com/eevee/status/599308342364778496.
callcc(fn(continuation(returnValue))) {
var completer = new Completer();
scheduleMicrotask(() {
fn((returnValue) => completer.complete(returnValue));
});
@nex3
nex3 / SassMeister-input.scss
Created May 15, 2015 22:40
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
$foo: 'baz';
$bar: 'qux';
$test: "foo(\"#{$foo}\") bar(\"#{$bar}\")";
sass {
@function safe($name, $args...) {
@each $arg in join($args, map-values(keywords($args))) {
@if $arg == null {
@return null;
}
}
@return call($name, $args...);
}