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
  • 01:11 (UTC -04:00)
View GitHub Profile
models:
xgboost:
type: lambdamart
backend:
type: xgboost
weights:
click: 1
features:
- bm25
- cos
{"id": "b9630485-27b6-478b-86c2-cf923fae5c2d", "timestamp": "2023-03-06T20:39:15Z", "user": "9ecf5550-5f46-4b31-b9c2-f354a8feda7c", "session": "9ecf5550-5f46-4b31-b9c2-f354a8feda7c", "fields": [], "items": [{"id": "62", "fields": [{"name": "cos", "value": 71.962}]}, {"id": "195", "fields": [{"name": "bm25", "value": 10.973}]}, {"id": "1168", "fields": [{"name": "cos", "value": 70.012}]}, {"id": "4985", "fields": [{"name": "bm25", "value": 10.922}]}, {"id": "397", "fields": [{"name": "cos", "value": 69.44}]}, {"id": "7530", "fields": [{"name": "bm25", "value": 10.843}]}, {"id": "2242", "fields": [{"name": "cos", "value": 68.255}]}, {"id": "2186", "fields": [{"name": "bm25", "value": 10.51}]}, {"id": "105", "fields": [{"name": "cos", "value": 60.901}]}, {"id": "6429", "fields": [{"name": "bm25", "value": 10.4}]}, {"id": "8532", "fields": [{"name": "bm25", "value": 10.328}]}, {"id": "7314", "fields": [{"name": "cos", "value": 55.683}]}, {"id": "1964", "fields": [{"name": "bm25", "value": 10.192}]}, {"id": "6549"
[16711680, 6160384, 16252928, 5308416, 6029312,
7077888, 15466496, 6488064, 15138816, 16318464,
4849664, 15138816, 5505024, 3014656, 11796480,
14680064, 6225920, 13893632, 5046272, 12648448,
3801088, 12582912, 11141120, 0, 16646144, 11141120,
4653056, 6291456, 4063232, 3604480, 10944512,
6225920, 11534336, 4521984, 15794176, 14614528,
6619136, 13041664, 15990784, 7340032, 15138816,
8126464, 16056320, 17367040, 13565952, 16580608,
7012352, 16187392, 4390912, 3735552, 10682368,
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:
@Enoch2090
Enoch2090 / nyq.sh
Last active February 14, 2022 03:46
$ pip3 install nyquisis
$ nyquisis ./pdf-to-drop.pdf
@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 / 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 / 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.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 / 📊 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%