2015年10月22日 星期四

常用核心記憶體分配函數

[轉貼]http://welkinchen.pixnet.net/blog/post/44174948-%E5%B8%B8%E7%94%A8%E6%A0%B8%E5%BF%83%E8%A8%98%E6%86%B6%E9%AB%94%E5%88%86%E9%85%8D%E5%87%BD%E6%95%B8

2015年6月23日 星期二

這是些測試的東東

現在就是做一些測試爛肉 第二行 第三行 測試肉

2015年6月15日 星期一

3n+1

#include <stdio.h>                                                                                            
#include <stdlib.h>

#define swap(x,y) (x^=y,y^=x,x^=y)

int main()
{
    unsigned long A, B;
    while(scanf("%ld %ld", &A, &B) == 2)
    {   
        printf("%ld %ld ", A, B); 
        if (A > B) swap(A,B);

        unsigned long max = 0;

        unsigned long i;
        for(i = A; i <= B; i++)
        {   
            unsigned long count, n;
            for(count = 0, n = i;;) 
            {   
                count++;
                if(n == 1) break;
                n = (n%2==1)? 3*n+1 : n >> 1;
            }   
            if(count >= max) max = count;
        }   

        printf("%ld\n", max);
    }
    return 0;
}                                       

2015年5月13日 星期三

ubuntu build kernel

看這個:

http://it.livekn.com/2013/01/compile-kernel.html

2015年5月11日 星期一

安裝cmake與其相關套件東東


ubuntu 14.04: 
apt-get install cmake flex libpciaccess-dev bison libx11-dev libxext-dev libxml2-dev libvdpau-dev
apt-get install build-essential -y
apt-get install doxygen

2015年3月24日 星期二

ubuntu修改grub開機時間

here:
/etc/default/grub

after modified should be updated:

update-grub

2015年3月14日 星期六

xeyes X11 connection rejected because of wrong authentication. Error: Can't open display: localhost:11.0

發現X11 connection有問題,原來是我變成"su"之後執行指令就產生以下訊息:
xeyes X11 connection rejected because of wrong authentication. Error: Can't open display: localhost:11.0


解法:

An easier solution follow as:
1.- ssh user@host

2.- $ sudo su

3.- # xauth merge /home/user/.Xauthority