Pages

2013年3月31日 星期日

Latex 使用中文的範例


\documentclass{article}
\usepackage{CJKutf8}
\usepackage{graphicx}
\title{aaa}
\author{name}
\date{}
\begin{document}
\maketitle
\section{Abstract}
aaa
\includegraphics{aaa.eps}
\begin{CJK}{UTF8}{gkai}
这是一个楷体中文测试,处理简体字。
\end{CJK}
\begin{CJK}{UTF8}{gbsn}
这是一个宋体中文测试,处理简体字。
\end{CJK}
\begin{CJK}{UTF8}{bkai}
這是一個big5編碼的楷體中文測試,處理繁體文字。
\end{CJK}
\begin{CJK}{UTF8}{bsmi}
這是一個个big5編碼的明體中文測試,處理繁體文字。
\end{CJK}

\end{document}
預留格式,之後使用
用PDFLatex 編譯即可

2013年3月29日 星期五

gnuplot 安裝

假如在Ubuntu的軟體中心直接搜尋gnuplot 就可以直接安裝此元件 , 然後就可以直接使用了,
但是你在畫圖指令卻不能馬上產生圖案出來,會沒Fe~
所以要安裝gnuplot-x11的元件 , 會馬上產生圖案出來!!

安裝方法:

  1. 直接在軟體中心找到 gnuplot-x11  安裝即可使用
  2. 輸入指令:sudo apt-get install gnuplot-x11 亦可
執行方法:
  1. 輸入指令 :gnuplot          就可進入gnuplot 程式
  2. 測試畫圖 :plot sin(x)       會跳出圖形畫面

安裝NS2.35 失敗問題 "Ns make failed!"

我在安裝NS2.35 失敗 一直產生此訊息:


In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘void LsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map, std::allocator > >’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!

後來找到解決之道:

步驟:

  1. 到 ns-allinone-2.35/ns-2.35/linkstate/  資料夾
  2. 開啟ls.h 檔案
          第137行中, void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
           修改成 void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
     3.  再一次執行指令:./install  

經過漫長的等待~~   完成!!!

參考自:文章

Syntax error: Bad for loop variable 解決

再跑sh的指令 一直出現
  "Bad for loop variable " 的訊息
我一直以為是迴圈寫錯 , 後來上網查才知道是Ubuntu 設定問題

指令 :sudo dpkg-reconfigure dash

  出現此訊息:


再跑一次sh 檔案 就可以執行了.


參考自:文章

Ubuntu 12.10 + NS2.35 + NAM 1.5

因為這次作業要修改到NS2.35裡面的檔案,所以我就重灌NS2.35 , 後來參考另一個完整的教學,才成功灌好NS2.35和NAM

材料:
  1. sudo apt-get update
  2. tar xvfz ns-allinone-2.35.tar.gz
  3. sudo apt-get install build-essential autoconf automake libxmu-dev
  4. cd ns-allinone-2.35/
  5. ./install (假如失敗:參考此文章)
  6. cd
  7. gedit .bashrc(**)
  8. mv nam-1-20090106.tar.gz ns-allinone-2.35
  9. cd ns-allinone-2.35
  10. tar -zxvf nam-1-20090106.tar.gz
  11. sudo reboot
測試指令:
  ns ns-allinone-2.35/ns-2.35/tcl/ex/simple.t­cl

完成!!!

(**) 環境變數:

PATH=$PATH:$HOME/bin:./:/home/user/ns-allinone-2.35/bin:/home/user/ns-allinone-2.35/tcl8.5.10/unix:/home/user/ns-allinone-2.35/tk8.5.10/unix:/home/user/ns-allinone-2.35/nam-1.15

export LD_LIBRARY_PATH=/home/user/ns-allinone-2.35/otcl-1.14:/home/user/ns-allinone-2.35/lib

export TCL_LIBRARY=/home/user/ns-allinone-2.35/tcl8.5.10/library

要注意紅色記號要修改成你的ns-allinone-2.35的位置,不然就無法啟用ns和nam指令.


主要都參考此影片.



2013年3月13日 星期三

在Ubuntu 看批踢踢

如果直接登入,因為編碼的不同,會亂碼.

指令:luit -encoding big5 telnet ptt.cc

這樣就可以順利看了, 但是有些圖案排版還是會亂.

安裝新酷音輸入法在Ubuntu 12.10

新酷音輸入法就是微軟的新注音輸入法, 用Ubuntu 裡的內建輸入法就像是ㄅ半輸入法一樣難用!!

安裝過程:
1.在Terminal 下輸入指令
     (1)  sudo apt-get install scim scim-chewing; sudo im-switch -s scim-bridge
     (2)  scim

2.重新開機

3. 在系統設定值的語言支援的鍵盤輸入法系統要用ibus

切換輸入法:ctrl + space

完成!!!

2013年3月10日 星期日

NS2 in Ubuntu 12.10


1.   安裝NS2 指令:
       sudo apt-get install ns2
       sudo apt-get install nam
       sudo apt-get install xgraph

2. 執行NS2指令:
      nam
     
   youtube教學

    還是在Ubuntu 下安裝NS2 簡單又快速,不像windows要安裝很久,下次再來研究如何在windows下如何安裝.
       
 
 
Blogger Templates