2008-11-24

金融风暴何去何从?

比较本次金融风暴与1930年代大萧条, 有几点类似的地方值得注意与观察:


  1. 问题的核心: 以银行为主体的金融体系问题积累至总爆发. 这是这两次与其他经济衰退的本质区别. 其他次都是局部或具体事件引起 (如石油危机或IT泡沫破灭等). 而这两次是纯银行资本系统自身投机引起.

  2. 问题的起因: 美国联邦储备 (the FEDERAL RESERVE) 过度推动以信用为主体驱动的消费. 表相不同, 上次表面是为帮助英国从一战后恢复金本位 (Ref.0), 这次表面是为伊战买单. 具体操作手法也大异, 上次是炒作汽车产业 (Ref.1), 这次是炒作房地产业特别是次贷 (所以这次也比上次爆发更快更惨. 太多参考索引, 恕我不予摘录). 实质都纯为银行资本家集体的贪婪私利所驱动, 导致过度投机, 一方面信用消耗贻尽, 另一方面资产泡沫破灭, 从而崩溃了整个金融基础系统的正常运作. 上次的美国政府以及国会的监管失职尚可借口为没有先例, 无法理依据; 这次可纯是银行资本家们或其代理说客利诱政客们把1930年代后建立的法规给主动废弃掉 (Ref.2), 真是资本家的孝子贤孙政客.

  3. 政府或银行家的自救动作: 表面大异其趣, 上次表面似乎联邦储备毫无作为 (非不为也, 乃不能耳 Ref.0), 这次表面联邦储备似乎为大众利益倾全力而为, 实则都是大银行家借机免手续费支取大把国库(或国债)去救助贪婪无度而先毁人再伤己的银行投机资本家们自己 ( Ref1) -- 上次11亿(Ref.0, 那可是70年前, 经济规模小得多而美元价值高得多!), 这次大家都知道是7000亿 --, 而把真正需要信心救助的辛苦存钱的工薪个体锁死在即将下沉的船舱里保持平衡以便创造条件给资本逃生. 上次表面是联邦储备任由银行倒闭, 实则倒闭的都是无钱或未能加入联邦储备系统的弱小银行 (Ref3) – 恰恰是这些银行平常主要在为弱势个体服务. 这些自救动作的效果如何呢? 上次就不必说了. 这次到目前为止的效果是:

a. 大银行系统放心甩下自己创造或因贪婪而犯错购入的垃圾包袱, 回过头来就捂紧自家口袋以策安全而决不轻易放贷 (网上大量文章, 恕我不予摘录. 而这也是本人与银行代理交谈所多次听到的). 而资本家本身则继续穷奢极欲. 整个一银行家专政社会主义.
b. 其他行业 (如汽车) 的资本家们眼红口馋, 纷纷要求分一杯羹, 威胁说如果分不到就倒闭或裁员. 最后结果只怕就是"会哭的孩子有奶吃".

基于以上观察, 我大胆预测美国7000亿紧急救助最终效果将会是火上浇油, 不但无补于消费者信心重建, 无法稳定就业, 反倒会刺激通胀, 加速美元乃自全球货币的贬值, 导致全球萧条. 而且仍然会有弱小银行倒闭或被兼并, 因为其弱小, 在前面经济上升期他们赚钱时本就必需也更敢于冒更大风险, 虽然其运营成本比大银行低, 但总利润无法与强势大银行相比; 而在后面的经济衰退期, 小银行又会因为资金不足以保本度过较长时间而不得不冒险率先放贷, 虽然机遇与风险并存, 但总是冒着比大银行更大的风险, 新冒险能否成功既取决于眼光, 也依赖于经济何时复苏, 而这是谁都无法准确预测的, 特别是这次.


当然也并非一片绝望, 如果以下几点能发生, 我相信将能有助于缓解萧条 (只能缓解, 无法避免, 因大势已成, 无法短期逆转), 或者起码不至于社会大动荡:

  • 奥巴马新政府改变紧急救助的用法, 不是去购买金融坏帐垃圾, 而用来担保个人和实体企业存款可保值兑付, 如果有银行要倒闭, 严加审查, 在确保资产不是被资本家转移或据为己有的条件下, 让其破产倒闭清算, 而政府担保将所有该行存款转至客户自由选择的其他银行. 这样有储蓄的个人可放心正常消费, 实体企业可照常运作. 不会发生纯因挤兑而导致小银行倒闭. 真正做到奖勤济弱, 鼓励理性投资抑制恶性投机的社会公义. 当然这只是构思, 具体操作程序需由专家制定再由国会审批.

  • 彻底改革联邦储备体系: 或者彻底取消(私有)银行推选董事的制度, 或者所有董事任命必须由国会或地方议会审批; 取消联邦储备的盈利自我支撑模式(这是腐败或职责变质的根源. 三点水尚且懂得军队不可盈利, 否则指挥不灵. 这当初联邦储备制度的制定者怎会如此糊涂或幼稚, 抑或是难得糊涂? 有时候不得不畏惧资本的能耐. 中国今后的制度制定或改革希望能以此为鉴), 改由国会审批拨付运作费用; 限制其功能纯为独立中央银行, 监管银行系统而不是代表银行家利益. 负责避免任何合法银行纯因挤兑而导致倒闭.

  • 恢复 Glass-Steagall_Act 之类的法规 (且另立法保证不可再将其取消), 杜绝今后再发生类似或更糟糕的金融投机.

否则真的除非中国能避免因大量失业而内乱, 依靠其强大的劳动生产力和宝贵的国民储蓄率带动全球经济避免恶性循环, 否则比上次大萧条更严重的大萧条将不可避免. (上次因为有二战正义最终胜利而打破人性恶性循环, 这次呢?)



Ref.0. http://en.wikipedia.org/wiki/Great_Depression#Causes

Scroll down to “Austrian School explanations” part:

......

One reason for the monetary inflation was to help Great Britain, which, in the 1920s, was struggling with its plans to return to the gold standard at pre-war (World War I) parity. Returning to the gold standard at this rate meant that the British economy was facing deflationary pressure.

......

... the Federal Reserve bought $1.1 billion of government securities from February to July 1932, raising its total holding to $1.8 billion. Total bank reserves rose by only $212 million, but Rothbard argues that this was because the American populace lost faith in the banking system and began hoarding more cash, a factor quite beyond the control of the Central Bank. The potential for a run on the banks caused local bankers to be more conservative in lending out their reserves, and this, Rothbard argues, was the cause of the Federal Reserve's inability to inflate.

......



Ref. 1. http://www.thetruthaboutcars.com/the-great-auto-industry-crisis-of-2008-history/

The Great Auto Industry Crisis of 2008: History

By menno
October 9, 2008 -

Doesn't the human race EVER learn? Why must we continually have to go through the same pains, trials and tribulations that our parents, grand parents and great grand parents went through? Same with the automobile industry. Same with how our nations handle their affairs– economics included. Even politics. Forever, politics.

1928: Times were “Terrific”. The “Roaring Twenties” they called them. After a short, sharp, 18 month long economic recession in 1920 - 1921, where the deadwood and dry brush was cleaned from the U.S. economy by an economic forest fire, new growth came along and prospered.

Even so, Chevrolet had come in at number one, selling 1,193,212 cars against Ford’s slow ramp-up of production of 607,592. Willys-Overland and sub-marque Whippet were third at 315k cars, with Hudson and sub-marque Essex at 282,203 following at number four. The total new vehicle market in the United States was 4,361,579.

Henry Ford finally listened to his son, Edsel, replacing the ubiquitous Model T “Flivver” with a new Model A car styled somewhat like a shrunken Lincoln. Yes, the great Henry Ford nearly destroyed his own nascent auto company with his stubborn demand that no change be made to what had been successful for so long. The Model T was his alter-ego, emphasis on ego. Finally, the market spoke and he at long last heard - at huge cost to his son who possibly alienated his father from that time on.

By August 1929, car sales dropped precipitously - even prior to the Great Depression which began on October 29. Even so, 1929 new vehicle sales amounted to 5,337,087. August car sales gave a warning that nobody heard.

1930 sales: 3,510,178 (a 34.2 percent drop year on year).

1931 sales: 2,472,359 (a 29.5 percent drop year on year)

1932 sales: 1,431,469 (a 42.1 percent drop year on year, a 73.2 percent reduction in sales compared to 1929. An auto market only a quarter the size of four years before).

1933 sales: up 38.7 percent year on year, to 1,447,018. (Still only about a third of the size of 1929).

1934 sales: up 45.5% year-on-year, to 2,669,963 (a 45.5% increase year-on-year). An auto market less than ½ the size of 1929.

The Great Depression dragged on until 1942, only interrupted by the great build-up of war materiel for America’s entry into World War II. Recently, only a year or so ago, people in charge of “The Fed” reluctantly admitted that the actions - or inactions - of their forbearers had not only caused, but exacerbated the Great Depression. “We’re sorry, we won’t do it again.”

So what are they doing now? Pretty much the same lever-pulling “never mind that man behind the curtain” antics that caused the ruination of the nation some 79 years ago. Throwing more paper money into a fire does nobody any good.

And things in 2008 are moving much faster than 1929. We have mountains of cash being thrown into a fire. The bail out with taxpayer money is for the sole “benefit” of the elite wealthy bankers.

Reminiscent of the Titanic, but instead of ladies and children getting the life-boats, it’s first class male bankers passengers, only, thank you - and the rest of you get locked into the hold to go down with the ship. Tough shit. We’re suddenly aware, as a people, that the politicians sworn to protect and “serve” us all have just locked us into a doomed ship and given the life rafts to others.

Are bank holidays next? Iceland’s economy has totally collapsed just within the last few days, the world’s economy is ever more interwoven. Messrs. Smoot and Hawley are ghosts now, but they are likely to begin haunting us again with protectionism rearing its head, further exacerbating the depth, length and longevity of the oncoming tsunami, just as happened in the 1930’s.

Much like our current “choices” between Presidential candidates, we can choose protectionism and certainly wreck our country, or choose a free market and watch it continue to be wrecked as it has been over the prior 40 years, when corporate managers began to decide to export jobs overseas in earnest. Is there a third way?

Yes. Ron Paul and others have been warning about the possibilities of all of this happening, and was ignored or received derision.

The underlying problem? As always, with humanity: a lack of morals. Corporate managers wanting more power and money at the expense of others. Union leaders and members wanting more power, money, less work and more influence at the expense of others. Politicians wanting more of everything and no accountability. Likewise bankers and financiers.

So how will this all affect Detroit, Inc? We’ll surmise about what might be happening very soon, in our next installment.



Ref.2. http://en.wikipedia.org/wiki/Glass-Steagall_Act#Repeal_of_the_Act

......

Repeal of the Act

See also Depository Institutions Deregulation and Monetary Control Act passed in 1980, the Garn-St. Germain Depository Institutions Act deregulating the Savings and Loan industry in 1982, and the Gramm-Leach-Bliley Act in 1999.

The bill that ultimately repealed the Act was introduced in the Senate by Phil Gramm (R-TX) and in the House of Representatives by James Leach (R-IA) in 1999. The bills were passed by a 54-44 vote along party lines with Republican support in the Senate[8] and by a 343-86 vote in the House of Representatives[9]. Nov 4, 1999: After passing both the Senate and House the bill was moved to a conference committee to work out the differences between the Senate and House versions. The final bipartisan bill resolving the differences was passed in the Senate 90-8-1 and in the House: 362-57-15. Without forcing a veto vote, this bipartisan, veto proof legislation was signed into law by President Bill Clinton on November 12, 1999. [10]

The banking industry had been seeking the repeal of Glass-Steagall since at least the 1980s. In 1987 the Congressional Research Service prepared a report which explored the case for preserving Glass-Steagall and the case against preserving the act.[11]

......



Ref.3. http://www.worldnetdaily.com/index.php?fa=PAGE.view&pageId=59405

......

Before the creation of the Federal Reserve, Friedman and Schwartz noted, bank panics were typically handled by banks themselves – for example, through urban consortiums of private banks called clearinghouses. If a run on one or more banks in a city began, the clearinghouse might declare a suspension of payments, meaning that, temporarily, deposits would not be convertible into cash. Larger, stronger banks would then take the lead, first, in determining that the banks under attack were in fact fundamentally solvent, and second, in lending cash to those banks that needed to meet withdrawals. Though not an entirely satisfactory solution – the suspension of payments for several weeks was a significant hardship for the public – the system of suspension of payments usually prevented local banking panics from spreading or persisting. Large, solvent banks had an incentive to participate in curing panics because they knew that an unchecked panic might ultimately threaten their own deposits.

It was in large part to improve the management of banking panics that the Federal Reserve was created in 1913. However, as Friedman and Schwartz discuss in some detail, in the early 1930s the Federal Reserve did not serve that function. The problem within the Fed was largely doctrinal: Fed officials appeared to subscribe to Treasury Secretary Andrew Mellon's infamous 'liquidationist' thesis, that weeding out "weak" banks was a harsh but necessary prerequisite to the recovery of the banking system. Moreover, most of the failing banks were small banks (as opposed to what we would now call money-center banks) and not members of the Federal Reserve System. Thus the Fed saw no particular need to try to stem the panics. At the same time, the large banks – which would have intervened before the founding of the Fed – felt that protecting their smaller brethren was no longer their responsibility. Indeed, since the large banks felt confident that the Fed would protect them if necessary, the weeding out of small competitors was a positive good, from their point of view.

......


2008-11-22

无题的小故事

听朋友讲了个感人的小故事,记下来以安心彻底忘却。我可不想时不时地鼻子不舒服或打喷嚏什么的。

朋友大H是个绅士心常存,却不时反应慢半拍的好人。 不幸被金融海啸浪尖波及,成了即将失业高薪专业人士之一 (公司还幸存也算人道, 给他们一个月通知并允许使用公司资源找工作). 意外故事的发生起因于同期被裁的有一老牌人事经理, 愤懑不过而告诉所有同期生说公司福利中包括好几百大洋的按摩针灸费, 在这最后一个月内仍有效, 怂恿大家不享用白不享用, 并发给一个链接就在公司不远的中高档保健按摩室. 大H于是有心一试, 又恰逢肩膀酸疼,万金油家庭医生毫无办法且不当回事, 便老实不客气地去了.

那倒确实是个正规的高档保健按摩室, 一长串注册按摩师的照片和档案列在那供挑选预约, 全是专职培训毕业的, 有好几个还是大专以上文凭. 大H选了几个看着顺眼的去预约. 第一个的时间已被排得满满, 再次验证大H的眼光不差. 他只能预约到一个星期后的傍晚一个小时. 肩膀的酸疼提醒他预约当天可能的, 前台小姐推荐给他一个, 大H一看还在自己的顺眼名单内, 赶紧定下当天下午的一个小时. 踩着点大H进去, 跟按摩师简单寒暄后就开始. 据大H跟我回忆所说, 一切再正常不过, 按摩师娇小文静稍有雀斑. 只是没想到居然是从南边邻国来这里进修,专业毕业。(为方便,后面只称呼她小L。) 小L先询问他肩膀酸疼的部位并反复按压确定, 然后推拿挤按等专业动作大H也说不全. 唯一的意外是最后一刻钟让他翻身后涂一种不知名的药膏时, 涂在了他的右肩上而不是酸疼的左肩上. 我不能断定大H没有当场纠正小L是因为绅士心发作还是又反应慢了半拍, 大H给我解释的是他以为小L会涂完右肩再涂左边,哪想到涂了右肩后小L又推拿右肩直至时间结束。 他就只好带着涂错了边的半边药膏回去了。

故事如果到此结束那就不算故事而是笑话,我也省了敲拼音的指力与心力了。

大H当天傍晚带着些许失望 (主要是因为没有人回他的求职信)挤*上公车回家,突然手机响,他盲目但赶紧地接听了(不敢错过任何可能的求职回音)。意外的是居然是小L打来的,说发现药膏涂错了肩膀,连声说对不起。大H本是绅士, 立马说没问题,没关系。不料邻国人果然思维不同,小L竟然提议请大H第二天去,她免费治疗一次以作补偿。大H可不想周末坐车去市中心就为这没鼻子没眼睛的事,但小L毫不放弃不挂电话。大H只好敷衍说下星期跟她联系。下一个星期大H忙着找工发简历接职介代理的电话,累得身心俱疲,当然没有联系小L (大H说心里话,倒不是他不想,确实忙得没好功夫去理那一茬)。直到电话提醒他预约的傍晚的按摩不能取消,他也就干脆什么都不想去按摩放松算了。新的按摩师虽是他的首选,但他到此也没什么心情欣赏挑逗美女,闭着眼睛享受了一小时按摩。让人惊诧的是当他去前台付账时,前台小姐告诉他今天的帐已被小L付了。大H的反应慢半拍毛病又发作了,楞着只知道说怎么会这样,末了请前台小姐转告谢谢,然后仓皇而逃。好在大H只是当场反应慢半拍,过后回家公车上就有了决定。

以下我只能白描纪录,无词评论。

第二天临近中午时分大H先试着打回小L打给他的电话,发现只是前台; 询问小L的电话,规定不能透露; 问能不能预约今天小L的按摩时间,回说已满,反问明天可不可以(又是周六了); 问下周一,回说小L只有周五和周末三天在此;大H立马定下下周五。
然后大H简单吃过午饭后就到最近的花店买了一朵花,恳请卖花人包裹严实,然后去按摩室,请前台小姐调出昨天的帐单,让他重新付账再请返还小L的付款。前台小姐问“你不接受小L的...?” 大H回说"我接受她的善意并且珍惜. 但我不能让她付这个钱." 等前台小姐操作完毕后大H拿出花请转交小L并谢谢. 前台小姐说"我会的".

我追问大H买的什么花. 大H笑说他不太懂花, 是询问花店小姐什么花适合送朋友表示感谢, 花店小姐追问是男是女, 确认是普通女性朋友后指点说除玫瑰花之外都可, 或者白色玫瑰花也可. 最后大H选了一支鲜艳的安祖花, 俗称红掌的. 认为一枝独立, 出尘不俗, 才配得上. 而且回头遍查网络, 确认意义不错后才放心.

最后我不想再多饶舌. 只是觉得在这金融海啸寒风扑面中, 大H能经历这一番普通人但不平凡的真性情, 也不枉他这么多年辗转仍能保有一颗绅士心.

绅士与真性情永存人间!

2008-11-03

iPhone Simulator, Safari on Linux

iPhone Simulator:
http://www.testiphone.com/
Itself can run in any web browser. But to have the really same rendering effect as in a real iPhone, you have to use Safari to to run the iPhone simulator page.

Following are my steps (& notes) to get Safari run in Linux (Ubuntu 8.0.4):

1. Required dependency packages: wine and msttcorefonts
-- In Ubuntu, you can use either Synaptic Package Manager or apt-get command to install these packages.
sudo apt-get install wine msttcorefonts
Now you should have a "Wine" menu item in your "Applications" menu. Run "Configure Wine" to set (or make sure) Windows version is XP.

2. Copy the core windows fonts for Wine.
-- This is the tricky to make sure installed Safari really work smooth (thanks & credit goes to: Vitavonni http://www.vitavonni.de/)
cd ~/.wine/drive_c/windows/
mkdir fonts
mkdir Fonts
cd /usr/share/fonts/truetype/msttcorefonts/
cp *.ttf ~/.wine/drive_c/windows/fonts/
cp *.ttf ~/.wine/drive_c/windows/Fonts/
Not sure which f(F)onts directory is really required. But if you are good at Linux/Unix, you know you can only creat one fonts directory and use symbol link for another so to save a little disk space ;) I am here just to make sure my steps work in any circumstance (such as my installed Wine has "Fonts" directory already but no "fonts" directory).

3. Download Safari for Windows XP.

4. Use Wine to install downloaded Safari executable file.
-- (My way: use file browser to find the safari exe file, mouse right click on it and then => Open with "Wine Windows Program Loader")

Now you should be happy to run Safari browser in Linux. Enjoy :)

Versions used in my experience:
Ubuntu: 8.0.4 (installed all recommended updates as of today)
Wine: 1.1.7 (but 1.0 works better, more stable)
Safari: 3.1.2

2008-10-14

喜丧金融风暴

所谓“人生如戏,戏如人生”。美国多的是擅长制作大片的导演,砸下巨资,拍的辉煌而精细,感人之处时而有之,赚的更是钵满盆漫。好莱坞搭建的大戏台显然已不计其数。不过比起华尔街金融家们利诱华盛顿政客们合力搭建的金融大舞台, 那就真是小巫见了大巫, 不是一个数量级的了. 这个金融大舞台可真是搭建不易, 耗时数十载, 拆迁多豪宅, 墙角垮塌无数, 连赫赫有名维系全球稳定的布雷登大叔也黯然退位, 黄金在它面前也曾经一度犹如粪土. 这个舞台是如此激励人心,鼓舞士气。舞台上的表演者自不必说,有幸近水楼台的美国大众在它的鼓动下,信用膨胀,消费无度,那可真是天堂难得的日子。随便一个节目,诸如“成器? 不成器!”, “比-5年级高材生还聪明?” 奖金动辄上十万,那可是美金,虽然含金量已不如前,毕竟垮塌的世贸还有大堆钢材瓦砾呢。时不时来个弱智老美一不留神就踩着黄金狗屎摇身变成百万富翁或婆。

在这个舞台灯火辉煌时,世界尤其是中国人只好望洋兴叹,低头干苦活,累死累活还得把最好的奉献给这个舞台以换取稍许的台面透气空间。这一奉献就是十数年。结果还是让老古董们给蒙着了,那是哪个老而不朽的说的来着:“祸兮福所倚,福兮祸所伏”。这一伏就是这些年,河东河西祸福转换居然仍有效,比那些想秃了脑袋,磨破了笔杆然后者了名的华尔街经济学家们发明的次贷浓缩精品毒垃圾高档礼品的有效期可长了去了。中国人的隐忍终于又栽培出了个现代美吴王。不事生产光享受?哪朝哪代也只是根兔子的尾巴。想想也是,老是打工的低声下气地借钱给大老爷享受,再聪明的大老爷也会给养笨了,最终不被蒙才怪。 从这点来说,小平同志的韬光养晦的确高水平,长眼光。

只是这个舞台实在是太高太大,垮塌时正唱主角的不必说必被摔死 (一小搓精明得脑袋早拿了大鼎的提前退场开溜的除外,当然也不能排除今后被众人的口水淹死的可能),靠近戏台的听众也被砸死踩死无数,有那隔着远的观众心里不平衡,总想挤到前台而赌博的,结果自然也是损伤惨重。

中国党国领导人的心中自然那是一个得意。好在表面看起来还算没有忘形,口口声声说我们保持扫清自家门前门后的雪就是帮了大家,倒是头一次附和了西人的人人为自己,上帝为大家的精神。希望领导同志们保持清醒,坚持信念,就算胳膊腿还是没有别人的硬,别人要强借钱总要提提条件,再不许搞什么出口配额限制,反倾销惩罚之类的不地道东东,或者再比如要求借去的钱必须买中国品牌的产品之类的条件。总是主动权在自己手中,别再只顾自个政治脸皮,不管中国百姓生活。

是为“喜丧金融风暴”。当然是马后炮。

2008-09-13

不知所云

无意中从图书馆重借了两张DVD: "Return of Dragon" 和 "Must Love Dogs". 既借之, 乃看之. 重温了一遍李小龙的招牌技击和喊叫, 以及李小龙电影中少见的成熟女角温情元素, 有一丝感动, 而有情人决绝而别, 无份相守的结局, 也令人感叹遗憾. WHY? WHY NOT?

"Must Loves Dogs", 一如其前辈西方爱情经典篇如"When Harry Met Sally"或者"You've Got Mail", 男主角总能自如地说他所想所感, 轻易打动女主角, 轻松地跟随自己的感觉行动而无需费神费功夫就能抱得意中人. 赶紧自我提醒, 那只是电影, 只是预先写好的剧本台词. 如果现实中他们也是如此, 那就真羡慕倒众生了. 可众生不就是因为现实中的难为甚或不可能才喜欢这些电影的吗? 佛说, 众生男女平等, 现实中难圆的梦, 在电影中去寄托, 也不算违背自然吧.

不知所云, 无以为继. 时间也到中秋节了, 还是好好休息吃月饼打电话算了.

2008-09-09

素未谋面的朋友

屏幕上的SKYPE终于提示有人呼叫,一看是素未谋面的朋友B, 赶紧回复,把蹦到脑子的英文字母一个一个以最快速度敲出去,生怕她觉得冷落而很快离去,又尽可能地表现理性保证她能按平常5:30离开办公室回家,不至于第一次网聊就被我吓跑。我的小聪明算是被我用到顶了。

那是昨日下午5:10左右的事。好在她提问不多,基本是按我的思路在交换话题,头一次让我觉得我对谈话的时间进度掌握得还好。只是5:30很快就到,网聊嘎然而止,有点意犹未尽的感觉,不知道她那边是否有同感。鱼与熊掌不可兼得,不当机立断前面的理性表示就变成虚伪了,遗憾了也没办法。

与B交换电子邮件已超过一年半了,居然是在一个业余网上编程赚点外快好打发圣诞节的项目中碰到,除了包工头,就我和她俩打工仔,算得鬼使神差吧。项目结束,包工头找茬克扣了最后一笔工钱,也懒得去折腾了。结识B应是最大的惊喜(虽然素未谋面,从唯一的一次项目电话讨论中可感觉她是温柔体谅随和的人),其它随它去吧。之后大家便各自隐迹于网络中,直到去年夏天VANCOUVER年度焰火节,居然发现大家都对此有兴趣。可惜我那时正热衷于太极,加上我已看过两届焰火节,而且公司和租家都在RICHMOND, 一时放不开,错过了极好的邀约见面的机会。再到今年焰火节,我恰好跳槽到VANCOUVER DOWNTOWN,方便看焰火之极,遂萌生了邀她共赏焰火的念头。只可惜天不作美,她竟然已长期不看GMAIL, 是在月余后才看到我发的电邮,正应验了那句“机会是给有准备的人”的话。但不管如何,我们又恢复了电邮联系,我终于鼓起勇气尝试直接邀约谋面。虽革命尚未成功,但有了更方便,更频繁的联系方式,总算是在天天向上,自需加倍诚心努力。想想当年追求初恋女友也未如此费心,还不知美眉是否恐龙。但知己难求,何况异性,有这一点焰火的共同兴趣我也知足了。

真困惑科技进步是友情的幸运还是不幸,以前送朋友一张新年贺卡就是一次见面聊天的机会,现在可好,不要见面,网上就可全打发了。离题了,就此打住。

占领

这是一个鹊巢鸠占,鹊鸠不分的世界。文明越发展,技术越进步,地球村越开放,这种现象就越明显。上周日晚我们就彻底占领了一把房东的HOUSE。

事情还得从半年前说起。房东老张早年从上海移民,闺女人长得可爱书也读得漂亮,初中就考入UBC预科,老张骄傲得不行,逢人就夸。只是上学远了点,坐BUS从RICHMOND到UBC得转车。老张舍不得闺女辛苦倒车,起先由老张太太每天开车接送,可是过桥堵车耽误时间,每天得早早起床,闺女抱怨睡不好。老张竟然到VANCOUVER西部租下另一整套HOUSE,全家搬过去,然后把原来自住的自家HOUSE的二楼租给从星马移民过来的GEORGE一家四口。就这么地,房东老张的HOUSE就全给我们新移民们暂领。

GEORGE和他太太都是基督徒,但GEORGE不会说中文,她太太也是马马虎虎,所以平日交往并不多。周日下午突然邀请我们一楼的租客们到二楼他家(暂且算是他家吧)共进晚餐。于是各人或买或自备或菜肴或水果或点心,前前后后头一遭聚到了一桌,边吃边说笑,倒也热热闹闹。饭后GEORGE太太竟然提议请我们大家都到客厅玩一个游戏,大家或惊或喜,于是纷纷到客厅或正坐沙发,或斜躺地毯,等着游戏开始,我就趁机观察了一把整个二楼的结构。等GEORGE和他太太都坐定,他太太发话开始游戏,原来只是个简单的合作问题。问如果现在大家准备去沙漠,每人限带两样东西,你会带什么?我冲口而出“水”,话音未落就心中暗自掌嘴,肯定错不了但不经大脑毫无新意,肯定被人当垫脚石。果不其然,北京来的小滕俩口子咬咬耳朵后说带骆驼,还加一句说骆驼能帮忙找到水,再加一句说第二样东西还是骆驼,一头自己骑,另一头给老婆骑,大家都笑了。GEORGE居然说带镜子,有人奇怪问为什么,回答是如果迷路了,有飞机来找人,可以用镜子反射阳光给飞机指路;就有人开玩笑说镜子还可以化妆用,这样被拯救的时候显得漂亮点;另有人说化妆得要水,我只好说我可以卖水发财了。七嘴八舌,大家笑闹成一片。GEORGE太太总结发言,说从游戏的结果看出大家可以合作互相帮助,比如EDWARD(鄙人)可以供水给口渴的人喝,小滕可以共享骆驼给累了的人骑,等等等等。

GEORGE太太话头一转,说接下来要跟大家分享一段关于基督的录像。原来他们教堂新得一批从BRITAIN来的见证基督演说录像,要求他们跟尽可能多的人分享。翻看那一盒包装精良的DVD,估计不下20集,每集约20分钟,真的很佩服他们教会的功夫。第一集标题是: “BORING?UNTRUE?IRRELEVANT?”。 纯正的BRITAIN口音,抑扬顿挫,快速而清晰,没有连读和默音的机巧,是我所偏好的。演说内容具体切身而幽默,最后归结为“JUSUS IS THE WAY, THE DIRECTION TO THE GOD,AND DIED FOR ALL OF US”,很能打动或迷惑人的那种。20分钟后GEORGE太太问我们大家的观后感,特别问我相信不相信上帝,我不想为逢迎她而说相信,也不想说不相信而跟她争执,先顾左右而言他,只说一年前我在VANCOUVER去过一间教堂,而且是MORMEN派别的,他们也教导JUSUS,HOLY GHOST等等。然后把时间转给小滕,小滕低头一会,然后说其实他跟太太有过一次严重的争论,他太太刚来半年就入了教,企图说服他相信上帝,最后谁也说服不了谁,太太倒气得要掐死他;这时他太太插话说,还是因为她自己掌握的基督知识不够深,不然肯定可以说服他先生;然后小滕问道,如果上帝存在,为什么还会有四川大地震死那么多人?大家都默然。GEORGE夫妇倒并不强辩,只说如果是上帝惩罚的话,也确实太血腥了点。GEORGE太太再问我的意见,我只好豁出看家本领打发说,其实相信不相信并不重要,基督所代表的并非现实的世界,而是注重精神,解放或释放精神压力,让人从精神痛苦中解脱;一般人平常紧张操劳,担心这忧虑那,搞的关系紧张,容易起冲突导致争斗;基督的精神就如同佛教,让人放松,减少压力,从而化解冲突争斗;当然这是好的一面,任何东西有好的一面就有坏的一面,如果因相信而过于执着,可能导致更严重的战争;所以上帝是不是真实的并无所谓,关键是现在的基督精神是教人向善,善待自己也善待他人。说来话长,写来纸短。期间还因为我的英语发音不正,BUDDHISM一词费了我不少口水才让他们明白,惭愧归惭愧,倒是杀了不少时间。不觉中就到了该散席的时候, GEORGE带头祷告,其他人也就跟着“阿门”。临别GEORGE太太问大家能不能下周日继续聚会看下一集,当然没有人反对。多好的邻里!

就这么地,我们从里到外,从物质到精神,干脆彻底地全城占领老张的HOUSE。

2008-09-06

eFAN's GWT Development Approaches

There are different approaches to do GWT web development. One easy and quick way is to use GWT Designer*. Design the GUI layout and look & feel within one tool, and the generated code is ready and bug free for integrating with business process logic code. Design, code, debug and test, ... all can be done by one single developer. The approach is so similar to traditional standalone windows application development approach. That's the beauty of GWT and GWT Designer. However, before GWT Designer could become widely adopted by GUI artists / designers, this approach does has two big disadvantages:
  1. Obviously, few developers are excellent at GUI design. Either a developer spends extra time to come out kind (not so professional) GUI by drag & drop in GWT Designer, or a GUI designer pass over a GUI design in paper (or whatever electric format) to a developer who then uses GWT Designer (or pure java coding if he prefer) to implement the design. Either way one has to spend extra or duplicated time, so the time saved by GWT is wastered here.
  2. More seriously, once that design went into implementation phase, it's totally mixed with Java code (or worse, mixed with process logic), then it's very hard to change the GUI without breaking the code.
So GWT Designer approach is only suitable for small project, or for quick prototype purpose. That's why I went into another approach.
The approach is, a GUI designer come out GUI design/mockup in html format (which has been widely adopted and language/tool independent), a developer takes that html then does two small changes:
  • Add GWT loading script (***.nocache.js) into the html head.
  • Assign unique ID property to each html tag which content need to be dynamic updated by code (or wrap that part in a "div" tag).
Then pass back the updated html to designer, and use the html as the host page for development. This approach integrates the design output and the Java logic code seamlessly but clearly separates the concern between GUI designer and Java developer, and the design could be changed without breaking the java code.

* Note:  GWT Designer was created by Instantiations which acquired by Google.

2008-07-03

GWT & AJAX Libraries

AJAX is becoming de facto leading Web development approach. It's not only because AJAX can give end users more responsive and better richer experience in Web browser, but also because it saves development time by using the approach invented in Google GWT (http://code.google.com/webtoolkit/) to translate Java code into javascript, so to free developers to focus on the language they familiar with, to develop Web app using standalone GUI app style (listener - event - handler style, and to retrieve data from backend only and display the data in UI naturally, but not page navigation) which saves time in both design flow and coding, and no need worry about cross-browser compatibility which saves time in debugging and testing…

Microsoft is following GWT's approach in new project Volta, so this approach is adoptable in .NET too. I had chance to use it to develop a Web Patch for CodeStriker and feel the same advantage to save time in design flow and coding (as I enjoyed in using GWT in my previous projects), though Volta inherits those bad genes of M$ (1. stolen the idea from GWT but denied; 2. pretend to be free but actually is not free - it requires you to buy VisualStudio Prof 2008; and 3. same as any other W$ development tools, buggy & poor documentation), but it still worth to wait to see if Volta growing mature in case one has to do development in .NET platform due to under the situation of decision made already...

2008-06-21

Software Dev: Archive: - 0 (Favorite Java Build Process: Ant + Maven Dependency Management) (2007.12)

(This article is still under editing because it's kinda hard to post here this style of docs which is much better to use attachments. Interested guys please leave your comments and contact info, I will send you those attachments.)


Ant + Maven Dependency Management

Ant: http://ant.apache.org/

Release used: 1.7.0

Maven dependency management within Ant: http://maven.apache.org/ant-tasks.html

Release used: 2.0.7

Build script configuration guide:

Common Ant with Maven


Artifactory (Best internal Maven Repository Management tool):

http://www.jfrog.org/sites/artifactory/latest/
Release used: 1.2.5-rc6

Configuration of Artifactory with SQL-Server

How to Deploy Artifact file(s) into Internal Maven Repo under Artifactory


How to Utilize Common Ant With Maven for Easy Ant Build-- To utilize Maven dependency management feature within Ant build process

To take the advantage of Maven dependency library management (focus on your project direct dependencies only, let Maven Dependency Management to manage / download the dependencies of dependencies of dependency for you automatically) without the learning curve and pain of building entire pure Maven build process. And to ease/simplify the ant build script for classpath and get libraries for IDE.
A working copy:




build.xml:


<?xml version="1.0"?>
<project name="rms-core" default="jar" basedir=".">
<property name="common-ant.script.dir" value="../../common-ant" />
<import file="${common-ant.script.dir}/common-maven-in-ant.xml" />

<target name="jar" depends="compile">
<jar destfile="${sjs-artifact}">
<fileset dir="${classes.dir}">
<exclude name="**/test/**" />
</fileset>
</jar>

<antcall target="share-local" />
<!-- This call is important if this target jar is a dependency of your other project components -->
</target>

......

<!--
This post-compile target won't work for you by default.
I list it here just as an example to show that you could do anything in post-??? targets..
-->
<property name="config.dir" value="conf" />
<property name="DEPLOY_TARGET" value="Tomcat" /> <!-- Overwrite it in ant command line -->
<target name="post-compile">
<condition property="DTARGET" value="${DEPLOY_TARGET}" else="default">
<available file="${config.dir}/META-INF/persistence-${DEPLOY_TARGET}.xml" />
</condition>
<echo message="Deploy target is ${DTARGET}" level="info" />
<copy file="${config.dir}/META-INF/persistence-${DTARGET}.xml" tofile="${classes.dir}/META-INF/persistence.xml" overwrite="true" />
</target>
</project>

The most relevant line to this topic is:




<import file="${common-ant.script.dir}/common-maven-in-ant.xml" />


The common-maven-in-ant.xml does the dependency magic.





common-maven-in-ant.xml:


<?xml version="1.0"?>
<project name="Maven-in-Ant"
xmlns:maven="urn:maven-artifact-ant">
<!-- Internal maven repo (artifactory) url property -->
<property name="repo-syscon-url" value="http://build01:8081/artifactory/repo/" />
<!-- IMPORTANT: change this value to your internal repo url, no matter it's artifactory or not. -->

<property name="shared.lib.dir" value="//syscon.ca/repo" />
<path id="maven-ant-tasks.classpath" path="${shared.lib.dir}/maven/maven-ant-tasks-2.0.7.jar" />
<typedef uri="urn:maven-artifact-ant" resource="org/apache/maven/artifact/ant/antlib.xml" classpathref="maven-ant-tasks.classpath" />
<maven:remoteRepository id="repo.syscon.url" url="${repo-syscon-url}" layout="default" />
<maven:pom id="maven.pom" file="${basedir}/pom.xml" />

<property name="shared.build.dir" value="../../BUILD" />
<property name="build.dir" value="${shared.build.dir}/${maven.pom.artifactId}" />
<property name="lib.dir" value="${build.dir}/lib" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="deploy.dir" value="${build.dir}/deploy" />
<property name="sjs-artifact" value="${deploy.dir}/${maven.pom.artifactId}-${maven.pom.version}.jar" />

<target name="clean">
<delete dir="${build.dir}" />
<antcall target="post-clean" />
</target>
<target name="post-clean" description="Hook into local build for post clean processing." />

<target name="init" depends="clean">
<mkdir dir="${classes.dir}" />
<mkdir dir="${lib.dir}" />
<mkdir dir="${deploy.dir}" />
<antcall target="post-init" />
</target>
<target name="post-init" description="Hook into local build for post init processing." />

<!-- Dependencies definition common to every project build component:
To compile and to add correct CLASSPATH into run-time scripts
-->
<dirname property="common-ant-script.basedir" file="${ant.file.common-maven-in-ant}" />
<target name="dependencies" depends="init">
<copy file="${common-ant-script.basedir}/settings-m2-syscon-common.xml"
   tofile="${shared.build.dir}/.m2/settings.xml">
<filterset>
 <filter token="shared.build.dir" value="${shared.build.dir}"/>
</filterset>
</copy>

<maven:dependencies   pathId="dependency.classpath"
                   filesetId="dependency.fileset"
    settingsFile="${shared.build.dir}/.m2/settings.xml" >
<pom refid="maven.pom" />
<remoteRepository refid="repo.syscon.url" />
</maven:dependencies>
</target>

<!-- This definition includes all the dependencies in pom.xml already.
Overwrite "classpath" definition ONLY when necessary.
NOTE: any target referring to this "classpath" must depend on "dependencies" target
-->
<path id="classpath">
<path refid="dependency.classpath" />
<pathelement path="${classes.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${deploy.dir}">
<include name="**/*.jar"/>
</fileset>
</path>

<target name="get-lib-by-maven" depends="dependencies">
<copy todir="${lib.dir}" flatten="true">
<fileset refid="dependency.fileset" />
</copy>
</target>

<!--
Compiles local src directory to classes directory in shared build.
Then call a target that hooks into your local post compile process.
-->
<property name="src.dir" value="src" />
<target name="compile" depends="init, get-lib-by-maven">
<javac destdir="${classes.dir}" classpathref="classpath">
<src path="${src.dir}" />
</javac>
<antcall target="post-compile" />
</target>
<target name="post-compile" description="Hook into local build for post compile processing." />

<!-- Target for sharing the artifact locally to other project components as dependency -->
<target name="share-local">
<maven:install file="${sjs-artifact}"
   settingsFile="${shared.build.dir}/.m2/settings.xml">
<pom refid="maven.pom"/>
</maven:install>
</target>
</project>

Simple steps to utilize above common scripts:

1. Create a pom.xml file for your project to define your direct dependencies:
Following are key format & elements of a pom. (a working copy pom.xml)
pom.xml

4.0.0
RMS Core Module


syscon.rms
sjs-rms-core
1.0







org.hibernate
hibernate-entitymanager
3.3.1.ga
compile



javax.mail
mail
1.4
compile



junit
junit
4.3.1
test



com.oracle
ojdbc14
10.2.0.2.0
runtime



log4j
log4j
1.2.14
runtime






syscon.common
sjs-common-util
1.0
compile







Note:



  • the pom.xml file
    must be in the same directory as the build.xml file.


  • Additional settings in build.xml if
    your project used sjs internal dependencies such as, a. sjs-common-util
    Make your "post-init" target depends on "compile-common-util".


  • ...



b. sjs-common-action Make your "post-init" target depends on
"compile-common-action".


...


Please refer
to http://maven.apache.org/maven-v4_0_0.xsd
for more details.

2. Run ant
build task as usual. e.g.

ant jar

One extra
benefit is to get library jars easier by one command:

ant get-lib-by-maven



Bottom of Form

Artifactory
use Derby as database by default. Syscon has SQL-Server production
database already and the most important is that the backup machenism is
there
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalready.

Quick two
steps to get it work from original zip file:

1. Replace the
content of repo.xml (inside
webapps\artifactory.war\WEB-INF\lib\artifactory-core-1.2.5-rc6.jar\jcr\repo.xml
inside artifactory-1.2.5-rc6.zip) with the content of attached http://info/download/attachments/7962830/repo.xml.sql-server(note: change all "???" to real password)

2. Include a
SQL-Server JDBC driver file into webapps\artifactory.war\WEB-INF\lib

Following are
related information.

A. Artifactory


A1. JCR API


A2. JCR Implementation


A3. Default DB: Derby

This is the
part to be replaced by SQL-Server.

A4. Switch to SQL-Server



  • Configuring
    Jackrabbit
    use SimpleDbPersistenceManager to replace DerbyPersistenceManager


  • Tricky is all in repo.xml
    ( plus a jdbc driver for sqlserver)

core/src/main/resources/jcr/repo.xml
inside svn source or webapps\artifactory.war\WEB-INF\lib\artifactory-core-1.2.5-rc6.jar\jcr\repo.xml
inside artifactory-1.2.5-rc6.zip or it could be /jcr/repo.xml under WEB-INF/classes or any classpath
preceeding WEB/INF/lib

A5. Issues TBD:



  • How to pass
    variables value into the repo.xml config file? db.server.name,
    db.server.port, db.name, db.user, db.password option 1. Hard code in
    the source code. option 2. Write a script to update at build / deploy
    time.



  • Move Web UI users data to
    sqlserver too? Requires more research effort related to: org.springframework.jdbc.datasource.DriverManagerDataSource



  • The link for deploy is available
    to Reader/Search only user, the permission check is done after the user
    uploaded the jar file and then get error message: Not enough permissions to deploy
    artifact 'org.jfrog:artifactory:zip:1.2.5-rc6'.

B. SQL-SERVER


B1. DB Info:



  • Server: sqlsrv01


  • User: artifactory


  • Database: repo (set owner to
    "artifactory" user so that the db schema could be created
    automatically) (Note: SQL-Server default installation disabled TCP/IP
    protocal, use SQLServer Configuration Manager to enable it.)

B2. JTDS JDBC Driver

C.
Artifactory database switch architect diagram



Bottom of Form


Step 0.
Do a search first to see if the jar is already in Syscon internal repo.

Login as
"search" Username: search Password: password

Click "Search
for Artifacts" in the left side Enter the name of the jar and click the
"Go!" button

Step 1.
Prepare to deploy a 3rd party jar into the repo Pre-condition: the 3rd
party jar file has been downloaded and verified. (e.g. to deploy
'icefaces-1.7.0.DR2.jar' )

Login as
"admin" Username: admin Password: xxxxxxxxx (set by the administrator)

Click "Deploy
an Artifact"

Step 2.
Upload and deploy the pom file (optional if the 3rd party jar has no
dependency itself) (e.g. 'icefaces-1.7.0.DR2.pom') Note: Verify to make
sure: a. the value of "GroupId" is same as defined in the pom. b. the
value of "Packaging" is "pom". c. the checkbox "Use Jar POM/Generate
default POM" is UNCHECKED. Tip: Copy the value of the "GroupId". It will
be used in the next step. Click "Deploy" button.

Step 3.
Upload and deploy the jar file (e.g. 'icefaces-1.7.0.DR2.jar' )

Note&Tip: paste the value of "GroupId" from step 2. Verify and/or
correct the values of "ArtifactId", "Version" to make sure it's proper.
IMPORTANT: Leave the "Use Jar POM/Generate default POM" check-box as is.
Do NOT change it. Click "Deploy" button.

Step 4.
Last but not least, verify the jar is in the repo and the pom is
correct. Click "Browsing" ==> "Repositories Tree" and navigate to the
jar file through package names

Right click on
the pom file and select "View" from the popup menu.

Verify the pom
file content is correct. (the values of "groupId", "artifactId",
"version", etc.. and dependencies reference included.)

录近作 - 1 (和春温哥华 2008.4)

和春温哥华

望穿樱树雪山现
温市花色宜赏析
梦回故国真情存
老屋竹香堪追忆


* 老姐在深圳发来咏春诗句感叹应景:

满眼不堪三月喜
举头已觉千山绿

读之尤似身临其境, 遂赋一首应景回应. 字句难工, 聊表情意而已.

* 温哥华到处可见樱树, 三四月间速开速落, 可谓温市一大春景. 而北面雪山环抱, 非至七八月积雪不化. 春夏季节花色雪光辉映, 惟叹词穷而已.

* 小时老屋后长有一大片竹林, 密密实实, 雀虫獾兽共聚, 是儿时掏鸟窝, 粘知了的不二宝地. 每当初春新笋破土发芽, 淡淡清香非我文字所能描述.

==========

录近作 - 0 (太极歌 2006.8)

太极歌

太极本无极
先贤亦无系
巧思复勤勉
立身天地气
招式可另创
心胸必开放
王廷开局明
露禅有灵性
鉴泉兼并蓄
精简大普及
三丰虽传奇
精义自飘絮
阴阳转虚实
五行换八卦
柔极克刚强
四两拨千斤
筋髓皆可易
自然意合一
天地有正气
混元出太极

==========

录旧作 - 1 (戏赏武大樱花 1995)

听课

???????
???????
听课坐爱夫子痴
又是樱花烂漫时


* 当年单位组织青年员工业余在武汉大学求学经济,难得碰上位中年老夫子备课及其认真严谨,教授借贷平衡关系一丝不苟,尤其准备的课余作业题说明清晰明了,一片痴心200%弥补了无法活跃课堂气氛的不足。

==========



折枝

双双对对步行迟
个个眼中似韵诗
忽闻保安声呵斥
落荒而逃已折枝
==========



无题

只羡蜜蜂不羡仙
无阻少滞游花间
可恨凡夫空多情
美意当前语犹腼

==========

录旧作 - 0 (三峡组诗 1995~1996?)

夜上三峡

残月当空悬
峭壁立两肩
险关重重过
蜀藏尽在握

==========



夜出三峡

一轮明月映江心
两岸风景寂无声
三更灯火五更笛
十分想念还是你

==========



三峡情

瞿塘雄关三度游
最是知音不可求
巴山柿红艳无方
相遇相知难相守

==========