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
# at_most(5.times) do | |
# some_volatile_operation | |
# end | |
def at_most(enum) | |
begin | |
yield | |
rescue => e | |
can_retry = enum.next rescue false | |
if can_retry |
- I did not create a spatially-enabled database. I had to do this manually on EC2, whereas I recall this happening automatically locally.
- I was not using a
postgis://
DATABASE_URL scheme. Caveat emptor: this apparently breaks pgbackups, though there is perhaps a better solution forthcoming
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
require 'thread' | |
module ThreadPool | |
class Executor | |
def initialize(queue) | |
@queue = queue | |
@thread = nil | |
end |
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
enum ConsPosition { | |
case Left, Right | |
} | |
func cons<T>(a: T, b: T) -> (ConsPosition -> T) { | |
func innerCons(i: ConsPosition) -> T { | |
if i == .Left { | |
return a; | |
} else { | |
return b; |
You work for a bank, which has recently purchased an ingenious machine to assist in reading letters and faxes sent in by branch offices. The machine scans the paper documents, and produces a file with a number of entries which each look like this:
_ _ _ _ _ _ _
| _| _||_||_ |_ ||_||_|
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
function emptyList() { | |
return function(which) { | |
return which(undefined, emptyList(), true); | |
}; | |
} | |
function prepend(head, tail) { | |
return function(which) { | |
return which(head, tail, false); | |
}; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<style type="text/css"> | |
/* Shared styles */ | |
body { | |
font-family: HelveticaNeue, sans-serif; | |
font-size: 16.0px; | |
color: #34302e; |
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
Auto Refills Card | |
Recommended Auto-Refills | |
Add Starter Set -> Considering Auto-Refills | |
Considering Auto-Refills | |
Add Auto-Refills -> Reviewing Auto-Refills | |
I prefer to Refill Manually -> Reconsidering Manual-Refills | |
Considering Manual-Refills | |
Review Order -> Reviewing Manual-Refills | |
I prefer Auto-Refills -> Reconsidering Auto-Refills | |
Reviewing Auto-Refills |
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
Auto Refills Card | |
Recommended Manual-Refills | |
Add Starter Set -> Considering Manual-Refills | |
Recommended Auto-Refills | |
Add Starter Set -> Considering Auto-Refills | |
Considering Auto-Refills | |
Add Auto-Refills -> Reviewing Auto-Refills | |
I prefer to Refill Manually -> Reconsidering Manual-Refills | |
Considering Manual-Refills | |
Review Order -> Reviewing Manual-Refills |
OlderNewer