Skip to content

Instantly share code, notes, and snippets.

View qiaohaijun's full-sized avatar
🎯
Focusing

qiao hai-jun qiaohaijun

🎯
Focusing
  • Beijing,China
View GitHub Profile
@qiaohaijun
qiaohaijun / mg.csv
Created January 10, 2013 06:17 — forked from nanxstats/mg.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 7 columns, instead of 6. in line 9.
1.1335086e+00, 1.0653587e+00, 8.4250325e-01, 7.0782984e-01, 1.0178784e+00, 1.2476827e+00, 9.0000000e-01
1.1645714e+00, 1.1355961e+00, 5.5885374e-01, 7.9370192e-01, 1.0346794e+00, 1.0067861e+00, 9.0000000e-01
1.0315895e+00, 1.1533842e+00, 4.2572016e-01, 1.0558440e+00, 1.1640420e+00, 7.1297054e-01, 9.0000000e-01
7.9058261e-01, 1.0678134e+00, 7.5043060e-01, 1.2000510e+00, 1.0670009e+00, 5.0349420e-01, 9.4136145e-01
6.3878936e-01, 8.1349649e-01, 9.7291951e-01, 1.2998549e+00, 1.0026658e+00, 5.8392542e-01, 1.1188041e+00
6.4385427e-01, 6.6246660e-01, 9.3785503e-01, 1.1857500e+00, 7.7000347e-01, 9.4327347e-01, 1.2161867e+00
9.7290237e-01, 6.2210481e-01, 1.0653587e+00, 8.4250325e-01, 7.0782984e-01, 1.0178784e+00, 1.2476827e+00
1.1330941e+00, 9.3890430e-01, 1.1355961e+00, 5.5885374e-01, 7.9370192e-01, 1.0346794e+00, 1.0067861e+00
1.1738960e+00, 1.1287058e+00, 1.1533842e+00, 4.2572016e-01, 1.0558440e+00, 1.1640420e+00, 7.1297054e-01
1.2210669e+00, 1.1699535e+00, 1.0678134e+00, 7.5043060e-01, 1.2000510e+00, 1.0670009e+00
@larsks
larsks / gist:4988914
Last active December 22, 2016 12:29

We were discussing the design of an HA environment for Puppet, and what the potential impacts were of a "split-brain" situation. For the model that I was discussing...

HA puppet architecture

...the "worst case" scenario is probably that the two Postgres databases become out-of-sync. This would require a network interruption that would cause:

  • the two front-end Puppet masters to lose contact with each other, causing both assume the master role, with the result that pgpool would be running on both nodes and each puppetdb process would be talking to it's local pgpool instance.
  • pgpool on one of the nodes to lose contact with the current master database server, causing it to erroneously promote the slave database.
  • some puppet clients in the environment to see one master and others to see the other master
``` bash
[@nmyjs_176_98 web.web_dnn.20170601.a.qhj_desm]# svn diff http://svn.sogou-inc.com/svn/websearch4/web/web_dnn/branches/desm2opt http://svn.sogou-inc.com/svn/websearch4/web/web_dnn/trunk
Authentication realm: <http://svn.sogou-inc.com:80> Sogou SVN
Password for 'qiaohaijun':
Index: src/gpu_server.cfg
===================================================================
--- src/gpu_server.cfg (.../branches/desm2opt) (revision 593977)
+++ src/gpu_server.cfg (.../trunk) (revision 593977)
@@ -10,7 +10,6 @@
"DnnModelPath"="data/base/dnn.model"

需要修改一下/etc/yum.repos.d/epel-7.repo

gpgcheck=0
enabled=1

这两项修改一下

安装服务软件

bazel run tensorflow/tools/graph_transforms:transform_graph -- \
--in_graph=tensorflow_inception_graph.pb \
--out_graph=optimized_inception_graph.pb --inputs='Mul' \
--outputs='softmax' --transforms='strip_unused_nodes(type=float, shape="1,299,299,3") fold_constants(ignore_errors=true) fold_batch_norms fold_old_batch_norms'
@yinyin
yinyin / env-autotools.sh
Last active December 4, 2018 23:56
Set environment variables for autotools
#!/bin/bash
# source ~/bin/env-autotools.sh
OPT_BASE=/opt
which autoreconf
if [ "$?" != "0" ]; then
export PATH=${OPT_BASE}/autoconf-2.69/bin:$PATH
fi
@bstaletic
bstaletic / Mutex.h
Created May 25, 2018 18:58
Clang thread safety annotations
#ifndef BENCHMARK_MUTEX_H_
#define BENCHMARK_MUTEX_H_
#include <mutex>
// Enable thread safety attributes only with clang.
// The attributes can be safely erased when compiling with other compilers.
#if defined(__clang__) && (!defined(SWIG))
#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
@inkydragon
inkydragon / .zshrc
Created August 7, 2017 11:57
zsh的配置文件
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/wo/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# 主题设置
@sunsided
sunsided / dump_operations.py
Last active October 27, 2021 21:26
Listing operations in frozen .pb TensorFlow graphs in GraphDef format (see comments for SavedModel)
import argparse
import os
import sys
from typing import Iterable
import tensorflow as tf
parser = argparse.ArgumentParser()
parser.add_argument('file', type=str, help='The file name of the frozen graph.')
args = parser.parse_args()
@josevalim
josevalim / 0_README.markdown
Created January 9, 2012 13:07
Hello world of Sinatra-like libraries on Elixir, Ruby and Node.js