tjy 聖經錄音剪接 進入路加福音
tjm 盧俊義牧師錄音剪接,修改網頁產生器
2007年3月10日 採購UPS防爆電池 預計 2010年更換
Trackback URL: http://blog.fhl.net/trackback.php?id=216
我看以後做了什麼還是來報告一下,不然要每週進度報告都會不知道說啥。
修正了網頁產生器,解決最新文章會出現雜訊的問題。
修正了公佈欄跑馬燈,讓系統更穩定一點,不過目前還有點小問題,因為我無法判定視窗的高度,所以不知道捲動的終點,先用固定值混一下
20081029,已經知道怎麼算高度
document.documentElement.clientHeight 計算視窗高度
document.links.length 計算連結筆數,就可以計算出捲動的狀況
匯出CBOL資料成 insert 格式
修正新約parsing輸入流程,並協助修改資料
Trackback URL: http://blog.fhl.net/trackback.php?id=213
php的iconv是個非常好用的函數,可以輕易達成繁簡體轉碼的功能, 但是這個函數有個缺點,當我們輸入「【囧男孩】為什麼你要一直笑呢?」這段字,由於 「囧」這個字不是gb2312支援的字,結果整個輸出會變成「【」,後面的字串全部會消失,而且 php端沒有任何錯誤信息(return也不會變成 false)。
為了解決這個問題,我用了轉回來的字串長度作為檢驗標竿,看看轉回來的字串是否正確,如果不正確,就用二分逼近法,先把正確的部份轉出來,把不正確的部份用遞迴方式繼續切割下去轉,最後把那個造成問題的字換成「?」,這樣就解決了問題。
<?php
function trangb($str)
{
$nstr=iconv('utf-8','big5',$str);
if (iconv_strlen($str,'utf-8')!=iconv_strlen($nstr,'big5'))
$nstr=riconv('utf-8','big5',$str);
$pnstr=iconv('big5','gb2312',$nstr);
if (iconv_strlen($nstr,'big5')!=iconv_strlen($pnstr,'gb2312'))
$pnstr=riconv('big5','gb2312',$nstr);
$nstr= iconv('gb2312','utf-8',$pnstr);
return $nstr;
}
function riconv($loc1,$loc2,$str)
{
$i=iconv_strlen($str,$loc1);
if ($i<=1)
return '?';
$blen=(int)($i/2);
$elen=$i-$blen;
$bstr=iconv_substr($str,0,$blen,$loc1);
$nbstr=iconv($loc1,$loc2,$bstr);
if (iconv_strlen($bstr,$loc1)!=iconv_strlen($nbstr,$loc2))
$nbstr=riconv($loc1,$loc2,$bstr);
$estr=iconv_substr($str,$blen,$elen,$loc1);
$nestr=iconv($loc1,$loc2,$estr);
if (iconv_strlen($estr,$loc1)!=iconv_strlen($nestr,$loc2))
$nestr=riconv($loc1,$loc2,$estr);
return $nbstr.$nestr;
}
echo trangb("【囧男孩】為什麼你要一直笑呢?");
?>
Trackback URL: http://blog.fhl.net/trackback.php?id=211
我最近買了一台Nokia E65(因為以前的手機掉到地上一台變成兩台,沒救了,又等不到google的手機平台出現),這台機器蠻好用的,可惜鍵盤很小,要輸入資料的話會耗掉半條命。因此只能在大電腦上輸入,再靠同步的方式輸入手機。
不過Nokia原廠的程式只能與XP、Vista同步,其實一開始我並不討厭Vista,我的電腦也裝了一個Vista,但是Vista開機實在太慢了。加上我的Linux上面自從跑了VirtualBox、裝了XP之後,實在是不需要再開進去Vista。好啦!於是每次我都是因為要更新聯絡人或行事曆才忍耐好幾分鐘,等Vista開機,輸入完、同步完又開回Linux,這樣實在有點笨笨的。
於是,昨天我下定決心要想辦法讓Nokia E65跟Linux上的Evolution同步,這樣我就可以完全擺脫Vista。很不幸的google裡面找到的東西都是 Ubuntu的說明(看來Fedora真的是危險了) ,害我自己K menu搞了一個晚上才搞定。為了怕忘記,再這裡寫個小抄。
第一步,先搞定藍芽連接
yum install bluez-utils bluetooth gnome-bluetooth
service bluetooth start
vi /etc/bluetooth/hcid.conf 編輯一下內容,讓手機跟電腦配對上(蠻容易的,莫名其妙就好了)
用 sdptool browse 來看一下手機的藍芽 address
通常是
00:17:E3:xx:xx:xx 這樣的形式
第二步,設定同步
先裝他個一大堆 opensync 的plugin
yum install libopensync-plugin-evolution2.i386 libopensync-plugin-file.i386 libopensync-plugin-synce.noarch libopensync.i386 libopensync-devel.i386 libopensync-plugin-gnokii.i386 libsyncml-0.4.5-2.fc9.i386 libopensync-plugin-syncml-0.35-4.fc9.i386
然後開始
msynctool --addgroup nok 建立group
msynctool --addmember nok evo2-sync 設定第一個成員是 evolution
msynctool --addmember nok syncml-obex-client 設定第二個成員是手機的控制系統
msynctool --configure nok 1 設定 evolution修改成
<?xml version="1.0"?>
<config>
<address_path>file:///home/username/.evolution/addressbook/local/system</address_path>
<calendar_path>default</calendar_path>
<memos_path>default</memos_path>
<tasks_path>default</tasks_path>
</config>
記得要把 username 改成自己的id,其實那一段就是定義自己的evolution資料庫放哪裡
msynctool --configure nok 2 設定手機的資訊
<?xml version="1.0"?>
<config>
<!-- (Only for bluetooth) The bluetooth address if the bluetooth mode is selected -->
<bluetooth_address>00:17:xx:xx:xx:xx</bluetooth_address>
<!-- (Only for bluetooth) The bluetooth channel to use. `sdptool browse $MAC` to search for the correct channel -->
<bluetooth_channel>14</bluetooth_channel>
......
<recvLimit>10000</recvLimit>
<maxObjSize>0</maxObjSize>
<!-- XXX: Currently you need to write this by your own.
Later it's planned to create such entries on the fly during
the discovery() call. Example database field:
-->
<database>
<name>Contacts</name>
<objtype>contact</objtype>
<objformat>vcard21</objformat>
</database>
<database>
<name>Calendar</name>
<objtype>event</objtype>
<objformat>vevent10</objformat>
</database>
紅色部份就是要改的,不過我還無法同步「待辦事項」,這個對我來說比較不重要....
msynctool --sync nok --conflict i 設定好了就可以同步了
這個同步系統比較陽春(不過會成功就好了),需要自己處理一下衝突的狀況,上面那個 --conflict i 就是要求
如果兩筆資料一樣,就不要忽略不處理,不然每次都會問我要怎麼辦,這樣會回答的半死。
以後只要定期 msynctool --sync nok --conflict i 即可
Trackback URL: http://blog.fhl.net/trackback.php?id=207
1.資料轉入: 必須下 update unv set txt=replace(txt,'‧',''); 把「‧」刪除,否則會造成轉換錯誤
2.語言選擇: config.php GBCODE=1 就是簡體 GBCODE=0 就是繁體
3.字型檔案: 放在 home directory的 pfont與 gfont中,要複製到 parsing與 parsing檔案中
4.default版面選擇: gen_hb.php裡面有兩個 if ($st==0 && $tab==1) 要同步修改,第一個st 控制strong number的位置、tab控制格式
5. 產生的指令 wget --timeout=300000 http://xxx.xxx.xxx.xxx/gen_hb.php &
要加 timeout,不然會出現問題
Trackback URL: http://blog.fhl.net/trackback.php?id=202
| « | 十一月 2008 | » | ||||
|---|---|---|---|---|---|---|
| 一 | 二 | 三 | 四 | 五 | 六 | 日 |
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |