Skip to content

Instantly share code, notes, and snippets.

@xiang-deng
xiang-deng / select.html
Last active October 3, 2025 23:03
html showing the usage of <select> element
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Select Field Demo</title>
<style>
.menu {
position: relative;
display: inline-block;
@xiang-deng
xiang-deng / numpy_describe.py
Created December 30, 2019 22:05
show statistics of a numpy array
def numpy_describe(array):
print('count', len(array))
print('min',np.min(array))
print('max',np.max(array))
print('mean',np.mean(array))
print('std',np.std(array))
print('10%',np.percentile(array,10))
print('25%',np.percentile(array,25))
print('50%',np.percentile(array,50))
print('60%',np.percentile(array,60))
@xiang-deng
xiang-deng / rank_metrics.py
Created October 2, 2019 18:24 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@xiang-deng
xiang-deng / tf_inspect.py
Created October 1, 2019 19:28
inspect tensorflow checkpoint
import numpy as np
import json
import pickle
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.platform import app
from tensorflow.python.platform import flags
import pdb
import argparse