Skip to content

Instantly share code, notes, and snippets.

Jianghua.yjh yjhjstz

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
yjhjstz / gdblive.sh
Created May 10, 2019
Gdblive script
View gdblive.sh
#!/bin/sh
# 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 ]
then
PROCS=`ps auxww | \
@yjhjstz
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: http://forum.geonames.org/gforum/posts/list/15/926.page
View geogres-knn-benchmark
#!/bin/bash
#===============================================================================
#
# FILE: getgeo.sh
#
# USAGE: ./getgeo.sh
#
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your
# database
#
@yjhjstz
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
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
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 Severing.md

TensorFlow Severing

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

安装

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

# 从https://github.com/bazelbuild/bazel/releases下载bazel安装包
cd ~/Downloads
chmod +x bazel-0.4.5-installer-linux-x86_64.sh
./bazel-0.4.5-installer-linux-x86_64.sh --user
@yjhjstz
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/libc.so.6").function("malloc").return {
@yjhjstz
yjhjstz / README.md
Created Jun 16, 2017 — forked from rantav/README.md
Find slow queries in mongo DB
View README.md

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
yjhjstz / pstack-osx.sh
Created Jun 14, 2017 — forked from theirix/pstack-osx.sh
pstack for osx
View pstack-osx.sh
#!/bin/sh
#
# Script prints gdb stack of the process with a specified pid
if [ -z $1 ]; then
echo "Usage: $0 pid"
exit 1
fi
PID=$1
You can’t perform that action at this time.