I carry an Optio S3 to make ad hoc photography.
According to the specification, the tiny camera has an aperture f2.6 - f4.8
However, even at an aperture f2.6, I can never shoot a picture with sufficient shallow depth of field (DOF), except in macro mode of course.
I start to ask why.
The most authoritative reference (but hard to understand) about Depth of Field is at Wiki (link http://en.wikipedia.org/wiki/Depth_of_field)
It gives complicated formula to show the relation of DOF vs. format size (though roughly speaking, DOF is inversely proportional to format size). Since my DC has a small CCD, the DOF is less shallow than the conventional SLR.
However, I try to associate the problem with APS-C or Four Thirds or micro Four Thirds.
In these cases, usually, we will use a crop factor to represent the effective focal length at full-frame (FF, at 35mm) format size . For instance, even you use a lens with 18mm on DSLR with crop factor 1.6, its effective angle of view is just same as 28.8mm at FF.
Please note that aperture is actually stated in F-number (the ratio of focal length to effective aperture diameter).
Then why not use similar the crop factor to calculate the effective DOF?
For instance, my Optio S3 has the focal length 5.8mm (equivalent to 35mm at FF). This means that the crop factor is about 6X.
Then even at aperture f2.6, the "equivalent" aperture at FF is already 6x2.6 = 15.6
This explains why I cannot shoot at shallow DOF even with the largest aperture (smallest F-number) because its FF-equivalent aperture at 15.6!
2009-10-09
Using COM objects in VB.NET
I am an old-fashioned guy and right now even though I uses VB.NET for my new programming, I still need to resort to old COM objects sometimes.
I find there is not much references to facilitate the process (e.g. I do not like command line tools). If I have a VB6 project orginally, the Studio Express can import it automatically. But if I starts a new .NET project, I find the following procedures is the quickest:
(1) Add the COM reference in the "Tools" | "Choose Toolbox Items" menu, so that the object is selectable in the left Toolbox

(2) Choose the COM Components Tab. If your object has been registered before hand, it is listed. Otherwise, click the Browse button to include it in the list

(3) Then you will find the Componet will appear in the left Toolbox. You then can drag it into your form.

(4) You will find VB.NET will automatically add appropriate references in your Project Properties, as in the following screen dump. In my cases, VB.NET add two references: one is the Interop and one is the AxInterop

I find there is not much references to facilitate the process (e.g. I do not like command line tools). If I have a VB6 project orginally, the Studio Express can import it automatically. But if I starts a new .NET project, I find the following procedures is the quickest:
(1) Add the COM reference in the "Tools" | "Choose Toolbox Items" menu, so that the object is selectable in the left Toolbox

(2) Choose the COM Components Tab. If your object has been registered before hand, it is listed. Otherwise, click the Browse button to include it in the list

(3) Then you will find the Componet will appear in the left Toolbox. You then can drag it into your form.

(4) You will find VB.NET will automatically add appropriate references in your Project Properties, as in the following screen dump. In my cases, VB.NET add two references: one is the Interop and one is the AxInterop

at
上午10:17
2009-08-24
高清無用!
當人人都「講」高清時,我發看很多人其實都將Windows的display解像度set得比native低(可能使用者有老花?),見MSDN Blog Follow-up on High DPI resolution

從圖可見,只有55%的人用native resolution,可悲!

從圖可見,只有55%的人用native resolution,可悲!
at
下午12:54
2009-08-06
Quick Building a Web service client using Axis
After some studies, to my surprise, building a web service client using the Axis library (not the web service itself) is in fact very easy. I would like to summarize my experience in this blog.
- Download Axis from the Apache web site and expand the zip file (Remark: in fact the whole package includes the server code. To build a client, only the jar files are needed. But for simplicity and because of the limited extra hard disk space, I recommend to expand the whole package).
In my example, I have downloaded Axis version 1.1 and put it at /home/craft/whc/axis-1-1 - Download the WSDL file of the web service. In this case, I have chosen the free stock quote example at webservicex at http://www.webservicex.net/stockquote.asmx?wsdl and store it in /home/craft/whc/StockQuote.wsdl
- Use the WSDL2Java tool from Axis to crate the stub codes. Since we need to refer to the jar files in the Axis, I have built a script with classpath set appropriately
The resultant files will be created at /home/craft/whc/NET/webserviceX/www#!/bin/sh
java -classpath "/home/craft/whc/axis-1_1/lib/axis.jar:
/home/craft/whc/axis-1_1/lib/log4j-1.2.8.jar:
/home/craft/whc/axis-1_1/lib/commons-logging.jar:
/home/craft/whc/axis-1_1/lib/commons-discovery.jar:
/home/craft/whc/axis-1_1/lib/wsdl4j.jar:
/home/craft/whc/axis-1_1/lib/jaxrpc.jar:
/home/craft/whc/axis-1_1/lib/saaj.jar"
org.apache.axis.wsdl.WSDL2Java StockQuote.wsdl - Create the simple client code (StockClient.java) as follows (I have hard-coded MSFT (Microsoft) for the stock code)
import java.net.URL;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
public class StockClient {
public static void main(String[] args) throws Exception {
NET.webserviceX.www.StockQuote service = new NET.webserviceX.www.StockQuoteLocator();
NET.webserviceX.www.StockQuoteSoap port = service.getStockQuoteSoap();
String result = port.getQuote("MSFT");
System.out.println("Result = "+result);
}
} - Compile the client code with a script as follows (Please note that I have deliberately omitted the wsdl4j.jar because the wsdl file is no longer processed at run time and ass a dot (current directory in the classpath)
#!/bin/sh
javac -source 1.5 -classpath "/home/craft/whc/axis-1_1/lib/axis.jar:
/home/craft/whc/axis-1_1/lib/log4j-1.2.8.jar:
/home/craft/whc/axis-1_1/lib/commons-logging.jar:
/home/craft/whc/axis-1_1/lib/commons-discovery.jar:
/home/craft/whc/axis-1_1/lib/jaxrpc.jar:
/home/craft/whc/axis-1_1/lib/saaj.jar:." StockClient.java - Run the complied class file (again, I have used a script to add the classpath. Moreover, since we need a http proxy to access the internet, I have defined these properties in during invoking the JVM using the -D switch
#!/bin/sh
java -classpath "/home/craft/whc/axis-1_1/lib/axis.jar:
/home/craft/whc/axis-1_1/lib/log4j-1.2.8.jar:
/home/craft/whc/axis-1_1/lib/commons-logging.jar:
/home/craft/whc/axis-1_1/lib/commons-discovery.jar:
/home/craft/whc/axis-1_1/lib/jaxrpc.jar:
/home/craft/whc/axis-1_1/lib/saaj.jar:." -Dhttp.proxySet=true -Dhttp.proxyHost="10.36.250.25" -Dhttp.proxyPort=8080 StockClient
The result is follows:
[craft:/home/craft/whc (465)] run_client.sh
Result = <StockQuotes><Stock><Symbol>MSFT</Symbol><Last>23.81</Last><Date>8/5/2009</Date><Time>4:00pm</Time><Change>+0.04</Change><Open>23.93</Open><High>24.25</High><Low>23.79</Low><Volume>53310240</Volume><MktCap>212.2B</MktCap><PreviousClose>23.77</PreviousClose><PercentageChange>+0.17%</PercentageChange><AnnRange>14.87 - 28.50</AnnRange><Earns>1.619</Earns><P-E>14.68</P-E><Name>Microsoft Corpora</Name></Stock></StockQuotes>
at
下午2:06
2009-08-04
2009-07-31
中國現行稅制
在整體舊資料時,找到一份n年前在清華大學參加短期「中國營商管理研習班」的講義。
以下是經濟學院陳關亨博士《中國現行稅制》的部份內容:
| 主體稅種 | 增值稅 | 營業稅 | 外商投資企業和外國企業所得稅 |
| 簡介 | 對生產、銷售商品或提供勞務過程中實現的增值額徵收的稅種 | 以經營活動的銷售額為稅基的一稅種 | 對在中國境內的外商投資企業(包括中外合資、中外合作和外資企業)和外國企業的生產、經營所得和其他所得徵收的一種稅 |
| 稅基 | 增值額(小規模納稅人用銷售額) | 營業額(銷售額) | 業務收入淨額+其他業務利潤+營業外收入 |
| 稅率 | 17%(但小規模納稅人的徵收率為4%) | 一般為3~5% | 一般為30% |
at
下午7:19
中國企業CEO失敗的的八大原因
在整體舊資料時,找到一份n年前在清華大學參加短期「中國營商管理研習班」的講義。
以下是經濟學院鄭曉明博士在《中國企業永續經營》的部份內容:
以下是經濟學院鄭曉明博士在《中國企業永續經營》的部份內容:
- 缺乏對壞消息的處理能力
- 投機性太強
- 盲目的擴張與多元化
- 缺乏財務知識
- 決策的獨斷和無制約
- 疲勞綜合症
- 缺乏處理人的能力
- 沒有一個堅貞不渝的團隊
at
上午11:36
2009-07-10
Using Less to view Huge Log files
My job requires me to view large application log files (several hundred M bytes). My original favourite editor, Crimson editor has limitation because it loads the full file into the computer memory.
I try to find other alternatives and have tried LTF (Large Text File) Viewer but I find it has problems to search the patterns even though I do know it exists in the file.
Moreover, these editors still resort to load a large portion of the document into the computer and consumes many CPU resources.
Suddenly I think why I do not resort to the orginal text mode utitlies. A popular is less (wiki)
But if I can make the command prompt window bigger and customize the font, the user-experience will be much better.
I have written a batch file to use the "mode" and "color" command for this customization.
The full steps of installation are:
1. download the less in in here
2. Put the download into a directory (e.g. c:\bin\less429)
3. Create a batch file (e.g. less_big_win.cmd) which contains the following lines
4. Associate a file type with the batch file

5. Open the log file using less

6. After opening, the less application is displayed in 160x40 new window:

7. Although my file has nearly 200M byte

you can see in the Task manager, it only consumes less than 1.5M bytes

I try to find other alternatives and have tried LTF (Large Text File) Viewer but I find it has problems to search the patterns even though I do know it exists in the file.
Moreover, these editors still resort to load a large portion of the document into the computer and consumes many CPU resources.
Suddenly I think why I do not resort to the orginal text mode utitlies. A popular is less (wiki)
But if I can make the command prompt window bigger and customize the font, the user-experience will be much better.
I have written a batch file to use the "mode" and "color" command for this customization.
The full steps of installation are:
1. download the less in in here
2. Put the download into a directory (e.g. c:\bin\less429)
3. Create a batch file (e.g. less_big_win.cmd) which contains the following lines
@echo off
mode 160,40
color 0A
c:\bin\less429\less.exe %1
4. Associate a file type with the batch file

5. Open the log file using less

6. After opening, the less application is displayed in 160x40 new window:

7. Although my file has nearly 200M byte

you can see in the Task manager, it only consumes less than 1.5M bytes

at
下午6:28
2009-07-04
嚴重抗議香港郵政之通函郵寄服務
香港郵政為了增加收入,發明了所謂《通函郵寄服務》,即發件者不用個別地址,便可濫發郵件,將無用的宣傳郵件放在我的信箱內。
我家大廈有保安員,普通人士不能隨便將宣傳品放在住宅信箱,但郵差叔叔就出入無阻。
我曾向香港郵政投訴,要求不要再接收所有的通函郵寄件,但不獲受理!
最近發覺香港郵政派發的通函郵寄件,都有一些要用放大鏡才可看到的所謂「不收取通函」聲明,註明如不欲繼續收取本機構發出的通函,請把你的地址郵寄xxxx(即個別商戶的通訊地址)。
哪有住戶那麼有心,一個一個商戶的通知,還要自己出個幾郵費,香港郵政又可漁人得利!
香港郵政自己不做把關工作,不尊重市民的權利,只將自己部門的收入放在最重要的位置。
強烈要求香港郵政懸崖勒馬,給我卑微的信箱一個喘息的機會,給地球一個減少廢紙的機會!
我家大廈有保安員,普通人士不能隨便將宣傳品放在住宅信箱,但郵差叔叔就出入無阻。
我曾向香港郵政投訴,要求不要再接收所有的通函郵寄件,但不獲受理!
最近發覺香港郵政派發的通函郵寄件,都有一些要用放大鏡才可看到的所謂「不收取通函」聲明,註明如不欲繼續收取本機構發出的通函,請把你的地址郵寄xxxx(即個別商戶的通訊地址)。
哪有住戶那麼有心,一個一個商戶的通知,還要自己出個幾郵費,香港郵政又可漁人得利!
香港郵政自己不做把關工作,不尊重市民的權利,只將自己部門的收入放在最重要的位置。
強烈要求香港郵政懸崖勒馬,給我卑微的信箱一個喘息的機會,給地球一個減少廢紙的機會!
at
上午10:59
訂閱:
文章 (Atom)
