Feed on
Posts
Comments

Monthly Archive for January, 2009

[Google]Offline Gmail 新功能

今天看到 Gmail 的新功能:Offline Gmail 可以讓使用者離線瀏覽自己的 Gmail 信箱,看到 New in Labs: Offline Gmail 這篇,裡面有一個影片非常的詳細介紹了這個 Offline Gmail 的好處,它利用了 Gears 來下載您的 mail 資料放於 local cache,這 cache 可以自動地 synchronized Gmail’s Server,當您失去了網路連線,Gmail 就會自動切換到 offline mode,然後轉換存取到您的電腦硬碟,來取代網路連線的模式。 底下是 google 的一段影片

Read Full Post »

最近在高雄面試的時候,被問到的資料庫問題,什麼是 left join,out join,inner join,其實這些都是寫基本 SQL 語法需要知道的,當然我比較少用到 out join,不過還是要知道一下比較好喔,底下來說明一下這些,整理一些心得 表格 test1 資料表 表格 test2 資料表

Read Full Post »

在 ptt bbs 的 AJAX 版討論到如何判斷計算有幾個中文字數,那 TonyQ 兄跟 toshii 兄分別提供了兩種方法,我自己測試了一下包含全形字型,如:?,。…這些都算喔,我自己想到 中華電信 emome 的簡訊系統也會有判斷數字加上英文跟中文字的算法,看了一下大致上都是相同的。 TonyQ 解法: /* 利用 regex pattern */ function chineseCount(word){     return word.split(/[\u4e00-\u9a05]/).length -1; } var word="test中asd文asd字as到底asd有幾asd個?"; alert(chineseCount(word));

Read Full Post »

筆記一下自己常用的 find 指令,適用於 FreeBSD 或者是 Linux 各大 distribution,系統管理這個指令就相當重要了,在搭配 grep,sed,awk,perl 可以快速找到自己要的檔案。我自己本身很常用到 grep,find,awk 這些撰寫 shell script。 底下先來介紹一下 find: 1. 找出 . 底下的 php 檔案 # # find . -name "*.php" 2. 找出 . 底下非 php 副檔名檔案 # # find . -not -name "*.php"

Read Full Post »

其實還蠻簡單的,只是想紀錄一下,利用 awk 或者是 perl command line 找出非系統產生的帳號 perl: # # perl 寫法 # perl -an -F: -e ‘if ($F[2] >= 1000) { print $F[0],"\n"; }’ passwd awk: # # awk 寫法 # awk -F ":" ‘($3 >= 1000) { printf $1 "\n"}’ /etc/passwd

Read Full Post »

今天看到一篇:[教學]用 cvsup-mirror 架設 CVSup Server (mirror site),自己就來架設一下,其實還蠻容易的,因為 FreeBSD Ports 都已經包好,所以安裝起來也不困難,利用 cvsup-mirror 這個軟體就可以架設完成了,那如何在台灣找尋一台最佳連線速度的 mirror 伺服器呢,利用 fastest_cvsup 這個 ports 軟體,就可以了,當 FreeBSD 剛安裝完成,就是要先設定 cvsup mirror 的站台,我自己都是用 cvsup.tw.freebsd.org,這伺服器是交大資工架設,domain 同 freebsd.csie.nctu.edu.tw,我們利用 fastest_cvsup 可以另外找尋更好的伺服器。 # # ports 安裝 # cd /usr/ports/sysutils/fastest_cvsup make install clean 說明如何使用指令: # # 找尋台灣區最佳的伺服器 # fastest_cvsup -c tw # # 找尋最上層 cvsup 伺服器,如 cvsup.freebsd.org # fastest_cvsup -c [...]

Read Full Post »

[PHP]製作類似 google 網頁認證碼

我在 網站製作學習誌 發現一篇 [Web] 連結分享 裡面有一篇:用php做出類似Google的字詞驗證圖片,這一篇寫的不錯,跟我之前寫的一篇:[PHP] 好用的留言板 驗證碼 功能,驗證碼的強度還要更好,畢竟這樣比較不會被破解,然而這篇加上許多干擾的驗證,也選用了比較複雜的字型來提供給網站驗證部份,在 google 的登入系統部份,剛開始都是給使用者方便,不會跑出驗證碼的部份,可是只要輸入幾次錯誤的帳號密碼之後,google 的驗證碼就會跑出來了,而這個很類似 google 的驗證碼提供給大家使用,當然也感謝原作者,因為在Google字詞驗證與 CAPTCHA 都已經相繼被破解,這消息我不知道從哪裡來的,在 這裡 有提到,詳細情祥可能要網路查查了 那在這個 php class 說明以及 code 如下,相信都寫的很清楚: html 認證部份: <html> <head> <title> Verify Page </title> </head> <body> Type the characters you see in the picture below. <br /> <img src="verify_image.php" alt="點此刷新驗證碼" name="verify_code" width="150" height="60" border="0" id="verify_code" onclick="document.getElementById(‘verify_code’).src=’verify_image.php?’ + [...]

Read Full Post »

在 FreeBSD 內建的搜尋 ports 指令搜尋速度有點慢,加上搜尋出來還蠻難找的,所以推薦一個搜尋 ports 軟體:psearch,支援 regular expression 安裝方式: # # ports 安裝 # cd /usr/ports/ports-mgmt/psearch make install clean rehash; 使用方法: options:   -V, –version        顯示版本資訊   -h, –help           顯示 help 資訊   -c CATEGORY, –category=CATEGORY                     [...]

Read Full Post »

自從上次介紹了 [PHP]好用的上傳 pear 模組 HTTP_Upload,最近又要使用到多重的檔案上傳,就又去看了一下官網的 document 寫的還蠻詳細的,大家去看看大概就知道我的作法了,底下是我的寫法: html 部份 <html>  <head>  </head>  <body>   <form name="fileuploadexample2" method="POST" enctype="multipart/form-data" action="">     <input type="file" name="f[]"/>&nbsp;檔案名稱:<input type="text" name="file_show_name[]" value="" size="32" maxlength="64"/><br />     <input type="file" name="f[]"/>&nbsp;檔案名稱:<input type="text" name="file_show_name[]" value="" size="32" maxlength="64"/><br />                <input type="file" name="f[]"/>&nbsp;檔案名稱:<input type="text" name="file_show_name[]" value="" size="32" [...]

Read Full Post »