Skip to content

Instantly share code, notes, and snippets.

@mitzen
mitzen / gist:f7d70fa9de89818f06ed3a356e224f40
Created January 27, 2024 22:45
openkruise-guessbook-2-replica.yaml
apiVersion: v1
kind: Service
metadata:
name: guestbook-clone-svc
labels:
app: guestbook
spec:
ports:
- port: 3000
targetPort: http-server
// declare your component
import type { ComponentPropsWithoutRef } from 'react';
interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
label: string;
}
export function MyButton({ label, ...rest }: ButtonProps) {
return (<button><button {...rest} /></button>);
}
# Initializes parameters "a" and "b" randomly
np.random.seed(42)
a = np.random.randn(1)
b = np.random.randn(1)
print(a, b)
# Sets learning rate
lr = 1e-1
lr = 1e-1
n_epochs = 1000
torch.manual_seed(42)
a = torch.randn(1, requires_grad=True, dtype=torch.float, device=device)
b = torch.randn(1, requires_grad=True, dtype=torch.float, device=device)
for epoch in range(n_epochs):
yhat = a + b * x_train_tensor
error = y_train_tensor - yhat
// remember to wrap it up in try/catch
async function lookupPromise() {
return new Promise((resolve, reject) => {
dns.lookup("www.aWebSiteName.am", (err, address, family) => {
if(err) reject(err);
resolve(address);
});
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: httpbin-gateway
spec:
gatewayClassName: istio
listeners:
- name: http
#hostname: "httpbin.example.com"
port: 80
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: httpbin-gateway
spec:
gatewayClassName: istio
listeners:
- name: http
hostname: "httpbin.example.com"
port: 80
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: httpbin
spec:
parentRefs:
- name: httpbin-gateway
hostnames: ["httpbin.example.com"]
rules:
- matches:
{{- $default := dict "boolProp" true "stringProp" "Override me" }}
{{- $explicit := dict "boolProp" false "stringProp" "String value is overriden, but bool value is not!" }}
$default:
{{- $default | toYaml | nindent 2 }}
$explicit:
{{- $explicit | toYaml | nindent 2 }}
# Here is the bug: `boolProp` can't be overriden with a `false` value by
# `merge`. `boolProp` should be false here (the first argument to `merge` has
"""
A stationary test is used in time series analysis to determine whether a given time series is stationary or not. Stationarity is a key assumption in many time series models, and if a time series is found to be non-stationary, it may need to be transformed or differenced before it can be effectively modeled.
The purpose of conducting a stationary test on a time series is to assess whether the statistical properties of the series remain constant over time, such as the mean, variance, and autocorrelation. A stationary time series is one in which these properties do not change over time, meaning that the distribution of values remains the same across different time periods.
There are several methods for conducting stationary tests, including visual inspection, statistical tests such as the Augmented Dickey-Fuller (ADF) test or the Kwiatkowski-Phillips-Schmidt-Shin (KPSS) test, and time series decomposition methods such as seasonal decomposition of time series (STL).
By conducting a stationary test, analys