A group of N pirates buries a treasure chest, where N is an odd number. The treasure chest is locked with multiple locks. For each lock, you may have any number of copies of the key that opens that lock. Each of the pirates receives one or more keys. The goal is to design a scheme where if any minority group (less than half) of the pirates come together, it's guaranteed that they do not have all of the keys needed to open the locks on the chest. At the same time, any majority group (more than half) of the pirates is guaranteed to have enough keys to open all of the locks. For example, if there are 11 pirates, the keys
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
#include <iostream> | |
int main() { | |
for (int i = 20; i--; ) { | |
std::cout << i << "\n"; | |
} | |
return 0; | |
} |
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
package main | |
import "fmt" | |
func isValid(x int) bool { | |
s := 0 | |
for y := 1; y <= 0x2000; y <<= 1 { | |
if x&y == 0 { | |
// 0-bit means open paren, push the stack | |
s++ |
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
package main | |
import "fmt" | |
func isValid(x int) bool { | |
b := 0 | |
s := 0 | |
for y := 1; y <= x; y <<= 1 { | |
if x&y == 0 { | |
s++ |
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
// App.js | |
import React, { Component } from 'react'; | |
class App extends Component { | |
state = { | |
todos: [] | |
}; | |
async componentDidMount() { | |
try { |
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
$ ssh otd | |
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-1015-gcp x86_64) | |
* Documentation: https://help.ubuntu.com | |
* Management: https://landscape.canonical.com | |
* Support: https://ubuntu.com/advantage | |
System information as of Fri Sep 21 06:17:42 UTC 2018 | |
System load: 0.4 Processes: 136 |
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
for e in ${_environment}; do | |
eval "export $e" | |
done |
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
// PushType represents a value that can be pushed into the hierarchy. | |
type PushType map[string]interface{} | |
func init() { | |
gob.Register(PushType{}) | |
} | |
var errBadPushCast = errors.New("bad push cast") | |
// go is so fucking stupid |
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
evan@bitcoin ~/code/firepad (master) $ npm install grunt-cli bower | |
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue | |
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=2.4.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. | |
npm WARN notice [SECURITY] minimatch has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=minimatch&version=0.3.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. | |
npm notice created a lockfile as package-lock.json. You should commit this file. | |
npm WARN [email protected] No license field. | |
+ [email protected] | |
+ [email protected] | |
added 12 packages in 4.044s |
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
evan@slowpoke ~ $ coredumpctl gdb gdb | |
PID: 2502 (gdb) | |
UID: 1000 (evan) | |
GID: 1000 (evan) | |
Signal: 11 (SEGV) | |
Timestamp: Tue 2018-05-22 12:11:55 PDT (56s ago) | |
Command Line: gdb -p 2436 | |
Executable: /usr/libexec/gdb | |
Control Group: /user.slice/user-1000.slice/[email protected]/gnome-terminal-server.service | |
Unit: [email protected] |