神器valgrind
其实早在2006年我就用过valgrind,但当时valgrind不能观测daemon的内存泄漏问题,所以后来渐渐用得少了。 今天又遇到一个内存泄漏问题,程序颇大,手工调试不太现实了,所以又想到了valgrind,毕竟在这7年间,valgrind又强大了不少。查了一下,它已经可以检测daemon进程了,方法在 这里 对应的官方文档在 这里 其中"monitor leak_check full...
View Articledebuginfo的rpm包
之前rpmbuild -ba xxx.spec能自动打出binary包和对应的debuginfo包,但是我不想分成两个包,希望binary包里就是带调试符号的,在网上找了一堆,最简单的办法就是在spec文件里(头部)加一句 %global debug_package %{nil} 那些说在~/.rpmmacros里加东西的办法似乎都不好使。...
View ArticleExt4 Workshop 2014
作者:刘峥 2014年3月26日,Napa Valley, CA. 今年LSF/MM Summit 2014会议就在这里举行,因此Ext4 Workshop相应的也就在这里了。会议内容主要是讨论后续一年Ext4文件系统的开发问题。 今年讨论的内容如下: Data Block Checksums Reflink Encryption Extent Cache Shrinker Buffer_head...
View ArticleLSF/MM Summit 2014
作者:刘峥 今年LSF/MM会议的内容lwn.net上已经有文章进行详细的介绍了。鉴于我本人分身乏术造成mm track基本没有听,同时会上讨论的有些问题本人理解也十分有限,所以推荐大家还是去lwn.net上看一下上面的文章。这里仅仅是总结我认为比较重要和关注的问题,希望通过这篇文章能让大家了解目前Linux Kernel在文件系统、存储和内存管理方面需要解决的问题。...
View Article小记备份遭遇
今天备份机器上的一个目录,用“du -sh .”看这个目录只占用了1.5G空间。但是,我一用tar打包,就半天停不下来,tar包都涨到十几G了还没有打包完。奇怪,哪多出来这么多东西。 查了半天,后来发现目录里有个101G的大文件,而du -sh 对这个大文件的返回结果却是”1.1M“,喔,原来这是个空洞文件,tar却只能老老实实的读数据,所以出来的tar包巨大无比。看来,备份目录前光"du -sh...
View Article追踪CPU跑满
最近测试一个应用遇到问题:一旦压力略涨,应用的CPU就顶满。由于是多线程应用,直接就把系统的CPU耗完了。 本来想用gdb來调试的,结果gdb不给力,就在attach那里卡死,半天不动。后来想到了用perf来调试,果然找到了一处性能热点。修复热点以后,CPU顶满的问题缓解了一些,不太容易出现了,但是,多跑一会儿,还是会有。而且现在出现CPU顶满时,不仅gdb不返回,连perf record -a...
View Article去哪儿
部门这几天在投票选六月份outing的地点,很多同事选了“泰国清迈”。 coly:咋那么多人选泰国啊!最近泰国这么乱,我又这把年纪了,万一穿着黄衬衫到泰国,被红衫军以为是黄衫军,痛打一顿,一身的血,结果又被黄衫军以为是红衫军,又被痛打.... 我回到家,把消息告诉了家人,家里人也觉得泰国最近不太平。吃饭,看电视,正好新闻里演泰国的局势,里面大大的标题“泰国,去向何方?”...
View Article自修DELL笔记本
家里有个DELL e6400的笔记本,最近用起来感觉越来越发烫,而且长时间浏览网页或干活儿后,就频频死机。一开始以为是今年夏天温度太高,于是把塑料瓶装上自来水冻成冰块,放到笔记本的背后降温。 后来在 @唐僧_huangliang...
View Article快十年了,我们再聊聊
Dong: http://oldblog.donghao.org/2007/09/euoo.html 你说时间过得多快 Hero: ...那时怎么大家这么无聊 无聊得来有基情 http://oldblog.donghao.org/2008/02/io.html 唐唐是谁? Dong: 唐勇,2008年我挪到他下面,就没有跟中中在杭州一起加班了...
View Article数据与模型
Hero: 我在看WE大会,多好的大会啊。股票也涨的很好 Dong: 阿里巴巴你怎么预测? Hero: 任何没有足够数据基础的预测都是耍流氓 - 三多 Dong: 三多这个流氓以为有数据就能预测了 - 三百 Hero: 有数据然后找三百看论文,就可以知道预测的置信度了 - 三多 Dong: ......
View ArticleProblems and solutions about building Tensorflow-1.8 with TensorRT 4.0
Problem: When compiling Tensorflow-1.8 with CUDA-9.2, it reports:bazel-out/host/bin/_solib_local/_U_S_Stensorflow_Spython_Cgen_Unn_Uops_Upy_Uwrappers_Ucc___Utensorflow/libtensorflow_framework.so:...
View ArticleReinforcement Learning example for tree search
I have been learning Reinforcement Learning for about two weeks. Although haven’t go through all the course of Arthur Juliani, I had been able to write a small example of Q-learning now. This example...
View ArticleUsing multi-GPUs for training in distributed environment of Tensorflow
I am trying to write code for training on multi-GPUs. The code is mainly from the example of ‘Distributed Tensorflow‘. I have changed the code slightly for runing on GPU:......
View ArticleRegularization loss in ‘slim’ library of Tensorflow
My python code using slim library to train classification model in Tensorflow:with tf.contrib.slim.arg_scope(mobilenet_v2.training_scope(weight_decay = 0.001)): logits, _ =...
View ArticleDo tf.random_crop() operation on GPU
When I run code like:with tf.device('/GPU:0'): images = tf.random_crop(images, [IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNELS]) ...it reports:Could not satisfy explicit device specification '/device:GPU:0'...
View ArticleUse PCA (Principal Component Analysis) to blur color image
I wrote an example of blurring color picture by using PCA from scikit-learn:import cv2 import numpy as np from sklearn.decomposition import PCA pca = PCA(n_components = 0.96) img =...
View ArticlePrediction of Red Wine Quality
In Kaggle platform, there is an example dataset about Quality of Red Wine. I wrote some code for it by using scikit-learn and pandas:import pandas as pd from sklearn.preprocessing import StandardScaler...
View ArticleSource code analysis for Autograd
Autograd is a convenient tool to automatically differentiate native Python and Numpy code. Let’s look at an example first:import autograd.numpy as np from autograd import grad def f(x): return x * x +...
View ArticleMigrate blog to AWS’s ec2
My blog had been hosting on Linost since 2013. But recently support staff from Linost noticed me that my site has led CPU usage of the host machine to 100% so the hosting system automatically ‘limited’...
View Article