Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 <cctype> | |
#include <cstdio> | |
#include <string> | |
#include <algorithm> | |
std::string clean_string1(std::string w) { | |
w.erase(std::remove_if(w.begin(), w.end(), [](char &c) { return !isalpha(c); }), w.end()); | |
std::transform(w.begin(), w.end(), w.begin(), tolower); | |
return w; |
This file contains hidden or 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 bisect | |
specials = [] | |
with open("specials.txt", "r") as f: | |
for line in f: | |
specials.append(int(line.strip())) | |
specials.sort() |
This file contains hidden or 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
I0823 20:36:36.834892 1778 docker.go:327] Start docker client with request timeout=2m0s | |
I0823 20:36:36.867905 1778 aws.go:604] Zone not specified in configuration file; querying AWS metadata service | |
I0823 20:36:37.112241 1778 aws.go:726] AWS cloud filtering on tags: map[KubernetesCluster:pndtest] | |
I0823 20:36:37.112289 1778 server.go:349] Successfully initialized cloud provider: "aws" from the config file: "" | |
I0823 20:36:37.113350 1778 manager.go:138] cAdvisor running in container: "/" | |
W0823 20:36:37.222328 1778 manager.go:146] unable to connect to Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp 127.0.0.1:15441: getsockopt: connection refused | |
I0823 20:36:37.328437 1778 fs.go:139] Filesystem partitions: map[/dev/xvda1:{mountpoint:/var/lib/docker/aufs major:202 minor:1 fsType:ext4 blockSize:0}] | |
I0823 20:36:37.333430 1778 manager.go:192] Machine: {NumCores:2 CpuFrequency:2394478 MemoryCapacity:4143976448 MachineID:9da75450b5baeda6ab8af33757aa419a SystemUUID:EC26648B-0807-6D |
This file contains hidden or 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 python | |
import contextlib | |
import io | |
import os | |
import sys | |
inside_tmux = "TMUX" in os.environ |
This file contains hidden or 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
def symmetric_multi_difference(list_a, list_b): | |
seen = [] | |
result = [] | |
for element in list_a + list_b: | |
if element in seen: | |
continue | |
seen.append(element) | |
elements_in_a = [x for x in list_a if x == element] |
This file contains hidden or 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
$ cat somefile.yaml | |
options: | |
preferences: | |
delay: 1 | |
use_mouse: 1 | |
async: 0 | |
$ cat temp.py | |
import pprint | |
import yaml |
This file contains hidden or 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
cesarkawakami@pandambp13r:~/temp/TheBigDeal [crap3] | |
$ cat factor.py | |
import collections | |
import math | |
def factor(n): | |
factors = collections.defaultdict(int) | |
for candidate in range(2, int(math.sqrt(n))): | |
if n == 1: |
This file contains hidden or 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
import math | |
m = [ | |
[1, 2, 4, 7, 11, 16], | |
[3, 5, 8, 12, 17], | |
[6, 9, 13, 18], | |
[10, 14, 19], | |
[15, 20], | |
[21], |