Skip to content

Instantly share code, notes, and snippets.

View Enoch2090's full-sized avatar
⌨️
Alive

Yucheng Gu Enoch2090

⌨️
Alive
  • University of Michigan
  • Ann Arbor
  • 15:07 (UTC -04:00)
View GitHub Profile
@Enoch2090
Enoch2090 / LUT_generator.m
Created March 20, 2020 10:45
LUT generator
function success=LUT_generator(num,mode)
% --------参数设置--------
indent = ' ';
format long g
digits(16)
factor = 1.94106625850464;
% --------查找表设置--------
switch num
% 原始的查找表
case 0
@Enoch2090
Enoch2090 / Independence.py
Created May 10, 2020 07:09
Independence Test with Steps
'''
https://enoch2090.me
A python Test for indepencence. Separate all inputs with spaces.
'''
import numpy as np
import pandas as pd
import scipy.stats as sst
[r, c] = list(map(int, input("Row by column: \n").split(" ")))
@Enoch2090
Enoch2090 / content.md
Created June 1, 2020 18:08
Gist from Drafts

Opportunity's dream

The rover sees no difference between Mars and Earth. The same vast plain with some pits at the center and ridges lie far. Her internal clock always claim that a sol is no different than a day except forty more minutes of slack. Therefore most of time she rests on the edge of a crater. And soaked


@Enoch2090
Enoch2090 / 📊 Weekly development breakdown
Last active November 11, 2021 20:07
📊 Weekly development breakdown
Other 🕓 6 hrs 33 mins ████████▏░░░░░░░░░░░░ 38.8%
CSS 🕓 4 hrs 18 mins █████▎░░░░░░░░░░░░░░░ 25.5%
HTML 🕓 3 hrs 9 mins ███▉░░░░░░░░░░░░░░░░░ 18.7%
Python 🕓 2 hrs 38 mins ███▎░░░░░░░░░░░░░░░░░ 15.7%
JavaScript 🕓 8 mins ▏░░░░░░░░░░░░░░░░░░░░ 0.8%
# enoch2090.me
# Register for your api key at https://www.wordsapi.com
import requests
headers = {
'x-rapidapi-host': "wordsapiv1.p.rapidapi.com",
'x-rapidapi-key': "YOUR API KEY"
}
url = "https://wordsapiv1.p.rapidapi.com/words/"
@Enoch2090
Enoch2090 / success.html
Created August 25, 2020 12:56
success.html
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
<!DOCTYPE html>
<html>
<head>
<title>Untitled Diagram</title>
<meta charset="utf-8"/>
</head>
<body><div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="{&quot;highlight&quot;:&quot;#FFFFFF&quot;,&quot;lightbox&quot;:false,&quot;nav&quot;:true,&quot;resize&quot;:true,&quot;toolbar&quot;:&quot;zoom&quot;,&quot;edit&quot;:&quot;_blank&quot;,&quot;xml&quot;:&quot;&lt;mxfile host=\&quot;Electron\&quot; modified=\&quot;2020-08-25T12:53:17.957Z\&quot; agent=\&quot;5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.9.13 Chrome/80.0.3987.163 Electron/8.2.1 Safari/537.36\&quot; etag=\&quot;s5vQooWAJqlCozVtNpk-\&quot; version=\&quot;12.9.13\&quot; type=\&quot;device\&quot;&gt;&lt;diagram id=\&quot;bJmID53qQG9rN-0mmbp_\&quot; name=\&quot;Page-1\&quot;&gt;jZNNb4MwDIZ/DcdJhVTdehys2w77qMSk7ZoRF6IFjEIodL9+ZjilrKq0E8ljxx+vTSCSsn+wsi6eUYEJooXqA3EXRFEYLlb0GchhJDdiMYLcasVOE0j
@Enoch2090
Enoch2090 / bid.py
Created December 6, 2020 13:45
从BV号生成 Bilibili iframe 播放器代码
# Usage:
# $ python3 bid.py [BID]
# e.g.
# $ python3 bid.py BV1yt4y1a7FN
import requests
import sys
import platform
import os
@Enoch2090
Enoch2090 / yolov4_quant.py
Created August 8, 2021 13:24
YOLOv4 Pytorch quantization using Vitis-ai
import os
import re
import sys
import argparse
import time
import pdb
import random
from pytorch_nndct.apis import torch_quantizer, dump_xmodel
import torch
import torchvision
@Enoch2090
Enoch2090 / nyq.sh
Last active February 14, 2022 03:46
$ pip3 install nyquisis
$ nyquisis ./pdf-to-drop.pdf
def cluster(diff: list, maxiter: int=200, seed: int=42) -> tuple([int, list]):
'''
Run an unsupervised cluster algorithm on the list diff.
Assumes the list can be divided by a clear threshold,
return that threshold using the mean of the two clusters' centers.
Arguments:
- diff (list): The list of hash differences.
- maxiter (int): Max number of K-means iteration.
- seed (int): Seed to initialize numpy's RNG.
Returns: