免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2010年12月23日 星期四

CSS embed in blogger/blogspot

After some harsh try-and-errors, i realized that
it's possible to embed CSS style in blogger/blogspot
but needs to take care of several points:


  • edit in "Edit Html" mode rather than "Compose" mode

  • add "type" attribute into the style tag <style type="text/css" >

  • remove the break tag(<br />) introduced during copy/paste

  • "Preview" doesn't always reflect the effect of the embedded styles



//===
在一連串的嘗試錯誤後 終於找出在Blogger/Blogspot中
加入<style >... </style> 的方式
有幾點容易出錯的地方 需要注意:

  • 編輯模式最好選擇"Edit Html" 而非 "Compose"

  • 在style tag 中加入 "type" 屬性(attribute), <style type="text/css" >

  • 移除拷貝過程中引起的 break tag(<br />)

  • 預覽模式"Preview" 不見得能反映所加入styles的效果


//===
[example]
http://3hitek.blogspot.com/2010/12/left-top-corner-logo-by-css.html

2010年12月21日 星期二

MBP and TRBL : 2 CSS shorthands (簡寫) for layout

CSS 關於版面佈局(layout)有兩個重要的順序
MBP and TRBL
自己常會忘記確實的先後順序
發明一些聯想來記住他們的簡寫

MBP: margin, border, padding

  • 由外而內
  • mvp 諧音
  • MB 聯想 主機板 mainboard/motherboard/member
  • BP 聯想 英鎊 british pound

TRBL: top, right, bottom, left

  • 順時鐘
  • trouble 聯想 TR-ou-BL-e
  • TR 聯想 table/tr/td
  • BL 聯想 SBL

[example]

margin:100px 50px; --> margin 的 top=100px, right=50px; bottom=top; left=right

border: 20px --> border 的top=20px; R==B==L==top

padding: 40px 30px 20px 100px --> padding的 top=40px, right=30px, bottom=20px, left=100px

//===

There are two important sequences in CSS layout : MBP and TRBL,
but i often forget the exact order.

So, I invent some connections/correlations to memorize the two shorthands

MBP: margin, border, padding

  • from outside to inside
  • mvp (homophonous)
  • MB connects to mainboard/motherboard/member
  • BP connects to British Pound


TRBL: top, right, bottom, left

  • clockwise
  • trouble connects to TR-ou-BL-e
  • TR connects to table/tr/td
  • BL connects to SBL


2010年12月20日 星期一

Top-left/top-right corner logo by CSS



truetype.info
truetype.info logo

[Q] How to put an image at the left-top corner of an html webpage by CSS?

[try]
#mytopleft {position: absolute;left: 0px; top: 0px;display: block; height: 64px; width: 64px; margin:0px; border:0px; padding:0px; }

#mytopright {position: absolute;right: 0px;top: 0px; display: block; height: 32px; width: 32px; margin:0px; border:0px; padding:0px; }

...
<div id= "topleft"><img src="../images/urLogo.png)" /></div>


[ref]
http://www.liewcf.com/easy-css-top-corner-banner-2537/

CSS selectors (pattern matching rules) digest

//=== css selectors and pattern matching


  1. * universal selector

  2. , group selector

  3. [space] descendant selector

  4. . class selector

  5. > child selector

  6. + adjacent sibling selector

  7. [att] attribute selector

  8. : pseudo-class selector

[examples]



  • [group selector] p, h1, h2, h3 { font-family: serif }

  • [space, universal, attribute selectors] div p *[href]

  • [pseudo-class selector] a:link

  • [space, child, space selectors] div ul>li p

  • [adjacent sibling selector] h1 + h2 { margin-top: -5mm }

  • [class selector] h1.red { color: red }



//=== attribute selectors


[att] Match when the element sets the "att" attribute


[att=val] Match when the element's "att" attribute value is exactly "val".


[att~=val]
Represents an element with the att attribute whose value is a white space-separated list of words, one of which is exactly "val".
If "val" contains white space, it will never represent anything.
If "val" is the empty string, it will never represent anything either.


[att=val] Represents an element with the att attribute,
its value either being exactly "val" or
beginning with "val" immediately followed by "-"



[ref]


http://www.w3.org/TR/CSS2/selector.html

2010年12月18日 星期六

Outlook cannot access gmail after windows update

//=== 2010.12.17, outlook cannot access gmail after windows update
[Error Message]
Receiving Reported Error(0x800CCC18): your e-mail server rejected your login with Secure Password Authentication(SPA).Verify your account properties ...

[Environment]
Windows XP, SP3/ Outlook 2007, BitDefender

[WorkAround]
Under account settings, "uncheck" the box that says "Require Logon using SPA".

[Automatic Update on 2010.12.16]

  • Windows XP Security Update for Windows XP (KB2296199)
  • Office 2007 Security Update for Microsoft Office Publisher 2007 (KB2284697)
  • Windows XP Security Update for Windows XP (KB2443105)
  • Windows XP Cumulative Security Update for Internet Explorer 8 for Windows XP (KB2416400)
  • Windows XP Security Update for Windows XP (KB2440591)
  • Windows XP Update for Windows XP (KB2443685)
  • Windows XP Security Update for Windows XP (KB2436673)
  • Office 2002/XP Security Update for Microsoft Publisher 2002 (KB2284692)
  • Windows XP Update for Internet Explorer for Windows XP (KB2467659)
  • Office 2007 Update for Microsoft Office Outlook 2007 Junk Email Filter (KB2466076)
  • Office 2007 Security Update for Microsoft Office 2007 System (KB2288931)
  • Office 2007 Update for Microsoft Office Outlook 2007 (KB2412171)
  • Office 2002/XP Security Update for Microsoft Office XP (KB2289162)
  • Windows XP Windows Malicious Software Removal Tool - December 2010 (KB890830)
  • Windows XP Security Update for Windows XP (KB2423089)

[more on http://www.google.com/support/forum/p/gmail/thread?tid=7a3bf71d34d4788f&hl=en ]

  • Part of the Microsoft update turned Secure Password Authentication(SPA) back ON.
  • SPA needs to be OFF for Outlook to work with GMail according to GMail set-up instructions.
  • GMail doesn't need SPA, as the entire session is encrypted anyway via SSL.

[ref]
http://www.google.com/support/forum/p/gmail/thread?tid=47dc56cbb09eca79&hl=en

http://www.google.com/support/forum/p/gmail/thread?tid=7a3bf71d34d4788f&hl=en

http://mail.google.com/support/bin/answer.py?hl=en&answer=12103 (GMail setup)

2010年12月15日 星期三

special char escaping in gadget

To put html code into the "HTML/JAVASCRIPT gadget" of Blogger(Blogspot),
some special chars need to be escaped :


& === &amp; ???
< === &lt;
> === &gt;
" === &quot; ???
'=== &apos; ???

[example ] params for flash swf movie

<param value="
&dataTextFieldStyle=<p align='center'><font face='Arial' color='#000000' size='18'><b>[]</b></font></p>&
">

should be replaced by

&lt;param value="
&dataTextFieldStyle=&lt;p align='center'&gt;&lt;font face='Arial' color='#000000' size='18'&gt;&lt;b&gt;[]&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;&
"&gt;




[ref]
http://code.google.com/apis/gadgets/docs/fundamentals.html
http://3hlot.blogspot.com/

ProductCode and UpgradeCode

[ProductCode]
[UpgradeCode]
[ProductName]


For products(software packages) having the same [UpgradeCode]
but different [ProductCode] s, MS Windows can automatically
upgrade the old version to the new one?

2010年12月10日 星期五

Trojan Script 37423

前幾天 想找關於invisible watermark 的軟體
逛到一個比較老的網站 結果 嗶嗶 ! 中標!

Trojan.Script.37423 (防毒軟體 BitDefender 顯示警告)

Virus Detected: Trojan.Script.... in
"C:\Documents and Settings\username\LOCAL SETTINGS\TEMPORARY INTERNET FILES\CONTENT.IE5\xxxx\yyyyy[1].htm"

//===
Trojan.JS.Agent.wh (Kaspersky Lab) is also known as:
JS/Agent-KKN (Sophos)
JS/IFrame (FPROT)
Trojan.Script.37423 (BitDef7)
HTML.Crypted (Ikarus)
HTML/Framer.BU (AVG)
HTML/Crypted.Gen (AVIRA)
Trojan.JS.Agent.wh [AVP] (FSecure)




[ref]
Trojan.Script.Iframer
http://forum.kaspersky.com/lofiversion/index.php/t100452.html

Trojan.JS.Agent.wh
http://www.securelist.com/en/descriptions/6679886/Trojan.JS.Agent.wh

找不到 TEMPORARY INTERNET FILES ?
http://3hitek.blogspot.com/2010/12/temporary-internet-files.html

Temporary Internet Files 找不到

[Q] 找不到 Temporary Internet Files 目錄?


[try]
C:\Documents and Settings\username\Local Settings
--> Tools\Folder Options\View
--> 將選項 "Hide protected operating system files" 取消

//===
[Q] Cannot find the folder/directory "Temporary Internet Files"?

[try]
C:\Documents and Settings\username\Local Settings
--> Tools\Folder Options\View
--> uncheck "Hide protected operating system files

Superflexible file synchronizer

//===
UNC network path connection :
edit Profile Settings -> Advanced Settings -> Job -> click on "Network connections"
will pop out a window where we can input the network path, user name, password .


//===
zip package ???
the ExtremeSync Service and the ExtremeSync Remote Service.

2010年11月29日 星期一

block box and inline box

[Q] CSS 中的 block box 與 inline box 有何差異?
[A]
在使用block 格式的上下文(context)中 :
  • block 沿垂直方向擺置 上下相接
  • 相接的margin 會縮併(collapse)

在使用inline 格式的上下文中 :
  • block 沿水平方向擺置 左右相接
  • 相接的margin 不縮併


//===
[Q] What's the difference between block box and inline box in css?

[A]
In a block formatting context, boxes are laid out one after the other, vertically
In an inline formatting context, boxes are laid out one after the other, horizontally.




//=== digest from CSS2 spec, chap9, Visual formatting model
" ... In a block formatting context, boxes are laid out one after the other, vertically,
beginning at the top of a containing block.

The vertical distance between two sibling boxes is determined by the 'margin' properties.

Vertical margins between adjacent block boxes in a block formatting context collapse.
...
"


"... In an inline formatting context, boxes are laid out horizontally, one after the other,
beginning at the top of a containing block.

Horizontal margins, borders, and padding are respected between these boxes.

The boxes may be aligned vertically in different ways: their bottoms or tops may be aligned, or the baselines of text within them may be aligned.

The rectangular area that contains the boxes that form a line is called a line box.

..."


[ref]
http://www.w3.org/TR/CSS2/visuren.html#block-formatting

2010年11月22日 星期一

Win Form 's Location in C#

[Q] c# winfom's Location 的設定 無法產生作用 ?
Form frm1 = new Form();
frm1.Location = new Point(100,100);
frm1.Show();


[try]

frm1.StartPosition= FormStartPosition.Manual;



[Q] frm1.Location and frm1.DesktopLocation 的差異?

2010年10月22日 星期五

Seek in C#

C#的Stream 有個 Seek 的函數 :
Seek(long offset, SeekOrigin orn) {...}

當 orn 是 SeekOrigin.Begin 時
offset 應該 >= 0

當 orn 是 SeekOrigin.End 時
offset 應該 <= -1

當 orn 是 SeekOrigin.Current 時
offset 有正有負



[example]
Stream stm;
...
stm.Seek(-1, SeekOrigin.End);
int r= stm.ReadByte();
// r 會是檔案的最後一個byte
r=stm.ReadByte()
// r 變成-1

...
stm.Seek(0, SeekOrigin.End);
int r= stm.ReadByte();
// r 應該是-1 ?


stm.Seek(0, SeekOrigin.Begin);
int r= stm.ReadByte();
// r 會是檔案的第一個byte




[ref]
http://www.aspfree.com/c/a/C-Sharp/C-Sharp-FileStream-Explained/4/

2010年10月3日 星期日

T.sonic 310 mp3 如何關機?(不是T310 手機)

[前言]
許久之前 弟弟送的 一直沒搞清楚怎麼用

今天下午整理東西時發現 試試看還能不能用
沒想到久未充電(應該超過一年以上!)
竟然還可以動作 只是該怎麼關機呢?

 
[Q] 創見 T.sonic 310 mp3 player 如何關機?

[try]
網路上找到說明書下載
"長按 播放/暫停 直到聽見關機音"
試了兩三下 發現 "播放/暫停" 要稍微用力按著才行

露天議價功能

0. 開啟或關閉議價功能 :
(賣家)登入露天-> 我的拍賣-> 左邊選單-> 交易設定 -> 議價設定

1. 若想開啟並在商品圖示右方出現 "議價" 連結
還必須修改商品設定為 "直購價" 模式

//=== 露天議價有些問題
[延伸閱讀]

2010年9月17日 星期五

Flash package and class naming rules

//=== The naming rules for package and class in AS3 of Flash:
0. package name has to match the directory name and hierarchy.
1. class name has to match to the file name.
2. Edit -> Preferences -> AS3 settings -> class path


//=== Actionscript3(AS3) 的 package/class 的命名規則限制
0. package名稱 需與 目錄階層 一致

1. class名稱 需與 檔案名稱 完全相同



.

2010年9月10日 星期五

Upload file to google sites

[Q] 如何上傳檔案到自己的google site?
[Q] How to upload file to my own google site?

[try]
0. Log on google sites https://sites.google.com/  by gmail account

1. Select or create the site where you want to upload file

2. On the top right next to "Edit Page" is the "More actions"
click to choose "Manage site" (page should refresh to show sth. new)

3. Click  "Attachments" in the left side menu under "Site content"
(page should refresh to show sth. new)


4. Click "Upload" ...

2010年9月3日 星期五

Flash MovieClip change Color

[Q] How to change the color of a movieClip in AS3 of Flash?
[Q] 如何改變Flash "片段" 的顏色?

[Example]



[code snippet]
import flash.geom.ColorTransform;
...
var newColorTransform:ColorTransform ;
newColorTransform = new ColorTransform();
newColorTransform.color = 0x999999;
this.transform.colorTransform = newColorTransform;
...

[ref]
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/geom/ColorTransform.html

2010年9月2日 星期四

Vigor 2910, 2920, 2820 (居易 Draytek)

為了幫老闆賣掉不用的路由器Vigor2910G,
總算把 居易這幾台功能相近的路由器的差別搞清楚些

型號 Vigor2910 Vigor2910G Vigor2910N Vigor2910V
功能 CSM, VPN, Dual WAN, VLAN Vigor2910+ 802.11g AP Vigor2910+ 802.11n AP Vigor2910 + VoIP


型號 Vigor2910 Vigor2920
功能 1WAN+3LAN + 1WAN/LAN,
WAN/LAN: 100Mbps
2WAN+4LAN,
WAN1: 100Mbps, WAN2/LAN: Gigabit


型號 Vigor2820Vigor2920
功能 ADSL2 modem + 2WAN+3LAN,
WAN1/LAN: 100Mbps,WAN2: Gigabit
2WAN+4LAN,
WAN1: 100Mbps, WAN2/LAN: Gigabit

2010年8月30日 星期一

Flash Button States

傳統的Flash Button 有四種States:
up, down, over, hit

這四種States正式的屬性名稱為

upState, downState, overState, hitTestState

其中比較不一樣的就是 "hit"(hitTestState),
它決定了該按鈕(Button) 接受觸發的範圍

[code snippet]  btn1 is a given button ...

var imgGray1:MovieClip = new imgGray();

var greenCircleShape:Shape = new Shape();
greenCircleShape.graphics.beginFill(0x00ff00);
greenCircleShape.graphics.drawCircle(0, 0, 20);
 
 
btn1.upState= imgGray1;
btn1.overState= imgGray1;
btn1.downState= imgGray1;
btn1.hitTestState= greenCircleShape;

2010年8月29日 星期日

Facebook 如何顯示所有的friends?

[Q] 登入後 首頁左方的 Friends 點下去
看到的是Find People You Email(以email尋找朋友)和People you may know
要如何看到所有的friends?

[try]
create a list (click the button on the top right of "friends" page)
and add all friends into that list.

Disable drag of movie clip in Flash AS3

[Q]  How to disable the dragging behavior of a movie clip in Flash AS3?

[try]
After searching on internet, some people said that , for a movie clip mc,
  • mc.enabled= false;
  • mc.mouseEnabled=false;
can disable the dragging?

But they failed in my Flash CS3.

*** Found that beside changing  mc.enabled to false, need accompanying check action
within the mouse_down/up event to control whether to activate startDragging ...

[Code snippet]
this.mcVolSlider.addEventListener(MouseEvent.MOUSE_DOWN, startScroll);

function startScroll(e:Event):void {

       if (mcVolSlider.enabled==true) {
         this.mcVolSlider.startDrag(false,bounds);
      }
}

MsoCache

[Q] MsoCache 這個目錄/資料夾的用途?
目錄: directory;  資料夾: folder

[try]

MsoCache (cache on hard drive for microsoft office) , 也稱 Local Install Source (本機安裝來源)
在安裝 Microsoft Office 時 有個選項會將安裝/更新所需的檔案
複製到硬碟的 \MsoCache 目錄/資料夾下
 
 
[Q]  希望節省磁碟空間時,是否可以直接刪除 複製到MsoCache 的檔案?

[try] 不建議直接刪除 。當您刪除 MsoCache中的檔案後,未來在執行任何Office安裝動作時,還是會被要求提供 Office 光碟,而所有必要的來源檔案會再次複製到您的MsoCache 。

從硬碟移除MsoCache的建議方法,是使用
「本機安裝來源工具」Local Installation Source Tool (LISTool.exe)
從本機硬碟移除檔案。您可以從微軟網站的 Office Resource Kit 中取得這項工具:

http://office.microsoft.com/en-us/ork2003/HA011402361033.aspx

使用「本機安裝來源工具」移除MsoCache,同時也會移除參考檔案的登錄項目(registry),以避免將來發生問題。


//===
[Q] 如何控制 \MSOCACHE 資料夾的位置?

[try] 安裝時使用 LOCALCACHEDRIVE 屬性 來指定 \MSOCACHE 資料夾的位置。
可以從命令列(command line)或安裝程式設定檔案 (Setup.ini) 啟用 LOCALCACHEDRIVE 屬性。

安裝後要變更MsoCache的硬碟位置, 請至 
http://office.microsoft.com/en-us/ork2003/HA011402361033.aspx

下載 Local Installation Source Tool (LISTool.exe)
"...
Using the Local Installation Source Tool, 'administrators' can:
  • Disable the local installation source for users who are running short of hard disk space.
  • Move the local installation source to a different drive.
  • Enable the local installation source after Office is installed.

... "

[ref]
http://support.microsoft.com/default.aspx?kbid=830168

http://office.microsoft.com/en-us/ork2003/HA011402361033.aspx

2010年8月21日 星期六

Facebook的Likes and Interests

終於會用 Facebook 的 Likes and Interests (興趣與嗜好)!

想加入新的Likes and Interests  除了在輸入文字盒確認之外
還必須要在浮現的淺色底文字盒中確認
確認後 所輸入的文字會在 輸入文字盒的下方顯現
這時在按儲存(Save Change) 才有效
否則 ...

2010年8月16日 星期一

露天拍賣競標者的出價資訊與議價...

[Q] 露天拍賣競標者的出價資訊, 不會自動email給賣家?
除非達到直購價 或者超出底價而且拍賣時間結束?

[Q] 露天的議價功能
  • 透過悄悄話來執行
  • 但是議價成功後 無法自動讓買賣雙方成交於議定的價格?
  • 必須透過賣方手動更改直購價 或者更改商品為競標模式?
  • 還要等待買方真正下標 並由買方結束拍賣?
[PS]  2010.10.08, 這禮拜二 試著跟一位買家議價 發現露天 已經
可讓買賣雙方自動成交於議定的價格, 但似乎無法更改取貨方式?

2010年8月15日 星期日

如何抑制IE8網頁上的背景音樂?

[Q] 如何抑制IE8網頁上的背景音樂?
[Q] How to disable/mute the background music played with the web page browsed by IE8?


[try]
Tools -> Internet Options -> Advanced tab  -> Mulitmedia options ->
uncheck "Play sounds on web pages"

2010年8月10日 星期二

Orchard Cms

OrchardProject :  http://www.orchardproject.net/

related project :
http://orchard.codeplex.com/
http://oxite.codeplex.com/

Orchard Forum: 
http://social.msdn.microsoft.com/Forums/en-US/orcharddiscussions/threads


Walkthrough module development .pdf
orchardModuleWalkThrough.pdf on my GoogleDoc

Walkthrough module development .doc

http://www.orchardproject.net/privatedrops/orchardmodulewalkthrough.doc

Walkthrough module development web page
http://www.orchardproject.net/docs/Walkthrough-Writing-An-Orchard-Module.ashx?HL=module
(unfinished)

0. download Web PI(Web platform installer) from http://ww.microsoft.com/web

1. install .Net Framework 4.0

2. download the latest release of OrchardProject from http://orchard.codeplex.com/

3. follow
orchardModuleWalkThrough.pdf on GoogleDoc
http://www.orchardproject.net/docs/



//===
[Q] Comparison of Orchard and Drupal?
[Q] Comparison of Orchard and DotNetNuke?


[ref]  http://www.orchardproject.net/faq

"....
How does Orchard compare with DotNetNuke(DNN)? ...

DNN is a mature and successful .NET-based project, a key partner for Microsoft, and a vital contributor to the .NET open source ecosystem.

Our hope is that new technology investments made by Orchard will serve existing applications like DNN in the long run, and ultimately provide infrastructure and components that our partners can leverage to enrich their own offerings.

Orchard aims to help our .NET partners, not to compete directly with them. Orchard is already working with several partners in the .NET open source space, including DNN, to identify opportunities to work together for mutual benefit.

... Orchard’s extensibility model also presents partners with another vehicle for delivering their solutions and expanding their audience.
..."

"...
What is the Orchard CMS application? How does it compare with Microsoft SharePoint?


Orchard CMS is an open source project which aims to provide a simple solution for small web agencies who want to quickly create Internet-facing Web sites.

For corporations wanting a fully-featured, Microsoft-supported, enterprise-level CMS solution out-of-the-box, ... , Microsoft SharePoint™ is a more natural choice.

SharePoint also provides capabilities beyond CMS including Team Collaboration, Document and Records Management, Business Process Integration and Business Intelligence.

....
"

Microsoft.WebApplication.targets was not found?

[Q]  What to do with the error: "The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found"?



[try]

0. install the vs patch(which one ?) to get Web Application Project support

1. or just copy the desired Microsoft.WebApplication.targets and its parent folder from somewhere else
e.g. copy from "C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets"





[ref]
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/db5d2ec9-ee15-4de3-abe6-688d81a36461

"...


You should be OK just copying the contents of that directory to the same spot on your build machine. Alternatively, if you have VS installed on your build machine you should be OK after installing the VS patches.

..."




"... I just encountered the same problem for VS2008/TeamBuild 2008 and it was resolved the same way except by copying over the v9.0 version of the targets file..."

 
" ... still a problem in 2010.

... I don't want to have to install Visual Studio.
... expect that I ought to be able to build a web project with MSBuild without requiring Visual Studio to succeed.
...expect the WebApplication.targets to be installed with .NET 2.0 SP1.
...
"

2010年8月5日 星期四

如何輸入/如何打出 注音符號 ?

[Q] 如何打出 注音符號?

[try]
0. copy/paste, 將所有的37個 注音符號存在一個檔案裡或網頁上
要用的時候 拷貝再貼上

1. 用 Google Pinyin 輸入法的軟鍵盤 (感謝 ANo 的指導) , 但是怎麼打出ㄅ?

2. 新酷音 或 Sougo 輸入法???



[Q] Google Pinyin 輸入法如何打出ㄅ?


//=== 37個 注音符號
ㄅㄆㄇㄈ
ㄉㄊㄋㄌ

ㄍㄎㄏ
ㄐㄑㄒ

ㄓㄔㄕㄖ
ㄗㄘㄙ

ㄚㄛㄜㄝ
ㄞㄟㄠㄡ

ㄢㄣㄤㄥㄦ
ㄧㄨㄩ

2010年7月31日 星期六

PTT BBS 入門

小寫m 加入最愛
小寫z 進精華區
大寫E 修改發文
大寫T 修改標題
大寫Z + n : 搜尋推文 >=n 的文章

a 搜尋作者
/ 搜尋標題
?

y 回文
X 推文
% 也是推文?

w  丟文章作者水球


[Q] 怎麼發熱線?
[Q] 怎麼丟水球?
[Q] how to seach ptt bbs using google?

[try]

(→)(t)(Enter) 跟他/她聊天

(w) 熱線 Call in

(^W)切換水球方式 一般 / 進階 / 未來

(b) 對好友廣播 (一定要在好友列表中)

(^R) 即時回應 (有人 Call in 你時)


[ref]
http://ithelp.ithome.com.tw/question/10003326

2010年7月19日 星期一

憑證展期安裝失敗 重新申請 安裝又失敗

[系統環境]
WinXP Sp3, IE8, Atom161

[Symptom]
錯誤訊息:  CAPI  中找不到憑證序號 xxxxxx

Server 端認為Client端已經安裝成功
但是新的憑證雖然下載了 卻沒有成功裝到電腦的適當目錄中
導致 IE找不到憑證 ...
(感覺是最後將憑證寫入檔案時 沒有足夠的權限 , 與試用digiSealer的狀況類似 ...)

證券公司人員要求我下載安裝TeamViewer 讓他能夠遠端操控
雖然有點懷疑 但為了解決問題 只好冒險試試看
他裝了GCSCTools, 又重新做了一次 IE的環境設定 (加入信任網域 允許Cookie, popup, 允許ActiveX Control ...)
但結果還是一樣

更麻煩的是 我不知如何移除TeamViewer 在控制台的新增/移除程式中 找不到TeamViewer ?


//===
[Q] .cer 不包含私鑰?
證券公司人員傳送只含有公鑰的.cer 憑證檔案
假設私鑰部份已經在之前的下載過程中 成功安裝於電腦中
將公鑰的憑證匯入(.cer 檔案  按滑鼠右鍵 -> 安裝憑證)
成功後再將整個憑證匯出(記得要連私鑰一起匯出) 做備份

將備份憑證拿到另一台電腦做匯入
確認也可以做下單的動作
終於大功告成!





[Q] Where is TeamViewer installed?
[Q] How to uninstall TeamViewer?
[Q] How to make sure  TeamViewer had  been  removed?

2010年7月15日 星期四

Notebook(laptop) keyboard trouble

//===
筆電鍵盤 前一分鐘還是好好的 忽然出現奇怪的亂碼
中毒嗎 還是 鍵盤壞掉 ?
仔細觀察 左半邊正常 但按右半邊的字母則出現數字0,1,2,3 ...

原來是不小心按到右上方的NumLock
NumLock的顯示燈 不過我的筆電鍵盤沒有?

//===
The keyboard of my laptop suddenly went wrong and showed garbles.
Panic! Is it broken or my laptop is infected with virus?

After taking a close look, i discovered that the
left half of my keyboard worked normally but the
right half displayed only numbers(0,1,2,3,...) no matter which letters were pressed.

Ha! It is caused by my careless pressing of NumLock.
The indicator of NumLock is quite obscure on the small keyboard of laptop ...

2010年7月7日 星期三

微軟拼音輸入與漢語拼音

Chinese PRC:


Microsoft Pinyin IME3.0



Chinese Taiwan
Microsoft New Phonetic IME 2002a

-> properties -> Keyboard Mapping

-> HanYu Pinyin

VA, Watt, and power factor

VA: volt ampere
W: watt (joule/s, one joule per second)

pf: power factor(功率因素) , pf== W/VA



//===
FPL27Ex-N 省電燈管???
用"省電達靈"電力監測器(Power meter)量得 VA=41, W= 24,  pf==0.58


省電燈泡功率因素大約在0.55 ~ 0.6

每瓦發光效率大約55 ~ 70 lm

日光燈的功率因素低於0.5??
每瓦發光效率約81 lm



[ref]
http://www.mobile01.com/topicdetail.php?f=168&t=772594&last=8823003

2010年6月23日 星期三

Certificate and RSACryptoServiceProvider

//===
RSACryptoServiceProvider rsa ...

Bob rsa.Encrypt(): use Alice's public key to encrypt the msg sent for the receiver Alice;

Bob rsa.Decrypt():  use Bob's private key to decrypt the received msg target for Bob from ...;


Henceforth, in order to sign the hash, have to use rsa.Decrypt() (i.e. pirvate key) !?
to verify the crypted sig , have to use rsa.Encrypt()
but they failed for hash/sig verify/creation

*** use rsa.VerifyHash() / rsa.SignHash() instead


//=== another trouble
exception: Key not valid for use in specified state.
input data to long?

常用的Windows Registry 與 路徑

//=== application programs loaded in system tray
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
  • Run
  • RunOnce
  • RunServices
  • RunServicesOnce
//=== IE temporary internet files
C:\Documents and Settings\username\Local Settings
C:\Documents and Settings\username\Local Settings\Temp
C:\Documents and Settings\username\Local Settings\Temporary Internet Files
C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Internet Explorer
C:\Documents and Settings\username\Start Menu\Programs

Vista
C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\

2010年6月20日 星期日

Certificate chain and Certificate

[Q] How to get the whole certificate chain from a given X509 certificate?
[Q] How to get the CA's certificate from a given DN?
[Q] How to get the CA's certificate from a given public key?

[try]
C#,
X509Chain xChain;
X509Certificate2 cert;
...
xChain.Build(cert);
...
X509ChainElement
...

[ref]
X509Chain,
http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509chain.aspx

online certificate chain check,
http://forums.asp.net/t/1149495.aspx

//===
  • certificate chain = certificate path
  • DN= Distinguished Name
  • CN= Common Name

//=== Digital certificate (or Certificate for short)
Digital certificates are used to authenticate an entity( a person, an organization, a company, ...) 
 by  "a chain of trust" .
 
The chain is formed topdown?,  with a root authority(RA) at the top.
To view any certificate's chain,
  • trigger MMC snap-in by double-clicking a certificate,
  • then click the Certificate Path tab.


//===
The root authority certificate at the top of a certificate chain is self-issued.

//===  Distinguished Name (DN) uniquely identifies an entity in an X.509 certificate.
Attribute types in  DN:

  • CN:  Common Name
  •  T :  Title
  •  O :  Organization name
  •  OU :  Organizational Unit name
  •  L : Locality name
  •  ST (or SP or S)  : State or Province name
  •  C : Country

 //=== Digital certificate (Certificate for short)

A digital certificate contain at least the following information
  • The owner's public key
  • The owner's Distinguished Name  (Owner's DN)
  • The Distinguished Name of the CA that is issuing the certificate (issuer's DN)
  • The date from which the certificate is valid (Valid From)
  • The expiry date of the certificate (Valid To)
  • A version number
  • A serial number (SN)

 
[ref]
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzahu/rzahudistname.htm

http://java.sun.com/j2se/1.5.0/docs/guide/security/cert3.html

http://www.iona.com/support/docs/orbix2000/2.0/tls/html/OpenSSL4.html

2010年6月7日 星期一

Get CN from Certificate

[Q] How to get "CN" attribute from a certificate ?

X509Certificate2 cert;
...
cert.SubjectName.Name= "CN= ..., OU= ..."

[try] my primitive approach ...
//=== C# code snippet


public string getCN( X509Certificate2  cert)
{
string s = cert.SubjectName.Name;
string[] strArr=s.Split(new char[] { ',' });

for (int i = 0; i < strArr.Length; i++)
{
  if (strArr[i].Contains("CN"))
  {
    s = strArr[i];
    int pos = s.IndexOf('=');
    s=s.Substring(pos + 1);
    break;
   }

 }

 return s
}

2010年6月2日 星期三

asn, ber, der again

//===  BER encoding == Type(Tag) + Length + Value(Contents)
Type(Tag) : 佔掉1個byte
Length : 佔掉1~5(?)個bytes
Value(Contents): 所佔的bytes 由Length field 來決定

常用的Type :
0x03 == Bit String
0x04 == Octet String



//===  Example  of  BIT STRING with value "0101-1110-0100-1111-0111-1"
DER encoding (padding "000") :
0x 03(stands for type Bit String)  04(length in bytes)  03(3 padding bits) 5e 4f 78  
--> 0x 03 04 03 5e 4f 78


 


//=== short form / long form of  length field of BER-TLV
Short form:  the length field consists of a single byte where the bit B8 shall be set to 0 and the bits B7-B1 stands for the number of bytes in the value field. Any length from 0-127 is encoded by 1 byte.

Long form:  the length field consists of a leading byte where the bit B8 shall be set to 1 and the B7-B1 shall not be all equal(i.e 1111-1111, 1000-0000 are not allowed), B7-B1 stands for the number of subsequent bytes in the "length" field. Those subsequent bytes shall encode an integer equal to the number of bytes in the value field.
Any length within ushort  (up to 65535= 0xFFFF) can thus be encoded by 3 bytes.

Example:  if the value is  500-byte long (0x 01 F4), then the encoded length will consist of
three bytes: 82 01 F4.

Neither DER nor ISO/IEC 7816  use the indefinite lengths specified by the BER(basic encoding rules) of ASN.1





 
//===
"... DER adds the following restrictions to the rules given in Section 3:
  • When the length is between 0 and 127, the short form of length must be used
  • When the length is 128 or greater, the long form of length must be used, and the length must be encoded in the minimum number of octets.
  • For simple string types and implicitly tagged types derived from simple string types, the primitive, definite-length method must be employed.
  • For structured types, implicitly tagged types derived from structured types, and explicitly tagged types derived from anything, the constructed, definite-length method must be employed.
...
"

//=== BER encoding for BitString :

Primitive or constructed.

P/C is the primitive/constructed bit: Bit 6 of the first byte(Type byte) ,  it specifies if the value is primitive(integer, byte, bool, ..  or constructed type which holds TLV values like a SET.
If P/C bit is "on" , it indicates a constructed type.



Padding:
  • The bit string is padded with zero to seven bits of "any value" to make the length of the bit string a multiple of eight.
  • If the length of the bit string is a multiple of eight already, no padding is done.

 
"Primitive" encoding :
  • The first "contents octet" gives the number of bits by which the length of the bit string is less than the next multiple of eight (this is called the "number of unused bits").  == the number of padded bits for Bit String
  • The second and following contents octets give the value of the bit string, converted to an octet string.

  
"Constructed" encoding:
??? the contents octets give the "concatenation" of the BER encodings of consecutive substrings of the bit string, where each substring except the last has a length that is a multiple of eight bits.



Example: The BER encoding of the Bit String value "0110-1110-0101-1101-11"

 
  
DER encoding  : 03 04 06 6e 5d c0


 
padded with "100000"  : 03 04 06 6e 5d e0

   
long form of length octets : 03 81 04 06 6e 5d c0



constructed encoding: "0110111001011101" + "11"  
23 09 +
03 03 00 6e 5d +
03 02 06 c0
[ref]
http://luca.ntop.org/Teaching/Appunti/asn1.html
http://en.wikipedia.org/wiki/Basic_Encoding_Rules
http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_annex-d.aspx#AnnexD_3
https://www.opends.org/wiki/page/DefBasicEncodingRules

2010年6月1日 星期二

某大電信公司 非固定制ADSL配發固定ip時程

在打了三通客服電話 + 兩封email後
最後得到一個???答案 : "辦理移機業務 原則上需7個工作天才竣工,故需待竣工後申請之非固固定ip才能重新配發"

移機申請後 第二個工作天 工程人員就來跳線 當天網路查詢進度就已經竣工了
但是 "... 竣工後申請之非固 固定ip才能重新配發 ..."
竣工後 重新配發固定ip 又需要幾個工作天 固定ip才能真的上線使用呢???

還是沒有答案 ....



//===
Subject: xxNet客服中心回函(xxNet Customer Care Center Reply)

親愛的客戶您好: 首先感謝台端來函!


您的來函編號為{HIN5xxxxxxx}

經查詢詢台端是2010/05/xx辦理移機業務,故原則上需7個工作天才竣工,故需待竣工後申請之非固固定ip才能重新配發.

xx電信數據分公司祝您上網愉快! 若您有任何問題或者建言,請電洽0800 080 xxx客服中心或再來函與我們聯絡,我們將竭誠為您服務。
為有效處理廣告信檢舉,假使您是要檢舉廣告信請寄至spam@ms1.xxNet.net
======最新業務訊息======= 有關於ADSL+xxNet最新優惠方案台端可來函apply.xxNet@msa.xxNet.net留下您的大名及聯絡方式或來電02-2192xxxx 將有專人為您解說服務!




//===
Subject: xxNet客服中心回函(xxNet Customer Care Center Reply)

親愛的客戶您好: 首先感謝台端來函!


您的來函編號為{HINxxxxxxxxx}

有關台端的問題,煩請您來信提供ADSL附掛電話號碼(含區碼),以利為您轉相關單位回
覆,不便之處,敬請見諒!

xx電信數據分公司祝您上網愉快! 若您有任何問題或者建言,請電洽0800 080 xxx客
服中心或再來函與我們聯絡,我們將竭誠為您服務。
為有效處理廣告信檢舉,假使您是要檢舉廣告信請寄至spam@ms1.xxNet.net
======最新業務訊息=======
有關於ADSL+xxNet最新優惠方案台端可來函apply.xxNet@msa.xxNet.net
留下您的大名及聯絡方式或來電02-21926xxxx(???) 將有專人為您解說服務!


//===
Subject: web 主旨 : 非固定制ADSL 配發固定IP時程

敬啟者您好:

客戶HN號碼:
客戶端電腦系統環境: ....
以下為客戶來信內容

本人安裝非固定制ADSL 申請配發固定IP
自從移機當日 到今天已是第五個工作天
打了三次客服電話 每次都是
資料庫還在作業 請您再等兩三天 作業完成後會以email通知您

如此不僅用戶沒辦法掌握時程
反覆電話詢問 也會造成客服人員困擾

強烈建議: 申請非固定制ADSL 配發固定IP時程 應給出上限 避免彼此困擾

ThrashBox Test Again !


//===
preview differs from the final post ?
inter-influence between post and side-bar gadget?
embedded CSS name conflict?





//=== ThrashBox is fine within "Post" but doesnot work well in side gadget

TrashBox Test

Who's who?

//=== The following example does not use thrashBox and can be applied to Blogger's gadget without misalignment



SmartCard

2010年5月31日 星期一

CMS

CMS:
  • content management system
  • cryptographic message syntax

How to verify detached signature?


[Q] How to verify detached signature?
[try]
0. In addition to the detached signature itself,  still need 
  • the source data that was used to compute the digest and signature.
  • signer's certificate or public key
  • the timestamp when it was signed?
[example] 
openssl smime -verify -in detachedSig.dat -inform DER -content
sourceData.dat -signer signer_certificate.pem -noverify
[ref]
http://www.mail-archive.com/openssl-users@openssl.org/msg40857.html

2010年5月21日 星期五

2G and 3G

//=== 網搜
[Q] 3G門號 USIM可以用在2G手機嗎?? 有些2G手機不吃3G USIM卡?

[Q] 2G門號 SIM卡可以用在3G手機嗎?? 大部分可以

[Q] 不要把2G門號換成3G,市話打2G和3G手機價差可達1.2倍?



//=== [緣起]
撐到了不得不換手機的時候 (雖然還可以撥號 但是聽不到聲音 )
租房子 要與屋主或仲介連絡 出門前還可以用市話
到碰面地點要連絡 手機實在方便

如果要連續看三個地方
手機就變成必需品

還有陪爸爸去醫院 回程要叫某大x大車隊的計程車
也要靠手機.
醫院門口排班的計程車
一方面沒有折扣 一方面素質良莠不齊
透過手機叫車 有紀錄比較安全
個人覺得大x大車隊的司機確實比較有禮貌

//===
重點 要換手機
面臨的第一個問題就是哪裡買新機?

  • 電信公司營業窗口或直營門市
  • 特約服務中心比較好?
  • 直接服務中心較專業?
  • 通訊行
  • 網路
  • 續約兩年 手機優惠?

門號查詢, http://bms.emome.net/mbms/NewApply/findAvailable.jsp


希望省電(電池可以待機久一點) 又便宜 
-> 0元手機必須搭配新門號或續約兩年 月費低消沒有88的
-> 單買手機不綁門號的入門機種


[Q] 如何知道自己當初申請的是2G或3G的門號?
 --> 查詢目前費率


[try] 如果是鍾花電信, 登入 emome
我的 emome-> 門號資訊 (我的門號資料)>全區GSM 服務 (就是2G)




//=== 老人專用手機




//=== ~NT$1,300

  • SAMSUNG E1100/ E2120
  • NOKIA 1682 classic
  • LG GS108
  • LG GB125



[Q] 哪裡可以買的到山寨機?

[Q] MMS and SMS ?
[Q] 如何知道當初有無申請GPRS?
//===  http://www.emome.net/channel?chid=227

"
0.使用「MMS多媒體訊息服務」需要申請嗎?

從92.04.29起,凡客戶申請本公司GPRS整合封包無線電服務,即同步開通「MMS多媒體訊息服務」,無需另行申請MMS服務。
1.什麼是「MMS 多媒體訊息服務」?

「MMS 多媒體訊息服務」是一種嶄新的訊息服務,只要使用支援 MMS (Multimedia Messaging Service)的手機就能傳送或接收多樣的訊息內容,舉凡複雜的文字訊息、連串的黑白或彩色圖檔,聲音或是鈴聲,都能透過 MMS 傳送至對方或接收到自己手機,訊息內容可呈現動感、聲光而不再只是單純簡短的文字而已。



2.「MMS 多媒體訊息」與「SMS 簡訊」有什麼不同?

「MMS 多媒體訊息服務」使用話務頻道 (traffic channel) 來傳送訊息資料,藉由話務頻道來傳送資料可傳送之資料量大於使用控制頻道之 SMS,舉例來說,一張包含彩色圖片的 MMS 可能有20k(1K 為 1024 bytes)以上,且 MMS 可支援多種媒體格式如文字圖片、影像、聲音等,MMS 可說是新一代的訊息革新。

「SMS 簡訊」SMS 傳送的方式是透過電信網路中的控制頻道(control channel)來傳送訊息,一通 SMS 訊息最多只能傳送 160 Byte,SMS 僅可支援文字格式。
...

4.MMS 訊息支援那些資料格式?

根據 MMS 的標準,「MMS 多媒體訊息服務」支援 JPEG、GIF、text 及 AMR、MIDI 聲音檔案格式。
...
"
 


[ref]
[2006.05.06] http://www.beephone.com.tw/forum/viewtopic.php?t=1019

http://www.emome.net/channel?chid=227

2010年5月18日 星期二

Flash AS3 package/class 的注意事項

  • class 名稱必須與 檔案名稱完全一致
  • package 名稱必須與 目錄名稱完全一致
  • 名稱的大小寫有別
  • 如果package/class儲存的目錄並非現行目錄 必須手動將其加入class path
    Edit -> Preferences -> ActionScript 3.0 Language Settings
  • 用到的class 都必須import, 例如 import mypack.class1;




//===
  • case sensitive
  • class name must match file name
  • package name must match directory(folder) name
  • class path setting need to be added if .as is saved in directory other than current dir/flash system dir by "Edit -> Preferences -> ActionScript 3.0 Language Settings ..."
  • has to import the class, e.g. import mypack.class1;


[ref]
http://stackoverflow.com/questions/1259699/actionscript-3-import-package-vs-import-package-class

http://www.actionscript.org/resources/articles/698/1/Make-your-own-reusable-classes-using-Flash-and-AS3/Page1.html

http://www.foundation-flash.com/tutorials/packages/

Windows security alert about Java(TM) Platform SE binary

最近開機後老是出現 (XP sp3)
Windows security alert:
"Windows firewall has blocked some features of this program.
Do you want to keep blocking this program?
Java(TM) Platform SE binary"
-- Unblock, Keep blocking , Ask me later

[Q] 難道是沒有update 成新版 Java 引起的?

[try]
上網搜尋 找到sun的論壇 
有些人的說法是Java updater 嘗試著對外連線看是否有新的update
觸發Window firewall 的Security Alert
基本上 java的 JRE (SE binary) 應該沒有問題
可以Unblock ?






[ref] http://forums.sun.com/thread.jspa?threadID=5412928

2010年5月16日 星期日

Dw20.exe

Dw20.exe
  • Windows application error reporting tool for "microsoft office"
  • 當Office 出現問題停止回應時 Dw20.exe 自動將相關的資料透過網路上傳到微軟的...
[Q] 只針對 Office? 其他的應用程式呢?

"To disable the Application Error Reporting tool, add a DWReportee value of 1 to following registry keys:


 HKEY_CURRENT_USER\Software\Policies\Microsoft\PCHealth\ErrorReporting\DW 
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\PCHealth\ErrorReporting\DW
HKEY_CURRENT_USER\Software\Microsoft\PCHealth\ErrorReporting\DW
HKEY_LOCAL_MACHINE\Software\Microsoft\PCHealth\ErrorReporting\DW

"
 
 
[ref]
http://support.microsoft.com/kb/841477/en-us

抑制 Office XP 的錯誤回傳, http://support.microsoft.com/kb/325075/en-us

2010年5月11日 星期二

BER and DER of ASN.1

BER: basic encoding rules
DER: distinguished  encoding rules
ASN: abstract syntax notation

DER is a subset of BER, and BER is a subset of ASN.1

DER encoding for each ASN.1 value is unique
BER encoding for an ASN.1 value may be multiple.



[ref]
http://www.rsa.com/products/bsafe/documentation/certj212html/certj/dev_guide/group__CERTJ__STDS__ENCODING.html

operator precedence / priority in C#

byte[] buf= new byte{0x1A, 0x03};
...
int len = buf[0] + (buf[1] << 8);

int len = buf[0] + buf[1] << 8;

* the above two statements give different values to len

base64 encoding in C#

try
Convert. static functions:
  • FromBase64String()
  • FromBase64CharArray
  • ToBase64String()
  • ToBase64CharArray()
or try
http://www.codeproject.com/KB/cs/base64encdec.aspx

Remote control breaks remote desktop connection/session

At Windows7, when trying  to remote control windows 2008, the original  remote desktop connection broke up and popped out message to ask for help:
" Remote desktop session has ended, your network administrator might have ended the connection , ..."
...

--> rdp and remote control  resource settings(bandwidth, color resolution, ..)  have to be the same

[try]
windows update (KB969084)
http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=72158b4e-b527-45e4-af24-d02938a95683&displayLang=en

Terminal server settings
http://social.technet.microsoft.com/Forums/en/winserverTS/thread/87fc497a-27fd-4a76-ab59-ea5fe01c9091

mp3 with LineIn

具有LineIn的 mp3 player(撥放器)
可能有LineIn的錄音功能
也可能只有 LineIn 的放音功能(作為LineIn 音源的喇叭) 

即使該mp3 player具有所謂的錄音功能 
可能也只能從麥克風錄音 無法從LineIn錄音?

Some mp3 players/recorders may only record sound from the microphone
even if they have the so called LineIn hole,
i.e. the LineIn only transmits the sound source to amplifier/speaker
but does not record it?

2010年5月7日 星期五

Compile Errors

[Q] MSVCRT.lib(MSVCR90.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)

[try]
ignore lib libcmtd.lib/msvcrt.lib by
/NODEFAULTLIB:LIBCMTD.lib;MSVCRTD.lib

2010年5月5日 星期三

Smart card 與 憑證

最近需要用到Smart Card所儲存的憑證  不想透過Windows Certificate Store 存取
想直接讀出Smart Card中的憑證
用WinScard.dll
試了apdu的select file 有問題
開始大搜尋 發現一些比較有幫助的連結:











//=== GPKI安全保密函式的版本 ,  taiwan  hisecure API rely on HiCos PKCS#11 lib ???
" ... GPKI安全保密函式庫使用C語言與Java語言撰寫,都可在Windows與Linux平台編譯。GPKI安全保密函式庫最新版本名稱為HiSECURE v6.1.0

C語言版本係使用C++語言開發,...  以下為編譯環境:
(a)Windows平台之編譯環境:Windows作業系統 Visual Studio C++ 6.0
(b) LINUX平台之編譯環境:Linux CentOS 2.6.18-92.el5 gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)



Java語言版本2.1 ... 編譯環境包含
(a)Windows平台之編譯環境:JDK1.4.2以上
(b)LINUX平台之編譯環境:JDK1.4.2以上

"

//=== GTESTCA發展套件 與 GPKI安全保密函式庫
"GTESTCA發展套件除了提供相同之GPKI安全保密函式庫(內含使用手冊及範例程式),還提供已制式化處理與印刷的RSA IC卡片6張,以及USB介面IC卡讀卡機兩部,開發人員可使用安全保密函式庫進行系統開發作業,並以RSA IC卡片至政府測試憑證管理中心進行憑證申請等相關作業,以利進行系統測試。建議申請機關/單位請先向政府測試憑證管理中心申購GTESTCA發展套件,等系統測試一切正常後,再申請正式憑證及安全保密函式庫標準版(建議系統正式上線前一至兩個月至GCA網站之安全保密函式庫提出申請。請於線上填寫安全保密函式庫申請書,填寫完畢列印安全保密函式庫申請書及保密切結書,以公文書方式函送行政院研究發展考核委員會,若核准將提供帳號與密碼供下載安全保密函式庫。)

"


[ref]
http://gca.nat.gov.tw/07-01-07.html
http://epki.com.tw/api.htm
https://edm.moica.nat.gov.tw/apply/switch.do?waymark=baseIndex

2010年5月4日 星期二

smart card and private key

[Q] How can i dump out the private key if i own the pin number?
[Q] How does smart card prevent the private key frome being dumped out?
[Q] Smart card 如何防止 private key 被拷貝?
[Q] 如何告訴SmartCard 使用所儲存的private key 進行簽章?
[Q] How to sign a message with smartcard which internally compute the hash  and encrypt it with the private key ?

"... Vendors can define their own file format to optimize storage or processing efficiency. This key material should never be exported out of the ICC..."


[ref]
PCSC v2.part8, http://www.pcscworkgroup.com/specifications/files/pcsc8_v2.01.01.pdf

Where are dll installed in Windows?

[Q] When a dll is installed/registered? by regsvr32, where is it installed  in hard disk?
[Q] Where are those downloaded ActiveX control ,  initially placed in C:\WINDOWS\Downloaded Program Files,  installed ?

2010年5月3日 星期一

勞保局與勞保網路申報及查詢作業系統

比較新的勞保資訊 -->  http://3hitek.blogspot.tw/2014/07/blog-post.html

//=== 以下資訊已過時 聊供備查
行政院勞委會底下有
勞保局, http://www.bli.gov.tw/
在勞保局的網路申辦的頁面下
有這麼一段敘述:
   "... 投保單位網路申辦及查詢作業,請由此進入 (如無法連結使用時,請利用中央健康保險局網路申辦系統或另以書面郵寄申報。)... "


其中的由此進入就連結到 "勞保網路申報及查詢作業系統", http://www.blia.gov.tw/

其實我並非從該處得知 "勞保網路申報及查詢作業系統",  而是希望使用工商憑證 透過網路作業來簡化/節省作業時間 就從工商憑證的應用教學網頁,
http://gcis.nat.gov.tw/moeaca/application/application01.htm

連到了 "行政院勞委會勞保網路申報及查詢作業系統"", http://www.blia.gov.tw/



第一件讓我奇怪的事: "bli" 與 "blia" 是自己眼花了嗎? 還是網頁被竄改?
結果應該都不是 ... 所以是...
 
接下來的申請作業才是大問題 因為IE8 加上 沒有仔細先看過操作說明,
http://www.blia.gov.tw/doc/註冊作業說明.doc 
真的是一波七八折 !

避免有人重蹈覆轍 將一些容易出包的地方列出來 :
 
0. IE的相關設定 請參考, http://www.blia.gov.tw/blinet/iesetup.htm
將以下所有的網站加入信任的網站:
blia.gov.tw, 以及 202.39.225.14, 202.39.225.15,  202.39.225.21,
202.39.225.24,202.39.225.25,  202.39.225.37,  202.39.225.50

1. 如果是IE8 + XP, 記得先取消 memory protection , 重開IE.  可參考 http://3hitek.blogspot.com/2010/03/formosoft-capi-crash-ie8.html

2. 允許 blia.gov.tw 顯示 Pop-up, 不然最後成功註冊的回條畫面沒有出現 不僅功敗垂成 而且前面keyin的一些資料 也得重key!

憑證與Secure Email

憑證中的Subject裡如果沒有 email 的資訊 (e.g. E= xxx@yyy.zzz)
則無法用來傳送Secure Email

If there is no email address within the subject of a certificate(CN=certName, E=emailAddress),
we cannot send/receive secure email with that certicate.

2010年5月1日 星期六

數位相框 與 mp4/mp5

//=== 數位相框
經過一番搜尋 考量各方面因素 擬定了需求規格如下:
0. 有電池 可以插電 也可以不插電 觀賞
1. 有mp3/FM 功能
2. 有內建喇叭
3. LCD 7吋以上
4. LCD 解析度 800x480 以上
5. 價格 NT$3k 以下



//===
姪女誕生 想買數位相框存她的相片給爸媽看
網路搜尋之後 有些問題:

7吋的數位相框 與 5x7的相片 哪個比較大?
7吋的數位相框的電池可以用多久?
有人說買數位相框 不如買山寨的mp5 ?
有的數位相框兼具收音機與喇叭的功能
功能與耗電的關聯程度?
解析度 800x600, 800x480, 480x234?
顯示比例 16:9 , 4:3

網路燦坤 7吋的價格從 NT$1650 -- 4999  都有


//===
播放時間:約 4~6小時(依使用狀況而定)




//===
1.5吋CSTN-LCD 
鋰電池:內建3.7伏特 140mAh (待機約3-4小時)


 
 
//===
How about 10吋 LCD monitor + mp 4/5 player?

mp4,  http://shopping.pchome.com.tw/?mod=store&func=style_show&SR_NO=ABAO0F

mp5, http://shopping.pchome.com.tw/?mod=store&func=style_show&SR_NO=ABAO43

超強電源:影片可播放2-3小時、音樂5-6小時

 
//=== 7" 4:3 TFT LCD  [ref]


螢幕解析度: 800x600像素

音訊輸出: L / R 立體聲喇叭,各0.5瓦,  3.5mm耳機孔, 32 ohm

USB 介面: 標準USB A型介面,  USB mini B 型介面

儲存容量: 內建2GB 記憶體

控制鍵: 5個按鍵及遙控器

遙控器: 紅外線 (NEC 通訊協定)

電源供應: 輸入:100 ~ 240 V 0.3A,輸出:5V DC 2.0A

支援音樂檔案格式: MP3, WMA (不支援數位版權音樂), WAV

支援影片格式: Motion JPEG < AVI, MOV >(Up to 720x576 @ 30FPS)

支援圖片格式: DSC JPEG (up to 9000 x 6750)

支援裝置: SD/SDHC/MMC/MS/USB
音樂壓縮比: 32Kbps–320Kbps (MP3) 32Kbps–192Kbps (WMA)

安規認證: CE, FCC, BSMI

2010年4月27日 星期二

3G 網卡連線問題

2010.04.12? 兩個禮拜前 原本可以順利使用3G 網卡上網
直接連電腦 或 透過3G無線Router都可以

現在雖然可以撥接成功 拿到ip
但是 網頁連不通
ping DNS 不通

詢問cht ...

技術人員建議:
mobile partner -> Tools -> options -> network -> network type: WCDMA only, band: all bands

i.e. 只使用3G頻段 不掃描2G頻段
更改設定後 直接連電腦 ok, 網頁可以連上 , ping DNS  也通了
但是插回3G無線Router後 又不行了
why???

2010年4月26日 星期一

如何將flickr的影像加到 html 的頁面裡 ?

flickr似乎被yahoo購併了
登入畫面自動被轉到 yahoo的login

那google的相簿服務是用哪家呢?
--> Picasa

如何將flickr的影像加到 html 的頁面裡 ?
  • 點選target image -> 點選影像上方的 "All Sizes"  -> 
    Available size: 選擇適合的大小 如果是切割圖形的一部分 最好用原尺寸, 應該就是 "Large"
  • copy/paste the url  from the "Grab the photo's URL" to html

http://3hitek.blogspot.com/2010/04/picasahtml-webpage.html
->Link to the Photo -> Image Only


[ref]
add flickr img to html, http://www.ehow.com/how_2070652_add-flickr-images-web-page.html
add picasa img to html, http://3hitek.blogspot.com/2010/04/picasahtml-webpage.html

2010年4月25日 星期日

Picasa 不支援gif?

上傳 .gif 檔 到Picasa
自動被轉成 .gif.jpg 檔
透明變成黑色
該如何keep .gif?

如何將picasa中的影像放到html webpage?


重點:

Picasa -> MyPhotos -> click the image -> click "Link to this Photo" on the right side bar


[ref]
http://picasa.google.com/support/bin/answer.py?hl=en&answer=66969

2010年4月24日 星期六

ThrashBox 終於看懂了

ThrashBox 用了比較不一樣的方式(CSS 疊套)
來放置切割的背景圖形 達到圓角矩形的效果

一般用 PhotoShop, PhotoImpact 產生的圖形切割 是切成剛剛好 ;
div 的大小幾乎必須是固定的 而且至少要六個圖形
(四角 + body 水平線 repeat-y + top/bottom 垂直線 repeat-x)

ThrashBox 則只需4個圖形 , div 的大小 只要不過大即可(小於右下方的切割圖形), 缺點是四角的邊緣不能透明 否則會露餡兒 就像底下的例子


Test Head2 aaaaaaaaaaaaaaaa

1st sentence withour.


ps.
  • 使用Picasa 的影像時 記得選取Original size
  • 使用flickr 的影像時 記得選取All size -> Large
  • Picasa 會自動將gif 轉為jpg, 透明的效果不見了?


[ref]
ThrashBox , http://www.vertexwerks.com/tests/sidebox/
css padding, http://www.w3schools.com/css/css_padding.asp

2010年4月18日 星期日

MovieClipLoader and Loader for Flash

[Q] "MovieClipLoader" type not found?
MovieClipLoader 是擺在哪個namespace底下呢?


 
[Sol]

  • MovieClipLoader is for old Actionscript and not available in ActionScript3
  • use Loader/URLLoader instead
  • import flash.display.Loader;
  • onLoadInit -> Event.EnterFrame???
  • import flash.events.MouseEvent;
  • Mouse.addListener() -> Stage.AddEventListener()
  • Mouse position -> event.target.mousex???


 
[ref]
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html
http://maohao.wordpress.com/2007/07/14/getting-mouse-coordinates-on-stage/

 

AS3 Error 1119

[Q] Error 1119 occurred when i tried to get mouse position from MouseEvent
"Access of possibly undefined property width through a reference with static type Class."

[try]
  • ignore MouseEvent?
  • get mouse position by stage.mouseX, stage.mouseY
  • get mouse position by mc1.mouseX, mc1.mouseY

2010年4月13日 星期二

Hashtable.Clear() not clean ?

Hashtable ht= new Hashtable();
ht["test"]= "pig";

ht.Clear();
if (ht.count!=0)
{
string s= "sth wrong";
}

2010年4月8日 星期四

CSS style placement in html

[Q] Where to place CSS style within an Html page ?

[Q] Can we put <style> ... </style > within <body> rather than <head> ?
Yes, we can. Read more on
--> http://3hitek.blogspot.com/2010/12/css-embed-in-bloggerblogspot.html

[try] css style has to be defined before html's < body > ???
i.e. within <head> </head>

by

  • <link>
  • <style> ... </style > (embed)
  • @import "urstyles.css";

//=== otherwise --> css inline
<h2 style="color:red; background:black;">This is a heading style with red text and black background </h2>

can we put <style> ... </style > within <body> rather than <head> ?

The answer seems "Yes, we can". Please see my new blog post http://3hitek.blogspot.com/2010/12/css-embed-in-bloggerblogspot.html

How to remove addon from IE ?

[Q] How to remove addon from IE ?
[Q] 如何將IE的加載(addon)移除?

[try]
0. first disable the to-be-removed addon(s) via
Internet Options -> Programs -> Manage add-ons ->

1. Manage add-ons -> select "All add-ons" instead of "Currently loaded add-ons"

2.
  • IE7 -> Delete ActiveX control
  • IE8 -> select the target add-on -> disable it
    -> "More information" -> "Remove all sites" -> "Remove"

3. the target add-on should disappear from the list of "All add-ons"


xxx 3.1 Control Panel -> Add or Remove Programs -> remove those related with the add-ons ?

xxx 3.2 open IE, -> Internet Options -> General -> Delete Browing History

4. close and restart IE

2010年3月29日 星期一

Formosoft CAPI crash IE8

[Q] 在安裝了Windows/Adobe Reader9/Flash CS4試用版/... ?(i'm not sure which one) 的更新之後 網路下單出現問題 跳出提示視窗 要求安裝 Formosoft CAPI
然後整個IE 就當掉...


[try]
disable IE options-> Advanced-> "Enable memory protection to help mitigate online attack*"

IPCam not work with IE8?

[Q] 家中裝了台Wei-Chu 網路攝影機(IPCam) 在家裡LAN上測試OK
在公司用IE7的電腦 可以完成驅動程式的安裝 並正常顯示
但如果用IE8的電腦 則驅動程式安裝最後會出現Memory access fault
之後連上IPCam的網頁 只顯示出左半邊的導覽列
右半邊的Frame 則是connecting ... -> disconnected 無法顯示出正常的攝像


[try]

  • 取消IE8的memory protection的選項
  • 重新安裝IPCam的驅動程式

//===

[Q] My brother bought and installed an IP Camera home. Testing the IPCam at home via LAN is fine, we can see the image and manipulate the IPCam to pan around.

When i connected to the IPCam via internet from my office, some problem did occur. IE8 could not finish the driver installation successfully even though i already add the IP address of the IPcam to trusted sites and allow pop-up from that IP -- "memory access fault".

After that failure IE8 does not prompt for driver installation anymore and the video cannot be shown out. Only the navigation menu is shown in the left frame of IE8, in the right frame shows "connecting ..." then "disconnected" then blank/silence.

[try]

  • Disable the option of IE8 -> Advanced-> "Enable memory protection to help mitigate online attack*"
  • Reinstall driver for IPCam

2010年3月26日 星期五

How to create crypted pdf file with pkcs7 security handler?

[Q] How to create crypted pdf file with pkcs7 security handler?
[Q] How to create certificate crypted pdf file

[try]
use Adobe Acrobat -> Advanced -> Certificate Encryption

2010年3月14日 星期日

CSS rounded corner rectangle

  • ThrashBox, uses 4 background images, one for each corner
  • Spiffy corner, use <b> elements
  • Nifty corner, use <b> elements + javascripts
  • CSS3

CurvyCorners supports CSS3 /pre-CSS3 auto detection


[ref]
http://www.spiffycorners.com/
http://www.html.it/articoli/nifty/index.html (Nifty corner)
http://www.devwebpro.com/25-rounded-corners-techniques-with-css/

http://www.curvycorners.net/

http://redmelon.net/tstme/4corners/
http://www.alistapart.com/articles/customcorners/ (2003)

Even-odd and winding-number rules

"Even-odd" and "winding-number" rules to determine a point is inside/outside a polygon.

[Q] How to determine whether a point is inside a polygon or not?
[Q] How to determine whether a point is inside a region or not?
(supposed that the region is formed by a path composed of only line segments and Bezier curves)



[Comments] 0-outside, 1-inside
even-odd : even -> outside, odd -> inside
winding-number: 0 is even -> outside, 1 is odd -> inside

winding-number rule is usually prefixed by "nonzero" to represent that a point is inside the polygon if the winding number is nonzero.

Actually, even-odd can be reckoned a special case of winding-number rule when modulo 2 is applied to its counting metrics --
  • number of crossed edges (even-odd)
  • number of net crossed edges considering edge direction(winding-number rules)


[ref]
http://www.cs.berkeley.edu/~ddgarcia/cs184/r3/#02
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

2010年3月1日 星期一

[Q] How to make vpn connection from behind a 3G router to a remote vpn server?

[Q] How to make vpn connection from behind a 3G router to a remote vpn server?

when i directly connect my pc to the usb 3G modem, the vpn works with little problem(time-out can only be solved by logout/login so far),
but if i connect my pc to a 3G router, i.e. my pc is now within the intranet behind the router, the vpn connection fails to be established...

2010年2月1日 星期一

non-unicode application run in Windows

[Q] How to make the non-unicode programs, e.g. in Big5 , display correctly in Windows?


[try] change the following selections to the proper charset and language

Control Panel -> Regional and Language Options -> Regional Options
  • Standards and Formats
  • Location

Control Panel -> Regional and Language Options -> Advanced

  • Language for non-Unicode programs

2010年1月25日 星期一

When is DefineSceneAndFrameLabelData to be used?

[Q] When/Where is "DefineSceneAndFrameLabelData" tag to be used in Flash?

[Q] 在Swf spec.中的 DefineSceneAndFrameLabelData tag, 何時會被用到?

2010年1月21日 星期四

如何移除BDE Administrator?

[Q] 如何將BDE Administrator 從Windows移除?

[Q] How to remove "BDE Administrator" from Windows?

2010年1月20日 星期三

怎麼判斷安裝的Windows XP 是中文版還是英文版?

[Q] 怎麼判斷安裝的Windows XP 是中文版還是英文版?

[Q] How to tell the installed Windows XP is english version or chinese version?

[try]
check the version and language of kernel32.dll
C:\WINDOWS\system32 -> kernel32.dll -> properties -> language ->

2010年1月17日 星期日

VPN over 33.6kbps 撥接連線

[Q] VPN over 33.6kbps 撥接連線 可以建立VPN onnection , 但是跑remote desktop 出現黑屏
然後斷線; 網芳的檔案分享 只出現根目錄的畫面 雙擊進入子目錄則卡住 游標變沙漏...

[Q] Has problem when using VPN over 33.6kbps dial-up connection, although VPN connection is established, running remote desktop has no response, file-sharing also failed.

2010年1月6日 星期三

撥接上網的費用

Yahoo, PCHome 都有提供所謂免費的撥接帳號
只要有modem(有些筆電有內建的Software Modem)
就可以撥接上網

不過還是要付給電信公司通話費
以中華電信為例 大約 1.6 元 /5 分
也就是半小時大約NT$ 10元
假設每個週末回家用個四小時 --> 80元/week --> 320元/month

這樣划算嗎?