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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
creationTimestamp: null | |
labels: | |
component: etcdclient | |
tier: debug | |
name: etcdclient | |
namespace: kube-system | |
spec: |
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 <stdio.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#define FIFO_FILE "/tmp/myfifo" | |
int main() |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
def constrained_sum(nums: List[int]) -> int: | |
current, previous = 0, 0 | |
for value in nums: | |
previous, current = current, max(current, previous + value) | |
return current |
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
def my_gcd(a: int, b: int) -> int: | |
while b: | |
a, b = b, a % b | |
return abs(a) | |
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
def fib(n: int) -> List[int]: | |
fib_seq = [0, 1] | |
while len(fib_seq) < n: | |
fib_seq.append(sum(fib_seq[-2:])) | |
return fib_seq |
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
def bound_value(value: float, min_value: float, max_value: float) -> float: | |
return min(max_value, max(value, min_value)) | |
bound_value(235, min_value=0, max_value=255) |
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
def reverse_string(string: str) -> str: | |
if string == "": | |
return "" | |
else: | |
return string[-1] + reverse_string(string[:-1]) | |
reverse_string("stressed") |
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
def len_list(seq): | |
if seq == []: | |
return 0 | |
else: | |
return 1 + len_list(seq[:-1]) | |
len_list([1, 2, 3]) |
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
def len_list(seq): | |
if seq == []: | |
return 0 | |
else: | |
return 1 + len_list(seq[:-1]) | |
len_list([1, 2, 3]) |
NewerOlder