免責聲明

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

2011年4月29日 星期五

Google Doc 檔案上傳

[Q]  如何抑制上傳檔案轉換為Google Doc的格式?
[try]
0. API: 在Query Uri 加上 參數 convert=false
1. UI :  登入 Google Docs -> "Upload" -> Files/Basic -> 在對話盒中取消
選項 "Convert documents, presentations, spreadsheets, and drawings to the corresponding Google Docs formats"


在 try-and-error 的過程中 有些問題 在google的官方forum 不知如何快速找到對應的連結
直接google 所有網頁 發現cyberduck ( http://trac.cyberduck.ch/wiki/help/en/howto/googledocs  )
列出了許多想找的連結,
例如:

[Q] 如何上傳任意格式的檔案?
[try]
http://docs.google.com/support/bin/static.py?page=guide.cs&guide=1247871


[Q] 需要 Google Apps Premier Account (http://www.google.com/apps/intl/en/business/details.html)
才能上傳任意格式的檔案?


[Q] 不需要文件協同編輯 只想要單純的網路硬碟/儲存空間 ?
[try]
Google Storage 快速上手 ( http://trac.cyberduck.ch/wiki/help/en/howto/googlestorage )



//===  一般用戶的 檔案上傳大小限制
GoogleDocs -> Upload -> Basic...

"...    File types and size limits
Convert documents - up to 1 MB per file:
Microsoft Word (.doc, .docx), OpenDocument text (.odt), StarOffice text (.sxw)
Rich text (.rtf), Plain text (.txt), HTML (.htm, .html)

Convert presentations - up to 10 MB per file:
Microsoft PowerPoint (.ppt, .pps)

Convert spreadsheets - up to 20 MB per file:
Microsoft Excel (.xls, .xlsx) files, OpenDocument spreadsheets (.ods).
Comma-separated values (.csv)

Convert drawings - up to 2 MB per file:
Windows Metafile (.wmf)
 ...
Files that you don't convert (maximum 25 MB per file) will count toward your storage limit. ???
...

Convert text from PDF or image files - up to 2M per file:
Photos, scanned documents, screenshots, etc (.jpg, .gif, .png)
PDF files (.pdf)

Graphics are not converted — only text. For the best results, start with high-resolution image files.
Learn about OCR (optical character recognition)
...
"
[ref]
http://trac.cyberduck.ch/wiki/help/en/howto/googledocs

2011年4月26日 星期二

Google API's Auth (認證) 種類

Google API 至少有三種 authentication 機制
  • OAuth : 目前最新的 , 也是Google 推薦的
  • AuthSub :  Google proprietary, 已被融入OAuth, 不建議再使用
  • ClientLoginAuth : 最早的方式? 安全性比較低?

2011年4月22日 星期五

ExecRequest sample for Google Data API



從 http://code.google.com/p/google-gdata/downloads/list
下載 "Google Data API Setup (1.7.0.1).msi" 之後
試著要了解Google Doc 在取得文件資訊/上傳檔案的過程中,
authentication(認證)/authorization(授權)的機制

看了一些Sample projects, 發覺包了好幾層,
實在有點見林不見樹 ...

最後發現 "ExecRequest" 這個範例比較單純
只與Core Client(Google.Data.Client.dll) 這個library 有關
(source code 在\Google Data API SDK\Sources\Library\core 的目錄下)

ExecRequest <service> <cmd> <uri> <username> <password>

  • cmd 可以是 QUERY, UPDATE, INSERT, DELETE
  • uri 例子:
    https://docs.google.com/feeds/default/private/full/-/folder?max-results=100
    將Server上的 folder/collections 的資訊取出來

    https://docs.google.com/feeds/default/private/full?showfolders=true
    將Server上的 Documents/Files/folder/collections 的資訊取出來
  • service 必須要是對應的 ServiceName


ClientLogin ServiceName Table
Google APIService name
Google Analytics Data APIsanalytics
Google Apps APIs
(Domain Information & Management)
apps
Google Base Data APIgbase
Google Sites Data APIjotspot
Blogger Data APIblogger
Book Search Data APIprint
Calendar Data APIcl
Google Code Search Data APIcodesearch
Contacts Data APIcp
Documents List Data APIwritely
Finance Data APIfinance
Gmail Atom feedmail
Health Data APIhealth
weaver (H9 sandbox)
Maps Data APIslocal
Picasa Web Albums Data APIlh2
Sidewiki Data APIannotateweb
Spreadsheets Data APIwise
Webmaster Tools APIsitemaps
YouTube Data APIyoutube




[ref]

ClientLogin documentation, http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html



FAQ, http://code.google.com/apis/gdata/faq.html

2011年4月21日 星期四

Google Data API / Google Data Protocol

開始學習 Google Data API / Google Data Protocol


//===  Developer's Guide Overview
http://code.google.com/apis/gdata/docs/developers-guide.html

 *** Many Google products, such as Calendar and Spreadsheets, provide APIs
based on the "Google Data Protocol".

Google Data protocol(GDP) Version 2.0 vs. Version 1.0
GDP v1.0 (obsolete?) was developed before the Atom Publishing Protocol was finalized.
GDP v2.0 is fully compliant with the AtomPub RFC 5023 standard.

GDP 2.0 includes support for:
  • HTTP ETags making better use of HTTP cache.
  • Partial Response and Partial Update (Experimental).


//=== .NET library for Google Data SDK(including Samples) 
http://code.google.com/p/google-gdata/downloads/list
download "Google Data API Setup (1.7.0.1).msi" from the above webpage




//=== Google Documents List Data API guide:
Google Doc 3.0 guide, http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html
Google Doc 2.0 guide, http://code.google.com/apis/documents/docs/2.0/developers_guide_protocol.html


//=== Google Apps support forum
http://code.google.com/googleapps/support/

舊的 http://www.google.com/support/forum/p/apps-apis


//=== Google Doc forum
http://code.google.com/apis/documents/forum.html

舊的 https://groups.google.com/group/google-documents-list-api?pli=1


[others]
Official google doc blog?
http://googledocs.blogspot.com/

Unofficial tips for google?
http://googlesystem.blogspot.com/

Google Apps Developer Blog
http://googleappsdeveloper.blogspot.com/

2011年4月19日 星期二

IE9, 趕流行, 開開眼界

Demo of IE9 at beautyoftheweb.com

首先 amazing sites
右下方View by category -> 選擇Cool HTML5


10K apart 的入選作品中有個SunCal http://10k.aneventapart.com/Uploads/96/
結合了google map 與HTML5的canvas/geolocation?
呈現出太陽位置相對時間的變化
橘黃色的小圓圈代表太陽 移動上方的時間軸 就可清楚的看到太陽位置的變化
SunCal的原始網站: http://suncalc.net

 
[ref]
http://www.beautyoftheweb.com/
http://10k.aneventapart.com/

2011年4月13日 星期三

Flex3 / Flex4 components correspondence

Flex3: mx.controls.ComboBox spark.components.DropDownList (w/o editability)
Flex4: mx.controls.HorizontalList spark.components.List (with a HorizontalLayout)

Flex3:  mx.controls.ComboBox
Flex4: spark.components.DropDownList (w/o editability)

Flex3: mx.controls.HorizontalList
Flex4: spark.components.List (with a HorizontalLayout)

Flex3: mx.controls.HRule
Flex4: spark.primitives.Line
Flex3: mx.controls.VRule
Flex4: spark.primitives.Line

Flex3: mx.controls.Image
Flex4: spark.primitives.BitmapImage (w/o support for external images)

Flex3: mx.controls.LinkBar
Flex4: spark.components.ButtonBar (with a custom skin)
Flex3: mx.controls.ToggleButtonBar
Flex4: spark.components.ButtonBar

Flex3: mx.controls.LinkButton
Flex4: spark.components.Button (with a custom skin)

Flex3: mx.containers.ControlBar
Flex4: spark.components.Panel (with the controlBarContent property)
Flex3: mx.containers.ApplicationControlBar
Flex4: spark.components.Application (with the controlBarContent)

Flex3: mx.containers.Canvas
Flex4: spark.components.Group

Flex3: mx.containers.Tile
Flex4: spark.components.Group (with a TileLayout)
Flex3: mx.controls.TileList
Flex4: spark.components.List (with a TileLayout)

Flex3: mx.containers.HBox
Flex4 spark.components.HGroup
Flex3: mx.containers.VBox
Flex4: spark.components.VGroup

Flex3: mx.controls.VideoDisplay
Flex4: spark.components.VideoPlayer


[ref]
http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html#_Namespaces_and_packages

Flex4 namespace

Digested from [ref]
  • MXML 2006: The legacy MXML language namespace used in previous versions of Flex. Flex 3 applications compiled using Flex 4 can continue using this namespace.
    URI: http://www.adobe.com/2006/mxml 
    Default Prefix: mx
  • MXML 2009: The new MXML language namespace. This is purely a language namespace,
    and does "not contain component tags"?.  URI: http://ns.adobe.com/mxml/2009 
    Default Prefix: fx
  • Spark: This namespace includes all of the new Spark components. It should be used in conjunction with the MXML 2009 language namespace. URI:  library://ns.adobe.com/flex/spark  ?
    Default Prefix: s
  • MX: This namespace includes all of the MX components. It should be used in conjunction with the MXML 2009 language namespace. URI: library://ns.adobe.com/flex/mx  ?
    Default Prefix: mx



[ref]
http://www.adobe.com/devnet/flex/articles/flex3and4_differences.html#_Namespaces_and_packages

Regasm and Gacutil

[Q] Where is regasm.exe ?

[try]
C:\>cd \windows
C:\Windows>cd Microsoft.net
C:\Windows\Microsoft.NET>cd frame*
C:\Windows\Microsoft.NET\Framework>cd v2.0*

C:\Windows\Microsoft.NET\Framework\v2.0.50727>regasm
     --> WoW6432Node(32bit app on 64bit system)

C:\Windows\Microsoft.NET\Framework64\v2.0.50727>regasm
    --> Normal registry for 64bit System



//===
[Q] Where is gacutil.exe?

[try]
C:\Program Files\Microsoft SDKs\Windows\v7.0>cd bin
C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>dir gac*

...
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin>gacutil
or
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bin>gacutil
or
C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>gacutil /i d:\SharedAddIn2_anycpu.dll

...
Failure adding assembly to the cache: Invalid file or assembly name.  The name of
the file must be the name of the assembly plus .dll or .exe .
...

C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin>d:
D:\>c:gacutil /i SharedAddIn2_anycpu.dll

//===
D:\>c:gacutil /i SharedAddIn2_anycpu.dll
...
Failure adding assembly to the cache: Invalid file or assembly name.  The namef the file must be the name of the assembly plus .dll or .exe .

D:\>c:gacutil /i SharedAddIn2.dll
...
Failure adding assembly to the cache:   The system cannot find the file specifid.

D:\>dir
...
04/12/2011  11:29 AM             8,192 SharedAddIn2_anycpu.dll
04/12/2011  11:21 AM             7,680 SharedAddIn2_x64.dll
             ...

D:\>copy SharedAddIn2_anycpu.dll SharedAddIn2.dll
        1 file(s) copied.


D:\>c:gacutil /i SharedAddIn2.dll
...
Failure adding assembly to the cache: Attempt to install an assembly without a strong name
...

--> need to rebuild SharedAddIn2.dll so that it is strong-named !

2011年4月12日 星期二

COM Shim and ComShim Wizard

//=== There are a series of articles explaining COM Shim :
Part1 : COM Shim Background / Installation / Startup example
 http://msdn.microsoft.com/en-us/library/aa159894(office.11).aspx (office2003)
 http://msdn.microsoft.com/en-us/library/bb508939.aspx (office2007)

"...
The Visual Studio Tools for Office(VSTO) loader is an unmanaged DLL that acts as a shim to load the .NET CLR and then your custom managed assembly.
A custom COM shim has exactly the same behavior.

If you use the VSTO loader, you can set Office macro security to High (or Very High in Office 2003), because a managed smart tag loaded by the VSTO loader is not subject to Office macro security checking at all.
..."


Part2 : ComShimWizard for VS2010
http://blogs.msdn.com/b/mshneer/archive/2010/03/19/com-shim-wizards-for-vs-2010.aspx

Part3 :  How to get a working 32-bit shim wizard to work with 64-bit of Office
http://blogs.msdn.com/b/mshneer/archive/2010/02/24/taking-com-shim-wizards-to-64-bit.aspx



//=== COMShim Wizard download
COMShim Wizard for Office2007 + VS2008/VS2005
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3e43bf08-5008-4bb6-aa85-93c1d902470e&DisplayLang=en


Older version download
COMShim Wizard for Office2003
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=4C586367-C733-4C68-9971-373C180EC114&displaylang=en

.NET Framework version 1.1 for 64-bit operating systems

[Q] How to install .NET Framework version 1.1 for 64-bit operating systems?
[try]
To install .NET Framework 1.1,

To install .net1.1sp1,

[ref]
http://technet.microsoft.com/en-us/library/cc785813(WS.10).aspx

Shared addin deployment to 64bit office

[Q] How to deploy Shared AddIn to 64-bit Office2010?

[try]
Follow the steps in the article
http://blogs.msdn.com/b/vsto/archive/2010/04/09/deploying-com-add-ins-for-64-bit-office-using-visual-studio-saaid-khan-for-nathan-halstead.aspx

To develop Shared AddIn, COM Shim Wizard  is recommened by Microsoft's VSTO Team :
http://blogs.msdn.com/b/mshneer/archive/2010/02/24/taking-com-shim-wizards-to-64-bit.aspx

GAC

//=== GAC (Global Assembly Cache)

[Q] Where is GAC?
[try]
  • for .net 1.x, .net 2.x, .net 3.x :
    %windir%\assembly\...   --> e.g. C:\Windows\assembly
  • .net4.0 :
    %windir%\Microsoft.NET\assembly\... -> e.g. C:\Windows\Microsoft.NET\assembly\...

//=== .NET Framework
[Q] How to know which .NET Framework versions are installed?
[try]
  • check registry 
    HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework
  • check %windir%\Microsoft.NET\Framework directory will have the directories
    v1.x , v2.x, ...


 //===
[Q] Where is gacutil.exe ?
[try]
install Windows SDK suitable for the targeting version of Windows and .net framework
e.g. for Win7 + .net3.5sp1 ,
download iso file from

 //=== Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 (ISO)
File Name: GRMSDK_EN_DVD.iso
Chip: X86
CRC#: 0xCA4FE79D
SHA1: 0x8695F5E6810D84153181695DA78850988A923F4E
================================================
File Name: GRMSDKX_EN_DVD.iso
Chip: AMD64
CRC#: 0xB417A4F7
SHA1: 0x3393C98B8468CB3505557854922707510F8B65E1
================================================
File Name: GRMSDKIAI_EN_DVD.iso
Chip: Itanium
CRC#: 0x5E0E4BEA
SHA1: 0xAE454215585A044EBE593E9F71FF1A4BC03D56A8


  
[ref]

http://www.pcreview.co.uk/forums/which-net-framework-version-installed-t1346870.html

http://stackoverflow.com/questions/3397479/where-is-gacutil-exe

2011年4月10日 星期日

PDT(Php Development Tool) debugger setup

To get source-level debugging for php in PDT,
have to install Zend Debugger or XDebug Debugger.

//=== Zend Debugger Installation [ref: thierryb.net]:
UPDATE URL: http://downloads.zend.com/pdt
*** use "Help -> Install New Software"
instead of "Help -> Software Updates -> Find and Install"

* Zend Debugger Client:
 php.ini modification to make Zend Debugger client work with Mysql(only for PDT installed on MS Windows?)

* Zend Debugger Server:
download "Studio Web Debugger" from http://www.zend.com/products/studio/downloads


//=== Examples for PDT debug setting using Zend Debugger:

//=== phpinfo
PHP Version     5.3.2-1ubuntu4.7

//=== extension_dir  /usr/lib/php5/20090626+lfs   
put the extracted ZendDebugger.so under the extension_dir

//=== php.ini  edit (better back it up before editting)
sudo gedit /etc/php5/apache2/php.ini

set(or comment out) the following attributes:

* zend_debugger.allow_hosts
zend_debugger.allow_hosts=127.0.0.1/32, 192.168.0.0/16


; this is to see output while debugging
implicit_flush = On

* The output buffering functionality must be switched off to see debug output, too.
output_buffering = 0

[ Note: Remember that output buffering is necessary to allow you to send header (e.g. cookies) even after you sent body content.
Rrestore output_buffering to its original value when we get an error message like "Warning: Cannot modify header information - headers already sent",]


* Disable eAccelerator if it is installed and enabled:
eaccelerator.enable="0" (string or digit?)


* Disable the Xdebug extension by commenting out
;zend_extension=/usr/lib/php4/20020429/xdebug.so

* Disable DBG Debugger, too :
;extension=dbg.so
;extension=php_dbg.dll


* For linux, copy the following lines into the end of php.ini
[Zend]
zend_extension=/usr/lib/php5/20090626+lfs/ZendDebugger.so
zend_debugger.allow_hosts=<comma separated ip_addresses>
zend_debugger.expose_remotely=always

//=== restart web server
sudo /etc/init.d/apache2 restart


[ref]
http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_the_Zend_Debugger

https://bugs.eclipse.org/bugs/show_bug.cgi?id=269631

http://www.zend.com/en/community/pdt 
http://downloads.zend.com/pdt

Office2010 64bit Trouble

//===
Searching via google by "64bit Office runtime" will give us the
expectedly unexpected troubles for Office x64 ...

searching by "64bit word runtime" will lead us to the "runtime error 429"

//=== http://www.eggheadcafe.com/software/aspnet/36111953/word-2010-64-bit-and-runtime-error-429.aspx




//=== digest from
http://www.talkjcs.com/techsupport/system-requirements/91.html
『 ...
If there really is a requirement to use Office 2010 64-bit, the following procedure must be followed

    * Un-install all previous versions of Office
    * Un-install JCS
    * Un-install Microsoft Access Runtime
    * Install Office 2010 64-bit (this will fail if any 32-bit Office components remain)
    * Apply all updates to Office 2010
    * Re-install the latest version of JCS.
...



//=== http://www.eggheadcafe.com/software/aspnet/36111953/word-2010-64-bit-and-runtime-error-429.aspx

//=== http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/25b4feb8-8b23-4b2d-b357-c2d1dcfe7154

mentioned two modes of Office installation:
  • locally installed or
  • virutally installed(remotely installed? installed on cloud?)


//=== http://www.add-in-express.com/forum/read.php?FID=5&TID=8251

2011年4月8日 星期五

在 Amazon購物無法使用PayPal 付費?

[Q] 在 Amazon購物無法使用PayPal 付費?

[try] 到目前為止 Amazon 仍要求信用卡或金融卡?(debit card) ,
如果不想直接從信用卡扣錢
希望用PayPal帳戶的餘額付費的話
只好向PayPal 申請 PayPal的debit card
但在美國沒有住居地的人 似乎還不能申請?




[ref]
http://www.ehow.com/how_6777409_use-paypal-amazon.html

http://www.webhostingtalk.com/showthread.php?t=289452

COM AddIn , Shared AddIn

[Q] COM AddIn 與 Shared AddIn 有何差異呢?

[try]
COM AddIn 是通稱 多年前就被發展出來

Shared AddIn 也是一種 COM AddIn
不過是在 .NET的架構下發展出來的
也有人稱作 managed COM AddIn ?


[ref]
http://msdn.microsoft.com/en-us/library/aa434078(office.12).aspx

Shared AddIn, VSTO AddIn, and Visual Studio AddIn

Visual Studio 有提供三種 AddIn project templates
  • Shared AddIn: for Office
  • VSTO AddIn: for Office
  • Visual Studio AddIn: for Visual Studio
簡單的說 Visual Studio AddIn 的 host application 是 Visual Studio 2005/2008/2010
而 VSTO AddIn 和 Shared AddIn 的 host application 是 Office

VSTO 的原文是 Visual Studio Tools for Office
和 Visual Studio AddIn 的確滿容易混淆的 ...

2011年4月7日 星期四

如何部署VSTO addin ?

[Q] 如何部署VSTO addin ?
微軟網站有段教學 video, http://msdn.microsoft.com/en-us/office/Video/bb851702

還有source code 可供下載
C#,
http://download.microsoft.com/download/7/b/d/7bd6a2d4-ac14-43f6-97bc-07a334257dde/CS-VSTO-DeployaVSTOAdd-in_cs.zip

VB,
http://download.microsoft.com/download/7/b/d/7bd6a2d4-ac14-43f6-97bc-07a334257dde/VB-VST0-DeployaVSTOAdd-in_vb.zip


2011年4月5日 星期二

VSTO(Visual Studio Tools for Office)


VSTO for Office2007 requires .net framework 3.5

Project types : document-level / application-level
document-level ThisDocument Actions Pane
application-level ThisAddIn Custom Task Pane

rdesktop (terminal server client) in Ubuntu

[Q] 在Ubuntu中 可以用rdesktop登入遠端的 WindowsXP/Windows Server ...
但是要如何切換全螢幕模式?


[try]
0. CTL+ALT+ ENTER (works for me)
1. ??? CTL+ALT+ Backspace / ALT+F1 / CTL+ALT+F1 to login to console mode to kill the process

2011年4月2日 星期六

HyperV vhd (虛擬硬碟) 種類

HyperV vhd (虛擬硬碟) 可分三種:
  • dynamically expanding : 動態擴增
  • fixed size: 固定容量
  • differencing: 根據另一個vhd(母碟: parent vhd) 衍生來的

之前一直沒去探究 differencing vhd 的用法
最近得高手指點
恍然大悟  differencing vhd 的用途 :

0. 產生 vm(Virtual machine) "vmbase", 先將 OS 灌起來 存成 base.vhd ,
    將 base.vhd 設成唯讀
 
1. 根據 base.vhd 衍生 base_update.vhd,  產生 vm "vmbase_update",
    將vmbase_update 與 base_update.vhd綁在一起,
    * 安裝 OS update
    將 base_update.vhd 設成唯讀
 
2. 根據 base_update.vhd 衍生 base_update_app0.vhd,  產生 vm "vmbase_update_app0",
    將vmbase_update_app0 與 base_update_app0.vhd綁在一起,
   * 不安裝其他應用程式
   (除了不是唯讀之外 , 基本上 base_update_app0.vhd 與 base_update.vhd 應該是等價的)
 
3. 根據 base_update.vhd 衍生 base_update_app1.vhd,  產生 vm "vmbase_update_app1",
    將vmbase_update_app1 與 base_update_app1.vhd綁在一起,
   * 安裝 應用程式app1
 
4. 比較 2,3 就可看出 應用程式app1 對系統的影響

...

  

2011年4月1日 星期五

如何縮減HyperV虛擬硬碟的大小

There are three actions for "Edit Disk" to HyperV's virtual hard disk :
  • compact : remove blank space to shrink/reduce size
  • convert : dynamic size to fixed size or vice versa?
  • expand : increase size

//===
可透過HyperV 右側的Actions 工作列
點選 "Edit Disk" -> 選擇想要縮/擴的 .vhd 檔案
->
  • compact : 將因檔案刪除所造成的空隙移除以縮減vhd大小
  • convert : 將vhd從動態容量轉為固定容量模式?
  • expand :  增加vhd 容量