Monday, December 29, 2008

2009 Resolution

1. Personal Goals
1.1 Fitness goal: I am going to fit in the dark green size 0 pants.
Detail plan:
  • Bike to work Mar to Nov everyday unless emergency
  • Go to gym (Weight room) 4 times per week. Monday and Thursday focus on lower body, Tuesday and Friday work on upper body.
  • Do 20-30 mins cardio exercise on the days when not biking.

  • 1.2 Get a driver license.
    1.3 Hobby: Learn inline skate, front crawl.
    1.4 Make 1-2 friends.

    2. Professional Goals
    2.1 English handwriting. I don't need my handwriting to be pretty, but it need to be neat.
    2.2 Get 100% understand of South Park, and master the new words. At least finish one episode per week.
    2.3 Get 100% understand of 1-2 movies and choose an actress to imitate.
    2.4 Talk to 5 different people each day.
    2.5 Get involved in those email tech discussions at least once

    3. Financial Goals
    3.1 Looking for the area which I interest and I can really make passive income from.

    Saturday, December 27, 2008

    09 salary guide

    Refers: http://www.hays.ca/salary-guides.aspx

    上面的那个薪资指导包括了IT行业的各个工作,我只把我关心的程序员和DBA的薪水拿出来比较。一直印象中DBA会比同等资历的程序员拿得多,或者说至少是 资深DBA比资深程序员拿得多。 但是好像事实并非如此,而Business Analyst以及Technical Support却很高,这是我之前没想到的。
    还有就是, 2-3年前听说多伦多的薪水比温哥华高很多,现在好像是风水轮流转了。

    Unit ( thousand dollars per year)

    Developer

    <>

    5-10 years

    > 10 years

    Calgary

    65-80

    80-95

    95-110

    Toronto

    45-55

    55-75

    75-90

    Ottawa

    45-55

    55-65

    70-80+

    Vancouver

    40-60

    60-80

    80-100

    DBA

    <>

    5-10 years

    > 10 years

    Calgary

    55-65

    65-75

    75-85

    Toronto

    45-55

    55-75

    75-85

    Ottawa

    50-60

    60-70

    75+

    Vancouver

    45-65

    55-85

    75+

    Thursday, December 25, 2008

    Merry Christmas!

    白色圣诞,闭门思过,呵呵
    没有思过啦,只不过明天需要交Performence Review的自我评价,所以躲在家里埋头苦写,尽量想要不露痕迹的把自己吹捧成一朵花。。。好难啊。。。比解一个“闹鬼”的bug都难。。。

    什么时候可以不费吹灰之力的写需要上交的总结了,生活就会更美好了。这不是英文的问题,即使用中文写时一样觉得写着很困难。。。。

    Tuesday, December 23, 2008

    Hard Skill & Soft Skill

    在rolia上看到一个帖子,觉得很有道理。
    原帖:http://www.rolia.net/f/listSingleThread.php?f=0&pno=4912963

    看到不少朋友以技术大牛自诩,看不起光会“耍嘴皮子的”的白人印度人。我也曾经这样。
    by mikesmith (老猫) at 2008.12.11 13:53 (#4912963@0)

    1)记得很多年前的一个半夜,刚给一个大用户做完一个城域网的升级,跟我一起干的一个当地白人说:真难相信这是你第一次做项目,我在这个用户上作了2年,对其系统的了解还不如你半夜的功夫。我俩同时被雇佣,我知道他刚被升职,当时级别比我高,是个典型的好人。虽然“技术“永远不会及我,但他可以在公司上千人聚会上,上台说让大家都笑的笑话,而我当时甚至连听都听不懂。他升职而没有我的份,公平吗? 公平。

    2)记得很多年前的一个白天,刚给一个多伦多银行作完一个项目. 带我干的一个50多岁的资深工程师请我吃饭。这个项目他负责,我做的。我知道我掌握的“技术“他这辈子也不用想了。他在全部细节实现上依赖我。他是香港人。他当时级别比我高3级,公平吗? 公平。

    因为,所谓“技术“,就是个tool. 与人沟通,合作,交流,让别人心甘情愿的干,是结果。那个白人和香港人,至少在那时候,比我强。他们最终也都没隐藏我的贡献,都是我朋友。 而我的现在,也许就是从前的那个白人,那个香港人。

    Friday, December 5, 2008

    Singleton Pattern vs. Static Class

    refers: http://dotnetperls.com/Content/Singleton-Static.aspx

    When I heard singleton pattern, the first thing came in my mind is: not a big deal, it is just a static class.

    But actually, you won't want to use static class to implement the singleton pattern, if you read the referred article.
    Basically, using a non-static class with private constructor and a static Instance are much better than static class:
    1) Static class cannot implement interfaces, also it cannot be inheritted by other classes.
    2) Static class cannot be passed as an object to a method, but SingletonClass.Instance definitely can.

    Thursday, December 4, 2008

    Study Notes: Serialization.

    refers: http://msdn.microsoft.com/en-us/magazine/cc301761.aspx

    Serialization is the process of converting an object or a connected graph of objects into a contiguous stream of bytes. Deserialization is the process of converting a contiguous stream of bytes back into its graph of connected object.

    How serialization works:

    1.1) If any fields in the graph refer to other objects, then it serialize these objects, too. In other words, it is convenient to implement deep clone using serialization and deserialization.

    1.2) If two objects in the graph refer to each other, then the formatter detects this, serializes each object just once, and avoids entering into an infinite loop.

    1.3) It is possible and also quite useful to serialize multiple object graphs out to a single byte stream.

    1.4) When serializing an object, the full name of the type and the name of the type's defining assembly are written to the byte stream. By default, the BinaryFormatter and SoapFormatter types output the assembly's full identity, which includes the assembly's file name (without extension), version number, culture, and public key information

    1.5) Whole Process
    a.1) MemberInfo[] GetSerializableMembers(Type type);
    a.2) Object[] GetObjectData(Object obj, MemberInfo[] members);
    a.3) write the assembly type info and 2 arrays into the stream.

    b.1) Type GetTypeFromAssembly(Assembly assem, String name);
    b.2) Object GetUninitializedObject(Type type); It does not call any constructor.
    b.3) MemberInfo[] GetSerializableMembers(Type type);
    b.4) Object PopulateObjectMembers(Object obj, MemberInfo[] members, Object[] data);


    Dev notes:

    2.1) By default, types are not serializable. developer must apply the System.SerializableAttribute custom attribute to this type, to make it serializable.

    2.2) For performance reasons, formatters do not verify that all of the objects in the graph are serializable before serializing the graph. So, when serializing an object graph, it is entirely possible that some objects may be serialized to the byte stream before the SerializationException is thrown. If this happens, the byte stream is corrupt.

    I recommend that you serialize the objects into a MemoryStream first. Then, if all objects are successfully serialized, you can copy the bytes in the MemoryStream to whatever stream (file or network, for example) you really want the bytes written to.

    2.3) The SerializableAttribute custom attribute may be applied to reference types (class), value types (struct), enumerated types (enum), and delegate types (delegate) only

    2.4) You can easily make a derived class to be serializable if the base class is serializable. But if the base class is not, then you cannot apply the Serializable attribute to the derived class.

    2.5) So you may want to make all your classes serializable to grant a lot of flexibility to users of your types. However, you must be aware that serialization reads all of an object's fields regardless of whether the fields are declared as public, protected, internal, or private.

    2.6) You can put NonSerializedAttribute to a type's fields, so the fields are ignored when serializing. And the attribute continues to apply to these fields when inherited by another type.

    You may need to implement the System.Runtime.Serialization.IDeserializationCalback interface, if you need to do something for those NonSerialized fields.
    During deserialization, formatters check to see if the object it is deserializing comes from a type that implements the IDeserializationCallback interface. If the type does implement this interface, then the formatter adds this object's reference to an internal list. After all of the objects have been deserialized, the formatter walks this list and calls each object's OnDeserialization method.

    知识更新没有那么可怕。It's your worktime fun.

    成为一个技术高手,不需要头悬梁锥刺股,也不需要废寝忘食。需要做的只是合理利用你的上班时间。

    刚毕业的时候,看过一篇文章, 大体意思如下:(可惜找不到原文了 )

    大学生刚毕业的时候都是站在同一条起跑线上(都是什么都不会),等过上3-5年,差别就显出来了,为什么?因为大家每天上班的8个小时都差别不大,都是为了挣一份工资养活自己;但是不同的是除了睡觉之外的其余8个小时,如何利用这些业余时间使得这些社会新鲜人在3-5年内产生了很大的差异。这就是所谓的8小时求生存,8小时求发展。

    当时觉得这篇文章说得很对,于是决定好好利用业余时间读技术书,成为一名技术高手。但是在丢掉了学生时代晚自习的习惯之后,想要在晚上读严肃一点的书都会马上起到催眠的效果。结果书也没有读完一两本(技术书都太厚了。。。)。

    到了现在的公司不久,领导教育我说,很多人在刚进公司的时候,水平都差不多,但是过了2年以后,有的人原地不动,有的人技术提高很多,为什么呢?(咦,怎么听上去这么熟悉呢?)那么为什么呢?因为有的人会很好的利用Slow time,在这段时间内好好充实自己;而有的人在Slow time就晚来早走,一天在公司也就呆4,5个小时,中间还要来一个长长的午餐,剩下的时间也就上网看看新闻,看看YouTube,聊聊天。

    这个说法听上去很有道理,而且很具有可操作性。但是,有一点很重要的他没有提到。一般在Busy time的时候,干的活儿很多,遇到的不懂的技术点也就很多,但是没有时间仔细去研究,只求快点把事情做完。而闲下来的时候,又一时不知道该学点什么,没有边际的学习其实是效果很差的。

    所以呢,我就开始保留一个Study List, 每次遇到自己不懂的又想了解清楚的技术点时候,就把它列进去,然后等不太忙的时候再拿出这个列表选一个最想学的去学。

    再就是这个列表解决的另一个问题,就是在学习知识A的过程中遇到了知识B,于是去学B,又遇到了C,最后发现自己不懂的东西太多,都忘记自己最初要学的是什么了,只能很郁闷的放弃。用数据结构的语言来讲,这就是树的深度遍历遇到的问题,那么我们只需要采用广度遍历,学习A的时候,遇到B,那么把B放到我们的Study List里面,继续学习A. 学完A了再考虑学B,这个令人沮丧的问题就迎刃而解了。

    一个圆的面积越大,那么它的周长所能接触的面积也就越大。假使圆的面积是“知道”,圆外面的世界是“无知”;那么一旦我们“知道”得越多,我们也就相对地越是“无知”。但是我们有了Study List这个利器,就不会迷失在学而无涯的迷茫中。 ^_^

    =============================
    我的Study List:
    1) XML
    a. Structed knowledge
    b. Sql & xml
    c. XmlTextReader, XmlTextWriter vs XmlDocument
    d. Namespace?
    2) Serialization
    3) Delegate type
    4) XPath
    5) XSLT
    a. Xslt parameter (how to pass)
    b. Xslt function
    c. DataSet & xsl
    6) SOAP
    7) Design Patterns
    8) C# image process
    9) ASP.net 2.0 AJAX
    http://ajax.asp.net/docs/default.aspx
    10) IIS
    11) Regular Expression
    12) System tables in SQL
    13) SQL: Indexes and performance