- 博客(33)
- 资源 (3)
- 收藏
- 关注
转载 关于百度的五大真相
<br />关于百度的五大真相<br />昨天看到互动百科“致百度CEO李彦宏的公开信”,文章太酸、太长、太烂,百度该不该骂?该!百度成为众矢之的离不开中文第一搜的地位,以至于骂百度已经成为媒体博取用户关注的一种手段,赚钱赚到这样让这么多人恶心的程度,也实属难得。<br />很多人知道百度,不一定完完全全地了解百度,笔者这里就权且列五条关于百度的不良记录,权当笑谈。<br />真相一:在搜索结果中放广告赚钱<br />百度搜索竞价排名是笔者目前了解到的,多年来百度收入占比最大的一块业务,即便多次更名也丝毫没
2010-12-23 14:07:00 1930
原创 How to resolve '_DllMain@12 already defined in xxx.obj' ?
如何解决 _DllMain() 重复定义的错误?
2010-09-02 13:52:00 3115
原创 在Windows下用MinGW+GCC编译SDL的注意事项
长期(大于3年)以来被一个极其郁闷的问题困扰:就是在自己用gcc编译的SDL.dll一直比libsdl.org官方发布的SDL.dll的性能弱。即使用同样的codebase也是如此,最初是怀疑编译器的版本不同造成的,今天仔细分析了SDL编译时的configure脚本的实现,才发现真正原因是SDL用来侦测DirectX的代码与我本地的MinGW的内置的include和libs不兼容造成的,使得SDL
2010-03-09 15:19:00 7244 2
原创 Chrome常用的启动参数以及about命令
Chrome常用的启动参数:--user-data-dir=UserDataDir 自定义用户数据目录 --start-maximized 启动就最大化 --no-sandbox 取消沙盒模式 --single-process 单进程运行 --process-per-tab 每个标签使用单独进程 --process-per-site 每个站点使用
2010-02-20 18:37:00 5751
原创 在栈(stack)上动态分配内存的一种简单实现方式
有时候为了代码的高效性,需要在stack上分配内存。一般而言如果不通过额外的寄存器,只通过esp指针是没法实现在stack的上的内存的动态分配的,因为compile没法通过单纯一个esp指针来实现变量的相对地址的管理。 例如要实现如下类似函数: int foo(int n){ int x=100; // assume its not put in a regis
2010-02-10 19:29:00 2008 1
原创 变态的pkg-config
关于pkg-config的说明: 为了解决引用各种第三方库时的cflags和ldflags的设置问题,pkg-config被引进到编译配置中来,以便为了用一种统一的方式来自动设置项目所依赖cflags和ldflags等参数, pkg-config是通过库提供的一个 .pc 文件获得库的各种必要信息的,包括版本信息、编译和连接需要的参数等。这些信息可以通过 pkg-config提供
2010-01-14 22:03:00 1601
原创 pthread 静态编译版本在Windows下使用时的注意事项
作为通用的跨平台高性能线程库,在很多跨平台的项目中都可以看见pthread的身影。pthread本身的实现比较优雅,APIs使用起来也很方便。但在Windows下使用静态编译的pthread时要特别注意一下,必须显式的调用如下四个函数,否则pthread用到的一些全局变量会没有被初始化,导致所有的pthread的APIs调用都crash. BOOL pthread_win3
2010-01-14 13:56:00 6077
原创 x264 for Visual Studio 2008
默认情况下,用MinGW/gcc 编译x264的动态库的时候只能生成libx264.dll和libx264.dll.a,这个.a文件不是标准的Win32的DLL导出函数所用到的lib格式,虽然可以修改文件名为libx264.lib,然后在VS2008中用: #pragma comment(lib, "libx264.lib") 的方式来使用,但是由于此做法属于Hack性质的,
2010-01-08 14:57:00 3440
转载 算法的威力:法国人用台式机打破由超级计算机创造的圆周率运算世界记录
法国人Fabrice Bellard最近使用一台普通的台式电脑,完成了冲击由超级计算机保持的圆周率运算记录的壮举,他使用台式机将圆周率计算到了小数点后2.7万亿位,超过了由目前排名世界第47位的T2K Open超级计算机于去年8月份创造的小数点后2.5万亿位的记录。 Bellard使用的电脑是一台基于2.93GHz Core i7处理器的电脑,这部电脑的内存容量是6GB,硬盘
2010-01-06 14:59:00 1419
原创 保证函数调用时stack的起始地址是十六字节对齐的方法
在某些应用到SSE指令的代码中,都会要求所参与运算的内存地址必须是16字节对齐,否则程序将会crash. 在默认情况下如果一个(静态/动态)库是用gcc编译的,并且调用该(静态/动态)库的程序也是用gcc编译的,则该程序将运行正常,因为这样可以保证所有代码中都用相同的stack初始化逻辑,如果代码出错,则必定是真实的错误,而不是由于函数调用过程中stack初始化错误而造成的。
2009-12-29 10:48:00 5100 3
原创 Visual C++ 别名包含的用法: #pragma include_alias
缘起: 用某些版本的DirectX SDK 来编译mpc时会遇到如下问题: .....include/qedit.h(498) : fatal error C1083: Cannot open include file: dxtrans.h: No such file or directory 这是因为 dxtrans.h这个文件在某些版本的Microsoft Dire
2009-12-27 11:41:00 3385
原创 x264常用options整理
Syntax: x264 [options] -o outfile infile [widthxheight] Infile can be raw YUV 4:2:0 (in which case resolution is required), or YUV4MPEG 4:2:0 (*.y4m), or Avisynth if compiled with support
2009-12-25 10:15:00 1965
转载 暴风被判侵犯美国瑞尔公司著作权 赔偿20万元
12月23日消息,美国瑞尔数码公司诉暴风公司侵权一案近日在北京市高级人民法院宣判,暴风公司被判立即停止侵犯著作权行为,并在判决生效之日起15日内赔偿瑞尔公司经济损失人民币20万元。 据了解,RealPlayer媒体播放器软件是瑞尔公司研发的播放RM/RMVB格式文件的媒体播放器。瑞尔公司指出,暴风公司未经瑞尔公司授权,擅自在其多个版本的“暴风影音”媒体播放器软件中复制并使用RealPl
2009-12-24 20:54:00 2093
原创 How to compile x264 on Windows?
How to compile x264 on Windows? 0) install Subversion, CVS and git 1) install MinGW + msys from:http://www.sourceforge.net/projects/mingw 2) install yasm fromhttp://www.tortall.net/p
2009-12-24 17:28:00 2001
原创 GCC Linker 在Windows下的查找依赖库的规则
经常在Linux下做开发的朋友都知道,gcc在LDFLAGS中的-l编译选项会告诉连接器去找程序所依赖的第三方库,比如-labc,会和libabc.a这个库做依赖,即自动匹配libxxx.a。 而在windows上则除了上述匹配规则外,还额外做了如下匹配规则:xxx.lib,亦即-labc如果找不到libabc.a,会尝试寻找abc.lib.通过此举对Windows的开发人
2009-12-24 14:35:00 1181
原创 delete a NULL pointer is safe
C programmer often writes codes in the following fashion: if(p){ free(p); p = NULL;} But in C++ scenario, the check of NULL is useless! C++ guarantees that operator delete chec
2009-12-21 16:04:00 829
原创 P2P reload
最近一段时间因工作需要分析了市场上所有常见的P2P的视频点播和直播实现,没有发现一个令我满意的产品,虽然学术上对P2P的研究已经相当成熟,但研究一般止步于网络模拟阶段,并没有实现真正成熟的P2P产品!导致了虽然P2P的研究paper发了上千份,但最终也仅仅是"研究"而已! 尽管国内的P2P水准不必国外差,但纵观PPLive、PPStream、QVOD、 QQLive、迅雷看看、funshi
2009-12-14 12:47:00 637
原创 Visual Studio 2008 C++ code slower than Visual Studio 2005
" In Visual Studio 2008 SP1 (SP1 not RTM) there is a serious bug with /O2 optimization. One way this bug can be triggered is by upgrading a project from a previous version. Even though the project se
2009-11-25 22:15:00 918
原创 Intel C++ Compiler强奸AMD CPU的证据
Update 2010/01/04 http://www.osnews.com/story/22683/Intel_Forced_to_Remove_quot_Cripple_AMD_quot_Function_from_Compiler_ 但我测试Intel C++的最新版本11.1.054时发现intel并没有修正该问题 ---------------------
2009-11-23 15:47:00 7630 4
原创 用最新的Windows SDK + DirectX SDK 编译MPC-HC
Update: 2009/12/23最新版本的mpc-hc已经不存在DirectX SDK的版本依赖关系了,可以使用最新的DirectX SDK(August 2009),不需要修改任何代码直接编译通过。因为DirectX SDK里面不存在的头文件,mpc-hc已经在项目中主动提供了。 所以下面关于DirectX 7的一些hack,目前已经不需要,如何编译最新的mpc-hc,请参照如下
2009-06-27 22:57:00 10295 2
原创 感谢csdn,我用C币换的书收到了
感谢csdn,我用C币换的书收到了 今天收到了前一段时间用C币换的 UNIX 环境高级编程(英文版 第二版),书相当不错!厚厚的一大本,够我学习很长一段时间了
2009-06-24 17:48:00 664
原创 The simplest Singleton
最简单的单根模式的实现: //only suit for single-thread modeclass Singleton{public: static Singleton& Instance() { static Singleton theSingleton; return theSingleton; }
2009-06-20 14:01:00 565
原创 必须重视C语言的编译warning
必须重视C语言的编译warning:在代码中由于笔误调用了MSVC扩展的_alloca()函数,在用gcc编译后,导致代码程序在调用任何malloc()函数时都崩溃,查了一个晚上,用二分法做了近10次的版本回归,才定位到问题。没有warnig的C语言程序才有可能可靠!这一点上C++就做的好多了,如果函数原型不存在,直接报告编译错误!
2009-04-07 11:11:00 853
转载 [她是你的妻子]
在这整整六十多亿人中,只有其中一个与你朝夕相处。这个人就是你的妻子,这个妻子和你住同一所房子,养同一个孩子,使用同一笔钱的同时吃同样的早餐。 如果可以,百年后你妻子的名字还将和你的名字刻在同一块石头上。这块石头的名称叫墓碑。它将记载你,同时也记载你的妻子,它将告诉任何一个目睹此碑的人,别小瞧了你的妻子,在这个世界上的六十多亿人中,惟有她和你度过了最长也是最隐秘的时光。 你能够在人群
2009-02-24 13:01:00 1022
原创 不要在Windows DLL内部使用函数指针进行比较!
今天早晨maillist上收到如下的一封mail: Hi folks,I just spent somewhere between 2-3 weeks tracking down a weird bug thatresulted in our code creating corrupted files on Windows but working fine onLinux and Mac.
2009-02-19 12:27:00 2729 11
原创 欢迎参与NextPlayer讨论组
欢迎参与NextPlayer讨论组,目前有283名成员! 主要关注Chrome浏览器、FFmpeg、MPlayer、VideoLan的开发、学习与应用!Focus on distributed network(ICE) and multimedia(FFmpeg/MPlayer/VLC) development @ Google technology: Chrome,NativeCli
2009-02-18 13:43:00 1652
原创 emms指令在MMX指令中的作用
MMX和SSE都是INTEL开发的基于SIMD(单指令多数据流)的技术。所谓单指令多数据流是指可以用一条指令可以完成多个数据的操作。虽然64位系统已经推出,但是我们大部分都是使用32位系统,所以如果要完成两个128位的相加运算,用普通32位指令很明显要执行4条相加指令,而基于64位的MMX指令只需要执行两次即可完成,更强大的SSE能一次处理128位,故一次就可以完成操作,所以采用MMX及SS
2009-01-08 23:17:00 4016 1
原创 How to compile ffdshow-tryout with VS2008+SP1 + Vista Platform SDK(ver6.1) + Microsoft DirectX SDK (August 2008)
Note: 在使用最新的DirectX SDK (August 2009)的前提下,已经不需要下面的补丁了,也就是说最新的ffdshow-tryout可以不用做任何修改就可以用vs2008直接编译!Cheers! Update 2009/12/27 Index: src/TkeyboardDirect.h============================
2008-12-22 13:57:00 1563
FFmpeg20080412
2008-04-12
FFmpeg_ver12476_build
2008-03-17
FFmpeg_ver12430_build
2008-03-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人