Ubuntu預設套件庫來源是安裝OpenJDK
對於習慣用Oracle Java JDK(原Sun JDK)的人來說
可以參考下面這篇文章來替換
如何於Ubuntu安裝Oracle Java JDK?
http://single9.net/2011/05/how-to-install-java-jdk-in-ubuntu/
爬了一下網路上的設定方法
個人感覺上面是最簡單直覺的作法
唯一的小發現是編輯完JDK的路徑之後
必須先登出一次再登入
系統才能正確抓到Java的設定
2011/07/30
2011/07/28
利用stringstream進行字串與數值的轉換
以往都用atoi()、atof()來將字串轉成整數或是小數
這邊也可以用stringstream來實做
下面是把字串轉成數值
當然反過來也可以把數值轉為字串
簡單的實作了以下code
這邊也可以用stringstream來實做
下面是把字串轉成數值
當然反過來也可以把數值轉為字串
簡單的實作了以下code
2011/07/24
Ubuntu x86下安裝PAE 開啟4G以上ram支援
sudo apt-get update
sudo apt-get install linux-headers-server linux-image-server linux-server
2011/07/14
[轉貼] Windows 7 安裝後開啟 AHCI
參考資料:
http://iphonedaily.com/windows-7-ahci-enable-ahci-after-install/ Windows 7 AHCI-安裝後開啟 AHCI 的方法
※其他關於AHCI的參考資料:
何謂AHCI?如何在AHCI系統上正確安裝作業系統
在已安裝的作業系統上開啟AHCI傳輸模式
在現有的xp中打開ahci並安裝驅動程式 (Xp使用者請參考這篇)
P.S 在Linux系統kernel中已經包含AHCI的驅動,只要在BIOS中開啟AHCI功能即可。
http://iphonedaily.com/windows-7-ahci-enable-ahci-after-install/ Windows 7 AHCI-安裝後開啟 AHCI 的方法
※其他關於AHCI的參考資料:
何謂AHCI?如何在AHCI系統上正確安裝作業系統
在已安裝的作業系統上開啟AHCI傳輸模式
在現有的xp中打開ahci並安裝驅動程式 (Xp使用者請參考這篇)
P.S 在Linux系統kernel中已經包含AHCI的驅動,只要在BIOS中開啟AHCI功能即可。
C++指定路徑讀檔
在Windows、Linux底下實做過
其實可以這樣寫
假設輸入檔叫做input.txt
在Windows下,輸入檔放在D:\
輸入檔路徑給 D:\input.txt
在Ubuntu下,輸入檔放在使用者家目錄 /home/kevin
輸入檔路徑給 /home/kevin/input.txt
其實可以這樣寫
假設輸入檔叫做input.txt
在Windows下,輸入檔放在D:\
輸入檔路徑給 D:\input.txt
在Ubuntu下,輸入檔放在使用者家目錄 /home/kevin
輸入檔路徑給 /home/kevin/input.txt
#include <cstdlib> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { string Loc; string LineData = ""; cout << "請輸入檔案路徑:"; getline(cin,Loc); ifstream infile(Loc.c_str(),ios::in); if(infile) { cout << "Succeeded..." << endl; while(!infile.eof()) { getline(infile,LineData); cout << LineData << endl; LineData = ""; } } else { cout << "Failed..." << endl; } system("PAUSE"); return EXIT_SUCCESS; }
2011/07/13
C++在Widows下指定讀檔路徑
#include <iostream> #include <fstream> using namespace std; int main() { string InFile; int SlashNo = 0; string LineData = ""; cout << "Input File Location:"; getline(cin,InFile); for(int i=0; i<InFile.length(); i++) { if(InFile[i] == '\\') { SlashNo++; } } cout << "SlashNo = " << SlashNo << endl; int TotalLength = InFile.length()+SlashNo+1; char RealInputFile[TotalLength]; int jdx =0; for(int i=0; i<InFile.length(); i++) { if(InFile[i] == '\\') { RealInputFile[jdx] = InFile[i]; jdx++; RealInputFile[jdx] = InFile[i]; } else { RealInputFile[jdx] = InFile[i]; } jdx++; } RealInputFile[TotalLength-1] = '\0'; cout << "Current File Location : " << RealInputFile << endl; ifstream Source(RealInputFile,ios::in); if(Source) { cout << "Read Secceeded" << endl; while(!Source.eof()) { getline(Source,LineData); cout << LineData << endl; LineData = ""; } } else { cout << "Read Failed" << endl; } return 0; }
2011/07/12
Ubuntu將CD/DVD存成.iso
在Windows底下
要將CD/DVD製作成.iso來儲存
常用Alcohol 120%、Daemon Tools等軟體來達成
在Linux底下
只要用一行指令就可以達到相同的功能~
dd if=/dev/cdrom of=輸出檔名
例如:
dd if=/dev/cdrom of=Ubuntu.iso
即從CD-ROM裝置讀取資料存成Ubuntu.iso
要將CD/DVD製作成.iso來儲存
常用Alcohol 120%、Daemon Tools等軟體來達成
在Linux底下
只要用一行指令就可以達到相同的功能~
dd if=/dev/cdrom of=輸出檔名
例如:
dd if=/dev/cdrom of=Ubuntu.iso
即從CD-ROM裝置讀取資料存成Ubuntu.iso
2011/07/11
在Ubuntu安裝hifree
hifree官方只有釋出Windows平台的版本
因此在Linux系統中需要藉由Wine模擬出運作的環境
相關的設定可以參考這篇:
http://jclin.blogspot.com/2011/04/linux-hifree.html "在Linux上裝hifree"
因此在Linux系統中需要藉由Wine模擬出運作的環境
相關的設定可以參考這篇:
http://jclin.blogspot.com/2011/04/linux-hifree.html "在Linux上裝hifree"
訂閱:
文章 (Atom)