随笔分类 -  实践

摘要:简单归纳:1.(无虚函数或有虚函数的)空类的sizeof是1,它的实例化也需要独一无二的空间地址2.无虚函数的类的sizeof是内部成员大小之和3.有虚函数的类的sizeof是内部成员大小之和再加4,这样的类有一个指向虚函数表的指针4.子类的sizeof是基类的大小加上子类成员大小,若子类有新的虚函... 阅读全文
posted @ 2015-07-10 17:11 MayFirst 阅读(236) 评论(0) 推荐(0)
摘要:对于单一的字节(a byte),大部分处理器以相同的顺序处理位元(bit),因此单字节的存放方法和传输方式一般相同。对于多字节的数据,如int,long,有大端和小端之分。 阅读全文
posted @ 2013-05-03 10:19 MayFirst 阅读(719) 评论(0) 推荐(0)
摘要:从windows下拷贝的文件放到linux系统上看文件名称是乱码。解决:1、安装个convmv2、执行 convmv-rfGBK-tUTF-8--notest* 阅读全文
posted @ 2013-04-01 14:01 MayFirst 阅读(254) 评论(0) 推荐(0)
摘要:终端命令行cd /homeftp 1.1.1.1 连接 服务器Name: s #输入用户名Password: #输入密码//登录进去了ftp> bin #bin 代表采用二进制的文件ftp> ls #查看ftp目录下文件ftp>cd dir_aftp>lsa.tar.bz2ftp>get a.tar.bz2 //下载文件a.tar.bz2 到/home/下 阅读全文
posted @ 2012-12-21 11:26 MayFirst 阅读(965) 评论(0) 推荐(0)
摘要:计算一个函数调用花费了多长时间。 int gettimeofday(struct timeval *tv,struct timezone *tz); //tz一般使用NULLstrut timeval { long tv_sec; /* 秒数 */ long tv_usec; /* 微秒数 */ }; #if OSL_DEBUG_LEVEL >1timeval aLast; float timeuse; gettimeofday(&aLast,NULL); #endiffunction(); //测量此函数执行所花费的时间#if OSL_DEBUG_LEVEL >1time 阅读全文
posted @ 2012-08-16 17:02 MayFirst 阅读(357) 评论(0) 推荐(0)
摘要:[mj@localhost go_linux_CE]$ prefix=temp[mj@localhost go_linux_CE]$ suffix=$(date +%s) # 'date'命令的"+%s"选项是GNU特性.[mj@localhost go_linux_CE]$ filename=$prefix.$suffix[mj@localhost go_linux_CE]$ echo $filename temp.1340700913echo "The number of seconds elapsed since 01/01/1970 is 阅读全文
posted @ 2012-06-26 17:00 MayFirst 阅读(163) 评论(0) 推荐(0)
摘要:typedef struct XML_ParserStruct *XML_Parser;struct XML_ParserStruct { /* The first member must be userData so that the XML_GetUserData macro works. */ void *m_userData; void *m_handlerArg; char *m_buffer; const XML_Memory_Handling_Suite m_mem; /* first character to be parsed */ const char *m_bufferP 阅读全文
posted @ 2011-02-17 14:14 MayFirst 阅读(376) 评论(0) 推荐(0)
摘要:弄一个不大不小的功能,从一开始的清晰走到后来厚着脸皮补丁再补丁......只剩反思。没有一个很清晰的设计思路,就永远不要着手编码!设计框架应考虑到所有情况,不全面的设计,等待的只有无休止的填补和越来越臃肿的代码胖子!编码时,要讲基本的原则作风!该写的写,不该写的别写。诗人那一套,随便写,情思泉涌,是划不来的。功能切割,函数划分想好。暧昧不清,牵扯不止,等着晕吧...... 阅读全文
posted @ 2010-08-03 15:13 MayFirst 阅读(158) 评论(0) 推荐(0)
摘要:Quickly and partly build&debug my working modules for OOo on ubuntu:-->download the source (the mininal modules is ok,and don't omit any file in the root of the src tree.)-->cd the src dirct... 阅读全文
posted @ 2010-04-23 11:14 MayFirst 阅读(337) 评论(0) 推荐(0)
摘要:Motive: adding a new command as a menuitem 'Clear Cell Content' and merging it with a present command menuitem 'Clear Format' of 'FormatMenu' into one popup menuitem of 'EditMenu'.Steps need to do as ... 阅读全文
posted @ 2010-03-24 15:22 MayFirst 阅读(394) 评论(0) 推荐(0)
摘要:目的:不想在本地花费全部的编译时间,只编译改动代码的模块,并能够查看调试信息办法:借用别人/别处已经编译好的solver包具体步骤:(1)ooo源码只下载必须的几个公共模块:(用export命令而非checkout,一是快,且因为你不需要修改这些模块去submit)external、default_images、dmake、solenv、moz (好像它还需要guw)(2)下载源码根目录下的所有元... 阅读全文
posted @ 2010-03-19 16:42 MayFirst 阅读(288) 评论(0) 推荐(0)