Content Preview: rss
13 days ago
自从云南之行归来,一直没时间来写一篇游记, 虽然,自认记忆力还可以,但是重温那每一天的行程和细节还是困难的。 只有罗列一些名词做为回忆的载体,才可以自私的梦回彩云之南。 多民族的体现: 白族(金花,阿朋G)纳西(胖金G,胖金M)彝族(阿诗玛,阿黑哥,白,花)香格里拉(骚多哩,猫多哩) 云南十八怪已经很难记得了。 只记得:什么三个蚊子一盘菜,鲜花论斤卖,躺在床上谈恋爱~~~ 导游介绍的一些历史故事,却还能复述出来。 这次抱歉没有能图文相嵌,因为,我希望有空大家也要亲身去逛古街,搭讪下微笑的胖金妹,吃点特别的特色菜。 突然,发现自己在都市里变得像张白纸,而渴望去靠近五颜六色。
42 days ago
1,准备好程序(本例程序或服务名为TVMsrv) 摘抄部分: #if defined(__STDC__) defined(__cplusplus) main(int argc, char *argv[]) #else main(argc, argv) int argc; char *argv[]; #endif { int sockfd,new_fd; sockfd=new_fd=0; WorkThread(&sockfd); close(sockfd); return 0; } 2,在etc/services 中用vi在最后一行加入: TVMsrv 18023/tcp 3,在etc/xinetd.d/下建立文件TVMsrv,并加入如下内容:(注意服务名,文件名的统一) service TVMsrv { socket_type = stream protocol = tcp wait = no user = tbs server = /home/tbs/bin/TVMsrv.sh } 4,把启动服务程序的sh脚本,部署在相应描述的路径下。/home/tbs/bin/ 当然,把编译好的程序也放在此目录下。(同时部署好供其使用的配置文件) 因为,脚本文件的最后一句,即是启动程序,例如:./TVMsrv $HOME/config/TVMsrv.cfg 5,然后,就等着准备客户端来测试吧,系统在帮助我们一直监听请求哟。
72 days ago
chkconfig --list grep sshd 查看sshd服务在哪种级别下开启,建议only 3。 防火墙规则中必须允许sshd访问,可以: 1.清除防火墙规则,#iptables -F 2.#iptables -A INPUT -p tcp --dport 22 -j ACCEPT #iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
82 days ago
(turtle immortal) 4.俗语说, 过去的,已经过去了 未来的,还未可知 现在,却是上苍的礼赠 那就是为什么今天是present(现在/礼物) There is a saying, Yesterday is history Tomorrow is a mystery But today is a gift That is why it’s called the present (the gift) 1.往往在逃避命运的路上,却与之不期而遇(in other words when we afraid of sth,than sth may come true) One meets its destiny on the road he takes to avoid it 5.世间无巧合 There are no accidents.(every accident happenned with many conditions,we should pay more attendtion to) 10.我私家汤的绝密食材,就是…什么都没有。 认为它特别,它就特别了。 The secret ingredient of my secret ingredient soup is...nothing. To make something special ,you just have to believe it’s special. 2.你的思想就如同水,我的朋友,当水波摇曳时,很难看清,不过当它平静下来,答案就清澈见底了.(let us know the process or rule thing goes,another famous guy of old china use to said the same kind of this idiom 浊者自浊,清者自清----老子.) Your mind is like this water, my friend , when it is agitated ,it becomes difficult to see ,but if you allow it to settle , the answer becomes clear. ...
96 days ago
有关DLL的问题现在资料很多,但是很多人写DLL时经常出现调用程序无法找到相关的导出函数的问题,这里主要的原因是DLL在声明时出的问题。 在这里主要有两个问题,一个是调用约定的问题,一个是函数名修饰的问题,而这两个问题又是相互影响的。 一:声明为:extern "C" int __declspec(dllexport)add(int x, int y); 这种声明是强制用C语言方式进行修饰,且用C的默认约定,即__cdecl方式。这种方式编译产生的DLL中有一个导出函数:add,不加任何修饰。 二:声明为:extern "C" int __declspec(dllexport) __stdcall add(int x, int y); 这种声明是强制用C语言方式进行修饰,且用stdcall约定,这种方式编译产生的DLL中有一个导出函数:_add@8,即前面有“_”,后面加了参数长。 三:声明为:int __declspec(dllexport) __stdcall add(int x, int y); 这种声明不强制用C语言方式进行修饰,但是用stdcall约定,这种方式编译产生的DLL中有一个导出函数:?add@@YGHHH@Z。这个名字很怪,后面的不好理解。 四:声明为:int __declspec(dllexport) __cdecl add(int x, int y); 这种声明是不强制用C语言修饰,且用cdecl约定,这种方式编译产生的DLL中有一个导出函数:?add@@YAHHH@Z,注意看,和第三种方有一点不同。 实验一:显式调用方式调用DLL中的add函数。 #include <stdio.h> #include <windows.h> typedef int(_stdcall *lpAddFun)(int, int); //宏定义函数指针类型 int main(int argc, char *argv[]) { HINSTANCE hDll; //DLL句柄 lpAddFun addFun; //函数指针 hDll = LoadLibrary("1.dll"); if (hDll != NULL) { addFun = ...



