2010/12/29

BB 第九週: 醫生確認懷孕及政府醫院排期

經家庭醫生的官方驗孕結果後 (說實的只是與自己所檢一樣, 都是用驗孕棒驗尿, 只是多了一封官方式的確孕信已矣). 隨即當日便到東區醫院排期做產前檢查, 去到了以為去了深圳醫院, 所有的夫婦都是內地來的,  取了籌後等候入房, 介紹整個產前檢產的流程, 先看了一條用了普通話配音, 簡體字幕的影片介紹, 然後那個護士用半咸淡普通話介紹隨後的取得的說明文件, 及以下將會做抽血檢查.

當洗耳恭聽後便按次序排列等候見護士, 然後抽血, 亦是等候最長的時間. 當中發現原來不少內地夫婦聘用了Agent 代理(原來生產也有這回事, 中國人果然懂得做生意)辦理登記及排期等事宜. 三五個代理走在一起, 談的當然也是這些事宜, '甚麽今天你帶多少個來?' 然後大聲的風花說月. 更看到了在TBB的著名甘草演員梁舜燕陪同女兒來做檢查, 看到真人比上鏡老了.

如事者又等多了約一小時後又召了一班人入房, 護士解釋下次檢查將會是唐氏綜合症的檢查(OSCAR), 是要嬰孩十一週至十六週中做的, 會從超音波檢查中度取嬰孩的頸皮厚度, 配合抽血中的結果決定嬰孩患有唐氏的機率, 一般正常結果大概是五千份一的低風險云云..... 然後再依據週數到下月到東區的主座婦產科中做的.

臨走前, 在電梯口遇到雅X的媽媽會招收會員, 反正將來也有需要, 便填了個人資料, 隨即也收到了迎新的贈品, 孕婦奶粉的試用裝, 一個BB用的口水肩等等

太太身後的那對也是國內來的

先入房看產前檢查過程的錄像(普通話版配簡體中文字幕)

2010/12/23

BB 第六週: 作小產流啡

前幾天週末想與太太在家中背後的柏架山遠足, 一方面到郊外呼吸新鮮空氣, 也可與運動一下, 但行不到半小時, 太太已疲累不堪, 便原途折返.

及後兩天太太如厠後發現下體流有啡色的分泌物(流啡), 問了不少過來人, 這是作小產特徵之一, 二話不說便約私家醫生檢查, 馬醫生簡單做了一次超聲波檢查, 証實胎盤的位置正常, 然後只吩咐太太回家休息數天, 不要做劇烈運動及大幅度的動作云云...

當然只片面之詞不能釋去我們的疑慮及焦急, 所以回家後在問問許多過來人經驗, 更重要是藉著禱告, 神所賜的禮物, 我們只是託管者, 祂有祂對這個BB的計劃, 我們只有順服面對.




BB第五週: 兩條平行線的疑惑


經歷許多事, 太太找回工作後又要經過試用期後, 看中醫補了身, 亦汲收了不少經驗嘗試了好多次不同方法, 看來我們的生育大計終於實現了. 但那小生命就是由兩條平行線而來!? 神的創造真是奇妙, 其實一直都不是很確信驗孕的可信性, 到後來經醫生診証(其實還是一樣的方法, 下文再表), 所以再經過反覆的驗孕, 結果都是相同, 我們BINGO了!

但是心情一直仍很忐忑不安, 需要種種表現, 太太身體的表化, 遲來的月事都似乎引証著這小傢伙在媽媽的體內一天一天生長, 但直至後來醫生的確孕才令我們釋懷.

2010/12/20

iPhone 自製鈴聲

一般新手 iPhone 玩家都奇怪, 為何iPhone支援mp3鈴聲, 但不知在那裡設定. 筆者也為此曾煩惱一段時間, 剛好從youtube 找到了這一段自製 iphone 鈴聲, 步驟很簡單, 只需要安裝 itunes (廢話, 有iphoner 不裝itunes 嗎?), 當然雖然那段mp3鈴聲, 或者從cd track 中讀取亦可.


Crystal report with Dynamic Column

The objective of this article is to provide a process which can be followed to develop a crystal report with dynamic columns using parameterized column fields and formula fields. Before going for this the developer has to decide the maximum number of columns he/she has to display and as per the no. of columns the size of the paper. The developer can define the size of the paper by selecting Printer Setup in File menu.

There are two ways to display the columns in Crystal Report dynamically. The default is using the infamous Cross Tab component and the other is using parameterized columns. But there are certain limitations to this . Where the cross tab does not provide complete control to each individual cells value, for using dynamic columns, the developer has to decide the maximum no columns in design time and all the field values should be of same data type.

Lets take an example of an yearly report where the developer has to create  such a report , when executed will display only those month values as columns , which are selected with "Total" immediately next . So the view may look like :

If the sales of products selected from Mar 2006 to May 2006.
Product NameMarAprMayTotal
Pro 1128990191
Pro 2209970199
Grand Total32188160390
Same way if the end results for different scenario :
  1. If date is between Jan 2006 - Aug 2006
    Product Name  Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Total
  2. If date is between Jun 2006 - Nov 2006
    Product Name  Jun  Jul  Aug  Sep  Oct  Nov  Total
Note : These instructions only work if all the attribute fields are of the same data type as they will be dynamically interchanged using a logic statement. 

It seems most of the attribute fields will be of a String data type. We can create formulas in our report that will convert numbers to text using the ToText function. Then, simply use the formula instead of the database field. Or, if our organization uses Views or Queries as data source, convert the data type on that end.

Steps to create a report with dynamic columns...
1) Determine the maximum number of columns the report page can handle. Or determine the reasonable number of attributes an end user would want to see. (Consider a report with 50 columns of attributes. It would be unreadable.)

2) Create a string parameter for every attribute column on the report. Do not set the default values at this time (see next step).

3) Open Note Pad (on your desktop under accessories). Type all possible attributes starting in top right corner with one below the other (see below).
None
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Total

Keep in mind, these will be listed in the pick list and displayed on the report as column headings. The value "None" is important. It will be used in a logic statement, later in these instructions. Save the file (as a text file, .txt) in a shared location all users of the report can access (or on the CE server if using Enterprise).

Name the file similar to the .rpt file name combined with the word "attributes" or "parameter" so it is easy to locate.
4) Edit each parameter created in step 2 and do the following:

Click on "Set default values".
Click on "Import pick list".


Browse to locate the text file you just created in step 3.

Click OK. The list is automatically populated with the values in the text file.

5) Create empty formulas for the detail fields. The Design will look something like this...
Row Num Product name {?Month1} {?Month2} {?Month3}{?Month4}........................{?Total}
{rownum} {db.ProdName} 
{@mon.1-Detail{@Mon.2-Detail{@Mon.3-Detail}.............{@Total-Detail}

Just use the Insert Fields box and create the formulas up front. Leave them empty. Place them on the Design Tab. Then use the Insert Fields box to edit them later.

6) Edit the Mon.1-Detail field. Enter the following logic...

(assuming the Stored Proc or View returning column names as ProdName Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)

if {?Month1}= "JAN" then {DB.JAN}
else if {?Month1}= "FEB" then {DB.FEB}
else if {?Month1}= "MAR" then {DB.MAR}
else if {?Month1}= "APR" then {DB.APR}
else if {?Month1}= "MAY" then {DB.MAY}
else if {?Month1}= "JUN" then {DB.JUN}
else if {?Month1}= "JUL" then {DB.JUL}
else if {?Month1}= "AUG" then {DB.AUG}
else if {?Month1}= "SEP" then {DB.SEP}
else if {?Month1}= "OCT" then {DB.OCT}
else if {?Month1}= "NOV" then {DB.NOV}
else if {?Month1}= "DEC" then {DB.DEC}
------ add the total field value if applicable
else 0;

Save the formula changes, but don't exit the formula editor. Copy the entire logic statement, then exit.

7) Edit {@Mon.2-Detail}. Paste the logic statement from step 6 into the Formula editor. Use Find/Replace in the formula Editor to find "?Month1" and replace with "?Month2".

Then save the change. Repeat this process for the remaining column detail formulas.

Note: Incase of Total field it will start from the second field onwards. So to display the Total value add the line below (incase if second column will be counted as the total column)

else if {?Month2}= "Total" then {@Month_Det1}
Same way for all other columns also add .....
else if {?Month3}= "Total" then {@Month_Det1} +  {@Month_Det2} If 3rd will be the Total column
else if {?Month4}= "Total" then {@Month_Det1} +  {@Month_Det2} + {@Month_Det3} if 4th col will be the Total and so on.. 

8) You may also want to add conditional formatting to supress the columns that are not used. To do this you need to edit each field in the column (header and detail).

Start with Column 1's heading...
Right click on the parameter field, {?Column 1}.
Select Format field.
On the Common tab find Suppress at the top.


Go to the right and click on the "X+2" button. Enter the following logic in the Format formula editor:

if {?Month1}="None" then true else false;
Save, but don't close. Copy the statement. Close the Format formula editor.

Repeat on the 
{@Month.1-Detail} field using the pasted statement.

Repeat on the remaining columns, but remember to change the column number in the logic.
9) To add a running total for each column select a new running total field as display below

Select the parameterized field to sum up and and in the type of summary field select Sum from the dropdown.

Repeat the same process for all the columns as displayed above and also suppress them as per the condition (Refer Sec 8 to make a conditional suppress).

How it works :
1) The column heading will display the parameter value selected by the user. It will display just as you typed it into the default value list when creating the parameter.
Example :

In the example below I am displaying the records of references  during the month of Aug and Sep 2006 including the total and grand total value.

Select Aug for the month1 parameter field

Repeat it to select Sep for month2 parameter field and Total for month3 field . And select From Date and To date as 1st Aug 2006  - 30th Sep 2006.

2) The detail section will display the corresponding attributes for each item record based on the parameter values provided at run time.

On execution of this report it will display like the below

Contribution by: Kishore Gandra , Sarika Pahurkar , Edmond Joseph

2010/12/17

明朝那些事兒(肆) - 粉飾太平

More about 明朝那些事兒(肆)

今部開始講述昏君朱厚照死後無後嗣可繼,各臣推舉興獻王之子朱厚熜為皇,年號嘉靖。聰敏的嘉靖以「議禮之爭」剷除一些舊臣以為可以操控滿朝。但經夏言、嚴嵩、徐階之流等產生明爭暗鬥,亦這些文臣利用嘉靖篤信仙道而煉丹之事而作為攻擊對方的把柄,而攀登權力最高的內閣首輔之位。

身處內憂外患的明朝中葉時,東南沿海的倭寇搶劫令百姓生不如死。名將戚繼光及其親兵「戚家軍」精密陣式下,以九戰九勝的大小戰役中,將困擾明朝沿海邊彊十多年的倭寇之亂掃平。

明朝那些事兒(參) - 妖孽宮廷

More about 明朝那些事兒(參)

第三部開始, 首先經「奪門之變」成功復辟帝位的朱祁鎮,是明朝唯一有兩個年號的皇帝, 聽信讒言而殺害救助他的名臣于謙。他死後的兩代無能或無力的皇帝後, 誕生了有一個幾百年間最荒唐的昏君朱厚照,民間京劇中的《遊龍戲鳳》就是以朱厚照微服出巡的故事杜撰出來。他興「八虎」,建「豹房」, 自封威武大將軍。

同一年代,另一位繼孔孟後被後世稱為聖賢之仕的王守仁(陽明)掘起,他的心學說:「知行合一」,成為後世景仰的新學說。而他更是萬中無一的集思想、哲學、書法、軍事、教育、文學等大成的全能大人儒,亦是上陣征戰,指揮若定的統軍大帥。

由此部開始,筆者主要落墨於朝政中的明爭暗鬥, 皇帝, 文臣, 宦官之間的惡鬥。

[iPhone App] HK Caller - 過濾Junk call 好幫手

相信當大家每日收到最多致電給你的, 並非是閣下的母親或是男/女朋友, 而是各間銀行及借貸公司提供服務, 保險, 美容, 甚至是毫無感情的電話錄音 cold call 等, 雖然今時今日的手機服務 package 提供的 air time 絕不是一個問題, 但對於此等每日一電話, 筆者也覺得很困擾. 經朋友介紹下, iphone 的 HK Caller 絕對是好幫手,  重要的是 freeware. 據聞還對應 android 手機.

下載地址:
http://itunes.apple.com/hk/app/hkcaller/id382820868?mt=8

最新版本是1.5.0 (1.022)


為保障電話客戶的私隱, 不會顯示完整名稱 


用戶可以提交最新資料

更可隨時更新數據庫, 而匯進聯絡資訊後, 當該cold call 電話打來時將會顯示其名稱.

它的資料會以 "注/項" 為先方便排序











2010/12/07

[iPhone] How to Enable Emoji on iPhone iOS 4


Emoji icons disappeared for a while with the release of iOS 4. But they’re back! This simple trick, compliments of Simon, will show you how to enable Emoji icons on your iPhone iOS 4.
Emoji Icons on iPhone iOS 4

Step 1: Download this free app from the App Store.
Step 2: Launch the app and tap “ok, let’s do this”.
Step 3: Go to Settings > General > Keyboard > International Keyboard > Add New Keyboard > Emoji.
Step 4: Reboot your iPhone.
You can now get emoji icons on your iPhone. To bring up the emoji keyboard, launch your Notes.app and tap the little “globe” icon next to the space key.
If you send an email containing emoji icons, the person you send the email to must have emoji enabled too. For some reason, I wasn’t able to use emoji icons in the Email.app. It worked great for notes though.
How is it working for you?

ABAP Read_Text Function Module Tutorial To Read Long Text


In today’s tutorial, I want to show you how to use the READ_TEXT function module to read SAP long text. Every text in SAP has its own ID and NAME, by passing these parameters into the READ_TEXT function, we can get all the text in the SAP long text object.

Here’s how to do it, for example we’ll be using long text from Sales Order.

1. Execute tcode VA02 and enter the Sales Order number.

rtf09-1

2. Press enter to display the Sales Order data. Choose GoTo -> Header -> Texts

rtf09-2

3. Double click the “Header Note” text and enter the long text in the text editor.

rtf09-3

4. Click CTRL+S to save the Sales Order data.

5. Now that we need to get the “ID”, “NAME” and “OBJECT” of the text object to be used as the input parameters of READ_TEXT function module, to get this information, you can execute VA02 or VA03 and enter the Sales Order number again.
Choose GoTo -> Header -> Texts


6. Now double click inside the long text editor.

rtf09-4

7. Choose Goto -> Header.

rtf09-5

8. On the next window screen, you will see all the parameters required for the READ_TEXT function. (Name, Language, ID, Object)

rtf09-6

9. Now let’s get the text using ABAP, open your ABAP editor (SE38), copy this code below.
"A sample code to use READ_TEXT FM 
"www.freesaptutorial.com

  data:
        BEGIN OF header OCCURS 0,
          ld_txt1(163),
          ld_txt2(163),
          ld_txt3(163),
        END OF header.

  DATA: li_lines LIKE STANDARD TABLE OF tline WITH HEADER LINE,
        ID like THEAD-TDID,
        TNAME LIKE THEAD-TDNAME,
        TDOBJECT like THEAD-TDOBJECT.

        ID = '0001'.
        TNAME = '1820000009'.
        TDOBJECT = 'VBBK'.

  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id       = id
      language = sy-langu
      name     =  TNAME
      object   = TDOBJECT
    TABLES
      lines    = li_lines.

  READ TABLE li_lines INDEX 1.
  IF sy-subrc = 0.
    header-ld_txt1 = li_lines-tdline.
  ENDIF.

  READ TABLE li_lines INDEX 2.
  IF sy-subrc = 0.
    header-ld_txt2 = li_lines-tdline.
  ENDIF.

  READ TABLE li_lines INDEX 3.
  IF sy-subrc = 0.
    header-ld_txt3 = li_lines-tdline.
  ENDIF.

  WRITE:/ header-ld_txt1.
  WRITE:/ header-ld_txt2.
  WRITE:/ header-ld_txt3.
10. Now execute the program (F8), you will see the long text from the header note text object.

rtf09-7

2010/12/02

[ABAP] Display ListBox in Parameter of Selection Screen

Display ListBox in Parameter of Selection Screen

REPORT zpwtest.


TYPE-POOLS: vrm.

DATA: name TYPE vrm_id,

      list TYPE vrm_values,

      value LIKE LINE OF list.

 

PARAMETERS: ps_parm(10) AS LISTBOX VISIBLE LENGTH 10.

 

AT SELECTION-SCREEN OUTPUT.

 

  name = 'PS_PARM'.

  value-key = '1'.

  value-text = 'LINE 1'.

  APPEND value TO list.

  value-key = '2'.

  value-text = 'LINE 2'.

  APPEND value TO list.

  CALL FUNCTION 'VRM_SET_VALUES'

       EXPORTING

            id     = name

            values = list.

 

START-OF-SELECTION.

  WRITE: / 'PARAMETER:', ps_parm.