C ѧϰ±Ê¼Ç£º ÒÆÎ»²Ù×÷Á·Ï°¡£
#include <stdio.h>
unsigned int reverse_bits(unsigned int value)
{
unsigned int answer;
unsigned int i;
answer = 0;
for(i=1;i!=0;i<<=1){ //´ËÑ»·¿ÉÒÔºöÂÔ»úÆ÷µÄ²îÒì¡£64λºÍ32λ½Ô¿ÉÓã¬ÔöÇ¿´Ë´úÂëµÄ¿ÉÒÆÖ²ÐÔ
answer <<=1;
if(value & 1)
answer |= 1;
value >>=1;
}
return answer;
}
int main(void)
{
unsigned int get_answer=reverse_bits(13);
int i=31;
char t;
while(i)
{
t ='0'+ ((get_answer >> i) & 1);
printf("%c",t);
i--;
}
}
<<CºÍÖ¸Õë>> µÚ5ÕÂÁ·Ï°Ìâ¡£
Linux 2.6 kernelÖеÄset_bit²Ù×÷£º
ÐèÒª¿¼ÂÇ»úÆ÷ÊÇ32λ»¹ÊÇ64λµÄ¼ÆËã»ú¡£
static inline void set_bit(int nr, volatile unsigned long *addr)
{
int *a = (int *)addr;
int mask;
//unsigned long flags;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
//local_irq_save_hw(flags);
*a |= mask;
//local_irq_restore_hw(flags);
}
Ïà¹ØÎĵµ£º
pythonµÄC¡¢c++À©Õ¹
http://blog.chinaunix.net/u3/110228/showart_2148725.html
pythonµÄÇ¿´ó²»½ö±íÏÖÔÚÆä¹¦ÄÜÉÏ£¬¶øÇÒ»¹±íÏÖÔÚÆäÀ©Õ¹ÄÜÁ¦ÉÏ¡£
ʹÓÃC/C++ºÜÈÝÒ×±àдpythonµÄÄ£¿é£¬À©Õ¹pythonµÄ¹¦ÄÜ¡£
ͬʱ½«ÐÔÄÜÒªÇó±È½Ï¸ßµÄ´úÂëʹÓÃC/C++±àд£¬ÄܸüºÃµÄÃÖ²¹
½Å±¾ÓïÑÔÖ´ÐÐËÙ¶ÈÂýµÄȱÏÝ¡£
1. pythonµÄCÓïÑÔÀ©Õ¹
1.1 ......
C/C++ÊÇ×îÖ÷ÒªµÄ±à³ÌÓïÑÔ¡£ÕâÀïÁгöÁË50ÃûÓÅÐãÍøÕ¾ºÍÍøÒ³Çåµ¥£¬ÕâÐ©ÍøÕ¾Ìṩc/c++Ô´´úÂë¡£Õâ·ÝÇåµ¥ÌṩÁËÔ´´úÂëµÄÁ´½ÓÒÔ¼°ËüÃǵÄС˵Ã÷¡£ÎÒÒѾ¡Á¦°üÀ¨×î¼ÑµÄC/C++Ô´´úÂëµÄÍøÕ¾¡£Õâ²»ÊÇÒ»¸öÍêÕûµÄÇåµ¥£¬ÄúÓн¨Òé¿ÉÒÔÁªÏµÎÒ£¬ÎÒ½«»¶ÓÄúµÄ½¨Ò飬ÒÔ½øÒ»²½¼ÓÇ¿Õâ·½ÃæµÄÇåµ¥¡£
1¡¢http://snippets.dzone.com/tag/c/ --ÊýÒÔǧ¼Æ ......
½ñÌìÔÚVS2005µ÷ÊÔÒ»¸öC# C/S³ÌÐò£¬µ±Í¨¹ýRFCÓëSAPÁ¬½Óʱ¼ä¹ý³¤Ê±£¬³öÏÖ´Ë´íÎó£¬ÔÚÍøÉÏÕÒµ½½â¾ö°ì·¨¡£
VS2008ÉϵÄÒ»¸ö³ÌÐò£¬Í¨¹ýOracle.DataAccess.dllÖ´ÐÐdrop user
cascade²Ù×÷£¬ÎÒÔÚsqlplusÖ´Ðд˲Ù×÷´óÔ¼ÐèÒªÒ»·ÖÖÓ×óÓÒʱ¼ä£¬µ±ÎÒÔÚVS2008ÖÐdebugÆô¶¯´Ë³ÌÐòʱ£¬Ò»Ö±½ÓÊÕµ½
“ContextSwitchDeadlock is detected& ......
×ÛÊö
¿´Ò»ÏÂÊäÈë²Ù×÷µÄÔÀí£¬
³ÌÐòµÄÊäÈë¶¼½¨ÓÐÒ»¸ö»º³åÇø£¬¼´ÊäÈ뻺³åÇø¡£Ò»´ÎÊäÈë¹ý³ÌÊÇÕâÑùµÄ£¬µ±Ò»´Î¼üÅÌÊäÈë½áÊøÊ±»á½«ÊäÈëµÄÊý¾Ý´æÈëÊäÈ뻺³åÇø£¬¶øcinµÈÊäÈëÊä³öº¯ÊýÖ±½Ó´ÓÊä
È뻺³åÇøÖÐÈ¡Êý¾Ý¡£ÕýÒòΪcinµÈÊäÈëÊä³öº¯ÊýÊÇÖ±½Ó´Ó»º³åÇøÈ¡Êý¾ÝµÄ£¬ËùÒÔÓÐʱºòµ±»º³åÇøÖÐÓвÐÁôÊý¾Ýʱ£¬cinº¯Êý»áÖ±½ÓÈ¡µÃÕâЩ²ÐÁôÊý¾ ......