Skip to content

Instantly share code, notes, and snippets.

View yjhjstz's full-sized avatar
🏠
Working from home

Jianghua.yjh yjhjstz

🏠
Working from home
View GitHub Profile
@yjhjstz
yjhjstz / geogres-knn-benchmark
Created April 29, 2019 07:13 — 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
#!/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 / gist:7b501d4b2327a01ec24c8c977b32dd10
Created July 11, 2018 07:29 — forked from vreid/gist:c5caedb9049fc6a4faa6
boost::interprocess::managed_mapped_file + boost::multi_index::multi_index_containe
#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>
@yjhjstz
yjhjstz / fluent_logging_glog.cpp
Created June 27, 2018 00:38 — forked from eiichiroi/fluent_logging_glog.cpp
Fluent Logger for glog
#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 April 20, 2018 08:10 — forked from onauparc/C++ Predict with caffe
sample code for caffe C++ prediction
#include <cuda_runtime.h>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <iostream>
#include <stdio.h>
#include "caffe/caffe.hpp"

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 / README.md
Created June 16, 2017 11:39 — forked from rantav/README.md
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
yjhjstz / pstack-osx.sh
Created June 14, 2017 06:44 — forked from theirix/pstack-osx.sh
pstack for osx
#!/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
@yjhjstz
yjhjstz / stacktrace.cc
Created January 28, 2016 09:22 — forked from bnoordhuis/stacktrace.cc
Decode C/C++ and V8 JS stack frames.
#include "v8.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <cxxabi.h>
#include <dlfcn.h>
using namespace v8;