Orange Tiger 木匠 的 移民生活

Hope you're enjoying your stay here.

Friday, May 16, 2008

买房记 第二年

今年美国经济一片糟糕, 有新人DBA朋友在纽约, 亲身经历身边裁员声此起彼伏,包括IT部门. 加拿大近三个月经济急剧恶化,眼看要面临衰退.
中国又是藏独,紧接着地震,人灾天灾. 还要靠信心毅力坚持把奥运办好,这是我们祖国由懦弱到富强的转折点.
( 我淮河(岳母)也是第一次在中央台见到雪山狮子旗, 作为土生藏族人, 从不知道有这么个蓝色旗子存在. )
木匠的大年撞上了加拿大经济形势的小年,该冒进,还是稳守,不好判断. 以后有机会再介绍人生大小年定律.

说到移民, 理想生活景象是: 一个房子两辆车, 两个孩子一条狗.
说到买房子, 经历了2007年的屡次挫败, 步入2008年春夏之交, 终于全家老小又大力投入了买房子斗争当中.

由于经济形势在变差, 昨天吃完饭时问及泰山泰水(岳父母), "买涨还是买跌", 泰山答道, 通常人们都在追涨买涨,只有慧眼有远见之士会买跌. 因此我们也加大砍价力度,一口气压下5万,屋主竟然答应了.

作为家庭第二主力,马上开足马力,花了整晚时间浏览小区委员会给的3年维修记录,
谁家门口台阶楼梯加个扶手, 哪家延伸木板凉台, 哪家浇水喷头坏了,哪家修篱笆,哪家种树预防高尔夫球砸碎窗户 等等.
最有意思的是我们要买的58号, 从头到尾在说一件事情,就他家的Staffordshire terrier狗.

比如说拉屎不清理,毁坏草坪,吠叫,恐吓居民, 结果被小区居民控告举报, 而且举报内容非常详细,包括年龄,性别,品种,尺寸和重量,一一写进小区委员会例会记录里面. 老加(加拿大人)真是实诚.

最重要的是,新屋近靠Commonwealth Pool, 郭晶晶曾在这个池子里跳过水. 本木匠酷爱游泳,曾梦想横渡长江,可惜长江水污染日趋严重,随后放弃了.等日后清理干净了,再畅游.
身体是革命的本钱, 各种人生长短期宏伟目标,都要依赖一个健康的身体.

等我们搬进了新屋,再续生活感受.

Labels:

Monday, April 28, 2008

2008的职业转换 Work from home

曾经有个理想, 每个月写两篇日记.
Tom 很久没有更新博客了, 我也是, 在等待灵感. "Was waiting for inspiration I guess".

自从接了老客户的电信数据仓库项目,Work from home, 开始part time Remote DBA顾问工作.
更是少了时间与本地社区,Oracle社区分享生活与工作的乐趣.

还记得跟AnySQL谈起Oracle DBA consultant在美国的行情, 普通在$85~$120每小时, 卓越的DBA加上RAC服务会达到$200~$350每小时. AnySQL还就这个主题发了一篇贴子,并且没有声明出处,令我不快,嘻嘻!

去年底和客户谈工钱时,考虑的新职业起步,就自砍一刀,报了个最低价$80, 结果客户还嫌贵,硬要和老印的外包价格比较,也就是$25一小时, 顿时令我很伤心, 咱木匠起码也是北美地区Top N的拔尖DBA, 在维多利亚在这个偏僻小镇,做着$##每小时的全职工作, 好赖也相当于硅谷,纽约的17万年薪了. 咋能这么贱买了呢?!!...

最后还是以低于$80的价格成交. 等干两个月,客户发现了我的价值以后,再从新议价,只能如此了.

译言(http://www.yeeyan.com/)看了一篇如何制定目标和计划的文章,很受启发.

写下今年的目标:

*) 搜寻到3个以上客户, 动态平衡,旱涝保收.

*)年收入增加一倍.
后来跟领导和加拿大智囊一合计, 已经调整到50% 啦.

*)多爬山,多进球,多游泳(这周就开始,每周两次)

Tuesday, February 05, 2008

在维多利亚Oracle用户组学到的东西

上周四下午, 第一次参加了Victoria Oracle Users Group
组织的技术交流活动. 题目是 Database Gems: 9i, 10g, and 11g.

VicOUG 请来了著名Oracle 技术网站的http://www.psoug.org/的作者: Dan Morgan,
--
最常用的是
Morgan's Library http://www.psoug.org/library.html, 可以找到各种语法和函数用例.
这个伙计自称因为人员好, 被评为Oracle Ace Director.

言归正传, 以下是我学到的3点,

1)
ALTER SYSTEM SET PLSQL_WARNINGS='ENABLE:ALL';
建议在所有的开发(Development)及测试(Test)环境设置.

有啥好处呢? 编译PL/SQL的时候,给出有用的警告信息.
a) 严重问题, 比如参数混淆 (这点我还没有理解, 需要一个示例)
b) 性能问题, 一个INSERT语句,传递一个VARCHAR2值给一个NUMBER列
c) 提示信息, 比如有一段代码 永远不会被执行

详细说明, 请参考:
Oracle® Database PL/SQL Language Reference
11g Release 1 (11.1)
- 第十一章: 11 Handling PL/SQL Errors
-- Overview of PL/SQL Compile-Time Warnings

2)
wmsys.wm_concate

你可以Sum() 数字列, 也可以 Sum() Varchar2 字符串列,
我们叫作String Aggregate, 以后会有一长篇文章介绍.

这里有一个示例, 自己在 SQL*Plus 或者SQL Developer里面跑一下吧,
select DEFAULT_TABLESPACE,
translate(wmsys.wm_concat(username),',','|')
from dba_users
group by DEFAULT_TABLESPACE;

3)
FBI index, virtual column index and SHRINK clause

有个听众提个问题, 说在10.2以下版本, 有Function Based Index的表不能做空间回收-Shrink.
Dan Morgan这位老大自己没测试过, 随口就说11g上,在一个表的虚拟列上的构建索引,这张表可以Shrink, 岂不是犯了和 老旦一样的错误.
(老旦:Dan. 你们都知道是谁, 曾被老刘 Lewis 严肃的教育过, 以后有另外一篇文章评论,关于PGA 和 Parallel execution)

第二天到办公室一测试, 发现11.1也不行.

以下是测试用例:

--drop table scott.y1;
create table scott.y1(sal number, comm number);

drop index scott.yi_fbi1;
create index scott.yi_fbi1 on scott.y1(sal + comm)
--tablespace data_auto
;

alter table scott.y1 enable row movement;

alter TABLE scott.y1 shrink space compact;
alter TABLE scott.y1 shrink space;

ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object

drop index scott.yi_fbi1;

alter table scott.y1 add (income AS (sal + comm));

drop index scott.yi_vi1;
create index scott.yi_vi1 on scott.y1(income);

alter TABLE scott.y1 shrink space;

ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object

Sunday, February 03, 2008

在加拿大给美国客户远程工作, 相关流程总结

我自己亲身经历, 也有多位加拿大的华人朋友问到, 所以在这里总结一下.

如果你是搞IT系统维护或开发的,这样的话VPN远程接入美国客户应该是通常的手段了.至于远程会议等要看对方要求了.一般公司都有WEBEX之类的.

填一份 W-8BEN表格, 给美国客户寄去 备案, 就行了. 美国客户/雇主就可以开始给你付工钱了. (如果在美国工作, Independent Contractor 需要填w9 form)
另外,对方有可能要求签一个安全保密协议, Non-Disclosure-Agreement.
如果你觉得有必要, 再跟美国雇主签一个Offer(工作合同)

美国公司如何支付工钱: 美国公司 "电子转帐或寄支票" 来 支付工钱

纳税:
1) 美国缴税 - 不用

问过会计师了 无需向美国缴税
刚刚打电话,问了会计师, 确认不用向美国缴税.
下来就是明年报税, 找会计的问题了.

加拿大居民/公民, 不用给美国缴税.
If you perform the service from Canada, the income is not US source of income and is not taxable by US government.
http://www.irs.gov/businesses/small/...=96459,00.html

A nonresident alien (NRA) usually is subject to U.S. income tax only on U.S. source income.
http://www.irs.gov/businesses/small/international/article/0,,id=96459,00.html

Nonresident Aliensa
A nonresident alien usually is subject to U.S. income tax only on U.S. source income.

http://www.irs.gov/publications/p519/ch02.html#d0e1779

<<
如果你是美国公民, 绿卡持有人,

根据w8 form 指南, 美国客户(Payor)会预先扣缴 30% 的税
See: http://taxes.about.com/od/taxplanning/qt/form_W8BEN.htm
>>

2)加拿大缴税
如果是 Independent Contractors, 交加拿大这边的30%~50%的个人所得税.

注册公司:
年收入在$30,000以下, 不需要在加拿大注册公司.
(我个人觉得, 20万以下, 都不需要成立公司)
注册个公司很容易,拿着公司注册号去开个银行帐号,然后就等对方电子转帐或寄支票了.
http://www.smallbusinessbc.ca/bizResources-name.php
http://www.bcbusinessregistry.ca/introduction/index.htm

财务税务最好找个专业会计师.一年千把来块钱的开支,都可以打入公司运营成本, 还可以要回美国预扣的30%的税钱, 提交Form 8233.
如果你恰好组织BC省府维多利亚市,我还可以给你介绍一个有这方面经验的华人专业会计师.

也可以参考
华枫论坛> ◆主题论坛◆> 创业者俱乐部.
http://www.chinasmile.net/forums/showthread.php?t=303814

下面是一些英文原文资料摘要:

US Withholding for Canadian Independent Contractors

Using Form W-8BEN to Claim US-Canada Tax Treaty Benefits
American companies generally withhold income taxes on income being paid to foreign nationals. You may qualify for reduced withholding if meet some rules. Basically, there are three steps to this process. First, you must clarify in which country you are a resident. Second, you must decide where your "fixed place of business" is located. Third, you must notify your clients of your tax status using Form W-8BEN.
Withholding
The tax treaty specifically allows for US companies to withhold income taxes on self-employed Canadian residents (Article XVII, paragraph 1). Withholding will be 10% on the first $5,000 of income, and 30% on income over that threshold. The client and independent contractor may agree on a lesser percentage of withholding if these amounts are considered "excessive" (Article XVII, paragraph 2).
Normally, US companies are required to "withhold 30% of any payment of an amount subject to withholding made to a payee that is a foreign person" (Instructions for Form W-8BEN). Form W-8BEN is used to inform the US company that you are "a beneficial owner that is a foreign person entitled to a reduced rate of withholding." You qualify for a reduced rate of withholding if you meet the residency and fixed place of business rules
Filling out Form W-8BEN
Provide your name in Line 1 and check "individual" in Line 3. However, if you are working under a business name, provide your business name in Line 1 and check the appropriate type of entity in Line 3.
See: http://taxes.about.com/od/taxplanning/qt/form_W8BEN.htm

Claiming Tax Treaty Benefits
Exemption From Withholding
If a tax treaty between the United States and your country provides an exemption from, or a reduced rate of, withholding for certain items of income, you should notify the payor of the income (the withholding agent) of your foreign status to claim the benefits of the treaty. Generally, you do this by filing Form W-8BEN, Certificate of Foreign Status of Beneficial Owner for United States Tax Withholding with the withholding agent.

Rules that Apply to Compensation for Personal Services
Independent contractors. If you perform personal services as an independent contractor (rather than an employee) and you can claim an exemption from withholding on that personal service income because of a tax treaty, submit Form 8233 to each withholding agent from whom amounts will be received.
See: http://www.irs.gov/businesses/small/international/article/0,,id=96438,00.html


Instructions for the Withholding Agent

Requirement To Withhold
A withholding agent must withhold 30% of any payment of an amount subject to withholding made to a payee that is a foreign person unless it can associate the payment with documentation (for example, Form W-8 or Form W-9) …
Responsibilities of the Withholding Agent
If you are a withholding agent making a payment of U.S. source interest, dividends, rents, royalties, commissions, nonemployee compensation, other fixed or determinable annual or periodical gains, profits, or income, and certain other amounts (including broker and barter exchange transactions, and certain payments made by fishing boat operators), you are generally required to obtain from the payee either a Form W-9, Request for Taxpayer Identification Number and Certification, or a Form W-8. These forms are also used to establish a person's status for purposes of domestic information reporting (for example, on a Form 1099) and backup withholding. If you receive a Form W-9, you must generally make an information return on a Form 1099. If you receive a Form W-8, you are exempt from reporting on Form 1099, but you may have to file Form 1042-S and withhold under the rules applicable to payments made to foreign persons. See the Instructions for Form 1042-S for more information.
Generally, you must withhold 30% from the gross amount paid to a foreign person unless you can reliably associate the payment with a Form W-8. You can reliably associate a payment with a Form W-8 if you hold a valid form, you can reliably determine how much of the payment relates to the form, and you have no actual knowledge or reason to know that any of the information or certifications on the form are unreliable or incorrect.
Do not send Forms W-8 to the IRS. Instead, keep the forms in your records for as long as they may be relevant to the determination of your tax liability under section 1461. Use the information on Forms W-8 to prepare Forms 1042-S.
See: http://www.irs.gov/instructions/iw8/ch01.html

Labels:

Tuesday, January 22, 2008

Supporting Multilingual Databases and NLS_CHARACTERSET

We recommend going to AL32UTF8 as the ultimate solution for Oracle 11g-.
AL32UTF8 is the database character set that supports the latest version (5.0 in Oracle 11.1) of
the Unicode standard. It also provides support for the newly defined supplementary characters.

Here are some major points I briefed as a reference.

How to move to AL32UTF8 / UTF8 (Unicode) Database Character Set
Note:119119.1

to check you database Character Set,
select value from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';

Usualy database will grow when going to AL32UTF8, use CSSCAN to generate the size expansion report.

The NLS_LENGTH_SEMANTICS initialization parameter determines whether a new column of character datatype uses byte or character semantics. The default value of the parameter is BYTE. The BYTE and CHAR qualifiers shown in the VARCHAR2 definitions should be avoided when possible because they lead to mixed-semantics databases. Instead, set NLS_LENGTH_SEMANTICS in the initialization parameter file and define column datatypes to use the default semantics based on the value of NLS_LENGTH_SEMANTICS.

columne_name VarChar2(300 char/byte)

Related function: lengthb(), substrb()

UniStr() over Chr()
select Chr(163) from dual;
select UniStr('\C2A3') from dual;

convert(string_column,'AL32UTF8','US7ASCII'), convert from US7ASCII to AL32UTF8.

To use WE8MSWIN1252 over WE8ISO8559P1, WE8MSWIN1252 supports European Code.

Reference

* US7ASCII: US 7-bit ASCII character set
* WE8ISO8859P1: ISO 8859-1 West European 8-bit character set
* WE8MSWIN1252: Microsoft Windows West European Code Page 1252
* UTF8: Unicode 3.0 Universal character set CESU-8 encoding form
* AL32UTF8: Unicode 5.0 Universal character set UTF-8 encoding form

**Unicode character sets in the Oracle database, Note:260893.1

exp/imp

set NLS_LANG=
export

set NLS_LANG=
import into the new UTF8 db.

The conversion to UTF8 is done while inserting the data in the UTF8 database.

Today's learning:

如果你确信了那些消极的结论,那么你就极少可能去冒险和尝试新事物。消极的想法掩盖了你的感受,使其处于恐惧中。

积极的想法的也是以同样的方式起到其作用。带着积极的心态,你将搜寻那些积极的选择然后确信其积极的结论。它帮助你克服恐惧并且尝试那些可能你认为“不能做到”的事情.

积极的思想,有助于确定目标实现.

Labels:

Tuesday, January 08, 2008

看看日本人是怎么抵制中国货的

打击日货, 喊得有些累了, 这里转抄一篇, 华人同胞, 共同学习进步.

--From 枫华园
http://www.fhy.net

最近很多国家在抵制中国货,特别是日本。日本抵制中国货不是象我们中国只是喊口号,而是肆意贬低中国货,特别是利用宣传工具。

日本有2个电视台播放了2个关于中国货的节目。一个是试验生活中怎么不用中国货,当然是很可笑的了,可给消费者的影响可想而知。另外一个台,放了他们在中国的采访,说是广东的一个地方,说用来浇蔬菜的河水被污染了,河里的水--当然水很黑很臭的了。看了这样的镜头还有谁敢买中国的成品?还把河水和菜拿到日本来化验,虽然没查出什么。可还请什么专家来说话,说不能否定含有重金属。

利用媒体,不是直接抵制中国货,这就是日本的手法。断章取义,再好的东西都可说成说垃圾的,我们中国人在抵制日货方面是不是也可以其人之道还其人之身呢?中国的媒体在干吗?我们不放日本作品?我们可以去揭揭日资企业的违法问题?可以说说销售到中国的倭货是在日本被淘汰的东西的?要找问题,为什么不利用现代的科技手段呢?

建议大家不要光叫抵制日货的口号,真有爱国的思想的,多做一些具体的事情,真正的抵制日货。

Tuesday, December 25, 2007

过冬至 陕西老乡聚会 Potluck(家常便饭)

2007冬至, 由苏州热心朋友Yang组织 (他老婆是陕西人), 我们来自陕西的老乡 聚会了, potluck, 又吃到了各种正宗陕西菜, 写日志以纪念.


主人家在Cordova Bay, 面朝佐治亚/欢德福卡海峡,温哥华岛与大陆之间; 夜晚出来赏景, 月色映着海面, 别有一番韵味.

陆陆续续有十多位老乡到场, 如果算上不认识的, 比如乘以十, 那么BC省府-维多利亚的陕西人就有一两百个了. 有一位搞房屋建筑的材料专家,竟然跟我同一栋楼上班,他4层,我5层(就是前文书提到的三面海景绿玻璃楼),天天进进出出碰面,还以为他是韩国人. 我要执行四川同事 老高 的建议,在电梯里面贴一个广告,邀请同楼的所有华人老乡,到街道对面吃(早年飘洋过海来的)福建人开的四川皇都自助餐.

那天品尝到了久违的牛羊肉泡馍,肉夹馍,秦镇米皮,八宝饭,个个精彩,宛如回到了陕西老家.
我消化系统不太好,当晚吃的很多,却也睡得比较香,算是吃的对路啦.

去年2006冬至是到四川同事 老高 家里包饺子, 广东人讲了"冬至大过年".
近期 Potluck(家常便饭) 活动频繁, 发生撞车, 特次向 开吻 表示歉意, 来年我们可以春节聚会.
Potluck实际意思就是各做各的饭菜, 带到某个东主家一起大伙会餐.

本想体验一下加拿大的Boxing day,准备26日一早去FutureShop店门口排队,
商家又出新花样, 提前24日太平洋西海岸时间下午4:00开始网上抢购, 我抢到了一台500GB移动硬盘, 随后放弃了去现场排队的冲动.

今日星相预测:
Today is all about helping your friends and family.

今日激励:
积极的心态创造了一个富裕、热情以及解决方法的思想意识。而不是思考什么不能做,积极的思想者不会被束缚在“能”和“不能”里。一个积极思想者为解决问题是以新思路去自由思考,因为他们不会被限定在失败的恐惧中。

下期题目: 乘坐救护车

Labels: