Tuesday, 28 December 2010

basic git command

git is the fast version control system

Now I am studying how to use git

  • Here are the commands for common using:
  1. Use git clone to check out sources. i.e. Download pulseaudio sources:
    git clone git://git.0pointer.de/pulseaudio.git
    
  2. Use git status to show your working tree status
    git status
    
  3. Use git pull to update the codes to the newest version
    git pull origin master
    
  4. Add or edit your file
  5. Commit your new file
    git add your-file
    
    git commit -m 'log'
    
  6. Push your change to remote repository
    git push origin master
    

  • Here is a sample to generate a patch
    git status
    
    view /home/usr/.gitconfig 
    
    git add src/pulsecore/random.c
    
    git log -v
    
    git commit -m 'core: Fix variable "has_whined" value bug'
    
    git format-patch -s -1
    
    view 0001-core-Fix-variable-has_whined-value-bug.patch
    

android gstreamer debug information can not work

在android上面做一些gstreamer的工作
尝试显示出gstreamer自己的调试信息
在android模拟器上面运行:

gst-launch-0.10 --gst-debug-level=1 audiotestsrc ! audioflingersink

结果显示:

Could not open converter from 'ASCII' to 'UTF-8'

调试发现:libiconv在android上面已经移除了

在gconvert.c g_convert()中添加了以上代码自己转换,将ASCII 转换成 UTF-8,debug 消息就可以打印出来了

//--> allen add for testing
printf("allen in gconvert.c g_convert() %s %d\n", str, len);
gsize retval;
gchar *utf;
gsize utfmax;
if (len < 0)
{
len = strlen (str);
}
utfmax = 2 * (len + 1);
printf("utfmax: %d\n", utfmax);
utf = g_malloc (utfmax);
for (retval = 0; *str && utfmax > 1; utfmax -= 2, retval += 2)
{
*(utf + retval/2) = *(str + retval/2);
*(utf + retval/2 + 1) = 0;
}
if (utfmax > 0)
{
*utf = *str;
++retval;
}
if (bytes_read)
*bytes_read = len + 1;
if (bytes_written)
*bytes_written = retval;
printf("allen in gconvert.c g_convert() %s %d\n", utf, utfmax);
return utf;
//<--end

ubuntu qq for linux自动关闭的问题解决方法


ubuntu 10.04还是存在这个问题 哎
下面解决的办法:
1. 在终端输入命令代码:sudo vim /usr/bin/qq
2. 在打开的qq配置文件中,在#!bin/sh下面一行,cd /usr/share/tencent/qq/前面一行的位置插入代码:
export GDK_NATIVE_WINDOWS=true
3. 最终修改后的QQ脚本配置文件如下,保存关闭即可。
#!/bin/sh
export GDK_NATIVE_WINDOWS=true
cd /usr/share/tencent/qq/
./qq
 4. 重启QQ,qq不再自动退出和关闭了。