2009年05月22日

原创 Getting grub into a disk image


 dd if=/dev/zero of=disk.img bs=1024k count=500
  parted disk.img mklabel msdos
  parted disk.img mkpart primary ext2 0 500

  parted disk.img set 1 boot on
  parted disk.img mkfs 1 ext2



 fdisk -l -u disk.img
Disk disk.image: 0 MB, 0 bytes
4 heads, 32 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x000718b4
Device Boot Start End Blocks 阅读全文>

发表于 @ 2009年05月22日 15:20:00|评论(loading...)|编辑|举报|收藏

2009年04月10日

原创 typeof operator


http://gcc.gnu.org/onlinedocs/gcc/Typeof.html
 typeof is a way to refer to the type of an expression, supported by gcc
e.g.#define max(a, b)\({typeof(a) _a = (a);\typeof(b) )_b =(b);\_a>_b?_a:_b;})
To declare y as an array of the same type as x:typeof (x) y[4];又如: #define pointer(T) typeof(T*)

e.g. to cast a member of a structure to the container structure
#define container_of(ptr, type, member) ({ \             const typeof(((type *)0)->member)) *__mptr = (阅读全文>

发表于 @ 2009年04月10日 12:55:00|评论(loading...)|编辑|举报|收藏

2009年02月11日

原创 delete event和destroy信号

g_signal_emit之后,立即会调用g_signal_connect注册的回调函数。gtk的signal也是gsignal, 当main_loop中收到x的event后,x_event ->gdk_event ->g_signal阅读全文>

发表于 @ 2009年02月11日 16:36:00|评论(loading...)|编辑|举报|收藏

2009年02月10日

原创 modal dialog 的实现; mainloop的嵌套; g_object_notify的使用方法

modal dialog 的实现; mainloop的嵌套; g_object_notify的使用方法阅读全文>

发表于 @ 2009年02月10日 12:45:00|评论(loading...)|编辑|举报|收藏

2009年01月23日

原创 const at the end of function and passing const object in a function call


#include
Class B
{
  public:
         virtual void print() const
        {
                cout
        }
};

class A
{
  public:
        virtual void print(const B* b) const
       {
            cout
            b->print();
        }
};

main()
{
cout
A* a;
阅读全文>

发表于 @ 2009年01月23日 13:45:00|评论(loading...)|编辑|举报|收藏

2009年01月08日

转载 C++中extern “C”含义深层探索


引用自:http://blog.csdn.net/yydrewdrew/archive/2007/04/03/1550409.aspx

阅读全文>

发表于 @ 2009年01月08日 09:03:00|评论(loading...)|编辑|举报|收藏

2009年01月07日

原创 how to setup svn repos

how to setup svn repos:
1. svnadmin create /home/ted/backup/svn/repos
2. /home/ted/backup/svn/repos/conf里面是配置文件
    修改好配置文件后,启动svnserver:
    svnserve -d -r
/home/ted/backup/svn/

   netstat -lnp | grep svn
   tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
2480/svnserve

3. 导入project(在client端)
svn import mobile-manager-0.7/
svn://阅读全文>

发表于 @ 2009年01月07日 15:46:00|评论(loading...)|编辑|举报|收藏

2008年12月10日

原创 about user time in X domain

_NET_WM_USER_TIME property:  this property stores an Xserver time which represents the time of the last user input event received for this window(gdk_x11_set_user_time(GdkWindow *window, guint32 timestamp)).
This property may be used by the window manager to alter the focus, stacking, and/or placement behavior of windows when they are mapped depending on whether the new window was created by a user action or is a "pop-up" window activated by a timer or some other event.

Note that阅读全文>

发表于 @ 2008年12月10日 14:27:00|评论(loading...)|编辑|举报|收藏

2008年10月04日

原创 gtk中Gource注册过程和将xevent加入本地队列后处理

gtk中Gource注册过程和将xevent加入本地队列后处理阅读全文>

发表于 @ 2008年10月04日 16:33:00|评论(loading...)|编辑|举报|收藏

2008年09月27日

原创 notes on GMainLoop and GSource

notes on GMainLoop and GSource阅读全文>

发表于 @ 2008年09月27日 16:57:00|评论(loading...)|编辑|举报|收藏

原创 gobject reference count summary

gobject reference count summary阅读全文>

发表于 @ 2008年09月27日 13:56:00|评论(loading...)|编辑|举报|收藏

原创 gobject instantiation

gobject instantiation process summary 阅读全文>

发表于 @ 2008年09月27日 13:42:00|评论(loading...)|编辑|举报|收藏

2008年07月10日

转载 use glib-genmarshal to create marshalers

use glib-genmarshal to create marshalers 阅读全文>

发表于 @ 2008年07月10日 16:48:00|评论(loading...)|编辑|举报|收藏

2008年06月02日

原创 notes on rpmbuild

edit "~/.rpmmacros"

%_topdir /mnt/sda3/rpmbuild/  -->specifying rpmbuild top dir. According to  current config, RPMS, SOURCES... will be placed under       /mnt/sda3/rpmbuild
%debug_package %{nil}      -->do not build debug package阅读全文>

发表于 @ 2008年06月02日 11:16:00|评论(loading...)|编辑|举报|收藏

2008年05月26日

原创 gdk pixbuf collections

gdk pixbuf collections阅读全文>

发表于 @ 2008年05月26日 13:22:00|评论(loading...)|编辑|举报|收藏

Csdn Blog version 3.1a
Copyright © hwizhao