2015年2月24日 星期二

登入後執行的指令 登出後仍然繼續運作: bg

使用時機:想遠端登入server, build一大包image, 然後就登出去做別的事

http://stackoverflow.com/questions/954302/how-to-make-a-programme-continue-to-run-after-log-out-from-ssh

You press ctrl-Z. The system suspends the running program, displays a job number and a "Stopped" message and returns you to a bash prompt.
You type the disown -h %1  command (here, I've used a 1 , but you'd use the job number that was displayed in the Stopped message) which marks the job so it ignores the SIGHUP signal (it will not be stopped by logging out).
Next, type the bg command using the same job number; this resumes the running of the program in the background and a message is displayed confirming that.
You can now log out and it will continue running..

BUT!!!

我照作之後失敗了...SIGHUP仍然關掉了程序
後來改用nohup
nohup [command] 成功留住程序

參考這裡研究 nohup 跟 disown 的差別
http://unix.stackexchange.com/questions/3886/difference-between-nohup-disown-and

2015年2月12日 星期四

點panel-- DE mode (Data Enable mode) Sync mode

https://community.freescale.com/docs/DOC-93617

http://community.arm.com/thread/6225

https://community.freescale.com/thread/302384

http://bbs.ofweek.com/thread-825825-1-1.html

http://bbs.fpdisplay.com/showtopic-33936.aspx

http://www.nxp.com/wcm_documents/techzones/microcontrollers-techzone/Presentations/graphics.lcd.technologies.pdf

http://www.displayfuture.com/display/datasheet/tft/mi0570b1t.pdf

RGB mode only. DE mode 是指, 在有CLK,DE信号时, 就能直接控制显示. 譬如: DE=H,显示. DE=L, Blanking. SYNC mode是指, 在有CLK, HS,VS信号时, 一般VS 下降沿到来, X个CLK后(back porch),HS下降沿到来, 开始显示第一行数据.等待下一个HS下降沿到来,显示第二行...... 下一个VS下降沿到来,显示下一帧画面...   注意: 这里举例说信号下降沿, 实际操作看IC datasheet. DE与SYNC的选择, 有的IC是需要硬件设置或程序设置. 有的IC侦测DE信号, 发现DE信号则直接进入DE mode,没有发现则进入Sync mode.

2015年2月5日 星期四

Linux use command line parameter to pass some words to kernel (related atag)

the Parser use "__setup" macro to setup function about how to access those words.

Search "__setup" if you need to read example.

2015年2月3日 星期二

[轉文] 外籍專業人士在中國的薪資結構

http://wicerworkshop.logdown.com/posts/252451/foreigner-pay-structure-in-china

C語言裡用到結構時 有 -> 也有 . 兩者差異

http://programming.im.ncnu.edu.tw/Chapter13.htm


用於struct的運算符號

在如下的結構定義裡,next前面的*不可省略,否則就遞迴定義了,Compiler將無法決定struct list的大小。

struct list {
    int data;
    struct list *next; // a pointer to struct list
};

struct list listOne, listTwo, listThree;

listOne.next = &listTwo;
listTwo.next = &listThree;
// 以下想要由listOne設定到listThree的data
listOne.next.next.data = 0; // 這不合法, 因為.的左邊必須是struct,不可以是pointer
(*(*listOne.next).next).data = 0; // 這樣寫才對


你會發現上面的例子中, 如果struct裡面有pointer to struct, 而我們想要用該pointer來存取結構成員時, 就必須很小心的用*和()來表達。由於結構成員包括指向結構的指標(define a pointer to struct in a struct), 是很常見的事情, 這樣的(*(*listOne.next).next).data語法既難寫又難懂, 因此C語言定義了->運算符號。此符號的左邊是一個pointer to struct, 右邊則是該pointer指到的結構成員。->為第一優先權左結合, 因此

(*(*listOne.next).next).data = 0; //這樣寫才對
listOne.next->next->data = 0; // 這樣寫更漂亮