摘要: To add paths containing code to parse, follow these steps :1. Right click on the project2. Select Properties3. Go to C/C++ General4. Go to Path and Symbols5. If the paths are missing, add paths.To re-parse the code follow these steps :1. Right click on the project2. Select Index3. Rebuild 阅读全文
posted @ 2014-03-24 10:42 Bigben 阅读(352) 评论(0) 推荐(0) 编辑
摘要: MRS. OBAMA: (Applause.) Thank you. Well, ni-hao. (Laughter.) It is such a pleasure and an honor to be here with all of you at this great university, so thank you so much for having me.Now, before I get started today, on behalf of myself and my husband, I just want to say a few very brief words about 阅读全文
posted @ 2014-03-23 21:39 Bigben 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 2012-08-18 11:00:12标签:linux系统系统信息原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明。否则将追究法律责任。http://mooon.blog.51cto.com/1246491/966165下面是头文件内容,代码是mooon的一部分,对应的CPP文件请直接浏览:http://code.google.com/p/mooon/source/browse/trunk/common_library/src/sys/info.cpp#include #include "sys/config.h"SYS_NAMESPACE_B 阅读全文
posted @ 2014-03-21 10:17 Bigben 阅读(1246) 评论(0) 推荐(0) 编辑
摘要: linux 查看系统运行时间 (从开机当现在的开机时间)1.uptime命令输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.002.查看/proc/uptime文件计算系统启动时间cat /proc/uptime输出: 5113396.94 575949.85第一数字即是系统已运行的时间5113396.94 秒,运用系统工具date即可算出系统启动时间代码:date -d "$(awk -F. '{print $1}' /proc/uptime) second ago" + 阅读全文
posted @ 2014-03-21 10:02 Bigben 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 标准C++类std::string的内存共享和Copy-On-Write技术陈皓1、 概念Scott Meyers在《More Effective C++》中举了个例子,不知你是否还记得?在你还在上学的时候,你的父母要你不要看电视,而去复习功课,于是你把自己关在房间里,做出一副正在复习功课的样子,其实你在干着别的诸如给班上的某位女生写情书之类的事,而一旦你的父母出来在你房间要检查你是否在复习时,你才真正捡起课本看书。这就是“拖延战术”,直到你非要做的时候才去做。当然,这种事情在现实生活中时往往会出事,但其在编程世界中摇身一变,就成为了最有用的技术,正如C++中的可以随处声明变量的特点一样,Sc 阅读全文
posted @ 2014-03-20 09:39 Bigben 阅读(940) 评论(0) 推荐(0) 编辑
摘要: 构造和析构函数不允许调用纯虚函数,可以先调用虚函数,里面再调用纯虚函数实现。classBase{public:virtualvoidfoo()=0;Base(){call_foo();}voidcall_foo(){foo();}};classDerived:Base{voidfoo(){}};intmain(){Derivedd;}在父类中定义纯虚函数,实现工厂生产。子类再实现。可以用虚函数里面调用纯虚函数实现。父类实现了线程,子类实现方法即可示例://====================================================================== 阅读全文
posted @ 2014-03-17 16:06 Bigben 阅读(1230) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.2cto.com/kf/201110/109445.html接下来我们来学习一下串流类的基础知识,什么叫串流类? 简单的理解就是能够控制字符串类型对象进行输入输出的类,C++不光可以支持C++风格的字符串流控制,还可以支持C风格的字符串流控制。 我们先看看看C++是如何对C风格的字符串流进行控制的,C中的字符串其实也就是字符数组,字符数组内的数据在内存中的位置的排列是连续的,我们通常用char str[size]或者char *str的方式声明创建C风格字符数组,为了能让字符数组作为设备并提供输入输出操作,C++引入了ostrstream、istrstream、.. 阅读全文
posted @ 2014-03-17 13:12 Bigben 阅读(222) 评论(0) 推荐(0) 编辑
摘要: c++中静态变量不但要在头文件中declare,还要在实现的cpp中declare。当然也可以赋个初始值。class foo{ int _i; public: foo(int i) : _i(i) {}};class bar{ public: static int j; static foo f;};int bar::j = 0;foo bar::f(1); 阅读全文
posted @ 2014-03-11 10:22 Bigben 阅读(2624) 评论(0) 推荐(0) 编辑
摘要: symlink 阅读全文
posted @ 2014-03-07 16:23 Bigben 阅读(683) 评论(0) 推荐(0) 编辑
摘要: Linux下的fg和bg命令是进程的前后台调度命令,即将指定号码(非进程号)的命令进程放到前台或后台运行。比如一个需要长时间运行的命令,我们就希望把它放入后台,这样就不会阻塞当前的操作;而一些服务型的命令进程我们则希望能把它们长期运行于后台。进程前后台操作用到以下命令或按键:Ctrl+C终止并退出前台命令的执行,回到SHELLCtrl+Z暂停前台命令的执行,将该进程放入后台,回到SHELLjobs查看当前在后台执行的命令,可查看命令进程号码&运行命令时,在命令末尾加上&可让命令在后台执行fg N将命令进程号码为N的命令进程放到前台执行,同%Nbg N将命令进程号码为N的命令进程 阅读全文
posted @ 2014-03-07 09:47 Bigben 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 回调函数是基于C编程的Windows SDK的技术,不是针对C++的,程序员可以将一个C函数直接作为回调函数,但是如果试图直接使用C++的成员函数作为回调函数将发生错误,甚至编译就不能通过。普通的C++成员函数都隐含了一个传递函数作为参数,亦即“this”指针,C++通 过传递一个指向自身的指针给其成员函数从而实现程序函数可以访问C++的数据成员。这也可以理解为什么C++类的多个实例可以共享成员函数但是确有不同的 数据成员。由于this指针的作用,使得将一个CALLBACK型的成员函数作为回调函数安装时就会因为隐含的this指针使得函数参数个数不匹配,从而 导致回调函数安装失败。这样从理论上讲 阅读全文
posted @ 2014-03-03 17:55 Bigben 阅读(2416) 评论(0) 推荐(0) 编辑
摘要: Below tutorial will show you how to change username in ubuntu 12.04 precise.First,we need login as root the change the username,then restart the enable this changing ,here we go.1.Open a terminal by Pressing Ctl+Alt+t or search terminal in Dash2.Unlock account root and enable login as root using bel 阅读全文
posted @ 2014-02-19 14:18 Bigben 阅读(865) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/wenjiang/p/3272859.html终于要进入面向对象的世界了,虽然C++也是面向对象,但是它的面向对象程度并不高,因为考虑到要兼容C语言的移植性,它依然保留了非常多的C语言的东西,像是万恶的指针,就依然还在那里肆虐着入门者的脑细胞!JAVA之所以说是"C++--",其中有很大程度上是因为它抛弃了指针。 正式进入话题,首先,JAVA继承了之前String对象是不可变的认识,虽然我们表面上看好像是在改变原有的String,像是赋值操作,但实际上是在创建一个全新的String对象,而且就算我们将String对象作为参数传递 阅读全文
posted @ 2014-01-26 11:30 Bigben 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 转自: http://www.cnblogs.com/wenjiang/p/3266305.html 基本上所有主流的编程语言都有String的标准库,因为字符串操作是我们每个程序员几乎每天都要遇到的。想想我们至今的代码,到底生成和使用了多少String!标题上所罗列的语言,可以看成是一脉相承的,它们的String类库基本上也是一脉相承下来的,但是,在关于String的类库设计中却可以充分看出面向过程和面向对象,以及面向对象语言的抽象程度这些区别,也是我们认识这些语言之间区别的一个很好的入口。 首先从C语言和C++开始。 C语言几乎是现在程序员的程序入门语言,当然,也有不少人不是,比如说我,倒 阅读全文
posted @ 2014-01-24 16:57 Bigben 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 陈皓http://blog.csdn.net/haoel点击这里查看下篇>>>前言07年12月,我写了一篇《C++虚函数表解析》的文章,引起了大家的兴趣。有很多朋友对我的文章留了言,有鼓励我的,有批评我的,还有很多问问题的。我在这里一并对大家的留言表示感谢。这也是我为什么再写一篇续言的原因。因为,在上一篇文章中,我用了的示例都是非常简单的,主要是为了说明一些机理上的问题,也是为了图一些表达上方便和简单。不想,这篇文章成为了打开C++对象模型内存布局的一个引子,引发了大家对C++对象的更深层次的讨论。当然,我之前的文章还有很多方面没有涉及,从我个人感觉下来,在谈论虚函数表里,至少有以下这些内容没 阅读全文
posted @ 2014-01-24 16:53 Bigben 阅读(221) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include struct context { SDL_Renderer *renderer; SDL_Texture *texture; SDL_mutex *mutex; int n; uint32_t *pixels; int window_w; int window_h;};// VLC prepares to render a video frame.static void *lock(void *data, void **p_pixels) { stru 阅读全文
posted @ 2014-01-08 11:49 Bigben 阅读(1735) 评论(0) 推荐(0) 编辑
摘要: //============================================================================// Name : websocket.cpp// Author : // Version :// Copyright : Your copyright notice// Description : Hello World in C++, Ansi-style//========================================================================... 阅读全文
posted @ 2013-12-24 17:43 Bigben 阅读(4966) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.dorothybrowser.com/announcing-webkit-sdl-port/下载地址https://gitorious.org/spiegel/webkitsdl/source/master:Hi. I am Kwang Yul Seo, chief computer scientist at Company 100, Inc.. Today I am happy to announce the WebKit SDL port.You might wonder why we need another WebKit port because we al 阅读全文
posted @ 2013-12-16 10:11 Bigben 阅读(905) 评论(0) 推荐(0) 编辑
摘要: 当电脑硬盘坏道出现时,很多人建议通常是去换个新硬盘吧,但是有的时候我们想让这个硬盘能够继续使用,这时候我就要把硬盘的坏道屏蔽掉,一般来说屏蔽硬盘坏道都是要通过软件的,网上关于这个的软件非常多,集体用什么软件,那就是要看个人习惯了。1不通过软件进行修复用操作系统自己的检测程序全盘检测一遍,比如XP里面右击盘符,选择属性,然后选择工具,里面有个“磁盘检查”。那里有一个“扫描并试图恢复坏扇区”,勾选上。开始检查,这样如果,我是说如果能顺利检查完,那么该分区上的坏扇区就会被标记出来,不再使用。但是这个方法有个问题——很容易死机,检查不下去。即便检查完了,坏扇区标记好了,但是由于坏扇区的扩散效应,要不了 阅读全文
posted @ 2013-12-11 13:34 Bigben 阅读(1494) 评论(0) 推荐(0) 编辑
摘要: 现在大家手中可能都有些有坏道的硬盘,也可能现在机器上的硬盘也出问题了。硬盘有坏道,肯定不会全部都是坏道,不能使用了。但我们因此而不能使用了,那么就太可惜了。所以,只要把有坏道的区域隐藏起来,就如同使用新硬盘一样了,不会对使用有任何影响。下面我具体讲一下如何正确检测硬盘坏道的位置,然后如何分区并把坏道区域隐藏:一、首先把硬盘中所有的文件全部移动到其它硬盘上,然后删除所有分区,使硬盘为一个区。(如果没有条件,也可一个分区,一个分区的检测,此分区发现坏道,把文件移动到其它分区,再做处理。但隐藏坏道的方式是一样的)二、首先运行“DiskGenius”,在工具栏上,点击“硬盘”—-“坏道检测与修复”,会 阅读全文
posted @ 2013-12-10 11:20 Bigben 阅读(1620) 评论(0) 推荐(0) 编辑
摘要: Some interesting excerpts from the bash manpage:When bash is invoked as an interactivelogin shell, or as a non-interactive shell with the--loginoption, it first reads and executes commands from the file/etc/profile, if that file exists. After reading that file, it looks for~/.bash_profile,~/.bash_lo 阅读全文
posted @ 2013-12-09 10:12 Bigben 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 这篇文章来源于Quroa的一个问答《What are some time-saving tips that every Linux user should know?》—— Linux用户有哪些应该知道的提高效率的技巧。我觉得挺好的,总结得比较好,把其转过来,并加了一些自己的理解。 首先,我想告诉大 阅读全文
posted @ 2013-12-03 10:12 Bigben 阅读(234) 评论(0) 推荐(0) 编辑
摘要: httpClient不能动态执行网页中的js,这样无法获取js生成的动态网页。htmlUnit是个解决方法。if you’re considering web application testing tools, you’re probably looking at more than just these two options. Canoo WebTest, TestMaker, JWebUnit, Selenium, WebDriver and JMeter are all likely to be on your list.HtmlUnit – A quick introduction 阅读全文
posted @ 2013-11-28 10:20 Bigben 阅读(1470) 评论(0) 推荐(0) 编辑
摘要: /* ============================================================================ Name : http.c Author : Version : Copyright : Your copyright notice Description : Hello World in C, Ansi-style ============================================================================ */#include #in... 阅读全文
posted @ 2013-11-01 18:03 Bigben 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 1, 对于tar.gz v是verbose,输出信息 压缩:tar -zcvf archive-name.tar.gz directory-name 解压:tar -zxvf prog-1-jan-2005.tar.gz -C /tmp 2, 排除 .git 等版本控制文件夹 --exclude-v 阅读全文
posted @ 2013-10-25 09:41 Bigben 阅读(933) 评论(0) 推荐(0) 编辑
摘要: 单个源文件生成可执行程序 下面是一个保存在文件 helloworld.cpp 中一个简单的 C++ 程序的代码: 1 2 3 4 5 6 7 8 9 /* helloworld.cpp */ #include <iostream> int main(int argc,char *argv[]) { 阅读全文
posted @ 2013-10-21 15:25 Bigben 阅读(606) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #define VIDEOWIDTH 1920#define VIDEOHEIGHT 1080struct context { SDL_Renderer *renderer; SDL_Texture *texture; SDL_mutex *mutex; int n; SDL_Rect displayrect; int window_w; int window_h;};// VLC prepares to render a video frame.st 阅读全文
posted @ 2013-09-24 10:50 Bigben 阅读(3845) 评论(2) 推荐(0) 编辑
摘要: 作者:王姗姗,华清远见嵌入式学院讲师。exec用被执行的程序完全替换调用它的程序的影像。fork创建一个新的进程就产生了一个新的PID,exec启动一个新程序,替换原有的进程,因此这个新的被exec执行的进程的PID不会改变,和调用exec函数的进程一样。下面来看下exec函数族:#include int execl(const char *path, const char *arg, ...);int execlp(const char *file, const char *arg, ...);int execle(const char *path, const char *arg, ... 阅读全文
posted @ 2013-09-22 13:46 Bigben 阅读(595) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/yanxiangtianji/article/details/20474155 1。gcc包含的c/c++编译器gcc,cc,c++,g++,gcc和cc是一样的,c++和g++是一样的,(没有看太明白前面这半句是什么意思:))一般c程序就用gcc编译,c 阅读全文
posted @ 2013-09-17 11:43 Bigben 阅读(1705) 评论(0) 推荐(0) 编辑
摘要: 一、头文件 gcc 在编译时寻找所需要的头文件 : ※搜寻会从-I开始 ※然后找gcc的环境变量 C_INCLUDE_PATH,CPLUS_INCLUDE_PATH,OBJC_INCLUDE_PATH ※再找内定目录/usr/include /usr/local/include/usr/lib/gc 阅读全文
posted @ 2013-09-17 11:35 Bigben 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 用libvlc 提供的示例,用1080p播放本事是720p的视频,会有卡住的现象。后改用32位播放后正常。(R,G,B的掩码需要适当调换。我在ubuntu上编译两个项目,掩码值都需要调换,不知道为什么)SDL_CreateRGBSurface(SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_SRCCOLORKEY | SDL_SRCALPHA, w,h, 32, 0xff0000, 0xff00, 0x00ff, 0);SDL_CreateRGBSurface(SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_SRCCOLORKEY | SDL_S 阅读全文
posted @ 2013-09-16 12:07 Bigben 阅读(1105) 评论(0) 推荐(0) 编辑
摘要: 说明:由于图形化界面方法(如Add/Remove... 和Synaptic Package Manageer)比较简单,所以这里主要总结在终端通过命令行方式进行的软件包安装、卸载和删除的方法。一、Ubuntu中软件安装方法1、APT方式(1)普通安装:apt-get install softname1 softname2 …;(2)修复安装:apt-get -f install softname1 softname2... ;(-f Atemp to correct broken dependencies)(3)重新安装:apt-get --reinstall install softname 阅读全文
posted @ 2013-09-09 14:14 Bigben 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 开发环境安装:1,执行:"sudo apt-get build-dep libsdl1.2",确定依赖库都装全了。sdl2.0没有正式发布到ubuntu,使用下面方法安装:https://launchpad.net/~zoogie/+archive/sdl2-snapshotssudoapt-add-repositoryppa:zoogie/sdl2-snapshotssudoapt-getupdatesudo apt-get install libsdl2 libsdl2-dbg libsdl2-dev libsdl2-image libsdl2-image-dev li 阅读全文
posted @ 2013-09-06 16:37 Bigben 阅读(2644) 评论(0) 推荐(0) 编辑
摘要: 1, 在应用程序需要连接外部库的情况下,linux默认对库的连接是使用动态库,在找不到动态库的情况下再选择静态库。使用方式为: gcc test.cpp -L. -ltestlib 如果当前目录有两个库libtestlib.so libtestlib.a 则肯定是连接libtestlib.so。如果 阅读全文
posted @ 2013-09-06 10:00 Bigben 阅读(11222) 评论(1) 推荐(1) 编辑
摘要: 修改了同步播放ffmpeg问题。并且增加可以放大视频。 1 // tutorial05.c 2 // A pedagogical video player that really works! 3 // 4 // Code based on FFplay, Copyright (c) 2003 Fabrice Bellard, 5 // and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de) 6 // Tested on Gentoo, CVS version 5/01/07 compiled wit... 阅读全文
posted @ 2013-09-02 11:47 Bigben 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 步骤如下:1.下载官网永远是王道,呵呵:http://ffmpeg.org/download.html或者svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg2.编译运行./configure很不幸,运行configure后出现了错误提示:yasmnotfound,use–disable-yasmforacrippledbuild解决方案:sudoapt-getinstallyasm重新./configure,搞定makemakeinstall权限不够需要前面加上sudo编译源码:一定注意加载库的顺序.参考代码:#include #in 阅读全文
posted @ 2013-08-23 18:10 Bigben 阅读(877) 评论(0) 推荐(0) 编辑
摘要: SDL_BlitSurfaceUse this function to perform a fast surface copy to a destination surface.ContentsSDL_BlitSurfaceSyntaxFunction ParametersReturn ValueCode ExamplesRemarksRelated FunctionsSyntaxToggle line numbersint SDL_BlitSurface(SDL_Surface* src, const SDL_Rect* srcrect, ... 阅读全文
posted @ 2013-08-23 10:42 Bigben 阅读(1081) 评论(0) 推荐(0) 编辑
摘要: gl画纹理texture/* * SDL OpenGL Tutorial. * (c) Michael Vance, 2000 * briareos@lokigames.com * * Distributed under terms of the LGPL. */#include #include #include #include #include /******************************************************************* * ... 阅读全文
posted @ 2013-08-07 15:18 Bigben 阅读(1157) 评论(0) 推荐(0) 编辑
摘要: write by 九天雁翎(JTianLing) -- blog.csdn.net/vagrxie前一篇文章讲了SDL的除video以外的大部分模块。本文主要关注SDL的video模块部分。SDL中的video模块包含了大部分与平台相关的代码,并且SDL处理的很有技巧性,这里利用C语言的函数指针来模拟了一种类似于面向对象的效果。主要的关键点在SDL_VideoDevice *current_video = NULL;这一句定义的全局变量current_video上,我们先来看看这个变量类型SDL_VideoDevice。主要在SDL_sysvideo.h这个文件中structSDL_Video 阅读全文
posted @ 2013-08-07 10:37 Bigben 阅读(1215) 评论(0) 推荐(0) 编辑
摘要: write by 九天雁翎(JTianLing) -- blog.csdn.net/vagrxie前言 对于大牛来说,写关于阅读源码的文章都会叫源码剖析或者深入浅出啥的,对于我,自己阅读阅读源码,写一些自己的阅读笔记吧。 SDL我就不多介绍了,很多使用过的人都说很好,我自己实际使用的感觉SDL也是非常成熟易用,绝对对得起其simple两字。基本模块通过SDL.h中看到SDL作者对SDL进行的划分,可以看出SDL大概包含的内容:#include"SDL_main.h"#include"SDL_stdinc.h"#include"SDL_audio 阅读全文
posted @ 2013-08-07 10:27 Bigben 阅读(954) 评论(0) 推荐(0) 编辑