2016年3月15日 星期二

[開發紀錄]Vim的Hello World

vim使用
至上次安裝好後,還沒有寫一個程式來測試一下,按照慣例來個Hello World吧

輸入vim就可進入
$vim 檔名.c           創立某個檔名的c file
i可以開始編輯

程式碼部份
#include<stdio.h>
int main(){
        printf("Hello World\n");
        return 0;
}
執行指令
$ gcc hello.c -o hello
$ ./hello
顯示結果
 Hello World

存檔離開 :wq

離開vim的操作都是要按ESC
vim is a modal editor. Hit the ESC key to get into Normal (command) mode then type :q and press Enter.
To quit without saving any changes, type :q! and press Enter.
 原文:How do I quit from Vi?
VIM命令退出



第九章、vim 程式編輯器 

完整參考資料:康乃爾大學教材第一章

2016年3月9日 星期三

[C語言]define 中比大小

求最大值和最小值

#define MAX( x, y ) ( ((x) > (y)) ? (x) : (y) )

#define MIN( x, y ) ( ((x) < (y)) ? (x) : (y) )


參考網站:http://stenlyho.blogspot.tw/2007/04/c_04.html

2016年3月7日 星期一

[開發紀錄]unable to mount root fs on unknown-block(0 0)

unable to mount root fs on unknown-block(0 0)

這個問題可能是我之前一直灌不起來的原因吧?
因為之前沒有紀錄

不過上次我重灌的時候,我用一些很神奇的方法
最後還是把Ubuntu灌起來

雖然我覺得我解決的方法很奇怪
簡單紀錄一下

基本上是Windows跟Ubuntu雙系統的情況下
然後我先灌Windows再灌Ubuntu

每次出現這個問題,我的D槽在Windows灌好時,都需要被重新格式化,也是因此我猜測,未分配空間可能也需要格式化

看到這個,我就回Windows去重新檢測硬碟
再來電腦管理」的「磁碟管理」去將未分配空間重新格式化
簡單參考:
一點通 - 如何在 Windows 7 中動態調整硬碟空間 (MVP 撰寫)

然後比較有人再認真分析這個問題的
Thread: kernel panic-not syncing: VFS: unable to mount root fs on unknown block(0,0)

Thread: Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0)

[問題] Unable to mount root fs on unknown-block(0,0)


ADGuard