Skip to content

Instantly share code, notes, and snippets.

View ZhengHe-MD's full-sized avatar
🎯
Focusing

ZhengHe ZhengHe-MD

🎯
Focusing
View GitHub Profile
@ZhengHe-MD
ZhengHe-MD / 24.go
Last active October 30, 2022 12:33
package main
import (
"fmt"
"strconv"
)
func MakeTwentyFour(nums []int) (expr string, found bool) {
// in reality, as long as len(nums) >= 1, this function just works.
// Just to be conformed with the problem I'm trying to solve here.
@ZhengHe-MD
ZhengHe-MD / a-b-perm-test.py
Last active July 5, 2022 08:34
AB-Permutation-Test
import numpy as np
import matplotlib.pyplot as plt
#constructing an array of data : A/B
total_A, succ_A = 3469, 98
total_B, succ_B = 2798, 43
observation_A = np.array([1] * succ_A + [0] * (total_A-succ_A))
observation_B = np.array([1] * succ_B + [0] * (total_B-succ_B))
num_simulations = 10000
@ZhengHe-MD
ZhengHe-MD / gracefully_shutdown.go
Created December 14, 2018 08:20
gracefully shutdown a go server with timeout
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"