`
hankgong
  • 浏览: 196044 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
实现办公室Linux计算机硬盘备份到另外一台Linux服务器上。需要rsync和ssh连接。1. 确认rsync和ssh都工作,最好配置好主计算机到备份服务器不需要输入密码连接。rsync -avL --delete -e ssh HankProjects/ myname@gserver:HankProjects/2. 用crontab -e 打开定时任务编辑器,输入0 23 * * * rsync -avL --delete -e ssh HankProjects/ myname@gserver:HankProjects/  
verycd上的大部分ed2k的种子信息都不提供了,其他还好,我比较喜欢的discovery的种子全部都找不到了,费了一点周折才找到说现在种子是要下好给你一个txt文件,然后里面都是种子的链接。   我edonkey是用的mldonkey加上firefox的插件,每次往输入的地方拷贝链接实在太麻烦,我就写了一个简单的python脚本来生成一个可以浏览的种子网页。这样只要点击就会自动下载了,用emule的人应该也会方便一点。因为discovery都是台湾人录下来的,所以字体的编码有时候是utf-8,有时候是gbk之类的。只要改改charset就可以,也可以直接在我给的程序里面改,都不麻烦。 ...
If you have installed emacs, you may notice that it will automatically install its etags and also set it as the default ctags for the system. However, if you use vim, you will find that it's bad for vim autocomplete.    So you need to install exuberant-ctags, it will solve the problem.
- 我自己的一个小项目,在两个地方开发,在其中一个地方修改以后push到服务器上,在另外一个地方添加了一些文件,但现在并不希望保留这些文件。   git clean -d -fx ""
在学习pthread的时候,pthread_join这个函数的理解恐怕让很多人迷惑,这里我们用一个例子来示范一下: #include <iostream> #include <pthread.h> using namespace std; #define TOTAL 10 int sumarray[TOTAL]; void *PartSum(void* param) { int index = (int)param; int sum = 0; for(int i=1; i<=10; ++i){ ...
void *有人把它叫为generic pointer,中文翻译为泛型指针。一般来说,它的用法应该是作为指针来用,比如下面的例子   int main() { int i; char c; void *the_data; i = 6; c = 'a'; the_data = &i; printf("the_data points to the integer value %d\n", *(int*) the_data); the_data = &c; printf("the_da ...
A few days ago, we started to upload our program into the atmega2560 chips, but we found that the results are quite diffeerent on periodical running time. By measuring, we found that the system is 16 times slower than our expectation. Later on, we found that the system clock is 1Mhz and we were using ...

python print formating

Python's print command is not convenient to use comparing with ruby. Now it finally came a good solution.   "The sum is {0}+{1}={2}".format(1, 2, "ddfd")
wget http://poppler.freedesktop.org/poppler-data-0.1.tar.gz tar xzvf poppler-data-0.1.tar.gz && cd poppler-data-0.1 sudo make install datadir=/usr/share    就这么简单就可以了!
这个问题看似很简单,但是仔细思考一下其实还是很有意思的!   首先java就不需要pointer就可以实现各种数据结构,为什么呢?因为java的函数中对象传值的时候都是基于reference的,而c++中默认是by value的。   C/C++中数据结构的函数中传值的时候如果不用指针,是没法对数据结构进行操作的。   C/C++用reference也可以实现数据结构,但是复杂度很大。   具体的我以后慢慢写出来!

gcc -Werror

-Werror的意思是把所有的警告当成错误,让编译停止!
C/C++一个项目只能容忍一个main()函数,但是有时候这样并不是很方便,尤其是自己练习编程的时候,一个小程序就要在eclipse中建个项目好烦!   我这里用的是linux的编程环境,然后编译我用的不是makefile而是scons(http://www.scons.org/)。scons比makefile方便,而且因为是用python编写的所以比较容易自己编程。     1)在project的properties里面build command填上scons   2)在代码的debug或者release目录下创建一个SConstruct(相当于make的makefile),编辑 ...
TOEFL iBT TOEFL CBT TOEFL PBT TOEFL PBT Score Range TOEIC Score Range 120 300 677
gnuplot一般是用来画数据图,但是其实也是用来画托补图的,一般人可能不知道怎么弄。   1)画节点是用plot xxx using 1:2 w points pt 7就是园点了   2)画线段是用plot xxx using 1:2 w lines,线段要注意,线段默认是连续画的,如果想要线段不连续,则要在2组数据中间加一个空行,我的意思是写成比如 1 2 3 4   4 8 9 10 这样就会画两条线段(1,2)-(3,4)和 (4,8)-(9,10)   3)画线段也可以用set arrow from xx,xx to xx,xx no head lt rgb & ...
原因就是因为ubuntu默认让numpad来模拟鼠标的移动,去掉这个就可以了。 System -> Preferences -> Assistive technologies click "keyboard accessibility" go to the tab "mouse keys" uncheck "pointer can be controlled using keypad"
Global site tag (gtag.js) - Google Analytics