Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÏÂCÓïÑÔʵÏÖ×Ö·û´®×Ó´®Ìæ»»


    ÓÉÓÚLINUX
CûÓжÔ×Ö·û´®×Ó´®Ìæ»»¹¦ÄÜ,ËùÒÔÎÒ×Ô¼ºÐ´ÁËÒ»¸östr_replaceº¯Êý,ʵÏÖÁË×Ö·û´®Ìæ»».
Çë´ó¼Ò²Î¿¼.
/*
 * FUNCTION     : str_replace
 *
ABSTRACT     : replace child string in a string.
 *
PARAMETER    :
 *      
char* str          
the string that be replace
 *      
char* str_src       source string
 *      
char* str_des       destination string
 *
RETURN       :
 *      
0       OK
 *     
-1       FALSE
 * CREATE       : 2006-01-05   
ZHANG.JINCUN
 * NOTE        
:
 */
int str_replace(char* str,char* str_src, char*
str_des){
    char *ptr=NULL;
   
char buff[256];
    char buff2[256];
   
int i = 0;
   
    if(str !=
NULL){
        strcpy(buff2, str);
   
}else{
       
printf("str_replace err!\n");
       
return -1;
    }
    memset(buff,
0x00, sizeof(buff));
    while((ptr = strstr( buff2,
str_src)) !=0){
       
if(ptr-buff2 != 0) memcpy(&buff[i], buff2, ptr - buff2);
       
memcpy(&buff[i + ptr - buff2], str_des, strlen(str_des));
       
i += ptr - bu


Ïà¹ØÎĵµ£º

ÈçºÎʹÓ÷ºÐÍÄ£擬virtual? (C/C++) (template)

ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......

linux Æô¶¯¼¶±ð

ÒÔÏÂÊÇÅäÖÃÒýµ¼½øÈëͼÐÎģʽµÄetc/inittabÎļþµÄ²¿·ÖÄÚÈÝ£º
#Default runlevel.The runlevels used by RHS are:
# 0-halt(Do NOT set initdefault to this)
# 1 -Single user mode
# 2-Multiuser,without NFS(The same as 3,if you do not have networking)
# 3-Full multiuser mode   
# 4-unu ......

Ò»¸ölinux »ìÒô²¥·ÅµÄ /etc/asound.conf ÅäÖÃ

±¸Óá£
Ö»ÓÐÏàͬÓû§²ÅÄÜʵÏÖÉ豸µÄͬʱ´ò¿ª¡£
pcm.!dmix {
type dmix
ipc_key 5678293
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
period_time 0
period_size 2048
buffer_size 16384
format S16_LE
rate 48000
}
}
pcm.!dsnoop {
type dsnoop
ipc_key 5778293
ipc_key_add_uid yes
slave {
pcm "hw:0 ......

LinuxÐÔÄÜ¼à¿Ø¹¤¾ßµÄ½éÉÜÎÄÕÂ

»ùÓÚ½ø³ÌµÄÃüÁʽ²é¿´:
`ps -o pcpu,pmem,nlwp -p $PID`
#(pmem = % mem usage and nlwp is number of threads)
ÆäÖÐpcpu¶¨ÒåÊÇ:cpu utilization of the process in “##.#” format. It is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ