2014年3月28日 星期五

change MySQL Password on Ubuntu

# service mysql stop
# mysqld_safe --skip-grant-tables &
$ mysql -u root

mysql> use mysql;
mysql> update user set password=PASSWORD("YOUR-NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

# service mysql stop
# service mysql start
$ mysql -u root -p

2014年3月6日 星期四

三星七吋平板玻璃

過年前趕捷運時,摔破了平板的玻璃(很像蜘蛛網); Pan Peter提醒我可以上網買; 所以到eBay跟香港買家花了NT$300+360運費, 自己把玻璃換好了! 


拆開後GP1000的內部
換好後, 又是一台新的, 而且不用貼保護貼了(保護貼跟玻璃一樣貴).

2014年3月1日 星期六

整合行銷傳播的第一堂

IMC是什麼?
Integrated Marketing Communication (IMC) is the application of consistent brand messaging across both traditional and non-traditional marketing channels and using different promotional methods to reinforce each other.   --- 來源: wiki


謝寶泰老師的Blog


http://imcntit.blogspot.tw/search/label/IMC%E7%90%86%E8%AB%96

優級的廣告影片
這個影片讓你想到作者想要傳達的什麼意念?

I think:
作者想要籍由一段影片,透過人與馬的情感即使經過長久的時間還是不會改變,讓Viewer聯想e到產品的形象,建立消費者的品牌忠誠...
Just I think. 只是我的第一堂,不要期望太高...



2014年2月11日 星期二

Install php5 on Cygwin

 

  1. Use the latest Cygwin installers : setup-x86.exe(32-bit), or setup-x86_64.exe( 64-bit).
  2. Launch setup-*.exe with the -K flag from Cygwin term. , e.g.:
    cygstart – c:/MyInstall/setup-x86_64.exe -K http://cygwinports.org/ports.gpg

  3. On Choose Installation Type page, select "Install from Internet".
  4. On Choose Download Site(s) page, select a distro mirror, then enter ftp://ftp.cygwinports.org/pub/cygwinports ftp://sourceware.org/pub/cygwinports in the User URL field and press Add (making sure that both are highlighted).

    • Alternatively, you can use a sourceware mirror, but if you do, you must use one hosted on a different server than your selected distro mirror.

  5. Proceed with package selection and installation, making sure to install any indicated dependencies.

hope this is help.

2013年11月3日 星期日

免費英文學習資源

1. Voicetube-看影片學英語

voicetube

全臺最大的看影片學英語社群,每日更新影片,提供最多最優質的英文學習內容。

包括TED Talks、TED-Ed 教育、CNN Student News、看卡通學英文、聽音樂學英文、

電影片段、電玩、英文技巧學習等超過4,000部英語學習影片。

其特色包括影片字幕導讀、重覆播放功能、字幕跟讀功能、學習進度追蹤、

全文字典單字查詢收藏、螢光標示佳句等。

 
2. BCC learning English

BCClearningEnglish

由英國廣播公司製作的免費英語教學網站,內容涵蓋聽說讀寫四方面,

結合時事、科技、人文,且有文法及片語介紹,

所有文章皆包含MP3語音檔、PDF講稿文字與簡單問答,適合想熟悉英國腔者。

 

3. CNN Student News
CNN

美國 CNN 電視台將每天發生的重大新聞濃縮成十分鐘,並附上 PDF 檔的新聞稿,

讀者僅需每天只要花十分鐘聽英文,即可增進英文能力並了解國際動脈。

 

4. TED
TED

TED分別代表的是科技 (technology)、娛樂 (entertainment)、設計 (design),

集結全世界各領域,對未來充滿熱情的講者,透過每場18分鐘的演講,

傳達優秀的思想可以改變人們的看法,使人們反思自己行為的理念。

TED提供英文演講內容、字幕及逐字稿,部分附有中文字幕。

 

5. CC Prose
CCProse

此影音頻道沒有華麗的畫面,只是很簡單的把書本念給您聽,

同時打上字幕,讓您可以邊聽邊讀。

2013年10月18日 星期五

在Windows PHP安裝ffmpeg-php


關於在Windows內使用ffmpeg-php, 網路上有很多方法, 
e.g. myownserver 在 How to install ffmpeg-php for Windows Apache HTTP Server 介紹安裝在xampp的方法, 從 http://sergey89.ru/files/ffmpeg-php/ 下載ffmpeg-php-5.3-win32-all.zip後, 逐步安裝後再用一支程式測試.
但是我是用AppServ + PHP 5.3.5 所以我用的方法

取得 ffmpeg-php
php.ini
首先解開之後, 先把 php_ffmpeg.dll 複製到 php5/ext內; php.ini 增加 一行 
extension=php_ffmpeg.dll

http.conf
我不喜歡複製到 System32 , 所以我在 http.conf 增加下列幾行:
#php 5.3
之前就有的
Loadfile "C:\AppServ\php5\php5ts.dll"
Loadfile "C:\AppServ\php5\libpq.dll"
 這次增加的
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\avcodec-52.dll"
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\avcore-0.dll"
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\avdevice-52.dll"                                                 
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\avfilter-1.dll"
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\avformat-52.dll"
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\avutil-50.dll"
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\pthreadGC2.dll"
Loadfile "C:\AppServ\php5\ext\ffmpeg-php-5.3.1\swscale-0.dll"

phpinfo測試

測試ffmpeg.php
結果畫面

done.

PHP在Windows環境下執行

名詞解釋

首先說明VC6及VC9:

VC6 : 就是使用 Visual Studio 6 compiler 這個編譯器編譯的.
VC9 : 就是用微軟的 Visual Studio 2008 compiler 編譯的.
TS : Thread Safe 線程安全, 執行時會進行線程(Thread)安全檢查, 以防止有新要求就啟動新線程的CGI執行方式而耗盡系統資源
NTS : Non Thread Safe 非線程安全, 在執行時不進行線程(Thread)安全檢查
ISAPI(Internet Server Application Programming Interface)執行方式是以DLL動態庫的形式使用, 可以在被用戶請求後執行, 在處理完一個用戶請求後不會馬上消失, 所以需要進行線程安全檢查, 這樣來提高程序的執行效率.
FastCGI : 執行方式是以單一線程來執行操作, 所以不需要進行線程的安全檢查, 除去線程安全檢查的防護反而可以提高執行效率.

 

PHP 官網說明:

Which version do I choose?

If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9
Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed

Do NOT use VC9 version with apache.org binaries
 

Thread Safe線程安全

Linux 使用多進程(process)不同於Windows採用的多線程(Thread)的工作模式; 而CGI是以Linux的多進程所設計的, 所以如果在IIS 的 PHP 使用 CGI 模式, 每次HTTP的請求PHP都需重新加載及缷載, 所以速度慢。
IIS另外一個選擇是使用ISAPI的方式(早期的ASP.NET也是用這種方式), 因為php5nsapi.dll是用多線程設計的(Thread safe),符合Windows多線程的設計,速度較快。
但是在選擇PHP Extension時就要注意, 必須使用TS(Thread safe)的版本, 否則會搞垮IIS. 但是大部份的PHP_Extension都是針對Linux的多進程設計的.
為了在Windows IIS兼顧速度及線程安全, 微軟推出FastCGI; FastCGI保留了CGI的工作模式, 又提供一個pool機制管理重覆使用的進程, 確保non-thread-safe的libraries可以正常執行。
 

結論

使用ISAPI方式, php extension 就要用Thread Safe的版本; 如果使用FastCGI就不用Thread Safe(non-thread-safe)了,效能還更好呢.