Skip to content

Instantly share code, notes, and snippets.

Working from home

Jianghua.yjh yjhjstz

Working from home
Block or report user

Report or block yjhjstz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yjhjstz /
Created May 10, 2019
Gdblive script
# Usage: gdblive [ arguments to grep output of ps ]
cd $HOME
# tee /dev/tty is for user to see the set of procs considered
if [ $# -eq 0 ]
PROCS=`ps auxww | \
yjhjstz / geogres-knn-benchmark
Created Apr 29, 2019 — forked from spolakh/geogres-knn-benchmark
This script imports geonames into postgres for the purposes of knn-spgist vs knn-gist benchmarking. Based on the script from geonames forums:
View geogres-knn-benchmark
# USAGE: ./
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your
# database
yjhjstz / l2sqr_functions.cpp
Created Feb 25, 2019 — forked from matsui528/l2sqr_functions.cpp
Runtime evaluation for squared Euclidean distances with SSE, AVX, AVX512 implementations
View l2sqr_functions.cpp
#include <iostream>
#include <random>
#include <chrono>
#include <x86intrin.h>
#include <cassert>
// Runtime evaluation for squared Eucliden distance functions
// - fvec_L2_sqr_ref: naive reference impl from Faiss
// - fvec_L2_sqr_sse: SSE impl from Faiss
// - fvec_L2_sqr_avx: AVX impl from Faiss
yjhjstz / gist:7b501d4b2327a01ec24c8c977b32dd10
Created Jul 11, 2018 — forked from vreid/gist:c5caedb9049fc6a4faa6
boost::interprocess::managed_mapped_file + boost::multi_index::multi_index_containe
View gist:7b501d4b2327a01ec24c8c977b32dd10
#include <iostream>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/range/iterator_range.hpp>
View fluent_logging_glog.cpp
#include <iostream>
#include <sstream>
#include <string>
#include <ctime>
#include <glog/logging.h>
#include <msgpack.hpp>
#include <pficommon/text/json.h>
#include <pficommon/network/socket.h>
yjhjstz / C++ Predict with caffe
Created Apr 20, 2018 — forked from onauparc/C++ Predict with caffe
sample code for caffe C++ prediction
View C++ Predict with caffe
#include <cuda_runtime.h>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <iostream>
#include <stdio.h>
#include "caffe/caffe.hpp"
View TensorFlow

TensorFlow Severing

本文讲解如何使用TensorFlow Severing落地一个训好的模型。


Bazel (可选,编译源代码才用)

# 从下载bazel安装包
cd ~/Downloads
chmod +x
./ --user
yjhjstz / leak.stp
Created Nov 6, 2017
memory leak systemTap script
View leak.stp
global ptr2bt
global ptr2size
global bt_stats
global quit
probe begin {
warn("Start tracing. Wait for 10 sec to complete.\n")
probe process("/lib/x86_64-linux-gnu/").function("malloc").return {
yjhjstz /
Created Jun 16, 2017 — forked from rantav/
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

yjhjstz /
Created Jun 14, 2017 — forked from theirix/
pstack for osx
# Script prints gdb stack of the process with a specified pid
if [ -z $1 ]; then
echo "Usage: $0 pid"
exit 1
You can’t perform that action at this time.