Web blog of yydzero
姚延栋(Yandong Yao)的博客
归档
« 十一月 2009
星期日星期一星期二星期三星期四星期五星期六
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
今天
Click me to subscribe
Search In My Blog

链接
 

今日点击: 34

Locations of visitors to this page
« Previous page | Main | Next page »
星期六 五月 19, 2007
如何从 YouTube 等网站下在视频
经常看到Youtube有很多精彩的视频,但不知道怎么下载,今天google了一下,没想到下载方式竟然如此之多。不过我觉的其中最简单的就是http://vixy.net/提供的功能,使用该网站不但可以下载,还可以进行格式转换,这对于象我这样不愿意安装专门的 flv 播放器的人来说太棒了!原文请见 http://blogunion.org/blogging-tools/download-youtube-videos-directly.html。另外 http://www.kuju.cn/post/253.html 提供了更多的方式。
Posted at 07:59下午 五月 19, 2007 by Yaodong Zero Yao in Personal  |  评论[0]

使用 ultraedit 在 Unicode 和 Code page 之间进行编码转换

近来由于项目的需要,需要看一下Windows上的编码转换情况,本打算自己写个小程序来测以下,结果google了半天也没有发现好的例子,只是有WideCharToMultiByte, MultiByteToWideChar的API,鉴于已经 n 年没有写Windows的程序了(怎么编译都忘了),而且时间也不充足,所以还是想偷懒找个现成的工具。于是首先想到了功能极为强大的 UltraEdit, 结果UltraEdit果然没有让我失望,它提供了任意 code page 和 Unicode, UTF-8 之间的转换,而且不用修改系统的 code page. 下面简单介绍一下.(UltraEdit可以从http://www.ultraedit.com/免费下载试用45天,目前的最新版本是 v13.00a)

  1. 试用 UltraEdit  人以打开一个文本文件,可以不用关心其编码.(Notepad创建的文件的默认编码还是当前code page设定的编码,在简体中文环境下是 CP936, 即 GBK)
  2. 设定 UltraEdit 当前的 code page: 选择 "View -> Set Code Page", 然后选择你需要的code page. 这样后面执行的编码转换操作都是根据这里设定的 code page 进行的.
  3. 选择 "Edit -> Hex Function -> Hex Edit" 进入Hex编辑模式,这样你可以输入任意你需要的16进制数字,例如 4E02(Unicode) 或者 8140(GBK) ( "丂" )
  4. 转换: 根据你当前的文件的编码,选择 "File -> Conversions -> Unicode to ASCII" 或者 "File -> Conversions -> ASCII to Unicode", 这里的ASCII就是便是当前的 Code Page便是的编码。

有一点需要注意:如何显示转换的结果?

  1. 首先需要适当的字体,例如如果你的Windows是简体中文,而你想要转换 Unicode -> Big5,那么你需要 Big5 字体。从http://www.unifont.org/可以下载到很多字体。
  2. 即使有了合适的字体也不一定能正确的显示。我将我的系统 code page 设定成 CP950(Big5), 重起后将 UltraEdit 的 Code Page 设定成 CP936,然后转换 GBK <-> Unicode,结果是能够显示 Unicode编码的简体中文字符,而不能显示 GBK 编码的中文字符。估计可能是和字体的处理有关,字体处理如果和当前的 code page 有关的话,这种设定的不一致就会造成无法正确显示。不过在系统code page 是 CP936的情况下在选择了正确的字体后能显示繁体Big5-HKSCS的字符。
  3. 从 http://www.microsoft.com/globaldev/reference/WinCP.mspx 可以看到不同 Code Page 的编码转换表。
Posted at 11:05上午 五月 19, 2007 by Yaodong Zero Yao in I18N  |  评论[1]

星期三 一月 24, 2007
Use nxserver and nxclient to connect to office from home

Using nxserver/nxclient is faster a lot than using rdesktop+xmanager for me. Below is the simple steps to setup nxserver and nxclient.

  1. Install nxclient on home machine: download nxclient from www.nomachine.com according to your OS.
  2. Install nxserver on office machine: download nxclient, nxnode, nxserver from www.nomachine.com according to you OS. I am using space/Solaris 10.
    1. First install nxclient
    2. Then nxnode
    3. Last nxserver
    4. nxserver will auto start if success
  3. Config nxclient: run nxclient and config it. it is pretty simple.
  4. Run nxclient and login.
One major problem is that there is no nxserver for Solaris/x86 yet :(
enjoy.
Posted at 08:10上午 一月 24, 2007 by Yaodong Zero Yao in Personal  |  评论[3]

星期二 十二月 05, 2006
collection of mdb related information
Posted at 09:37上午 十二月 05, 2006 by Yaodong Zero Yao in solaris  |  评论[0]

星期四 九月 21, 2006
C books and articles

1. Books on C programming languages

  • The C Programming Language, Kernighan and Ritchie, 2nd Edition. Still reads well. I still have and use the first edition dated 1978. See <http://cm.bell-labs.com/cm/cs/cbook/>.
  • C Puzzle Book, Alan R Feuer, Addison-Wesley, 2nd edition 1999, ISBN 0201604612. The best ever book on understanding the quirks of C and how to use pointers properly.
  • The Practice of Programming, Kernighan and Pike, Addison-Wesley, 1999. An update of an earlier book written in the 1970s. Timeless advice, not just on C but on Java, C++ and Perl. See <http://cm.bell-labs.com/cm/cs/tpop/>.
  • The Standard C Library, PJ Plauger, Prentice Hall, 1992. Literally how it all works with full source code and tests.

    2. Some intresting articles and books

    Interview with Brian Kernighan Enjoyable reading with some support for our views on C++. Plus advice on how to pronounce his name correctly.
    comp.lang.c Frequently Asked Questions

    Link to www version. Highly relevant. An up-to-date copy may be obtained from ftp.eskimo.com in directory u/s/scs/C-faq/.

    中文faq的地址(提供了PDF格式):http://c-faq-chn.sourceforge.net/ccfaq/node1.html

    ANSI C Programming Lanuage A useful short help on C Programming, including precedence and the preprocessor.
    ANSI C Standard Library Summary of the ANSI C standard library functions (that's the real ANSI C).
    Rationale for ANSI C A link to the original Rationale for American National Standard for Information Systems - Programming Language - C. This was included in the original ANSI standard explaining why things were done as they were. It was unfortunately dropped from the ISO standard.
    Style in C Rob Pike's set of essays on coding style and a "philosophy of clarity in programming" as opposed to laying down hard rules.
    C Traps and pitfalls An essay by Andrew Koenig of AT&T Bell Labs written as the basis to his book C Traps and Pitfalls. "The C language is like a carving knife: ... This paper shows some of the ways C can injure the unwary, and how to avoid injury." Worth reading (and then re-reading).
    How To Steal Code Henry Spencer's article on inventing the wheel only once. "Never build what you can (legally) steal! Done right, it yields better programs for less work". There are some useful C programs at the end.
    The Ten Commandments for C Programmers Henry Spencer's amusing, but true, adaptation of the ten commandments for C programmers. We love number 6: If a function be advertised to return an error code in the event of difficulties, thou shalt check for that code, yea, even though the checks triple the size of thy code and produce aches in thy typing fingers, for if thou thinkest ``it cannot happen to me'', the gods shall surely punish thee for thy arrogance. Read and take note.

    How to write unmaintainable code

     

     

    Expert C Programming

    A link to Roedy Green's very amusing article on how to guarantee a lifetime's employment by making life impossible for maintenance programmers. (He actually has to explain that it's a joke!) Although focused on Java, he gives plenty of examples in C. If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. More quotes below.

     

    很不错的一本书,不过包含很多看似和语言无关的东西,我第一遍看的时候都跳过去了。这也造成本书的组织有点散。

     

     

    References

     

  • Posted at 11:56下午 九月 21, 2006 by Yaodong Zero Yao in C&C++  |  评论[1]

    星期二 七月 18, 2006
    UTF-8 Migration tool analysis

    As UTF-8 becomes the most popular encoding, many operating system such as solaris, ubuntu are using UTF-8 as the default locale. Then how to handle the large amount of legacy encoded file(filename/filecontent)? There are several tools available, let's have a look.

    [Read More]
    Posted at 02:57上午 七月 18, 2006 by Yaodong Zero Yao in solaris  |  评论[8]

    星期日 七月 16, 2006
    test

    测试SunBlogger pkg for OpenOffice

    标题2

    标题3

    测试字体颜色

    • 列表

    • 列表

    Posted at 09:09下午 七月 16, 2006 by Yaodong Zero Yao in gnome  |  评论[0]

    星期二 七月 04, 2006
    C tips from daily usage

    确定数组的长度

    通常我们需要在一个循环中遍历数组的所有元素,因此需要知道数组的长度。硬编码数组长度显然是不可取的,因为如果改变数组元素的个数的话,需要改动多处代码。使用下面的方式可以很好的避免这个问题:

    char * hero[][2] = {
           { "Guo Jing", "She Diao" },
           { "Ling Huchong", "Xiao ao Jiang Hu" },
           { "Yang Guo", "Shen Diao" },
           { "Hu Fei", "Xue Shan Fei Hu" },
        };

    for (i=0; i < sizeof (hero) / sizeof (*hero); i++)
    {
        printf ("%s come from %s\n", hero[i][0], hero[i][1]);
    }

    [转载]NULL 0 \0以及nul的区别


    信息来源:cprogramming.com

    NULL is a macro defined in several standard headers, 0 is an integer constant, '\0' is a character constant, and nul is the name of the character constant. All of these are *not* interchangeable:

    NULL is to be used for pointers only since it may be defined as ((void *)0), this would cause problems with anything but pointers.
    Use cc -E you can see what NULL means on solaris. Commonly NULL is defined by "#define NULL 0" or "#define NULL (void *)0"
    0 can be used anywhere, it is the generic symbol for each type's zero value and the compiler will sort things out.

    '\0' should be used only in a character context.

    nul is not defined in C or C++, it shouldn't be used unless you define it yourself in a suitable manner, like:

    #define nul '\0'

    empty string "" is "\0"

     


    匿名参数的使用

    有时候我们需要使用匿名参数以匹配指定的接口,譬如g_list_foreach()函数需要他的函数参数有两个参数,而如果我们把g_free传递给他时会报告错误,这样我们就可以使用一个函数封装g_free。例如

    o_free (gpoint p, gpoint /* data */)

    Posted at 10:17下午 七月 04, 2006 by Yaodong Zero Yao in C&C++  |  评论[0]

    C语言中可变长参数的处理

    如何写可变参数函数

    void va_start(va_list pvar, name): 根据name参数获得可变参数的指针 pvar。
    (type *) va_arg(va_list pvar, type): 获得下一个可变参数,需要指定参数的类型。
    void va_end(va_list pvar): 结束使用可变参数,使它不再指向内存有效地址。

    例如:
    void simple_va_func (int i, ...)
    {
        va_list arg_ptr;
        int j = 0;

        va_start (arg_ptr, i);
        //这里的arg_ptr可以传递给任意函数作为参数,在那个函数内需要使用va_* 宏去获得对应的参数。
        j = va_arg (arg_ptr, int); 
        va_end (arg_ptr);

        return;
    }

    如何实现可变参数

    可变参数的实现与具体的编译器/硬件平台相关,我们这里简单看一下 cdecl calling convention 下的参数传递。

    cdecl模式下参数从右向左压入堆栈,而且是由调用者来做这个操作。
                              
                                                   内存高地址(x86平台)
    +-----------------------------+
    | 最后一个可变参数     |
    +-----------------------------+
    | 倒数第二个可变参数 |
    +-----------------------------+
    |          ......                      |
    +-----------------------------+
    | 第一个可变参数         |      va_start 之后,arg_ptr 指向这里
    +-----------------------------+
    | 最后一个固定参数     |      这个参数的名字需要传递给va_start
    +-----------------------------+
    |          ......                      |
    +-----------------------------+
    | 第一个参数                 |
    +-----------------------------+
    | 函数返回地址             |
    +-----------------------------+
    | 调用者的 BP               |     被调用函数的栈基址
    +-----------------------------+
    | 局部变量                     |
    +-----------------------------+

    注意事项

    参考

    C语言中可变参数的用法
    水滴石穿C语言之可变参数问题
    CSDN C/C++电子杂志第一期 之 可变参数学习笔记
    Posted at 08:55下午 七月 04, 2006 by Yaodong Zero Yao in C&C++  |  评论[0]

    星期三 六月 28, 2006
    One tips using roller weblog

    There is several things which make my blogs display urgly: there is many stroke between text and some special characters will disappear, such as '*', '\'. Today i find the root cause: The evil is the plugins you used,some plugins( will convert some special characters automatically.

    You have two way to configure plug-in used:

    1. In 'Preference -> Setting' page, you can select the default plug-ins used by all your blog entry by default.
    2. You can configure one blog entry's plug-in through the 'Plugins To Apply' under 'Other Settings' at the bottom.

    Breif introduction for plug-ins:

    Posted at 08:03上午 六月 28, 2006 by Yaodong Zero Yao in Sun  |  评论[0]

    星期四 五月 11, 2006
    gnome file name URI
    Gnome use RFC 2396 - Uniform Resource Identifiers (URI) to reprensent filename, so that filename are represented independent of encoding. [Read More]
    Posted at 09:57下午 五月 11, 2006 by Yaodong Zero Yao in gnome  |  评论[0]

    星期四 三月 23, 2006
    building gnome cvs using jhbuild on solaris

    This document is written when i build gnome cvs using jhbuild, and i write it just for reference by myself, there maybe many information which are not correct. Welcome any suggestion and comments!

    1. jhbuildrc file

    First copy below contents as your ~/.jhbuildrc

    # -*- mode: python -*-

    # information about cvs server
    cvsroots['gnome.org'] = ':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
    cvsroots['fontconfig.freedesktop.org'] = ':pserver:anoncvs@cvs.freedesktop.org:/cvs/fontconfig'

    # modules to build (deps are also built)
    moduleset = 'gnome-2.16'
    modules = ['gtk+', 'meta-gnome-desktop', 'meta-gnome-devel-tools' ]

    skip = [ 'hal', 'mozilla' ]

    skip.append('evolution-exchange')

    # the prefix to install things to (user must have write access)
    prefix = '/export/home/gnome/install/gnome-cvs'

    # where the sources are checked out to
    checkoutroot = '/export/home/gnome/src/cvsroot'

    # where to put downloaded tarballs.
    tarballdir = '/export/home/gnome/src/tarballs'

    # arguments to pass to autogen script
    autogenargs='--enable-maintainer-mode --disable-static --disable-gtk-doc'

    # set CFLAGS:
    os.environ['CFLAGS'] = '-g'
    os.environ['PYTHON'] = os.path.join(prefix, 'bin/python')
    os.environ['PYTHONPATH'] = os.path.join(prefix, 'lib/python2.4/site-packages')

    # On SMP systems you may use something like this to improve compilation time:
    # be aware that not all modules compile correctly with make -j2
    os.environ['MAKE'] = 'make'

    os.environ['INSTALL'] = os.path.expanduser('~/bin/install-check')

    module_autogenargs['libgcrypt'] = autogenargs + ' --disable-asm'
    module_autogenargs['howl'] = autogenargs.replace('--disable-static', '')
    module_autogenargs['fontconfig'] = autogenargs + ' --with-expat=/export/home/gnome/install/gnome-cvs/'
    module_autogenargs['gtk+'] = autogenargs + ' --with-included-loaders=png'
    module_autogenargs['ekiga'] = autogenargs + ' --with-pwlib-dir=/export/home/gnome/install/gnome-cvs/ --with-opal-dir=/export/home/gnome/install/gnome-cvs/ --with-sdl-prefix=/export/home/gnome/install/gnome-cvs/'

    module_makeargs['libIDL']= makeargs + ' CPP="/usr/lib/cpp"'
    module_makeargs['ORBit2']= makeargs + ' CPP="/usr/lib/cpp"'
    module_makeargs['libbonobo']= makeargs + ' CPP="/usr/lib/cpp"'
    module_makeargs['dbus']= makeargs + ' CFLAGS="-I/export/home/gnome/install/gnome-cvs/include" LDFLAGS="-lexpat -lintl"'
    module_makeargs['cairo']= makeargs + ' LDFLAGS="-lc"'
    module_makeargs['gtk+']= makeargs + ' LDFLAGS="-lintl"'
    module_makeargs['libgnome']= makeargs + ' LDFLAGS="-lintl"'
    module_makeargs['libgnomeprint']= makeargs + ' LDFLAGS="-lintl"'
    module_makeargs['bug-buddy']= makeargs + ' LDFLAGS="-lintl"'
    module_makeargs['eog']= makeargs + ' LDFLAGS="-lintl"'
    module_makeargs['zenity']= makeargs + ' LDFLAGS="-lintl"'
    module_makeargs['evolution-webcal']= makeargs + ' LDFLAGS="-lintl"'

    addpath('XDG_DATA_DIRS', '/export/home/gnome/src/gnome-cvs/share')
    addpath('XDG_CONFIG_DIRS', '/export/home/gnome/src/gnome-cvs/share')

    2. Issues met during building

    export LC_ALL=C first

    1. Install cbe

        look at opensolaris.org

    2. Install jhbuild

    3. jhbuild bootstrap

    4. jhbuild build

    4.1fontconfig:

               - need expat: http://nchc.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz
               - need freetype: www.freetype.org
               - module_autogenargs['fontconfig'] = autogenargs + ' --with-expat=/export/home/gnome/install/gnome-cvs/', exit jhbuild and rerun jhbuild build.

                ps: build freetype and expat under jhbuild enviroment, otherwise freetype will link
      expat.so.0 under /usr/sfw/lib instead of $prefix/lib

    4.2 cairo

    cairo will be compiled with the following surface backends:
      image:      yes (always builtin)
      Xlib:       yes
      Quartz:     no
      XCB:        no
      Win32:      no
      PostScript: yes
      PDF:        yes
      SVG:        no
      glitz:      no
      BeOS:       no
      DirectFB:   no

    the following font backends:
      FreeType:   yes
      Win32:      no
      ATSUI:      no

    the following features:
      PNG functions: yes

    and the following debug options:
      gcov support:  no
      test surfaces: no

    using CFLAGS:
    -DXTHREADS -I/export/home/gnome/install/gnome-cvs/include -I/usr/local/include/libpng12 -I/export/home/gnome/install/gnome-cvs/include -I/export/home/gnome/install/gnome-cvs/include/freetype2


     - libpng: http://prdownloads.sourceforge.net/libpng/
      cp scripts/makefile.solaris makefile
      change prefix
      make && make install

     - cairo:
      module_makeargs['cairo']= makeargs + ' LDFLAGS="-lc"'

    4.3 gtk+

     - failed to load "./stock_about_16.png": Couldn't recognize the image file format for file './stock_about_16.png'
      ===> --with-included-loaders=png

      It is true that lt-gdk-pixbuf-csource doesn't seem to have png/tiff/jpeg built
    into it, so that's why I believe this seems to be the corrent line of solution.

    I'm trying to impliment a similar solution... I'm pretty sure the SHLIB stuff is
    hp-ux specific. So I went into gdk-pixbuf/Makefile and added the -L./.libs to
    the LINK= line and did a 'gmake clean; gmake' and now I get:

    g_module_open() failed for
    /auto/src-01/common/usc/gnu/gtk+/gtk+-2.2.3/gdk-pixbuf/libpixbufloader-png.la:
    ld.so.1:
    /auto/src-01/common/usc/gnu/gtk+/gtk+-2.2.3/gdk-pixbuf/.libs/lt-gdk-pixbuf-query-loaders:
    fatal: relocation error: file /usr/usc/png/1.2.5/lib/libpng.so.3: symbol
    inflateReset: referenced symbol not found

    Which I'm confused about. png 1.2.5 is the latest, and it was compiled with the
    same compiler.

    I've been playing with this for 3 weeks. I actually had to hard code the
    '-L/usr/usc/png/1.2.5/lib' into the configure.in file because the configure
    script couldn't find it with --with-libpng= even if I set LDFLAGS... This is the
    last of *many* problems I've had trying to get gtk+2 to compile...

    Phil

     -  Undefined                       first referenced
       symbol                             in file
      libintl_dgettext                    /export/home/gnome/src/cvsroot/gtk+/gdk/.libs/libgdk-x11-2.0.so
      ld: fatal: Symbol referencing errors. No output written to .libs/gtk-query-immodules-2.0

      ==> -lintl

    4.4.0 libIDL

     Use /usr/lib/cpp as c preprocessor, otherwise orbit-idl-2 will cause many problems.

    4.4 ORBit2

     - CFLAGS="-Werror-implicit-function-declaration -std=gnu89 $CFLAGS"
      -> comment out this line in configure.in

     - test/inhibit: unknow Foo_..._EPV, this is caused by lack definition.
      add foo.h into baa.h.
      see: http://mail.gnome.org/archives/orbit-list/2001-May/msg00074.html
      ***: if we use /usr/lib/cpp for libIDL, then no such problem.

    4.5 bonobo

     need libIDL, ORBit2 use /usr/lib/cpp on solaris as CPP(c preprocessor)

    module_makeargs['libIDL']= makeargs + ' CPP="/usr/lib/cpp"'
    module_makeargs['ORBit2']= makeargs + ' CPP="/usr/lib/cpp"'
    module_makeargs['libbonobo']= makeargs + ' CPP="/usr/lib/cpp"'


     cpp under solaris:
      /usr/lib/cpp
      /usr/sfw/bin/cpp
      /opt/SUNWspro/bin/cc -E
      

    4.6 howl

     module_autogenargs['howl'] = autogenargs.replace('--disable-static', '')

    4.7 dbus

     - can't find expat.h

      module_makeargs['dbus']= makeargs + ' CFLAGS="-I/export/home/gnome/install/gnome-cvs/include LDFLAGS="-lexpat -lintl"'

     - ImportError: ld.so.1: python2.4: fatal: relocation error: file /usr/lib/python2.4/lib-dynload/array.so: symbol _PyArg_NoKeywords: referenced symbol not found
        export PYTHON and PYTHONPATH

    4.8 hal:  still need patch in order to run on solaris correctly

     can't find pci.ids
     Patch hal for solaris: http://lists.freedesktop.org/archives/hal/2006-February/004630.html

     1) Can't find definition for __FUNCTION__, use __func__


     cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pciids login
     cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pciids co -P pciids

     can't find 'endian.h', 'byteswap.h'

     skip this module and delete all dependency on this.

    4.9 gnome-vfs 

     - __PRETTY_FUNCTION__  undefined:  As noted in the previous subsection, the g++ compiler defines two standard built-in preprocessor macros: __FILE__ and __LINE__. The g++ compiler also defines two non-C standard preprocessor macros called __FUNCTION__ and __PRETTY_FUNCTION__ that return the name of the current function. We can use any of these special pre-defined macros to build our own debug utilities.

       GNU CC predefines two string variables to be the name of the current
    function.  The variable `__FUNCTION__' is the name of the function as
    it appears in the source.  The variable `__PRETTY_FUNCTION__' is the
    name of the function pretty printed in a language specific fashion.

       These names are always the same in a C function, but in a C++
    function they may be different.  For example, this program:

         extern "C" {
         extern int printf (char *, ...);
         }
        
         class a {
          public:
           sub (int i)
             {
               printf ("__FUNCTION__ = %s\n", __FUNCTION__);
               printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);
             }
         };
        
         int
         main (void)
         {
           a ax;
           ax.sub (0);
           return 0;
         }

    gives this output:

         __FUNCTION__ = sub
         __PRETTY_FUNCTION__ = int  a::sub (int)

       These names are not macros: they are predefined string variables.
    For example, `#ifdef __FUNCTION__' does not have any special meaning
    inside a function, since the preprocessor does not do anything special
    with the identifier `__FUNCTION__'.

     This symbol are gcc/g++ only, fortunately it is mostly used by debug.
     We can disable debug, so that we don't compile it.

    Sulotion:
     rm $(topdir)/CVSVERSION

    AC_ARG_ENABLE(http-debug,
    [  --enable-http-debug  Enable HTTP method debugging],
    set_http_debug="$enableval",[
    if test -f $srcdir/CVSVERSION; then
            set_http_debug=yes
    else
            set_http_debug=no
    fi
    ])


    #ifdef HAVE_UTMP_H
            /* This sets stdin, stdout, stderr to the socket */
            /*if (login && login_tty (fd) == -1) {
                    g_printerr ("mount child process login_tty failed: %s\n", strerror (errno));
                    return -1;
            }*/
    #endif


    4.10 startup-notification

     - Undefined symbol: __FUNCTION__
      add one patch: use __func__ for Sun CC compiler instead of __FUNCTION__

    4.11 gnome-doc-utils

     - ../../intltool-merge: No such file or directory
      copy from other modules

     - doc/ can't build
      Run under command line manually.

    4.12 libgcrypt

     - "mpih-add1.S", line 44 : Syntax error
      --disable-asm

    4.13 gnome-terminal

     - No rules to make 'help/bg'
      ignore it: need evaluate on this problem.

    4.14 libgtop

      -
    "shm_limits.c", line 62: incomplete struct/union/enum shminfo: sinfo
    "shm_limits.c", line 73: improper member use: shmmax
    "shm_limits.c", line 74: improper member use: shmmni
    "shm_limits.c", line 76: improper member use: shmmin
    "shm_limits.c", line 77: improper member use: shmseg
     - using libgtop-2.8.3 and one patch from http://www.whacked.net/2005/07/25/libgtop-on-solaris-10/

    4.15 libxklaver

     - no doxygen
      modify autogen.sh to don't --enable-doxygen
     - illegal option -Wall
      patch $(topdir)/libxklavier to remove them

    4.16 liboil

     - exmaple/Makefile: cantain '-O2' which can't be recognized by Sun cc.


    4.18 gnome-cups

     - need install cups
      --need openldap: need berkely DB install to /usr/ diretory
       --berkely DB: http://www.sleepycat.com/
        cd build_unix
        ../dist/configure default prefix
        make
        make clean

     - When build example: can't found symbol definiton for libintl_dgettext
          

    4.19 nautilus

     - need libexif: http://kent.dl.sourceforge.net/sourceforge/dropline-gnome/libexif-0.5.12.tar.bz2

    4.20 gnome-control-center

     - "/export/home/gnome/install/gnome-cvs/include/libxklavier/xklavier_config.h",  : _XklConfigItem
    cc:/opt/SUNWspro/prod/bin/acomp

    4.20: yelp

     - fno-rtti can't be recognized by compile
     - liconv

    4.21 nautilus-cd-burner

     - Wall illegal option
     - -lc -lintl
     =
    Undefined                       first referenced
     symbol                             in file
    void __Crun::ex_rethrow_q()       .libs/dvd_plus_rw_utils.o
    void*operator new[](unsigned)                       .libs/dvd_plus_rw_utils.o
    void operator delete(void*)                       .libs/dvd_plus_rw_utils.o
    ld: fatal: Symbol referencing errors. No output written to .libs/libnautilus-burn.so.3.0.0


      add -lCstd -lCrun at proper position


    4.22 libmusicbrainz

     - ./examples/:  ld: fatal: library -lstdc++: not found
      -cpp_example_LDADD = $(top_builddir)/lib/libmusicbrainz.la -lstdc++ -lm
      +cpp_example_LDADD = $(top_builddir)/lib/libmusicbrainz.la -lm -lCstd -lCrun

    4.23 totem

     -  cannot find include file: <linux/cdrom.h>
      use patch from laca's spec file. 
     - no kill func:
      include <signal.h>
     

    4.24 gnome-media

     - Replace '__FUNCTION__' with __func__
     - CDROM_GET_CAPABILITY undefined: #define CDROM... 0x42432

    4.27 zenity: -lintl
    4.29 gnome-mag:

     - can't found lib Xdamage:
    ld: fatal: library -lXdamage: not found
    ld: fatal: library -lXfixes: not found
    ld: fatal: File processing errors. No output written to .libs/magnifier

      -R/usr/X/sfw/lib -L/usr/X/sfw/lib -lXdamage -lXfixes

    4.30 epiphy:

     - need xpcom, skip this

    4.31 gnome-system-tools skipped

     undefined symbol: NETSTAT_PROTOCOL_FORMAT

    4.32 gnome-volume-manager

     skip because of hal

    4.33 sound-juicer: skip

     -Wall
     -lstdc++:

    4.34 evolution-webcal: intl


    4.35 evolution-exchange: skip


     Package requirements (libsoup-2.2 evolution-shell-2.6 libedataserverui-1.2 libexchange-storage-1.2 libbonobo-2.0 libxml-2.0 gconf-2.0)


    4.36 ekiga

     - need SDL
     - need PWlib: http://sourceforge.net/projects/openh323  or cvs
       --with-pwlib-dir
     - need opal: cvs -z9 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/openh323 co opal
       PWLIBDIR=/path/to/pwlib
       

     - modify configure file manually
      --with-pwlib-dir=/export/home/gnome/install/gnome-cvs/ --with-opal-dir=/export/home/gnome/install/gnome-cvs/ --with-sdl-prefix=/export/home/gnome/install/gnome-cvs/

    4.37 dasher - skip
    4.38 gnome-keyring-manager: -Wall -W-Wno-format-y2k

     skip


    4.39 sabayon: --with-disto

         Xnest binary not found.

    4.40 poper

     --freetype: add include file

     

    6. Run jhbuild gnome

    6.1: create /usr/bin/jhbuild-session:

     #!/sbin/sh
     exec jhbuild --file=/.jhbuildrc run dbus-launch gnome-session

    6.1.1: /usr/share/xsessions

     copy gnome.session jhbuild-gnome.session

    6.1.2: /usr/dt/config/Xsession.jds
    6.1.3: exec /usr/dt/bin/Xsession:

     SDT_ALT_SESSION="/usr/dt/config/Xsession2.jhbuild"

    6.1.4: /usr/dt/config/Xsession2.jds
    6.1.5: /usr/dt/config/Xinitrc.jhbuild

     jhbuild-session

    6.2: copy /etc/fonts into $prefix/etc

     then execute fc-cache to handle with font issues.

    6.3: update-mime-database $prefix/share/mime

       update-desktop-database -v

    6.4:   bonobo-slay

        bonobo-activation-sysconf --display-directories
        bonobo-activation-sysconf --config-file-path

        $prefix/etc/bonobo-activation/bonobo-activation-config.xml
       add below: <item>$prefix/lib/bonobo/servers</item>


     we need make bonobo-activation-server be able to find your .sever file, it can be done in three ways:
      1) copy the server file to /usr/lib/bonobo/servers
      2) export BONOBO_ACTIVATION_PATH
      3) activation-client --add-path $(pwd)

      gtk-update-icon

    6.5: gconf schema file: where to get?

      $prefix/libexec/gconfd-2: how to run it?

    6.6: copy im-iiim.so to $prefix/lib/gtk-2.0/2.4.0/immodules/

    7.0 References

     - Jhbuild issues:  http://www.gnomebangalore.org/wiki/index.php/Jhbuild_issues
          http://live.gnome.org/JhbuildIssues_2fpango

     - Build gnome on Ubuntu: http://live.gnome.org/JhbuildOnUbuntu
     - sample jhbuildrc: http://ftp.gnome.org/pub/gnome/teams/releng/2.13.1/sample-tarball.jhbuildrc
     - Python issue: http://mail.gnome.org/archives/garnome-list/2005-July/msg00199.html

    Posted at 08:09上午 三月 23, 2006 by Yaodong Zero Yao in gnome  |  评论[0]

    星期六 二月 18, 2006
    Why python minutes


    1. Oddly enough, Python's use of whitespace stopped feeling unnatural after about twenty minutes.

    2. An important measure of effort in coding is the frequency with which you write something that doesn't actually match your mental representation of the problem, and have to backtrack on realizing that what you just typed won't actually tell the language to do what you're thinking.

    3. it is compact--you can hold its entire feature set (and at least a concept index of its libraries) in your head. C is a famously compact language. Perl is notoriously not; one of the things the notion ``There's more than one way to do it!'' costs Perl is the possibility of compactness.

    4. The gold Python rule is "explicit is better than implicit"

    Posted at 03:01上午 二月 18, 2006 by Yaodong Zero Yao in gnome  |  评论[0]

    星期三 一月 18, 2006
    The encoding returned from gtk widget is UTF-8 commonly
    Gtk+ provide several widget to let user input characters, such as GtkEntry, gtk multiline widget, and then you can using some method such gtk_entry_get_text() got what user input. But question is: what is the encoding of returned text on different locale?

    The answer is that the encoding is utf8 no matter on which locale user input it.

    #include <gtk/gtk.h>
    #include <stdio.h>

    void
    cb_activate (GtkEntry *entry, gpointer user_data)
    {
        const gchar *text;

        text = gtk_entry_get_text (GTK_ENTRY(entry));

        if (text != NULL)
            printf ("The text returned from entry: %s\n", text);
        else
            printf ("The text returned from entry: NULL\n");
    }

    int
    main (int argc, char **argv)
    {
        GtkWidget *window;
        GtkWidget *entry;

        gtk_init (&argc, &argv);

        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title (GTK_WINDOW (window), "Test the encoding of text input by user");
        gtk_window_resize (GTK_WINDOW (window), 300, 100);
        g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
        g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);

        entry = gtk_entry_new ();
        g_signal_connect (entry, "activate", G_CALLBACK (cb_activate), NULL);
        gtk_container_add (GTK_CONTAINER (window), entry);

        gtk_widget_show_all (window);
        
        gtk_main ();

        return 0;
    }
    Posted at 03:30上午 一月 18, 2006 by Yaodong Zero Yao in gnome  |  评论[0]

    星期六 一月 14, 2006
    The encoding of messages file and encoding of gettext()

    po file are handled by gettext/dgettext/dcgettext.

    1. The encoding of po file is specified in po file through 'charset' keyword, gnome messages files are utf8.
    2. The output encoding of gettext is dependent to LC_CTYPE at default
    3. You can use bind_textdomain_codeset() to specify what encoding of the output of gettext is.

    char * gettext(const char *msgid);

    char * dgettext(const char *domainname, const char * msgid);

    char * dcgettext(const char *domainname, const char *msgid, int category);

    1. What is message domain?
      1. A set of translatabel msgid messages.
      2. Use domain name to determine where the translation is looked up.
    2. The message domain of gettext is specified by a preceding textdomain call.
    3. Translation Operation
      1. gettext, dgettext use LC_MESSAGES to lookup. It is determined by a preceding call to the setlocale function. setlocale(LC_ALL, "") initializes the LC_MESSAGE locale based on the first nonempty value of the three enviroment variabled LC_ALL, LC_MESSAGES, LANG.
      2. Use LC_CTYPE to convert the translated message from the translator's codeset(specified in po file, mostly is UTF-8) to the current locale's codeset. You can use bint_textdomain_codeset to specify the output messages encoding.
    Posted at 11:57下午 一月 14, 2006 by Yaodong Zero Yao in gnome  |  评论[1]