Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / letor_metrics.py
Created June 15, 2017 06:31 — forked from mblondel/letor_metrics.py
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters
@githubutilities
githubutilities / rank_metrics.py
Created June 15, 2017 06:31 — 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

jumbo

A package management system which allows installation to non-system location.

点此 为 jumbo 捐款!

jumbo 是什么?

jumbo 是一个适用于百度测试机环境的包管理工具, 使用它可以方便地管理各种软件包. 真的, 不会再有比这个更方便的管理工具了!

@githubutilities
githubutilities / disable-android-pattern-code.md
Created August 1, 2016 08:47
Disable Android pattern code
@githubutilities
githubutilities / iOS-penetration-test.md
Last active July 24, 2016 14:09
iOS penetration test

Install Penetration Env

# install ruby
wget http://apt.saurik.com/cydia/debs/ruby_1.8.6-p111-5_iphoneos-arm.deb
wget http://apt.saurik.com/cydia/debs/rubygems_1.2.0-3_iphoneos-arm.deb

dpkg -i ruby_1.8.6-p111-5_iphoneos-arm.deb
dpkg -i rubygems_1.2.0-3_iphoneos-arm.deb
@githubutilities
githubutilities / sniffing.md
Last active July 12, 2016 07:24
Jailbreak network sniffing
@githubutilities
githubutilities / ubuntu-tweek.sh
Created April 18, 2016 04:16
ubuntu gui-tweek
#!/bin/bash
# sudo apt-get install xdotool
xdotool search --class "$@" windowactivate %@
# if [ $# -ne 1 ];then
# echo -e "Usage: `basename $0` PROGRAM_NAME\n
# For example:\n\t
# '`basename $0` gnome-terminal' for Terminal\n\t
@githubutilities
githubutilities / get-and-build-crfsuite.sh
Last active March 18, 2018 08:45
Get and build crfsuite
#! /usr/bin/env bash
#sudo apt-get install --yes autoconf
WORKING_DIR=`pwd`
LIBLBFGS_GIT=https://github.com/chokkan/liblbfgs.git
LIBLBFGS_SRC_DIR=./liblbfgs/
LIBLBFGS_INSTALL_DIR=$WORKING_DIR/local/lbfgs/
CRFSUITE_GIT=https://github.com/chokkan/crfsuite.git
CRFSUITE_SRC_DIR=./crfsuite/

Ubuntu Freeze

1. kill command

2. sudo service lightdm restart

3.REISUB when freezes

Alt + SysReq + REISUB

R: Switch to XLATE mode
# Export to json
mongoexport -d <database> -c <collection> -o <out-file>
# Export to csv
mongoexport --csv -o <out-file> -d <database> -c <collection> -f <field-1>, <field-2>
# Import from json
mongoimport -d <database> -c <collection> <in-file>
# Import from csv