2015年6月27日 星期六

程式設計概論0628

# 上上週課程複習
# 輸入窗
import javax.swing.*;
// input is String
        BufferedReader buf;
        String str1;
        buf=new BufferedReader(new InputStreamReader(System.in));
        str1=JOptionPane.showInputDialog("Input Integer Num. :");
// str1 to integer(a)
        int a;
        a=Integer.parseInt(str1);
// show dialog
JOptionPane.showMessageDialog(null,"Input Error, range 0~100");

# 邏輯運算子
# && and 所有為真即為真
# || or 只要有一個題就是真

A && B  T || F
T    T  F    T

# 0 以下;100 以上
# 50~59 之間要補考
a < 0 || a > 100
a < 60 && a > 49

# 結樣設計
循序性
由上至下

開始
 |
敘述1
 |
敘述2
....|
敘述n

# 選擇性結構
根據判斷條件成立與否,決定程式該執行哪一個敘述。
if_else
switch_case

# 重複性結構
根據判斷條件成立與否,決求程式執行的次數。
for
while
do-while

# 條件運算子 ?:
# 此為 if-else 的簡潔版
傳回值 = (判斷式)?true:false;

# for 迴圈
for (設定初值;判斷條件;設定增減量)
{
        程式敘述;
}

# while 迴圈
設定初值;
while(判斷條件){
        程式敘述;
        設定增減量;
}

# do-while 迴圈
設定初值;
do
{
        程式敘述;
        設定增減量:
}while(判斷條件);

# break 敘述,跳離迴圈外
for(.....){
        程式敘述;
        ...
        break;
        ...
        程式敘述(不會執行);
}

# continue 敘述,跳至迴圈初始
for(.....){
        程式敘述;
        ...
        continue;
        ...
        程式敘述(不會執行);
}

# switch_case
switch(運算式)
{
        case1:
        敘述;
        break;

        case2:
        敘述2;
        break;

        ...

        default;
}

# 陣列
存放相同資料型態的資料。

# 陣列宣告:
資料型態 陣列名稱[] = new 資料型態[個數]

 (1) 宣告陣列名稱。
 (2) 利用 new 配置記憶體區塊。
 (3) 下面三種位置都能宣告,但不能在 int 前面。
int arr[];
int[] arr;
int []arr;

# 陣列初值設定
# 假設有間旅館 arr,有五個房間,房間編號 0,1,2,3,4,分別五個客人{1,2,3,4,5}
int arr[]={1,2,3,4,5};

# 也可以先設定好陣列數,但不放資料。
int arr[]=new int[5];
arr[0]=3;
arr[1]=7;
arr[2]=8;
# 沒宣告初值的陣列會自動補資料 0,所以 arr[3]=arr[4]=0

# 陣列長度
陣列名稱.length;

Bluetooth 藍芽配對連接

Debug 在置底。

---------------------------------------------------------------------
說明:筆者使用於筆電之內建藍芽與藍芽機械式鍵盤進行配對 。

*** 規格 ***
系統: Debian Jessie 8.0
核心:3.18.21
筆電:Acer VN7-591G
鍵盤:ZIPPY BW7050
---------------------------------------------------------------------
查看無線驅動:
lspci -k|grep -iA2 Network
0d:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
Subsystem: Foxconn International, Inc. Device e052
Kernel driver in use: ath9k
---------------------------------------------------------------------
檢查驅動:
lsmod |grep ath9k
lsmod |grep bluetooth
---------------------------------------------------------------------
安裝 bluetooth 套件:
apt-get update
apt-get install bluetooth bluez
apt-get upgrade -y
---------------------------------------------------------------------
啟動服務:
systemctl enable bluetooth.service
systemctl start bluetooth.service
systemctl status bluetooth.service
---------------------------------------------------------------------
設定檔:vi /etc/default/bluetooth
# Defaults for bluez-utils

# This file supersedes /etc/default/bluez-pan. If
# that exists on your system, you should use this
# file instead and remove the old one. Until you
# do so, the contents of this file will be ignored.

# start bluetooth on boot?
# compatibility note: If this variable is not found bluetooth will
# start
BLUETOOTH_ENABLED=1

# This setting will switch HID devices (e.g mouse/keyboad) to HCI mode, that is
# you will have bluetooth functionality from your dongle instead of only HID.
# Note that not every bluetooth dongle is capable of switching back to HID
# mode, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=355497
HID2HCI_ENABLED=1
HID2HCI_UNDO=1
---------------------------------------------------------------------
常用指令:
hciconfig: 顯示本機藍芽裝置
hciconfig -a: 顯示本機藍芽裝置詳細資訊
hciconfig hci0 up/down: 啟用 / 關閉第一個藍芽裝置 ( hci0 )
hcitool dev: 顯示本機所有藍芽裝置address
hcitool scan: 搜尋周邊欄芽裝置
---------------------------------------------------------------------
無線裝置軟/硬體開關 (blocked:no 為裝置開啟):
sudo rfkill list
0: acer-wireless: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: acer-bluetooth: Bluetooth
Soft blocked: no
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: yes
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
sudo rfkill block all -----------> 關閉全部無線裝置
rfkill unblock bluetooth--------> 只開啟 bluetooth
---------------------------------------------------------------------
使用 bluetoothctl 指令配對連線:
bluetoothctl -----------> 進入 bleutoothctl 指令模式 exit  quit 可離開

以下為 [bluetooth]# 下的指令:
help
version
power on -------------> 開啟藍芽
list --------------------> 查看本機 Bluetooth
discoverable off -------> 筆電藍芽不開放給別人看到
pairable off ------------> 筆電藍芽不開放給別人配對
scan on ----------------> 開啟掃描,此時會抓到我的鍵盤 BT address
[NEW] Device AB:CD:EF:00:11:22 我的鍵盤 BT Address

開始連線 ( [bluetooth]# 下):
info AB:CD:EF:00:11:22 -----> 查看鍵盤藍芽裝置
pair AB:CD:EF:00:11:22 -----> 配對
trust AB:CD:EF:00:11:22 -----> 加到信任
unblock AB:CD:EF:00:11:22 -> 不阻擋
connect AB:CD:EF:00:11:22 -> 連線

此時沒意外話,可以連上鍵盤了。
---------------------------------------------------------------------
Debug

善用幾個指令 debug 看系統訊息,方便至 google 爬文。
dmesg | grep -i bluetooth
sudo grep bluetooth /var/log/syslog
systemctl status bluetooth
---------------------------------------------------------------------
Debug1

核心驅動問題
cd /usr/src/linux
make menuconfig

進入 -*- Networking support  ---> <M>   Bluetooth subsystem support  --->
--- Bluetooth subsystem support
       [ ]   Bluetooth 6LoWPAN support
          RFCOMM protocol support
       [*]     RFCOMM TTY support
          BNEP protocol support
       [*]     Multicast filter support
       [*]     Protocol filter support
          CMTP protocol support
          HIDP protocol support
             Bluetooth device drivers  --->

進入 -*- Networking support  ---> <M>   Bluetooth subsystem support  ---> Bluetooth device drivers  -->
 HCI USB driver 
        HCI SDIO driver
        HCI UART driver
       [*]   UART (H4) protocol support
       [*]   BCSP protocol support
       [*]   Atheros AR300x serial support
       [*]   HCILL protocol support
       [*]   Three-wire UART (H5) protocol support
        HCI BCM203x USB driver
        HCI BPA10x USB driver
        HCI BlueFRITZ! USB driver
        HCI DTL1 (PC Card) driver
        HCI BT3C (PC Card) driver
        HCI BlueCard (PC Card) driver
        HCI UART (PC Card) device driver
        HCI VHCI (Virtual HCI device) driver
        Marvell Bluetooth driver support
          Marvell BT-over-SDIO driver
        Atheros firmware download driver

save ---> exit
time make-kpkg --initrd --revision=$version kernel_image -j $CORE
dpkg -i linux-image-$version_amd64.deb
reboot
.
.
.
其他驅動問題,參考 http://ubuntuforums.org/showthread.php?t=2251009

至 http://drvbp1.linux-foundation.org/~mcgrof/rel-html/backports/ 下載對應核心之 backport 檔,接著做:
cd Desktop/backports-3.18-rc1-1
make defconfig-ath9k
make
sudo make install
sudo reboot
---------------------------------------------------------------------
Debug 2

hciconfig ------> 無輸出
hcitool dev ----> 無裝置
hcitool scan ---> 無輸出

查看無線 WiFi/Bluetooth 卡是不是 Atheros 的?
lspci -k |grep -i network

參考 http://unix.stackexchange.com/questions/146097/bluetooth-device-not-working-debian-wheezy
可以試試安裝
apt-get install firmware-atheros
---------------------------------------------------------------------
Debug 3

因本人在編譯其他軔體時,不小心誤將 Bluetooth 的其中一個 firmware 刪除或覆蓋,因此在開機的時候,就顯示如下圖:



使用以下指令也可以看到此錯誤訊息:
dmesg | grep -i bluetooth

使用下列指令去尋找 ar3k 這個資料夾:
find / -name ar3k

確實裏面找不到 ramps_0x11020100_40.dfu 這個檔案

可以到以下網址去下載:
http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/ar3k

將所缺失的檔案載入,就ok了。

然後在 reboot 。
---------------------------------------------------------------------








Reference:
https://wiki.debian.org/BluetoothUser




2015年6月14日 星期日

設定指令優先權(Java 安裝為例)



update-alternatives --install <連結> <名稱> <路徑> <優先權>
update-alternatives --config <指令>



範例來說明:
當我們想裝最新版本的 Java,但又本身電腦裝有舊版時,
但想要兩者皆保留,而目前需要使用的是最新版本。

1. 查看目前版本,下面 "1.7.0_79" 是舊版:
java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

2. 下載最新版本:
Java SE Development Kit 8u45

這邊我是選擇下載 jdk-8u45-linux-x64.tar.gz

3. 解壓縮
sudo tar xfva jdk-8u45-linux-x64.tar.gz -C /opt

4. 設定 PATH (一般USER)
cd ~
vi .bashrc
PATH=$PATH:/opt/jdk1.8.0_45/bin
source .bashrc

5. 新增優先權選項
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0_45/bin/java" 1

6. 設定 /urs/bin/java 這指令優先權
sudo update-alternatives --config java
  選項       路徑                                          優先權  狀態
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      自動模式
  1            /opt/jdk1.8.0_45/bin/java                        0         手動模式
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      手動模式
選擇 1  enter

7. 檢查版本,要可以看到最新版
java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)




2015年6月13日 星期六

程式設計概論0614

Data Type
 char = 字元


 byte = 整數
 short
 int
 long


float = 浮點數
double


boolean = 布林



 Data Type 變數名稱 = _____ ; 初始值 

※注意大小寫
※英文字母,數字or底線

#################################################################################

for example2

 //變數的宣告

 public class Test3{
                      public static void main (String args[]){
                                 int num1=2; //int num1=2, num2=3; int num2=3;
             
                                       System.out.println("I have "+num1+" dog"+".");
                                       System.out.println("He has "+num2+" dog"+".");
                                       System.out.println("So we are have "+(num1+num2)+" dogs"+".");                                                        System.out.println("Sol:"); System.out.println(num1+" + "+num2+" = "+(num1+num2)); 
            }
}

 #################################################################################

Ans:


#################################################################################

 ※ 跳脫字元 

\n ---> 換行
\+ ---> Tab
\\ ---> 斜線
\" ---> 雙引號
\' ---> 單引號

#################################################################################

 for example 4

 //字元宣告

 public class Test4{
                             public static void main(String args[]){

                                    char c1=71; // ASCII
                                    char c2='G'; // 字母
                                    char c3='\u0047'; // unicode
                                    char c4='\"'; // "
                            System.out.println(c1+","+c2+","+c3);
                            System.out.println("\"Spring is coming.\"");
                            System.out.println(c4+"Spring is coming."+c4); 
               }
}

 #################################################################################

Ans:


#################################################################################

//Data Type Change

1. 轉換前的資料型態要和轉換後相容。
2. 轉換後的資料型態要大於轉前。
※(資料型態) 變數名稱。

#################################################################################

for example 5

//字元宣告

public class Test5{
public static void main(String args[]){

int a=47; //
float b=2.3f; //
int c=36,d=7;        //

System.out.println("Sol:");
System.out.println("a= "+a+" , "+" b= "+b);
System.out.println(a+"/"+b+" = "+(a/b));
 System.out.println("c= "+c+" , "+" d= "+d);
System.out.println(c+"/"+d+" = "+(double)c/d);
}
}


#################################################################################

Ans:


#################################################################################

※String 轉 數值

Byte.parseByte()

Short.parseShort()

Integer.parseInt()

Long.parseLong()

Float.parseFloat()

Double.parseDouble()


#################################################################################

※for example 相乘  (Swing)

//
import javax.swing.*;

public class SwingDemo{
public static void main(String args[]){

String str; //負責接收輸入的data
int num; //負責轉換後的data

 str=JOptionPane.showInputDialog("Input number:"); //將輸入值指定給str
 num=Integer.parseInt(str); //將轉換後的值指定給給num
JOptionPane.showMessageDialog(null,(num*num));

}
}

#################################################################################



一元運算子

+   --->  正號
-    --->  負號

算數運算子

+
-
*
/
%  ---> 取餘數, ex: a=5%3 = 2

if 敘述和關係運算式

>
<
=
!=
==

#################################################################################

遞增遞減運算子

++
--





2015年6月11日 星期四

Beamer 範本:每週進度報告

以下為我個人使用的範本:

檢視:mybeamer.pdf
下載:mybeamer.tex

編譯方式 (若有 .bib 檔可能需要先 rm 刪除掉):
xelatex mybeamer
bibtex mybeamer
xelatex mybeamer
xelatex mybeamer

evince mybeamer.pdf



vi mybeamer.tex

% version 2015/06/06
%===============================================================
% LaTeX Beamer environment setting
\documentclass[xetex,mathserif,serif,xcolor=dvipsnames]{beamer}
%\usepackage{fontspec,xunicode,xltxtra} %可自定義 fonts 的套件
%\usepackage[nodayofweek]{datetime}% 設定 \today 套件
\usepackage{listings} %% 程式語言 demo 套件

%自訂一個 \myday 時間格式
%\newdateformat{mydate}{\twodigit{\THEDAY}{ }\shortmonthname[\THEMONTH], \THEYEAR}

%\usepackage{datenumber}%時間計數器
%\usepackage[top=2cm,botton=2cm,left=2cm,right=2cm]{geometry}

% 解決 XeTeX 中文的斷行問題
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
%\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt

% WebLink
\usepackage{url, hyperref}

% Table Setting
\usepackage{color, colortbl}
\usepackage{caption}
\captionsetup{skip=0pt,belowskip=0pt}
%===============================================================
%% 字型 Fonts Setting
%% http://hyperrate.com/thread.php?tid=23544

% 預設英文字體
\usepackage{arevmath}
\usepackage[no-math]{fontspec}
\setmainfont[Scale=0.9]{DejaVuSansMono}
%\setmainfont[Mapping=tex-text,LetterSpace=-1.25]{DejaVu Sans}
%\setsansfont[Mapping=tex-text,LetterSpace=-1.25]{DejaVu Sans}
%\setmonofont[Color=00663300]{DejaVu Sans Mono}

% 預設中文字體
\usepackage[CJKchecksingle, normalindentfirst, SlantFont, BoldFont]{xeCJK}
\setCJKmainfont{金梅新中楷國際碼}
%\setCJKmainfont[Scale=1.2,BoldFeatures={FakeBold=1.8}]{金梅新中楷國際碼}
%\setCJKmonofont[Scale=1.2,BoldFeatures={FakeBold=1.8},FakeStretch=1.11686,Color=00663300]{金梅新中楷國際碼}

% 自定義字體切換指令
% 中文
\newfontfamily{\J}{金梅新中楷國際碼}
\newfontfamily{\B}{華康中黑體}

% 英文
\newfontfamily{\D}[Scale=0.9]{DejaVuSansMono}
\newfontfamily{\T}{Times New Roman}
\newfontfamily{\A}{Arial}

% 粗體字 / 斜體字
% \textbf{粗體內容}
% \textit{斜體內容}
%===============================================================
%% Theme 設定主題樣式
%%底部可以加上標題,要注意的是一定要在選定主題 \usetheme 之前就使用
%\useoutertheme{infolines}

%% 參考樣式 https://www.hartwork.org/beamer-theme-matrix/
%% http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme_and_color.html
%% 內設的主題 http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html
%% AnnArbor, Antibes, Bergen, Berkeley, Berlin,
%% Boadilla, CambridgeUS, Copenhagen, Darmstadt, Dresden, Frank-
%% furt, Goettingen, Hannover, Ilmenau, JuanLesPins, Luebeck,
%% Madrid, Malmoe, Marburg, Montpellier, PaloAlto, Pittsburgh,
%% Rochester, Singapore, Szeged, Warsaw, boxes
% OK 的:
%Rochester, Copenhagen, Frankfurt, Copenhagen, Luebeck, Warsaw, Boadilla
%\usetheme{Madrid}
\usetheme[height=0mm]{Rochester}%這邊設定投影片標題高度,0 是因為下方設定
%\usetheme{Boadilla}
%===============================================================
%% Color Theme設定投影片顏色
% http://en.wikibooks.org/wiki/LaTeX/Presentations
% 內設顏色: red, magenta, green, blue, cyan, yellow, black, darkgray, gray, lightgray, orange, violet, purple, brown, SeaGreen
\usecolortheme[named=SeaGreen]{structure}

% 內設主題顏色:default, albatross, beaver, beetle, crane, dolphin, dove, fly, lily, orchid, rose, seagull, seahorse, whale, wolverine
%\usecolortheme{beaver}

%============================================================
% 設定投影標題樣式
% 感覺不太出來
%\setbeamertemplate{blocks}[rounded][shadow=true]

% 設定列表樣式
% 可以選擇:ball, circle, rectangle, default
\setbeamertemplate{items}[ball]

% 設定圖片標號
\setbeamertemplate{caption}[numbered]
%============================================================
%隱藏 beamer 底部小工具列
\setbeamertemplate{navigation symbols}{}

%============================================================
% 自訂 footline
%\setbeamerfont{footline}{size=\fontsize{9}{11} \selectfont}
%\setbeamerfont{footline}{size=\fontsize{5}{5} \D \selectfont}

%%% 自訂 Page Number
%\setbeamertemplate{footline}[frame number]

\setbeamercolor{footline_blue}{fg=blue}
\setbeamercolor{footline_black}{fg=black}
\setbeamerfont{footline}{series=\bfseries}
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
% \usebeamercolor[fg]{footline}%
\hspace{1em}%
{
\usebeamercolor[fg]{footline_blue}\insertframenumber
\usebeamercolor[fg]{footline_black}/\inserttotalframenumber
}
}

%======================================================================
%% Reference Table 參考文獻建表
% https://www.sharelatex.com/learn/Bibliography_management_in_LaTeX#The_bibliography_file
% http://tex.stackexchange.com/questions/3587/how-can-i-use-bibtex-to-cite-a-web-page
% http://tex.stackexchange.com/questions/68080/beamer-bibliography-icon
% https://zh.wikipedia.org/wiki/BibTeX

\begin{filecontents}{\jobname.bib}
@book{b1,
title={USB 2.0 系統開發實例精解},
author={廖濟林},
isbn={9789861990040},
year={2007},
publisher={城邦文化事業股份有限公司},
keywords = {USB}
}
@misc{WinNT,
title = {{MS Windows NT} Kernel Description},
howpublished = {\url{http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm}},
note = {Accessed: 2010-09-30}
}

@misc{mcp2200,
title={MCP2200},
howpublished={\url{http://www.microchip.com/wwwproducts/devices.aspx?dDocName=en546923}},
note={Accessed:2015-06-06}
}

\end{filecontents}
%======================================================================
%% Reference Setting 參考文獻環境設定
%% http://tex.stackexchange.com/questions/147279/references-at-the-end-of-beamer-slides
%% https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM
%% http://tex.stackexchange.com/questions/147279/references-at-the-end-of-beamer-slides

\usepackage{cite}
\usepackage{natbib}

%\usepackage{natbib}
%\usepackage{bibentry}
%\usepackage{chngcntr}
%\bibliographystyle{apalike}
%
%\setbeamercolor*{bibliography entry title}{fg=black}
%\setbeamercolor*{bibliography entry author}{fg=black}
%\setbeamercolor*{bibliography entry location}{fg=black}
%\setbeamercolor*{bibliography entry note}{fg=black}
%\setbeamertemplate{bibliography item}{}
%%\setbeamertemplate{bibliography item}{\insertbiblabel}
%\setbeamertemplate{frametitle continuation}[from second]
%
%\counterwithin*{footnote}{page}
%\newcommand\fcite[1]{\footnote{\tiny \bibentry{#1}}\label{\thepage:#1}}
%\newcommand\scite[1]{\textsuperscript{\ref{\thepage:#1}}}
%
%\nobibliography{\jobname}
%=======================================================================
\begin{document}
%======================================================================%% 標題設定 Title Setting
% 重設 frametitle 的預設為置中,上方的 usetheme 要改為 [height=0]
\setbeamertemplate{frametitle}[default][center]

% 自定義 title 格式
%\usepackage{titlesec}
%\titleformat{\section}{\Large\xbsong}{\thesection}{1em}{}

%%% Title Setting 1 自訂亂設法
% 指令 \datedate 可以設定為 \date 加減幾天
%\setdatetoday
%\addtocounter{datenumber}{-7}
%\setdatebynumber{\thedatenumber}
%\date{\large 2015/03/26}

%\begin{frame}
% \begin{titlepage}
% \begin{center}
% {\Huge 每週進度報告}\\% 標題內容
% \vspace{.5cm}% 0.5cm 垂直空間
% \rule{\textwidth}{3pt}\\% 粗分隔線
% \vspace{.5cm}% 0.5cm 垂直空間
% {\LARGE 指導教授:李博明\\
% MA330101 廖凱霖}
% \end{center}
% \end{titlepage}
%\end{frame}
%----------------------------------------------------------------------------
%%% Title Setting 2 正規設法
%% http://tex.stackexchange.com/questions/26848/beamer-font-size-for-footer

%\title[footline title]{\Huge Real Title}
\title[每週進度報告]{\huge 每週進度報告}
%\title[每週進度報告]{\fontsize{20}{25} \selectfont 每週進度報告}

\author{MA330101 廖凱霖}
%\author{ MA330101 廖凱霖}
%\author{{\large 指導教授:李博明\\
% {\D MA330101} 廖凱霖}}

%\institute{機構}

%\date{\D \number\year/\number\month/\number\day}% 自排格式
\date{2015/06/11}
%======================================================================
%% 投影片開始 Frame Start
% 印出標題
\begin{frame}[fragile]
\titlepage
\end{frame}

% Outline
\begin{frame}[fragile]
\frametitle{Outline}
\tableofcontents % 插入目錄
\end{frame}

% TEST Test test page
\section{Test Page}
\frame{\frametitle{Outline}\tableofcontents[currentsection]}
\begin{frame}
\frametitle{Test Page}
\begin{itemize}[<+->]
\item \textbf{正規粗體法 English 0oO}
\item \textit{測試斜體字 the word 0Oo}
\item Is it socially\nocite{WinNT} stratified?\cite{b1}
\item Sauss\cite{mcp2200} said some stuff
\end{itemize}
\end{frame}

% Road map
\section{Road map}
\begin{frame}[fragile]
\frametitle{Outline}
\tableofcontents[currentsection] %% 插入所在目錄
\end{frame}
\begin{frame}[fragile]
\frametitle{行程規劃 (Road Map)}
\begin{itemize}
\item date word
\end{itemize}
\end{frame}

% Last Week Issue
\section{Last Week Issue}
\begin{frame}[fragile]
\frametitle{Outline}
\tableofcontents[currentsection] %% 插入所在目錄
\end{frame}
\begin{frame}[fragile]
\frametitle{上週 lastweek 遭遇問題及後續}
\end{frame}
% This week progress rate
\section{Progress Rate}
\begin{frame}[fragile]
\frametitle{Outline}
\tableofcontents[currentsection] %% 插入所在目錄
\end{frame}
\begin{frame}[fragile]
\frametitle{本週 thisweek 進度}
\begin{itemize}
\item first
\item second
\item three
\end{itemize}
\end{frame}

% This week issue
\section{This Week Issue}
\frame{\frametitle{Outline}\tableofcontents[currentsection]}
\begin{frame}[fragile]
\frametitle{本週所遭遇問題及可能解法}
\begin{block}{問題:這邊輸入問題}
可能的解法:這邊輸入可能的解法...
\end{block}
\end{frame}

% Next week progress plan
\section{Next Week Plane}
\frame{\frametitle{Outline}\tableofcontents[currentsection]}
\begin{frame}[fragile]
\frametitle{下週 {Nextweek} 預計進度}
\end{frame}

%% 範例10: 參考文獻
\section{Reference}
\frame{\frametitle{Outline}\tableofcontents[currentsection]}
\frame{ \frametitle{Reference}
\tiny{\bibliographystyle{abbrv} } % 文獻標號
\bibliography{\jobname} } % 文獻來源
%======================================================================
%% 範本 1
%\begin{frame}
% \frametitle{投影片標題}
% \begin{block}{小重點}
% 試試 block 的使用方式
% \end{block}
% \begin{alertblock}{大重點}
% 特別重要的東西
% \end{alertblock}
% \alert{這一點重要}\\
% \alert<2>{第二張才重要}\\
% \color<4>{green}{第四張時是綠色}\\
% \color<6>{brown}{第四張時是棕色}\\
%\end{frame}

%% 範本2: 插入圖片,pdf, .png, .jpg
%\begin{frame}
% \begin{figure}
% \centering
% \includegraphics[scale=.5]{foo.png}
% %\includegraphics[width=0.5\textwidth]{foo.png}
% \end{figure}
%\end{frame}

%% 範本3: 條列式
%\begin{frame}
% 我們先說明...
%%% itemize, enumerate, description
% \begin{itemize}% 指定頁顯示
% \item<1-> 第一項
% \item<2-> 第二項
% \item<6-> 第三項
% \end{itemize}
% \begin{itemize}[<+->]% 逐頁顯示
% \item 第一項
% \item 第二項
% \item 第三項
% \end{itemize}
% % 暫時跳脫去下面說明
% \pause
% 然後可以發現...
% \pause
% % 指定該 frame 後第幾個投影片出現
% 我們知道「\only<6->{第二張以後才會出現}」°\\
% 我們知道「\uncover<6->{第二張以後才會出現}」°
% % 直接跳到投影片 here label 位置
% \hyperlink{here}{\beamerbutton{去這篇投影片}}
%\end{frame}
%
%% 範本4: 投影片標籤 here
%\begin{frame}[label=here]
% 過來這裡
%\end{frame}

%% 範本5: 原文照例 \verb 用法
%\begin{frame}
%\begin{frame}[fragile]% 重點要記得加入 fragile
%\begin{verbatim}
% 輸入原文
%\end{verbatim}
%\end{frame}

%% 範本6: Web Link
%\href{http://tex.stackexchange.com/q/20800/5701}{\beamergotobutton{Link}}

%% 範本7: Table
% http://www.tablesgenerator.com/
% https://www.sharelatex.com/learn/Tables

%% 範例8: outline, current section
%\section{第一點}
%\frame{\frametitle{Outline}\tableofcontents[currentsection]}

%% 範例9: Coding
%% https://www.sharelatex.com/learn/Code_listing#Supported_languages
%% language support: bash, Java, C++, PHP, Python, Latex, HTML...
%\begin{frame}[fragile]
% \lstset{language=C++, keywordstyle=\color{blue}, stringstyle=\color{red}, commentstyle=\color{green}, morecomment=[l][\color{magenta}]{\#}}
% \begin{lstlisting}
% void make_set(int X) {
% parent[X] = X;
% }
% \end{lstlisting}
%\end{frame}

%%% 範例10: 參考文獻
%\section{Reference}
%\frame{\frametitle{Outline}\tableofcontents[currentsection]}
%\frame{ \frametitle{Reference}
% \tiny{\bibliographystyle{abbrv} } % 文獻標號
% \bibliography{\jobname} } % 文獻來源

%%% 範例11: 表格 Table
% http://www.tablesgenerator.com/latex_tables#
% \captionof{table}{USB 分析儀市場調查表}
% \begin{table}[h]
% \begin{tabular}{|l|r|}
% ...
% \end{tabular}
% \end{table}

\end{document}

LaTeX 環境建置



一、安裝
sudo apt-get install texlive-full latex-cjk-all

二、設定字型

1. 查看目前系統字型支援
fc-list

2. 字型檔路徑
/home/$USER/.fonts

我的字型檔(不要公開):https://drive.google.com/file/d/0BxEiZ5gd9umbeDgwWWJydk9pWE0/view?usp=sharing

3. 其他免費字體:
sudo apt-get install xfonts-wqy ttf-wqy-microhei ttf-wqy-zenhei


2015年6月6日 星期六

Wicd 網路管理程式(適用 Wireless)

一、 安裝
su
apt-get update
apt-get install wicd

二、 執行
wicd-client

三、 操作

 1. 開啟 WiFi,並搜尋可連線網路。

2. 若 WiFi 需要密碼,則選「特性」。

3. 設定密碼 ( 下次使用會記憶起來)

4. 點選「連線」,正常來講即可連上 WiFi

5. 使用完畢,可以直接「斷線」或「關閉 WiFi」。



Teamviewer 遠端連線程式

Teamviewer 遠端連線程式,可免去 VPN 直接控制,
Windows - Linux 都可以互相連線。
於 Debian Jessie 使用 Teamviewer 只能裝 i386 本版!


1. 下載
teamviewer_10.0.41499_i386.deb

2. 更新 ATP i386 套件庫
sudo dpkg --add-architecture i386
sudo apt-get update

3. 安裝
dpkg -i teamviewer_10.0.41499_i386.deb
apt-get -f install -y
dpkg -i teamviewer_10.0.41499_i386.deb

4. 執行 (一般使用者)
teamviewer

5. 下次開機不要啟動
因為 teamviewerd.service 開著的話,關機會很慢,
故設定下次開機不自動啟動,需要使用在開!

關閉:
sudo systemctl disable teamviewerd
sudo systemctl stop teamviewerd
sudo systemctl status teamviewerd

下次開機要使用:
sudo systemctl start teamviewerd
teamviewer






Reference:
http://steronius.blogspot.tw/2014/08/install-teamviewer-9-in-64bit-debain.html