2012年5月8日 星期二

PUSH on Android and Windows Phone

做了個測試把 Push notification 直接到兩個不同 OS - Android / WP.  好厲害超快亦機乎同時到達


2012年4月29日 星期日

Windows 7 Push Notification

From web: $uri="http://db3.notify.live.net/throttledthirdparty/01.00/AAHCuoXMr7ucQphPazXmhi9_AgAAAAADDAAAAAQUZm52OkJCMjg1QTg1QkZDMkUxREQ"; //uri sended by Microsoft plateform $notif=new WindowsPhonePushNotification($uri); $notif->push_toast("123","456"); notif_url = $notif_url; } /** * Toast notifications are system-wide notifications that do not disrupt the user workflow or require intervention to resolve. They are displayed at the top of the screen for ten seconds before disappearing. If the toast notification is tapped, the application that sent the toast notification will launch. A toast notification can be dismissed with a flick. * Two text elements of a toast notification can be updated: * Title. A bolded string that displays immediately after the application icon. * Sub-title. A non-bolded string that displays immediately after the Title. */ public function push_toast($title, $subtitle,$delay = WindowsPhonePushDelay::Immediate, $message_id=NULL) { $msg = "" . "" . "" . "".htmlspecialchars($title)."" . "".htmlspecialchars($subtitle)."" . "" . ""; return $this->push('toast',$delay+2,$message_id, $msg); } /** *A Tile displays in the Start screen if the end user has pinned it. Three elements of the Tile can be updated: *@background_url : You can use a local resource or remote resource for the background image of a Tile. *@title : The Title must fit a single line of text and should not be wider than the actual Tile. If this value is not set, the already-existing Title will display in the Tile. *@count. an integer value from 1 to 99. If not set in the push notification or set to any other integer value, the current Count value will continue to display. */ public function push_tile($background_url, $title, $count, $delay = WindowsPhonePushDelay::Immediate,$message_id=NULL) { $msg = "" . "" . "" . "".htmlspecialchars($background_url)."" . "$count" . "".htmlspecialchars($title)."" . "" . ""; return $this->push('token',$delay+1, $message_id,$msg); } /** * If you do not wish to update the Tile or send a toast notification, you can instead send raw information to your application using a raw notification. If your application is not currently running, the raw notification is discarded on the Microsoft Push Notification Service and is not delivered to the device. The payload of a raw notification has a maximum size of 1 KB. */ public function push_raw($data, $delay = WindowsPhonePushDelay::Immediate,$message_id=NULL) { return $this->push(NULL,$delay+3,$message_id, $data); } /** *@target : type of notification *@delay : immediate, in 450sec or in 900sec *@message_id : The optional custom header X-MessageID uniquely identifies a notification message. If it is present, the same value is returned in the notification response. It must be a string that contains a UUID */ private function push($target,$delay,$message_id,$msg) { $sendedheaders= array( 'Content-Type: text/xml', 'Accept: application/*', "X-NotificationClass: $delay" ); if($message_id!=NULL) $sendedheaders[]="X-MessageID: $message_id"; if($target!=NULL) $sendedheaders[]="X-WindowsPhone-Target:$target"; $req = curl_init(); curl_setopt($req, CURLOPT_HEADER, true); curl_setopt($req, CURLOPT_HTTPHEADER,$sendedheaders); curl_setopt($req, CURLOPT_POST, true); curl_setopt($req, CURLOPT_POSTFIELDS, $msg); curl_setopt($req, CURLOPT_URL, $this->notif_url); curl_setopt($req, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($req); curl_close($req); $result=array(); foreach(explode("\n",$response) as $line) { $tab=explode(":",$line,2); if(count($tab)==2) $result[$tab[0]]=trim($tab[1]); } return $result; } } ?>

2012年3月20日 星期二

Mobile devices screen size

jquery zoom 解決不同 mobile devices 的 screen 問題

$( document ).ready( function() {
var $body = $('body'); //Cache this for performance

var setBodyScale = function() {
var scaleSource = $body.width(),
scaleFactor = 0.35,
maxScale = 600,
minScale = 30; //Tweak these values to taste

var fontSize = scaleSource * scaleFactor; //Multiply the width of the body by the scaling factor:

if (fontSize > maxScale) fontSize = maxScale;
if (fontSize < minScale) fontSize = minScale; //Enforce the minimum and maximums

$('body').css('font-size', fontSize + '%');
}

$(window).resize(function(){
setBodyScale();
});

//Fire it when the page first loads:
setBodyScale();
});



var designWidth = 480; // zoom to fit this ratio
var designHeight = 762; // not 800 b/c top bar is 38 pixels tall
var scaleChange = 1; // % change in scale from above #s

function zoomScreen() {
var docWidth = window.outerWidth;
var docHeight = window.outerHeight;

if (docWidth != designWidth) {
var scaleX = docWidth / designWidth;
var scaleY = docHeight / designHeight;
if (scaleX < scaleY) {
$('body').css('zoom', scaleX);
scaleChange = scaleX;
} else {
$('body').css('zoom', scaleY);
scaleChange = scaleY;
}
}
}

2012年1月29日 星期日

林國雄信箱

初學八字就當然會四處找人問問 今天找回林國雄信箱幫我睇的一些回覆 那時時間為 2002 年 12 月 我第一年跟余老師學風水的年份 也算是初踏玄學界

姓名:ALEX NG
性別:男 婚姻狀況:未婚
出生年月日時:新曆一九七三年十一月四日十三時二十五分

詢問事項:1.八字中五行的喜忌?
2.何時事業才會暢旺?什麼事業才好?
3.是否適合創業?
4.正財及偏財運如何?
5.何時會結婚?

吳先生的八字為癸丑、壬戌、甲辰、辛未。辰戌丑未齊,四庫齊沖,不能在一個地方待得太久,故適宜從事服務性行業,左撲右撲為合。
 
八字喜木喜火,虛齡廿九歲起行火運,一直好下去。
 
婚姻一定要遲,早婚易離婚。虛齡廿九歲後始可論婚姻。
 
八字身旺,不旺偏財。正財於虛齡廿九歲後轉好,亦適宜於虛齡廿九歲後創業,宜選木火行業。

2012年1月25日 星期三

2012 外星文明的信息 - Part 1

這幾天被一本書(我被外星人綁架 11 次)吸引。關於外星人、UFO都聽好多。真真假假 自行判斷。而這本書講的不只是作者聲稱被綁架,我感興趣的是書裡面的數學! 真的大開眼界。先不理作者講的是真是假,但裡面的數學斷估作者作不出來的。因裡面所寫的連當今物理學家也在研究中,而作者只有小六程度的數學。除了數學外,作者亦畫了以下這張圖。最後那個行星在當時沒多人知而這張圖是 2002 年畫的。一輸入程式 你會見原來這些行星的排列就是出現在一個重要日子 - 2012年9月21日! 即今年。會有什麼事沒人知,也可能什麼事都沒。但最多人猜是人類會見到外星人出現整個天空。另一圖在這些行星傍有兩條蟲洞,如果真的人類就真的認真思考自己的位置,我們太渺少。





2011年12月22日 星期四

Google / Microsoft / Nokia / Apple 科技公司

今天突然好想寫寫這幾間科技公司 因我跟他們的 IT 及 PR 接觸過, 他們是科技界的龍頭。

Google事緣 2007 年 因比賽勝出而跟那些技術人員溝通。Google (不知內地或台灣) 的 技術非常好,回覆我的問題好快亦好專業。香港 marketing (也是操國語的) 說話超快,也好好效率。我曾試過晚上 11:00 send mail, 不到 5 分鐘便回我。 所以 Google 請的人確是一流。只是最後有些感覺怪怪因那時超過 Budget 幾百元 都沒得 claim haha...

Nokia - 亦是比賽所以接觸他們香港的 marketing. 可惜他們沒有給我好印象。他們叫我弄些本土味重的 apps然後交給他們測試,我照辦。第一次 ok 有回 (隔好耐)。之後 N8 出又弄,可惜這次一點回覆也沒。簡直浪費時間。比賽是有獎金的,若我沒問 相信可能會沒人提。還有就是 NOKIA China。那次搞比賽 我也有參加。但結果公布日完全沒消息。我走去 Nokia China Forum 問,回覆已過 連誰勝出也沒人知。唉 好難想像咁大間公司,d marketing 可以是這樣的。所以現在沒有搞 Nokia 的東西。當然v非常睇好 Windows Phone的前景。 Nokia 好彩能跟 MS 合作。

Microsoft - 最近因為參加 MS 的 first apps 比賽,所以直接 send email 問 MS HK 香港人能否參加
"HI,
I am living in Hong Kong. I just want to make clear that whether Hong Kong Citizen can enter MS First Apps Contest or not?

Thanks"

有位職員回
"
Dear customer,

Thank you for contacting Microsoft Hong Kong Customer Service, my name is xxxx, and I am glad to be of assistance.

From your email we understand that you might receive some problem on MS App issue. For server product issue /development product issue /�燫ow-to�� issue /issues of product under Volume License /free downloadable software issue, we provide a free Self-Help Online Support via
Knowledge Base articles at http://support.microsoft.com, or community-based forums at http://answers.microsoft.com and http://social.microsoft.com/forums/zh-hk/categories, where you can search, browse, and post questions and answers.

Additionally, you may also want to visit our technical resources for IT Professionals at http://technet.microsoft.com/en-us/default.aspx, or development resources for programmer at http://msdn.microsoft.com/en-us/default.aspx.
Moreover, you can purchase Microsoft Professional /Personal Support. Please refer to the following website for Terms and Conditions:
http://support.microsoft.com/gp/offerprophone/en-hk.

http://support.microsoft.com/gp/offerperphone/en-hk.

I hope the above information I provided is able to address your enquiry. If you have further questions, please feel free to contact us on our hotline (852) 2388-9600, or Macau Toll Free Number (853) 0800-760, after selecting language, press option 3. It will be our pleasure to assist you further with your inquiry.

Thank you for giving me the opportunity to serve you. Our goal is for you to be �焻atisfied�� with our service.

Thank you again for contacting Microsoft."

各位 我想知這算是 " 九唔答八嗎"?

好 可能我問得差,再問
"HI,
I think you have misunderstood my question. MS announces a global contest
(see the link)
https://buildwindowscontest.com/

However, it doesn't mention HK citizen can join this contest or not. Thus, I
want to ask and if HK citizen is not allowed to join, then I don't need to
develop the apps for this contest.

Hope it is clear enough"

佢覆:
"
Dear customer,
Thank you for contacting Microsoft Hong Kong Customer Service, my name is xxxx, and I am glad to be of assistance.

From your call I know that you want to know about Microsoft windows 8 first apps issue. I am pleased to provide you the following information for reference:

MSDN hotline: +852 3002 7866

I hope the above information I provided is able to address your enquiry. If you have further questions, please feel free to contact us on our hotline 2388 9600, after selecting language, then press option 3 and 1, it will be our pleasure to assist you further with your inquiry.

Thank you for giving me the opportunity to serve you. Our goal is for you to be �焻atisfied�� with our service.


Thank you again for contacting Microsoft."

見到嗎? 究竟香港人能否參加? 到現在是個 -- 謎。


Apple - 因為最近有個 apps 被 reject 所以感受好深。Apple 連續 3 次 reject,我也 3 次回覆 講理由。到最後他們放出 17.2 條 reject 的理由,真的到終審了,結果也是 REJECTED. 於是我又寫一大編理由說明我沒有違反條例。哈 他們真的有睇亦最後 approved! 這次我好感受到 他們不是亂來的。 只要你能交出合理的解釋, 他們確是會重新看及審閱。好有人情味!!

日後如能再接觸科技司,心中也有數他們的 style是怎樣。

2011年11月13日 星期日

怎样分析六亲

(转贴)张泽华:怎样分析六亲

怎样分析六亲 (2008-12-19 11:34:23)


这是一篇16号上午给江苏一位弟子的八字讲课录音整理资料,现拿来供大家借鉴一些喜用神无法突破的盲区。

X命:一九六九年—月—日—辰时生

己酉

乙亥

丁酉

甲辰

这位弟子因为是第一次听笔者的课,所以全部的讲课内容是以这位弟子的八字来讲解如何六亲定位和分析六亲。

一:母亲的分析:

时干甲木为母亲,定位后就以这个甲木为太极点,也可以看成是日元,丁火是食伤星,乙木是比劫星,己土是财星。天干只跑出来这三个星,那么官杀星和印星就不用去考虑了,只看着三个星就知道其母一些事情。己土被乙木所克,财星被制,其母做过生意,而且还是合伙做的,但做的不太理想,是自己不愿合伙做了。【事实上正如笔者所断】这些是怎么看出来的,制财的是乙木比劫,比劫是朋友,故是和他人合伙做生意。甲木生丁火来泄乙木,乙木制己的力量不够,因为是甲木生着丁火来制乙木,所以其母的生意除了做得不太理想之外,也是自己先退出来的。

母亲的兄弟姐妹如何来看,甲辰是【雷风恒】卦,【震】为母亲,三至五爻的【兑】为二,表示其母亲是姐妹两个,二至四爻还有一个【乾】卦来比助【兑】卦克着【震】卦,说明上面会有兄姐,再从一至三爻的【巽】卦来看,【巽】为长女,这个时候要将【巽】卦看成是长男,为什么要这么看呢?因为【震】卦是长男却代表了女性,所以【巽】卦就要反过来看。【巽】卦上面是【乾】卦,【乾】为老男,【震】卦下面是【兑】卦......,从这些就知道其母亲上面有一个兄长。要是想看其母亲的身体,也是将【雷风恒】卦展开就能一目了然,基本上会不带错的。

二:父亲的分析:

日支酉金为父亲,为什么不将年支的酉金看成父亲,因为这个八字有两个偏财,年支的酉金没有紧贴丁火,所以就把紧贴丁火的酉金定位成其父亲。偏财在地支,所有的天干就不要去考虑了,只看和酉金有关系的三个地支。月支亥水是其酉金的食伤星,年支酉金是其比劫,时支辰是其财星。日支酉金制时支辰财星,从这点来看其父亲的职业也是做生意,可是年支的酉金生月支的亥水来泄代表其父亲的这个酉金,酉金制财的力量就很小,那么其父亲就不会在生意场上有一席之地。但是,酉金毕竟还是制着财,这个时候就因该考虑其父亲是有一个单位。

三:丈夫的分析:

天干没有壬癸水,只有月支亥中藏有壬水官杀,亥代壬水,年支日支双酉是亥水的印星,时支辰是亥的食伤星。辰的本气戊土是亥的官杀,辰代戊土官杀,酉金合制辰,官杀有制,按说其夫必有官职在身,但是再看日支的酉金的力量被亥水泄,而且这个亥水还有年支的酉金生,其夫就不会有官职了,只会在一个好点的单位供职。其夫还会和别人做点生意,这个怎么看,就留给大家一个思考的空间。

四:女儿的分析:

年干己土为女儿,月干乙木是官杀星,日干丁火是印星,时干甲木也是官杀星,丁火制着乙木,官杀有制,其女儿日后必会在政界有一席之地,而且还是得到一把手的提携。现在其女儿的学习有点欠妥,这个怎么看?这个八字现在走己卯大运,己合时干的甲,丁火制乙木的力量就很弱,所以其女儿的心静不下来,学习就会大打折。

以上这些是分析六亲的基础,须知一物一太极。