- 博客(13)
- 资源 (1)
- 收藏
- 关注
转载 GLib 创建自定义事件源
GLib 实现了一个功能强大的事件循环分发处理机制,被抽象成为 GMainLoop,用于循环处理事件源上的事件。每个 GMainLoop 都工作在指定的 GMainContext 上。事件源在 GLib 中则被抽象成了 GSource。在 GMainContext 中有一个 GSource 列表。GLib 内部定义实现了三种类型的事件源,分别是 Idle, Timeout 和 I/O。同时也支持创
2015-09-28 02:05:06 875
原创 编译器自动创建的析构函数
下面摘自 http://en.cppreference.com/w/cpp/language/destructorTrivial destructorThe destructor for class T is trivial if all of the following is true:The destructor is not user-provided (meanin
2015-09-26 12:25:45 913
原创 使用 shared_ptr 的一個問題代碼
代碼如下:#include #include #include class A{public:void Add();void Delete();~A();private:std::list > m_ptr;};void A::Add(void){ m_ptr.push_back(std::shared_ptr (this));}void A::De
2015-09-24 07:43:08 3999 1
转载 shared_ptr Analysis
Smart pointer uses RAII(Resource Acquisition is Initialization) idiom to manage resource. The C++ 11 standards accept it as first class library member, and it resides in namespace std, instead of n
2015-09-24 07:33:21 2703
转载 X Window Programming Manual: Chapter 3 Basic Window Program
Chapter 3. Basic Window ProgramEvery Xlib program has a similar structure. This chapter shows asimple program that puts up a window and handles events in thatwindow. You can use this simple appl
2015-09-16 08:07:47 1542
转载 X Window Programming Manual: Chapter 2: X Concepts
Chapter 2. X ConceptsThis chapter introduces the concepts that underlie X programming.You should read this chapter even if you are the type of person wholikes to jump right into the code. (If you
2015-09-16 08:05:41 1447
转载 X Window Proramming Manual: Chapter 1 Introduction
Chapter 1. IntroductionThis chapter gives the big picture: what X is all about and somefundamentals of how it works. Everyone should look at this chapter,though readers who are already familiar wi
2015-09-16 08:03:11 813
转载 trace: Add user-space event tracing/injection
Subject: trace: Add user-space event tracing/injectionFrom: Ingo Molnar Date: Wed Nov 17 10:11:53 CET 2010This feature (suggested by Darren Hart and Pekka Engberg) allows user-spaceprograms to pr
2015-09-13 09:50:03 645
原创 更新 GCC工具链需要注意的问题
一般更新之后,会有两个或以上版本的 gcc.不建议使用 update-alternatives 来维护。手动维护(gcc的符号链接) 就可以了。$ ls /lib/cpp -llrwxrwxrwx 1 root root 21 Feb 19 2015 /lib/cpp -> /etc/alternatives/cpp$ ls -l /etc/alternatives/cpplrw
2015-09-10 00:02:27 1574
转载 Inotify Example: Introduction to Inotify with a C Program Example
inotify utility is an effective tool to monitor and notify filesystem changes. You can specify a list of files and directories that needs to be monitored by inotify. This library is used by various o
2015-09-06 06:29:21 1042
原创 grep 使用的一个问题
先看下面的命令:echo -e "123\nabc\n456" | grep -e [1-9]按理,应该输出123456,但实际上,什么输出都没有。。经过检查,终于发现原因: 在当前目录下,有几个名字为 1,2,3的文本文件,而且这几个文件里面,都不包含数字。所以,输出为空。
2015-09-06 02:56:13 658
转载 Parameter expansion
IntroductionOne core functionality of Bash is to manage parameters. A parameter is an entity that stores values and is referenced by aname, a number or a special symbol.parameters referenc
2015-09-01 01:48:52 1108
原创 ")syntax error: invalid arithmetic operator (error token is "
有时候,在用 shell 脚本处理windows下的文本的时候,会出现标题里错误。问题的原因是,windows系统里面,换行标记为 "\r\n" linux下面为 "\n"windows里面, "\r"成为 CR, "\n"为 LF.shell的运算符 $() 会去掉末尾的"\n", 这样的话,就剩下 "\r". "\r"会导致标题里的错误。复现方法:$ foo=$'
2015-09-01 01:19:43 21562
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人