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
#!/usr/bin/env bash | |
NAME="test-cluster" | |
echo "+++ Cleaning up old test artififacts" | |
kubectl delete cluster --name "${NAME}" > /dev/null 2>&1 || true | |
rm sample-controller > /dev/null 2>&1 || true | |
echo "+++ Creating test cluster" | |
kind create cluster --name "${NAME}" --config kind-config.yaml |
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<pthread.h> | |
#include<unistd.h> | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<functional> | |
#include<queue> | |
#include<iostream> | |
typedef std::function<void()> func; |
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" | |
"net" | |
) | |
func main() { | |
fmt.Println("Starting the server ...") | |
// 创建 listener |
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<cstdio> | |
#include<iostream> | |
#include<queue> | |
#include<vector> | |
using namespace std; | |
struct Node | |
{ | |
int data; | |
Node *left; |
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" | |
type I interface { | |
M() | |
} | |
type T struct { | |
S string |
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
from __future__ import print_function | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torchvision import datasets, transforms | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import ipdb |
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
use core::panic; | |
use std::fs::File; | |
use std::io::ErrorKind; | |
fn main(){ | |
let path = "a.txt"; | |
let f = File::open(path); | |
let f = match f { | |
Ok(file) => file, | |
Err(error) => match error.kind() { |
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
/* | |
* Print an unsigned integer in base b. | |
*/ | |
printn(n, b) | |
long n; | |
{ | |
register long a; | |
if (n<0) { /* shouldn't happen */ | |
putchar('-'); |
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
from smtplib import SMTPException, SMTP_SSL | |
from email.mime.text import MIMEText | |
from email.header import Header | |
email_to = "[email protected]" | |
email_from = "[email protected]" | |
smtp = "xxxx" |
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
print("Start") | |
enum Event<Element>{ | |
case next(Element) | |
case error(Error) | |
case complete | |
} | |
protocol ObserverType { | |
associatedtype Element |
NewerOlder