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
import json | |
from requests import get | |
REGISTRY_URL = 'https://registry.hub.docker.com/v2' | |
NAME = 'library/ubuntu' | |
REFERENCE = 'latest' | |
def parse_www_authenticate(s): | |
objs = [obj.split('=') for obj in s.split()[1].split(',')] | |
return {obj[0]: obj[1][1:-1] for obj in objs} |
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
+++++++++[>++++++++>++++++++++++>++++>+++++++++++++<<<<-]>-.>---.>>+.<<----.>----.<<++++++.>.>.<----.>.<<----------.>+++++++.+++++++.------------.>>-------.---.<<--.>>++++++++.<<++++.>+.. |
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
import random; (lambda ws: (print("Hello! Let's play hangman!"), random.shuffle(ws), all(((lambda f: (print("Congratulation!" if f() else "Gameover... Answer is %s" % w), input("continue? (y/n): ") in ["y", "Y", "yes", "Yes", "YES"])[1])((lambda: (lambda cs, ins:(lambda f: f(f, 5))((lambda f, l: (print("life: %d, inputs: %s" % (l, ",".join(sorted(ins)))), print("".join([c if c in ins else '_' for c in w])), (lambda c: ((ins.add(c), f(f, l if c in cs else l - 1) if not cs.issubset(ins) else True)[1] if not c in ins else f(f, l)) if len(c) == 1 else f(f, l))(input("> ")) if l != 0 else False)[2])))({c for c in w}, set()))) for w in ws)), print("Goodbay!")))(open("words").read().splitlines()) |
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: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: growi-ingress | |
annotations: | |
kubernetes.io/ingress.global-static-ip-name: growi | |
kubernetes.io/ingress.allow-http: "false" | |
spec: | |
tls: | |
- secretName: growi |
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
import gmpy2 | |
def get_prime(random_state, b, n=25): | |
p = gmpy2.mpz_urandomb(random_state, b) | |
while not gmpy2.is_prime(p, n): | |
p = gmpy2.mpz_urandomb(random_state, b) | |
return p | |
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 <bits/stdc++.h> | |
using namespace std; | |
using i32 = int32_t; | |
using u32 = uint32_t; | |
using f32 = float; | |
using f64 = double; | |
using i64 = int64_t; | |
using u64 = uint64_t; |
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 <stdint.h> | |
int main() { | |
double ans, index; | |
printf("index = "); | |
scanf("%lf", &index); | |
ans = 1; |
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
import time | |
from matplotlib import pyplot as plt | |
import numpy as np | |
def fold(x, base, k): | |
return sum(x * base ** k) | |
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
import time | |
from matplotlib import pyplot as plt | |
import numpy as np | |
def main(f, N, postfix=''): | |
# compute the value of function | |
t = np.arange(0, N) | |
x = f(t, N) |
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 <iomanip> | |
#include <iostream> | |
#include <functional> | |
#include <limits> | |
typedef std::function<double(double)> func_t; | |
double bisection_method(func_t f, double min, double max) { | |
double mid; | |
double minval, midval, maxval; |
OlderNewer