11 2010 档案

摘要:■ 匿名 unions struct {       char a;       union {           char c[4];      ... 阅读全文
posted @ 2010-11-24 15:16 napoleon_liu 阅读(252) 评论(0) 推荐(0)
摘要:■ 内部函数 gcc 扩充一个类似 java 内部类的功能,一个函数内部可以嵌套定义一个子函数。 子函数不能被外部访问,只能被嵌套它的函数访问。 void hi(char *s) {       auto void say_hi(char *s);       char *me = &quo... 阅读全文
posted @ 2010-11-24 14:43 napoleon_liu 阅读(397) 评论(0) 推荐(1)
摘要:C 宏很强大,但我们大多只知道它的替换功能,具体细节总是不清楚,现在时候全面了解它了。 测试方式 gcc –E macro.test.c 参考资料 gcc: http://gcc.gnu.org/onlinedocs/cpp/Macros.html 也可以研究一下boost的 MACRO Metaprogram 或看Linux内核的一些宏技巧(比如list定义,once_call,... 阅读全文
posted @ 2010-11-20 03:23 napoleon_liu 阅读(10422) 评论(1) 推荐(2)
摘要:这个FOREACH使用了GCC的扩展特性typeof和({}),所以只保证能在linux下玩哦。 源程序 foreach.h #ifndef _MACRO_FOREACH_H_#define _MACRO_FOREACH_H_#define FOREACH_USE_ITERATOR(each_var, it_begin, it_end) \ if(int is_break_used_for_fo... 阅读全文
posted @ 2010-11-20 01:57 napoleon_liu 阅读(2522) 评论(3) 推荐(3)
摘要:前端开发,JS调试有很多方法。修改程序的方式: 1 alert (最早也是最原始的方方式) 2 日志方式(console.log, console.trace, console.assert, console.time, console.profile) 3 插入debugger不修改程序的方式:使用调试器设置断点。做过前端都知道,网站大多数JS都会minified, 主要是为减小js文件大小。调... 阅读全文
posted @ 2010-11-12 12:02 napoleon_liu 阅读(2532) 评论(0) 推荐(0)
摘要:测试代码代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<scripttype="text/javascript">//Testnamefindpath(function(){functionA(){this.a="objectvalu... 阅读全文
posted @ 2010-11-11 23:13 napoleon_liu 阅读(1659) 评论(0) 推荐(0)
摘要:转自:http://msdn.microsoft.com/en-us/library/bb250448.aspxThe Evolution of the Web Developer In the past, memory leaks haven't posed huge problems for Web developers. Pages were kept relatively si... 阅读全文
posted @ 2010-11-10 00:24 napoleon_liu 阅读(305) 评论(0) 推荐(0)
摘要:跨域Ajax有两种方式,<img src="out_url"/> 和 <sccript src="outside_url"></script>JSONP使用的就是 script方式。jsonp.js 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeH... 阅读全文
posted @ 2010-11-04 20:28 napoleon_liu 阅读(4423) 评论(0) 推荐(0)