Plurk

她的第一篇日記




前兩天, 我家女兒拿了幾張回收紙玩起黏貼的遊戲, 後來出現了一整本, 她自己嚷著說是"紜紜日記", 凹她老媽幫她寫上這幾個字, 宣告主權.

今天, 2007/03/29, 她在上頭寫上"ㄐㄧㄣ ㄊㄧㄢ ㄉㄜ˙ ㄧㄥ ㄨㄣˊ ㄎㄜˋㄓㄣ ㄉㄜ˙ ㄏㄠˇ ㄧㄡˇ ㄑㄩˋ ㄛ˙", 再次宣告, 這次她的日記本, 這是她的第一篇日記.

隱約記得, 我有這樣的能力時, 應該是上了小學之後吧!? 敢問專家, 這樣會不會太快了一些? 不過, 電視上不是常有報導所謂天才的事嗎? 相較之下, 我家小孩是慢的多了!

家裡小孩讓人說是天資聰明, 做父母的有誰會不高興, 只希望她能有自己的想法, 快樂成長, 而非人云亦云, 一時的天才.

紜紜, 五歲半, 六歲未滿, 中班, 她會自己唸出書報上的文字/拼注音, 但不懂真正的意思.

Google Notebook/Google 筆記本

老早有人介紹的google工具, 讓您上網時可以隨時記錄用的"小"工具, 基本上就跟Windows內建的Notepad差不多. 當然它不是那麼死板, 開了Windows才能用, 如果習慣使用其他OS的朋友, 透過Google Notebook, 在上網的狀態下, 很方便的紀錄/保存個人筆記.
基本用法:

1. 線上編輯: Google Notebook 使用Google帳號登入, 可以線上編輯/管理個人Notes.





2. 可以選擇公開/不公開.









3. 配合不同瀏覽器(IE/FireFox)下載Plug-in, 可以隨時開啟方便使用.

4. 安裝plug-in後, 可以讓右鍵選單多齣一個擷取文章的選項, 瀏覽網頁時, 隨時抓取想紀錄的文字.

LightBox JS 2.0



LightBox JS 2.0, 一直覺得很炫的效果, 沒甚麼機會用上, 用在這邊應該很好, 就是拿來秀相片用的. 下列是原始網站的說明:
下載請至原始網站


How to Use:
Part 1 - Setup
1. Lightbox v2.0 uses the Prototype Framework and Scriptaculous Effects Library.
You will need to include these three Javascript files in your header.
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>


2. Include the Lightbox CSS file (or append your active stylesheet with the Lightbox styles).
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />


3. Check the CSS and make sure the referenced prev.gif and next.gif files are in the right location. Also, make sure the loading.gif and close.gif files as referenced near the top of the lightbox.js file are in the right location.

Part 2 - Activate
1. Add a rel="lightbox" attribute to any link tag to activate the lightbox. For example:
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>
Optional: Use the title attribute if you want to show a caption.

2. If you have a set of related images that you would like to group, follow step one but additionally include a group name between square brackets in the rel attribute. For example:

<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
<a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a>
<a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a>

No limits to the number of image sets per page or how many images are allowed in each set. Go nuts!


如果您自行下載原始檔使用, 從原網站下載德檔案中, css/js兩個目錄裡所有檔案必須上傳到您的空間裡!!

讓blog上的程式碼美化一些

看到一些blog上寫code時的表現方式蠻好, 記得以前也見過, 只是沒特別去注意它, 把這效果用再blog上感覺應該不錯.
找了一下網路上的介紹, 良人的大秘寶 裡介紹了. 很簡單的改法, 紀錄一下免的忘了!!

1. 加上CSS
CODE {
display: block; /* fixes a strange ie margin bug */
font-family: Courier New;
font-size: 8pt;
overflow:auto;
background: #f0f0f0 url(http://klcintw.images.googlepages.com/Code_BG.gif) left top repeat-y;
border: 1px solid #ccc;
padding: 10px 10px 10px 21px;
max-height:200px;
line-height: 1.2em;
}

2. 使用時將code包含在 <code>...</code>中
.comment-body-author {
margin:0;
padding:0 0 0 20px;
background-color:#C0C0C0;
}

Post document from Google Docs directly

下面內容是由Google Docs編輯好傳過來的, 另一篇則是用Copy/Paste, 同樣的內容的空白都不見了, 難道一定得用HTML Tag, 還是繼續用我的全形空白吧!

//////////////////////////////////////////////////////

Blogger的編輯器真難用, 尤其是編輯程式碼時, 一堆跳行/空白通通不見了, 編輯框又小, 試試Google Docs應該比較人性一些吧!!

試試看這段:

function GotoSleep: Boolean;
begin
 if (you feel tired) then
  Result := (goto sleep)
 else
  Result := (work hard);
end;


Google Docs用用看, Blogger編輯器真難用

Blogger的編輯器真難用, 尤其是編輯程式碼時, 一堆跳行/空白通通不見了, 編輯框又小, 試試Google Docs應該比較人性一些吧!!

試試看這段:

function GotoSleep: Boolean;
begin
if (you feel tired) then
Result := (goto sleep)
else
Result := (work hard);
end;

Rave Reports 7.0.x轉PDF中文亂碼, 解決部分問題

這是從5.x就一直存在的問題, 原本使用BDS2006中的內建版本, 困擾一直無法解決, 後來找了包含source code 的7.0.2來玩, 參考了scyangyu 公佈的方法, 加上一點運氣, 好不容易終於讓中文正確出現在PDF上了, 第一階段到此, 試了一堆字型, 只有AR MingtiM BIG-5字型可以達到預覽/轉RTF/轉PDF的需求.

後來因為不同字型的需求, 只好硬著頭皮去google找解決方法, 原本第一階段的中文字型問題解決了一半, 當報表中存在兩種以上字型時, 一跑報表, 程式就出錯, 後來竟然發現一年以前scyangyu 已經解決了, 之前找資料竟然沒發現, 連前一階段困擾的字型重疊一直沒解決的問題scyangyu也show出已解決的圖片, 可惜, 沒把方法公佈出來, 發了信去問, 還沒接到回信, 也許對方沒空, 只好自己硬著頭皮trace程式, 竟然讓我解決了一些, 至少常用字型可以正常轉PDF了! 真是一個高興!

Rave Reports還有一些Memo上亂碼的問題, 可以參考scyangyu的blog.

列一下轉PDF問題的重點程式(繁體中文可用)
RpRenderPDF.pas

1. procedure TRPPDFFontComposite.InitData;

//這兩行改成這樣
PrintLn('/Encoding /' + CompositeFontEncoding);
//PrintLn('/Encoding /Identity-H');


2. procedure TRPPDFFontComposite.SetFontData;

procedure SetWidths; //稍稍改寫一下
var
 i1: integer;
 WidthScale: smallint;
begin
 i1 := 0;
 // ShowMessage(Format('firstchar, lastchar = %d,%d', [FirstChar, LastChar]));
 while i1 < name =" '新細明體')">

3. procedure TRPPDFFontComposite.SetFontData;

//這是參考scyangyu的程式來的
 if Panose.bProportion = PAN_PROP_MONOSPACED then
 begin
  if FontCharSet = CHINESEBIG5_CHARSET then
  begin
   CompositeFontEncoding := 'ETen-B5-H';
  end
  else if FontCharSet = GB2312_CHARSET then
  begin
   CompositeFontEncoding := 'GBK-EUC-H';
  end else if FontCharSet = SHIFTJIS_CHARSET then
  begin
   CompositeFontEncoding := '90ms-RKSJ-H';
  end else
  begin
   CompositeFontEncoding := 'KSCms-UHC-HW-H';
  end;
 end
 else
 begin
  if FontCharSet = CHINESEBIG5_CHARSET then
  begin
   CompositeFontEncoding := 'ETen-B5-H';//'CNS-EUC-H';
  end else if FontCharSet = GB2312_CHARSET then
  begin
   CompositeFontEncoding := 'GBpc-EUC-H';
  end else if FontCharSet = SHIFTJIS_CHARSET then
  begin
   CompositeFontEncoding := '90msp-RKSJ-H';
  end else
  begin
   CompositeFontEncoding := 'KSCms-UHC-H';
  end;
 end;
 Descriptor.PDFFontName := PDFFontName;
 Descriptor.FontName := FontName;
 Descriptor.SetValues(OutlineTextMetric, FontWidths[32]);
 Descendant.PDFFontName := PDFFontName;
 Descendant.Descriptor := Descriptor;
 Descendant.Registry := 'Adobe';
 if FontCharSet = CHINESEBIG5_CHARSET then
 begin
  Descendant.Ordering := 'CNS1';
 end else if FontCharSet = GB2312_CHARSET then
 begin
  Descendant.Ordering := 'GB1';
 end else if FontCharSet = SHIFTJIS_CHARSET then
 begin
  Descendant.Ordering := 'Japan1';
 end else
 begin
  Descendant.Ordering := 'Korea1';
 end;

 if FontCharSet = CHINESEBIG5_CHARSET then
 begin
  Descendant.Supplement := 1;
 end
 else if FontCharSet = GB2312_CHARSET then
 begin
  Descendant.Supplement := 0;
 end
 else if FontCharSet = SHIFTJIS_CHARSET then
 begin
  Descendant.Supplement := 2;
 end else
 begin
  Descendant.Supplement := 1;
 end;


4. procedure TRPPDFFontComposite.SetFontData;

//mark下兩行程式
//Descendant.Ordering := 'Identity';
//Descendant.Supplement := 0;


應該沒忘了甚麼!!

Delphi For PHP


前不久看到的消息, CodeGear 也就是Borland原來的IDE部門, release了Delphi For PHP, 還沒玩過, 應該是個使用Delphi(環境?語法?習慣)來開發PHP的工具 !
"Delphi® for PHP revolutionizes PHP web development with Delphi’s proven visual Rapid Application Development (RAD) approach for accelerated visual PHP web development. Delphi for PHP is the fast and easy way to build robust PHP web applications." 聽起來好似不錯! 原本沒啥動力去學新東西, 這個倒是有機會要拿來試試看!

Delphi中的Rave Reports搞死人

原本想這應該是個短命的工具, 沒想到這麼久以來他還存在, 接了個小案子, 沒想到去找Fastreport, 直覺用它上吧!

從5.x就有的亂碼問題, 到7.x依舊有問題, 參考了google上找到了討論, 只提到5.x的修改方法, 7.x討論的真是少啊! 用它做報表的人應該非常少吧!

首先, 原本用了BDS2006內建的版本, 沒錯, PDF轉出問題了! 它只認識蝌蚪文, 轉出一堆亂碼. 好吧, 找個新版試試, 你沒猜錯, 它還是一堆亂碼! 還好, 用上它的Source Code + Google上找來的改法, 可以正常輸出中文了(沒長進的Rave, 新舊版改法都一樣), 看, 字型對齊的問題還是沒解決! 最後找到個 AR MingtiM BIG-5字型, 竟然一切正常了! 不管, 先用了吧!

再來, 聽說Rave Reports在Memo的處理上也有問題, 是的, 別人會碰上我當然有碰上了. 對於資料庫中的Field抓進報表的資料, 就是一堆亂. 沒辦法了, 試試runtime再assign值給它印, 竟然...竟然就ok了! 啊, 不然是怎樣...


osCommerce

朋友在找購物車軟體, 很久以前看過osCommerce, 有空再玩(我也不知道何時有空)吧!
http://www.oscommerce.com/ osCommerce
http://osc.kmd.com.tw/ 網路甘仔店-osCommerce中文社群網站
http://www.twecommerce.org/ OLDPA的TWE
... 族繁不及備載

使用Delphi 壓縮 Access DB

網路上找來的, 原來還蠻簡單, 以前一直沒去想, 突然用上, 找來頂一下!

function compressDB(dbName: string): Boolean;
var DaoVar: OLEVariant;
begin
 if ADOConn.Connected then ADOConn.Close;
 try
  try
   DaoVar := CreateOleObject('DAO.DBEngine.36');
   if FileExists('temp.mdb') then DeleteFile('temp.mdb');
   DaoVar.CompactDatabase(dbName, 'temp.mdb');
   if DeleteFile(dbName) then RenameFile('temp.mdb', dbName);
   ShowMessage('Success');
   Result := true;
  except
   Result := false;
  end;
 finally
  ADOConn.Open;
 end;
end;

Designed by Posicionamiento Web | Bloggerized by GosuBlogger | Blue Business Blogger