in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

April 2006 - Posts

  • 此间的少年

      《此间的少年》是以金庸小说人物为基础的同人小说,用作者江南的话说,“《此间》中使用的人名无一例外出自金庸先生的十五部武侠小说……但是,无论这个故事中的人物叫什么名字,他们都不再是人们耳熟能详的江湖英雄和侠女,他们更贴近于曾经出现在我身边的少年朋友们,而《此间》,也是一个全新的故事。”

      这是一个讲述我们熟悉的大学生活的故事,以宋代嘉佑年为时间背景,故事发生的地点在以北大为模版的“汴京大学”,登场的是我们同样熟悉至极的乔峰、郭靖、令狐冲等大侠,不过在大学里,他们和我们当年没有什么不同,早上要去跑圈儿,初进校门的时候要扫舞盲,有睡不完的懒觉,站在远处默默注视自己心爱的姑娘……在这个学校里,郭靖和黄蓉是因为一场自行车的事故认识的,而这辆自行车是化学系的老师丘处机淘汰下来的,杨康和穆念慈则从中学起就是同学,念慈对杨康的单恋多年无果,最后选择的人却是彭连虎。脑中存着金庸小说先前的印象,再徜徉于这样全新的故事中,是一种双重的温习,而这双重的回忆最后归结为一点,便是我们那一段或者年轻的朋友正在经历的,轻狂无畏的少年时光。我们在这里种下自己最初的爱情,错过最初的缘份,经历着自己光辉灿烂的荣耀和黯然神伤的挫折,然后从这里走开,永远走进了成年。

      这是一本引人入梦的书,一本让我们在不知停歇的劳顿中稍息的书,一本掩卷后轻叹一声却又心满意足的书

    印证的乐趣

    / 李树波

      我读完金庸小说的收获是从此有了门户之见。某某口齿伶俐,睚眦必报,是慕容家的:以子之术,还治彼身;某某行文灵动,充满精英色彩,想是黄家的落英缤纷掌一路;某某的表现水准落差之大,有如段誉的六脉神剑。精神世界里有了金庸这座花果山,常使我胡思乱想,如猢狲上下攀缘,到处采摘引证的乐趣。

      人的左脑管理智、现实、逻辑,右脑管感觉、形象、记忆。我是用左脑读金庸,上网后知道,另一半人用右脑读金庸。程灵素,黄蓉,杨过,乔峰……总是BBS里最热的话题,不必多说,提一个名字,便有雾般感受涌上来。这些虚构的人物已经和某一代人的青春编织在一起,难解难分,不论单独谈哪一种,总使人意犹未尽。

      2002年春天,我开始读一篇传说中的绝妙好文,从此陷入了难堪的等待。像等待着一群沉睡在记忆中的朋友,被一个个的复活。你不知道接下来江南——这个顽皮的作者会叫出哪一个,也不知道在这一世他或她有什么样的命运。而在汴京大学里,校园的风声、饭堂的泔水味、寂寞的操场、焦急的等待,都被复活了。
    不必等到逢五年或者十年的同学聚会,在蓄意喝下许多白酒后,等待滑过胸口的那一滴惆怅——江南是一个解人。

      奇怪的是,回忆起来味道最好的,往往不是真事。也许回忆的魅力正在于虚构,而回忆往往从“如果”开始。

    Posted Apr 29 2006, 12:32 PM by wicky with no comments
    Filed under:
  • Oracle: How to set a NLS session parameter at database level for all sessions ?

    主题: How to set a NLS session parameter at database level for all sessions ?
      文档 ID: 注释:251044.1 类型: BULLETIN
      上次修订日期: 27-OCT-2005 状态: PUBLISHED
    
    Why to set a NLS session parameter at database level for all sessions? 
    ----------------------------------------------------------------------
    
    The NLS_LANG setting will override the instance NLS settings
    like documented in Note 241047.1 The Priority of NLS Parameters Explained.
    
    Please note that oracle recommends you to define always the correct NLS_LANG.
    
    The <characterset> part of the NLS_LANG is a (very important) client only
    parameter and cannot be set or defined from server side for a session.
    
    Why this is so important is documented in Note 158577.1 and Note 179133.1.
    
    However, if you like to overwrite some NLS session parameters for all clients
    then you can do that in the way described in this note.
    
    please note that this is *not* working for some JDBC drivers
    Note 115001.1 NLS_LANG Client Settings and JDBC Drivers
    
    How to set a NLS session parameter at database level for all sessions ?
    -----------------------------------------------------------------------
    
    Create an event trigger like this:
    (Example for the nls_numeric_characters parameter)
    
      create or replace trigger global_nls_session_settings after logon on database
      begin
        execute immediate 'alter session set nls_numeric_characters=",."';
      end;
      /
    
    The parameters which can be set like this, are all the NLS session parameters:
    
    8i:
    
    NLS_CALENDAR  
    NLS_COMP  
    NLS_CREDIT  
    NLS_CURRENCY  
    NLS_DATE_FORMAT  
    NLS_DATE_LANGUAGE  
    NLS_DEBIT  
    NLS_ISO_CURRENCY  
    NLS_LANGUAGE  
    NLS_LIST_SEPARATOR  
    NLS_MONETARY_CHARACTERS  
    NLS_NUMERIC_CHARACTERS  
    NLS_SORT  
    NLS_TERRITORY  
    NLS_DUAL_CURRENCY
    NLS_TIME_FORMAT
    NLS_TIMESTAMP_FORMAT
    NLS_TIME_TZ_FORMAT
    NLS_TIMESTAMP_TZ_FORMAT
    
    new in 9i/10g:
    NLS_LENGTH_SEMANTICS
    NLS_NCHAR_CONV_EXCP
    
    Again, the client character set CANNOT be set or defined this way.
    
    This select gives you all defined after logon triggers:
    
     select OWNER, TRIGGER_NAME, TRIGGER_BODY from DBA_TRIGGERS where trim(TRIGGERING_EVENT) = 'LOGON';
    
    When testing the trigger, note that a after logon trigger dous not fire for sysdba
    connections, so test with a "regular", non sysdba user.
    
    Further information can be found in:
    
    Note 241047.1	The Priority of NLS Parameters Explained.
    Note 158577.1 NLS_LANG Explained (How does Client-Server Character Conversion Work?)
    Note 179133.1 The correct NLS_LANG in a Windows Environment  
    
    For further NLS / Globalization information you may start here:
    Note 267942.1 Globalization Technology (NLS) Library index
    
    
    Posted Apr 28 2006, 03:20 PM by wicky with no comments
    Filed under:
  • Oracle: The Priority of NLS Parameters Explained

    主题: The Priority of NLS Parameters Explained
      文档 ID: 注释:241047.1 类型: BULLETIN
      上次修订日期: 13-OCT-2005 状态: PUBLISHED
    
    This note explains the order in which NLS parameters are taken into account
    in the database client/server model using a standard client connection.
    (This does NOT cover JDBC connections, please see Note 115001.1 
    NLS_LANG Client Settings and JDBC Drivers for more info on jdbc and NLS.)
    
    There are 3 levels at which you can set NLS parameters: Database, Instance and
    Session. If a parameter is defined at more than one level then the rules on 
    which one takes precedence are quite straighforward:
    1. NLS database settings are overwritten by NLS instance settings
    2. NLS database & NLS instance settings are overwritten by NLS session settings
    
    In the remainder of this note we shall explain all the different settings in 
    detail. The categories A to C shown below indicate the order of precedence with 
    A being the highest and C the lowest.
    For example, if you set NLS_NUMERIC_CHARACTERS in the init.ora (point B) and 
    in the environment (point A 6), then for a session the value defined in the 
    environment will take priority because point A 6 comes before point B.
    
    
    A) The Session Parameters.
    --------------------------
    
      select * from NLS_SESSION_PARAMETERS;
    
      These are the settings used for the current sql session.
    
    These reflect (in this order):
    
    1) The values of NLS parameters set by "alter session .... "
    
       alter session set NLS_DATE_FORMAT = 'DD/MM/YYYY';
    
       * this can also been done with an after logon trigger(!).
         select OWNER, TRIGGER_NAME, TRIGGER_BODY from DBA_TRIGGERS where 
         trim(TRIGGERING_EVENT) = 'LOGON';
         -> Note 251044.1 How to set a NLS session parameter at database
            level for all sessions ?
    
    2) If there are no explicit "alter sessions ..." statements done then it 
       reflects the setting of the corresponding NLS parameter on the client derived
       from the NLS_LANG variable.
    
       NLS_LANG consist of:  NLS_LANG=<Language>_<Territory>.<clients characterset>
       for example:
       NLS_LANG=DUTCH_BELGIUM.WE8MSWIN1252
    
       For information on how to find the NLS_LANG your sqlplus session is using 
       see point "4.2 How can I Check the Client's NLS_LANG Setting?" in Note 158577.1 
    
    3) If NLS_LANG is specified with only the <Territory> part 
       then AMERICAN is used as default <Language>.
    
       So if you set NLS_LANG=_BELGIUM.WE8PC850 then you get this:
    
       PARAMETER                      VALUE
       ------------------------------ --------------
       NLS_LANGUAGE                   AMERICAN
       NLS_TERRITORY                  BELGIUM
       NLS_CURRENCY                   <euro sign here>
       NLS_ISO_CURRENCY               BELGIUM
       ....
    
       Note the difference between NLS_LANG=_BELGIUM.WE8PC850 (correct) and 
       NLS_LANG=BELGIUM.WE8PC850 (incorrect), you need to set the "_" as separator.
    
    4) If NLS_LANG is specified with only the <Language> part then the <Territory> 
       defaults to a setting based on <Language>.
    
       So if you set NLS_LANG=ITALIAN_.WE8PC850 then you get this:
    
       PARAMETER                      VALUE
       ------------------------------ --------------
       NLS_LANGUAGE                   ITALIAN
       NLS_TERRITORY                  ITALY
       NLS_CURRENCY                   <euro sign here>
       NLS_ISO_CURRENCY               ITALY
       .....
    
       Note the difference between NLS_LANG=ITALIAN_.WE8PC850 (correct) and 
       NLS_LANG=ITALIAN.WE8PC850 (incorrect), you need to set the "_" as separator.
    
    5) If NLS_LANG is specified without the <Language>_<Territory> part
       then the <Language>_<Territory> part defaults to AMERICAN_AMERICA.
    
       So if you set NLS_LANG=.WE8PC850 then you get this:
    
       PARAMETER                      VALUE
       ------------------------------ ----------
       NLS_LANGUAGE                   AMERICAN
       NLS_TERRITORY                  AMERICA
       NLS_CURRENCY                   $
       NLS_ISO_CURRENCY               AMERICA
       ....
    
       Note the difference between NLS_LANG=.WE8PC850 (correct) and 
       NLS_LANG=WE8PC850 (incorrect), you need to set the "." as separator.
    
    6) If the NLS_LANG is set (either like in point 3,4 or 5) then parameters like 
       NLS_SORT, NLS_DATE_FORMAT,... can be set as a "standalone" setting and will 
       overrule the defaults derived from NLS_LANG <Language>_<Territory> part.
    
       So if you set NLS_LANG=AMERICAN_AMERICA.WE8PC850 and NLS_ISO_CURRENCY=FRANCE 
       then you get this:
    
       PARAMETER                      VALUE
       ------------------------------ -----------
       NLS_LANGUAGE                   AMERICAN
       NLS_TERRITORY                  AMERICA
       NLS_CURRENCY                   $
       NLS_ISO_CURRENCY               FRANCE
       ...
    
      * Make sure that you set "NLS_ISO_CURRENCY=FRANCE", NLS_ISO_CURRENCY= FRANCE
        (note the space) will not give an error but the parameter is just ignored 
        and the default based on NLS_TERRITORY will be used.
    
    
      Defaults:
      ---------
      * If NLS_DATE_LANGUAGE or NLS_SORT are not set then they are derived from 
        NLS_LANGUAGE.
    
      * If NLS_CURRENCY, NLS_DUAL_CURRENCY, NLS_ISO_CURRENCY, NLS_DATE_FORMAT,    
        NLS_TIMESTAMP_FORMAT, NLS_TIMESTAMP_TZ_FORMAT, NLS_NUMERIC_CHARACTERS are 
        not set then they are derived from NLS_TERRITORY
    
    
    7) If the NLS_LANG is not set at all, then it defaults to 
       <Language>_<Territory>.US7ASCII and the values for the 
       <Language>_<Territory> part used are the ones found in 
       NLS_INSTANCE_PARAMETERS. Parameters like NLS_SORT defined as "standalone" on
       the client side are ignored.
    
       * Oracle does NOT recommend to have the NLS_LANG UNSET, please always define 
         at least the proper <clients characterset> part for the NLS_LANG like shown
         in point 5)
         See Note 158577.1 NLS_LANG Explained (How does Client-Server Character Conversion Work?)
         and Note 179133.1 The correct NLS_LANG in a Windows Environment
    
    Note that:
    
    * If set, client parameters (NLS_SESSION_PARAMETERS) take always precedence 
      above NLS_INSTANCE_PARAMETERS and NLS_DATABASE_PARAMETERS.
    
    * This behavior can not be disabled on/from the server, so a parameter set 
      on the client always has precedence above an instance or database parameter.
    
    * NLS_LANG cannot be changed by alter session, NLS_LANGUAGE and NLS_TERRITORY 
      can. However NLS_LANGUAGE and /or NLS_TERRITORY cannot be set as a "standalone" parameters
      in the enviroment or registry on the client.
    
    * NLS_SESSION_PARAMETERS is NOT visible for other sessions. If you need to trace
      this then you have to use a logon trigger to create your own logging table 
      (based on session_parameters)
    
    * The <clients characterset> part of NLS_LANG is *NOT* shown in any system table
      or view. (see section 4.2 How can I Check the Client's NLS_LANG Setting? in 
      Note 158577.1)
    
    * On Windows you have two possible options, normally the NLS_LANG is set in 
      the registry, but it can also be set in the environment, however this is not 
      often done and genrally not recommended to do so.
      The value in the environment takes precedence over the value in 
      the registry and is used for ALL Oracle_Homes on the server(!) if defined as
      a system environment variable.
      See Note 179133.1 The correct NLS_LANG in a Windows Environment
    
    * NLS_COMP *cannot* be set as enviroment variable (unlike documented in the 
      manual). All Oracle8i and Oracle9 versions use NLS_COMP from INIT.ORA or 
      from explicit ALTER SESSION. 
      Bug 2155062 NLS_COMP cannot be set in the client ENVIRONMENT
    
    * NLS_LENGTH_SEMANTICS *cannot* be set as enviroment variable in 9i, 
      from 10g onwards it can be.
      It is however possible to do a ALTER SESSION.
                                                                
    * NLS_NCHAR_CONV_EXCP *cannot* be set as enviroment variable.
      It is however possible to do a ALTER SESSION.
                                                                                    
    * NLS_LANGUAGE in the session parameters also declares the language for the 
      client error messages, see also Note 132090.1.
    
    * you cannot "set" a NLS parameter in an SQL script, you need to use alter 
      session.
    
    B) The Instance Parameters.
    ---------------------------
    
      select * from NLS_INSTANCE_PARAMETERS;
    
     These are the settings in the init.ora of the database at the moment that 
     the database was started or set trough ALTER SYSTEM.
    
     If the parameter is not explicitly set in the init.ora / defined by 
     ALTER SYSTEM then it's value is NOT derived from a "higher" parameter 
    
     (=we are talking about parameters like ex. NLS_SORT who 
      derive a default from NLS_LANGUAGE in NLS_SESSION_PARAMETERS,
      this is NOT the case for NLS_INSTANCE_PARAMETERS )
    
    Note that:
    
    * NLS_LANG is not a init.ora parameter, NLS_LANGUAGE and NLS_TERRITORY are.
      so you need to set NLS_LANGUAGE and NLS_TERRITORY separated.
    
    * you cannot define the <clients characterset> or NLS_LANG in the init.ora
      the clients characterset is defined by the NLS_LANG on client side (see above).
    
    * you cannot define the database characterset in the init.ora.
      The database characterset is defined by the "Create Database" command (see point c)).
    
    * These settings take precedence above the NLS_DATABASE_PARAMETERS.
    
    * These values are used for the NLS_SESSION_PARAMETERS if on the client the 
      NLS_LANG is NOT set (we strongly advice to set the NLS_LANG).
    
    * Oracle *strongly* recommends that you set the NLS_LANG on the client at least to 
      NLS_LANG=.<clients characterset>
    
    * ALTER SYSTEM SET NLS_LENGTH_SEMANTICS does not change the SESSION parameters
      (who take precedence) due to bug number 1488174,
      however it can be set in the init.ora or Spfile -> see Note 144808.1
    
    * ALTER SYSTEM SET NLS_NCHAR_CONV_EXCP does not change the SESSION parameters
      (who take precedence).. workaround: use a init.ora parameter.
    
    * The NLS_LANGUAGE in the instance parameters also declares the language for the
      server error messages in alert.log and in trace files, see also 
      Note 132090.1.
    
    C) The Database Parameters.
    ---------------------------
    
      select * from NLS_DATABASE_PARAMETERS;
    
     These are always defaulting to american america if there were no parameters 
     explicitly set in the init.ora during database creation time (!).
     If there were parameters set in the init.ora during database creation you see 
     them here. There is no way to change these after the database creation. 
     Do NOT update systemtables!
     These settings are used to give the database a default if the INSTANCE and 
     SESSION parameters are not set.
    
    Note that:
    
    * NLS_LANG is not a init.ora parameter, NLS_LANGUAGE and NLS_TERRITORY are.
      So you need to set NLS_LANGUAGE and NLS_TERRITORY separatly.
    
    * These parameters are overruled by NLS_INSTANCE_PARAMETERS and 
      NLS_SESSION_PARAMETERS.
    
    * you cannot define the <clients characterset> or NLS_LANG in the init.ora
      the clients characterset is defined by the NLS_LANG on client side (see above).
    
    * you cannot define the database characterset in the init.ora.
      The database (national) characterset (NLS_(NCHAR)_CHARACTERSET)
      is defined by the "Create Database ..." command.
    
    * The NLS_CHARACTERSET and NLS_NCHAR_CHARACTERSET parameters cannot be 
      overruled by instance or session parameters.
    
      They are defined by the value specified in "create database ..." and are not 
      intended to be changed afterwards dynamically.
      Do NOT update systemtables to change the characterset.
      This will corrupt your database and potentialy it will by impossible to open
      the database again.
      See Note 225912.1 Changing the Database Character Set - an Overview
      If you want to change the database characaterset. Don't mess with this if you
      don't know what you are doing. Log a tar if any doubt.
    
    * Setting the NLS_LANG during the creation of the database dous not influence 
      the NLS_DATABASE_PARAMETERS.
    
    * The NLS_LANG set during the database creation has NO impact on the database 
      (national) Characterset. 
    
    * These settings are used in evaluation of CHECK constraints if TO_CHAR/TO_DATE
      without a date format is used in the CHECK condition. Writing CHECK 
      constraints without explicit date formats is a bad habit, you should use
      explicit formats and this setting becomes irrelevant.
    
    Additional selects:
    -------------------
    
    A)  select name,value$ from sys.props$ where name like '%NLS%';
    
        This gives the same info as NLS_DATABASE_PARAMETERS.
        You should use NLS_DATABASE_PARAMETERS instead of props$.
        Note the UPPERCASE '%NLS%'
    
    B)  select * from v$nls_parameters;
    
        A view that shows the current session parameters and 
        the *DATABASE* characterset as seen in the NLS_DATABASE_PARAMETERS view.
    
    C)  select name,value from v$parameter where name like '%nls%';
    
        This gives the same info as NLS_INSTANCE_PARAMETERS.
        Note the LOWERCASE '%nls%'
    
    D)  select userenv ('language') from dual; 
        and
        select sys_context('userenv','language') from dual;
    
        Both these select statements give the session's <Language>_<territory> 
        and the *DATABASE* character set. The database character set is not the 
        same as the character set of the NLS_LANG that you started this connection
        with! So don't be fooled, although the output of this query looks like the
        value of a NLS_LANG variable - it is NOT.
    
        For more info on SYS_CONTEXT please see Note 120797.1 
    
    E) select userenv ('lang') from dual; 
    
       This select gives the short code that Oracle uses for the Language defined
       by NLS_LANGUAGE setting for this session.
       If NLS_LANGUAGE is set to French then this will return "F", 
       if NLS_LANGUAGE is set to English then this will return "GB"
       If NLS_LANGUAGE is set to American then this will return "US", and so on...
    
    F) show parameter NLS%
    
       This will give the same as the NLS_INSTANCE_PARAMETERS 
    
    Remark:
    -------
    
    The <clients characterset> part of NLS_LANG is *NOT* shown in any systemtable 
    or view (it is not known in the database). If you require to know the current 
    setting of a clients NLS_LANG then please see section 4.2 (How can I Check the 
    Client's NLS_LANG Setting?) of Note 158577.1
    
    
    
    Related Documents:
    ------------------
    
    Note 179133.1 The correct NLS_LANG in a Windows Environment
    Note 158577.1 NLS_LANG Explained (How does Client-Server Character Conversion Work?)
    Note 227331.1 Setting NLS Parameters - Frequently Asked Questions
    
    Note 13978.1 NLS Sort Characteristics
    Note 13882.1 Linguistic Sorting of Data in Oracle7 and Oracle8
    Note 30557.1 NLS_DATE_FORMAT and a Default Century
    
    Note 225912.1 Changing the Database Character Set - an Overview
    
    Note 132090.1 How to get messages in your own language on MS Windows platform?
    Note 120797.1 How to Determine Client IP-address,Language & Territory and Username for Current Session
    
    Note 251044.1 How to set a NLS session parameter at database level for all sessions ?
    Note 144808.1 Examples and limits of BYTE and CHAR semantics usage
    
    Bug 2155062 NLS_COMP cannot be set in the client ENVIRONMENT
    
    For further NLS / Globalization information you may start here:
    Note 267942.1 Globalization Technology (NLS) Knowledge Browser 
    Note 60134.1  NLS Frequently Asked Questions
    
    Posted Apr 28 2006, 03:19 PM by wicky with no comments
    Filed under:
  • 10gR2 New Feature: Case Insensitive Searches

    10gR2 New Feature: Case Insensitive Searches

    There are always a few topics in regards to writing SQL that always seem to come up more often than others. Querying data with case insensitivity is one of those topics. And Oracle has addressed this issue in many of their release. But in Oracle 10gR2 they have reached new levels. This article takes a dive into case insensitivity and how it is now handled in 10gR2. For the better!

    Firstly for those that are new to case insensitivity I will give a very brief introduction here. Basically case insensitivity is the treating of upper case letters and lower case letters as equal when comparing or sorting them. So the comparison of the letters 'a' and 'A' in a case insensitive world would be equal. And if we had a table LETTERS(letter char(1)) and did the following query it would return the following two rows.


    SQL> SELECT letter FROM letters WHERE letter = 'a';
    LETTER
    ------
    a
    A

    Up until the release of 10gR2 there have been many different approaches to accomplishing pattern matching such as using UPPER, NLS_UPPER, different NLS_SORT and NLS_COMP combinations such as GENERIC_BASELETTER for NLS_SORT, and you could even use Oracle's regular expression functions REGEXP%. But prior to 10gR2 writing a standard SQL statement that used a LIKE comparison operator and was able to take case insensitivity into consideration was non-existent. The only option was to use REGEXP_LIKE.

    Before we get into how this is now solved in 10gR2 lets just take a quick look at the pieces of the solution and how they have worked in the past and how they currently work in 10gR2.

    Table 1: NLS_COMP & NLS_SORT Visited

     
    PARAMETER
    Description
     
    NLS_COMP
     
    The sole purpose of this variable is to determine how the predicates in SQL statements will evaluate to each other when a comparison is required. The typical comparison operator is the WHERE clause but also includes such comparisons as ORDER BY, START WITH, HAVING, etc.

    Prior to Oracle 10gR2 there were two settings.

    BINARY : All comparisons will be done in accordance to the binary value of the characters.

    ANSI : All comparisons will be done linguistically in accordance to the setting of the variable NLS_SORT.

    After Oracle 10gR2.

    BINARY : Still available.

    ANSI : Still available but only for backward compatibility and should not be used.

    LINGUISTIC : New setting and fully honors the setting of NLS_SORT variable. You will see this latter but basically when you had set NLS_SORT to be case insensitive it didn't always hold true. In 10gR2 it now does!

    How to set

    Set with an operating system environment variable:
    SET(export) NLS_COMP=<binary|linguistic>

    Set inside your database session:
    ALTER SESSION SET NLS_COMP=<binary|linguistic>;

     
    NLS_SORT  NLS_SORT specifies the collating sequence for ORDER BY queries.

    If the value is BINARY, then the collating sequence for ORDER BY queries is based on the numeric value of characters.

    If the value is a named linguistic sort, sorting is based on the order of the defined linguistic sort. Most (but not all) languages supported by the NLS_LANGUAGE parameter also support a linguistic sort with the same name.

    There are many values.

    BINARY : All sorting is done in accordance to the binary value of the characters.

    V$NLS_VALID_VALUES : All sorting is done in accordance to a named linguistic definition. This means that Oracle will sort in accordance to a particular locale (GERMAN, POLISH, FRENCH, etc.).These valid named definitions may be obtained by querying the V$NLS_VALID_VALUES where parameter = `SORT'. Just be aware that all the values in this view also have a hybrid definition by adding a suffix of _CI (case insensitivity)

    How to set


    Set with an operating system environment variable:
    SET(export) NLS_SORT=<valid_value>

    ALTER SESSION SET NLS_SORT=<valid_value>; 


    Examples in Oracle 10g

    In prior versions of Oracle (pre 10gR2) if we had a table called NAMES and have the following entries in that table:

    SQL> select name from names;
    NAME
    -------------------
    Johny Jacobson
    johny jacobson
    JOHNY JACOBSON
    And we wanted to perform a search on 'Johny Jacobson', under normal setting of case sensitive (NLS_SORT=BINARY) searching we would get the following. This is exactly how you would assume an equality to work.

    SQL> alter session set NLS_SORT=BINARY;
    Session altered.

    SQL> select name from names where name = 'Johny Jacobson';
    NAME
    --------------------------------------------------------------
    Johny Jacobson
    But often times we don't necessarily know how someone might have entered data and thus we want to find all occurrences of a name, email address, or some other information. In this case we turn on case insensitivity. If we set NLS_SORT=BINARY_CI we would get the following results:


    SQL>  alter session set NLS_COMP=ANSI;
    Session altered.
    SQL> alter session set NLS_SORT=BINARY_CI;
    Session altered.

    SQL> select name from names where name = 'Johny Jacobson';
    NAME
    --------------------------------------------------------------------
    Johny Jacobson
    johny jacobson
    JOHNY JACOBSON
    These last two examples used strict equality (where name = 'Johny Jacobson'). Often times, more often than not, we don't know much about the column contents and want to perform a search where we can supply only a portion of a name. So under normal settings of case sensitivity NLS_SORT=BINARY we may perform searches such where name LIKE '%John%', 'Johny%', '%ohn%' and so forth until we get a result set we are comfortable with. Using the normal setting of case sensitive (NLS_SORT=BINARY) searching we might do the following. Obviously if we are looking for all occurrences of case insensitivity this doesn't work.


    SQL> alter session set NLS_SORT=BINARY;
    Session altered.

    SQL> select name from names where name like 'Johny%';
    NAME
    ------------------------------------------------------------
    Johny Jacobson
    So we quickly, in prior versions of Oracle, tried to switch to case insensitivity by setting the NLS_SORT parameter. If we are still looking for the simple BINARY case insensitivity we might try the following. But as you can see in prior versions of Oracle we still do not get true case insensitivity!


    SQL> alter session set NLS_COMP=ANSI;
    Session altered.
    SQL> alter session set NLS_SORT=BINARY_CI;
    Session altered.

    SQL> select name from names where name like 'Johny%';
    NAME
    ------------------------------------------------------------
    Johny Jacobson
    This is where the new setting of NLS_COMP comes into play. Setting NLS_COMP to LINGUISTIC tells Oracle to perform strict case insensitivity operations and looks like the following two examples. As you can see there is complete case insensitivity for both equality and now LIKE operations.


    SQL> alter session set NLS_SORT=BINARY_CI;
    Session altered.
    SQL> alter session set NLS_COMP=LINGUISTIC;
    Session altered.

    SQL>  select name from names where name = 'Johny Jacobson';
    NAME
    ------------------------------------------------------------------
    Johny Jacobson
    johny jacobson
    JOHNY JACOBSON

    SQL> select name from names where name like 'Johny%';
    NAME
    ------------------------------------------------------------------
    Johny Jacobson
    johny jacobson
    JOHNY JACOBSON
    There are literally dozens of ways in Oracle you can pattern match and find the information you need. The problem was, for case insensitivity you couldn't rely on strict case insensitivity in its purest form. You needed to hook in other functions or expressions. Now with Oracle 10gR2 you can set the NLS_COMP parameter and get true case insensitivity without having to change your application. Nice! Especially if you needed to port to another database vendor. Just so long as their case insensitivity is the same as Oracle's.


    » James Koopmann's blog
     
    In fact, I think Oracle
    Submitted by fuyuncat (not verified) on Mon, 2005-12-26 08:23.
    In fact, I think Oracle still used a UPPER or else on it. Coz from the execution plan, we can see there is FTS, instead used the index on the field:

    SQL> alter session set NLS_SORT=BINARY_CI;

    Session altered.

    SQL> alter session set NLS_COMP=LINGUISTIC;

    Session altered.

    SQL> select * from t2 where f1 = 'a';

    F1                AAA
    ---------- ----------
    A                   1
    a                   2


    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1513984157

    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |     1 |     5 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T2   |     1 |     5 |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------

    SQL> alter session set NLS_SORT=BINARY;

    Session altered.

    SQL> alter session set NLS_COMP=ANSI;

    Session altered.

    SQL> select * from t2 where f1 = 'a';

    F1                AAA
    ---------- ----------
    a                   2


    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2238318762

    ---------------------------------------------------------------------------------------
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |         |     1 |     5 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T2      |     1 |     5 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | T2_IDX1 |     2 |       |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------------

     

    Posted Apr 28 2006, 02:09 PM by wicky with no comments
    Filed under:
  • ASP.NET 2.0 之 加密/解密 Web.Config

    通常我们都习惯于把数据库连接串之类的数据放在Web.Config里面,然而直接把明文密码保存在服务器始终不是一个好主意。

    以前我们习惯于自己编写一段程序把其中的用户名和密码加密,在ASP.NET 2.0,微软提供了一个便捷的方法,就是利用aspnet_regiis工具进行加密和解密。

    示例:
    加密:aspnet_regiis -pe "connectionStrings" -site "VS.NET" -app "/cda"
    解密:aspnet_regiis -pd "connectionStrings" -site "VS.NET" -app "/cda"

    参数说明:
    -pe configSectionName 加密指定的configuration section,比如connectionStrings, appSettings等
    -pd configSectionName 解密指定的configuration section
    -site SiteName/SiteID 可选参数,指定IIS的Site,不指定的话就是Default Web Site
    -app VirtualPath 可选参数,指定相应Site下的应用程序,不指定的话就是"/"

    这样就有效防止了一般的用户通过Web.Config获取或者修改系统信息。

    后记:
    经试验,要令上述加密生效,还要做一些工作,简要步骤如下:
    (http://blogs.vertigosoftware.com/snyholm/archive/2005/12/16/1746.aspx)
    (http://msdn2.microsoft.com/en-us/library/53tyfkaw.aspx)

    1、确认web.config里面configuration节点有如下attribute
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    2、在configuration里面添加如下section:
    <configProtectedData>
      <
    providers
    >
        <
    add name
    ="MyProtectedDataProviderName"
            
    type
    ="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
            
    keyContainerName
    ="MyKeyContainerName"
            
    useMachineContainer
    ="true" />
      </
    providers
    >
    </
    configProtectedData>

    3、创建key container并赋相应权限:
    aspnet_regiis -pc "MyKeyContainerName"
    aspnet_regiis -pa "MyKeyContainerName" "NT AUTHORITY\NETWORK SERVICE"
    4、可以用aspnet_regiis或者编写程序进行加密解密。
    5、如果是deploy到其他服务器,还要将密匙导出/导入(晕。。。越来越麻烦。。。),具体参看上面的连接文章。否则会出现错误“Failed to decrypt using provider 'MyInsideProtectedDataProvider'. Error message from the provider: The RSA key container could not be opened.”。

     

    Posted Apr 24 2006, 10:13 AM by wicky with 3 comment(s)
    Filed under:
  • HotScripts.com

    http://www.hotscripts.com/

    The net's largest PHP, CGI, Perl, JavaScript and ASP script collection and resource web portal ...

  • Linuxquestions.org 评出2005年用户选择奖


    Linuxquestions.org论坛用户投票选出了2005年度用户选择奖,完全名单如下,后面的百分比为得票率。

    • 年度发行版
    • 年度桌面环境
    • 年度办公套件
    • 年度视频多媒体应用
    • 年度图形应用
    • 年度数据库
    • 年度文本编辑器
    • 年度窗口管理器
    • 年度Windows虚拟机
    • 年度开源游戏
    • 年度音频多媒体应用
    • 年度即时通讯
    • 年度LiveCD
    • 年度文件管理器
    • 年度集成开发环境
    • 年度SHELL
    • 年度Web浏览器
    • 年度邮件客户端
    • 年度网站开发编辑器
    • 年度安全应用

      年度发行版:

      1. Ubuntu 19.49%

      2. Slackware 19.05%
      3. Suse 13.18%
      4. Debian 10.58%
      5. Fedora 9.38%
      6. Gentoo 8.99%
      7. Mandrakelinux 5.79%
      8. MEPIS 2.92%
      9. Arch 2.84%
      10. PClinuxOS 1.76%
      11. CentOS 1.48%
      12. Red Hat Enterprise Linux 1.36%
      13. LFS 0.92%
      14. Knoppix 0.76%
      15. Linspire 0.72%
      16. Xandros 0.56%
      17. Novell Linux Desktop 0.24%

      年度视频多媒体应用:

      1. mplayer 46.94%

      2. xine 30.17%
      3. VLC 9.67%
      4. Totem 7.69%
      5. Gstreamer 2.73%
      6. Kino 1.07%
      7. Cinelerra 0.74%
      8. acidrip 0.41%
      9. Helix 0.41%
      10. Ogle 0.17%

      年度图形应用:

      1. GIMP 62.02%

      2. Inkscape 11.81%
      3. Blender 9.09%
      4. Krita 8.07%
      5. Scribus 3.91%
      6. ImageMagick 3.23%
      7. Tux Paint 1.02%
      8. Kolourpaint 0.85%

      年度数据库:

      1. MySQL 62.98%

      2. PostgreSQL 16.03%
      3. Firebird 7.92%
      4. sqlite 5.63%
      5. Oracle 4.20%
      6. DB2 1.53%
      7. Berkley DB 0.95%
      8. Sybase 0.38%
      9. EnterpriseDB 0.29%
      10. InnoDB 0.10%

      年度文本编辑器:

      1. Vim 37.96%

      2. Kate 22.47%
      3. Nano 9.68%
      4. Emacs 8.65%
      5. Gedit 7.88%
      6. Pico 3.16%
      7. Midnight Commander Editor 3.16%
      8. Nedit 2.07%
      9. Joe 1.94%
      10. jEdit 1.81%
      11. Scite 1.23%

      年度窗口管理器:

      1. Fluxbox 27.11%

      2. KWin 18.07%
      3. Enlightenment 15.00%
      4. MetaCity 8.35%
      5. IceWM 7.84%
      6. Window Maker 6.65%
      7. xfwm4 5.63%
      8. Blackbox 3.07%
      9. fvwm2 2.81%
      10. Openbox 2.22%
      11. Ion 1.36%
      12. sawfish 0.77%
      13. AfterStep 0.60%
      14. Ratpoison 0.51%

      年度windows虚拟机

      1. Wine 53.94%

      2. VMware 16.94%
      3. Crossover Office 11.33%
      4. Cedega 8.41%
      5. QEMU 7.34%
      6. Win4lin 2.05%

      年度办公套件:

      1. OpenOffice.org 84.84%
      2. Koffice 11.64%
      3. Goffice 2.46%
      4. Staroffice 1.06%
      5. Applixware 0%

      年度开源游戏:

      1. Frozen Bubble 23.17%

      2. Wesnoth 16.76%
      3. SuperTux 12.94%
      4. Tux Racer 11.47%
      5. FreeCiv 6.97%
      6. BZFlag 6.30%
      7. FlightGear 5.96%
      8. GNOME Sudoku 4.39%
      9. UFO: ALIEN INVASION 3.49%
      10. gnuchess 3.26%
      11. Pingus 2.92%
      12. TuxKart 1.24%
      13. xbill 1.12%

      年度桌面环境:

      1. KDE 64.86%

      2. Gnome 25.67%
      3. XFCE 8.8%
      4. GNUstep 0.57%
      5. Ximian 0.10%

      年度音频多媒体应用:

      1. amaroK 41.86%

      2. XMMS 28.87%
      3. K3b 9.08%
      4. Audacity 9.00%
      5. Rhythmbox 3.83%
      6. GStreamer 2.03%
      7. mpg123 1.56%
      8. Ardour 1.49%
      9. LAME 1.25%
      10. gtkpod 0.78%
      11. Muse 0.23%

      年度即时通讯:

      1. gaim 52.41%

      2. kopete 23.46%
      3. skype 7.40%
      4. amsn 5.41%
      5. xchat 3.66%
      6. Irssi 2.25%
      7. Psi 1.83%
      8. konversation 1.58%
      9. Gizmo 0.83%
      10. BitchX 0.75%
      11. GnomeMeeting 0.42%

      年度LiveCD:

      1. Knoppix 39.59%

      2. Ubuntulive 14.71%
      3. Slax 13.51%
      4. DamnSmall Linux 9.22%
      5. Simplymepis 7.00%
      6. Kanotix 4.69%
      7. PCLinuxOS 4.61%
      8. Suse Live 2.62%
      9. MandrakeMove 1.35%
      10. Morphix 0.87%
      11. dyne:bolic 0.56%
      12. BeatrIX 0.40%
      13. Gnoppix 0.40%
      14. DNALinux 0.24%
      15. Feather Linux 0.24%

      年度文件管理器:

      1. Konqueror 51.25%

      2. Nautilus 15.93%
      3. Midnight Commander 11.67%
      4. Krusader 7.12%
      5. Rox-Filer 5.73%
      6. Xfe 3.23%
      7. gentoo 1.54%
      8. EmelFM/EmelFM2 1.54%
      9. Xandros File Manager 1.10%
      10. Worker 0.44%
      11. KFM 0.37%
      12. Xplore 0.07%

      年度集成开发环境:

      1. Eclipse 31.99%

      2. Kdevelop 31.38%
      3. Emacs 13.06%
      4. Netbeans 6.11%
      5. Anjuta 5.62%
      6. Zend Studio 3.42%
      7. MonoDevelop 3.66%
      8. Kylix 1.71%
      9. Komodo 1.59%
      10. eric3 1.47%

      年度SHELL:

      1. bash 89.67%

      2. zsh 3.65%
      3. tcsh 2.62%
      4. korn/ksh 1.91%
      5. sh 1.51%
      6. csh 0.56%
      7. ash 0.08%

      年度Web浏览器:

      1. Firefox 71.90%
      2. Konqueror 11.05%
      3. Opera 10.12%
      4. Mozilla 3.91%
      5. Epiphany 0.88%
      6. links/elinks 0.59%
      7. Dillo 0.54%
      8. Galeon 0.44%
      9. lynx 0.39%
      10. Netscape 0.20%

      年度邮件客户端:

      1. Thunderbird 51.74%

      2. Kmail 21.47%
      3. Evolution 11.20%
      4. Sylpheed 3.83%
      5. mutt 3.83%
      6. pine 2.34%
      7. Opera M2 2.06%
      8. Mozilla Mail 1.84%
      9. SquirrelMail 1.28%
      10. Balsa 0.21%
      11. IMP 0.21%

      年度网站开发编辑器:

      1. Quanta 44.31%

      2. Nvu 24.91%
      3. Bluefish 21.53%
      4. Mozilla Composer 6.13%
      5. Screem 2.88%
      6. Ginf 0.25%

      年度安全应用:

      1. nmap 31.68%

      2. ClamAv 15.03%
      3. Firestarter 12.62%
      4. SELinux 11.54%
      5. snort 5.91%
      6. Nessus 5.91%
      7. chkrootkit 7.11%
      8. Tripwire 2.95%
      9. tcpdump 2.68%
      10. kismet 2.15%
      11. Bastille 1.48%
      12. fwBuilder 0.94%
      -->
    Posted Apr 19 2006, 08:46 AM by wicky with no comments
    Filed under:
  • 千千万万的IT开发工程师路在何方?

    http://dev.csdn.net/article/83981.shtm

      恭喜,你选择开发工程师作为自已的职业!
      悲哀,你选择开发工程师作为自已的职业!
      
      本文所指的开发工程师,仅指程序开发人员和以数字电路开发为主的电子工程师。当你选择计算机或者电子、自控等专业进入大学时,你本来还是有机会从事其它行业的,可你毕业时执迷不悟,仍然选择了开发作为你的职业,真是自作孽不可活。不过,欢迎你和我一样加入这个被其它人认为是风光无限的“白领”吧。如果你不是特别地与人世隔绝,我想你一定看过金老先生的名著《笑傲江湖》吧,里面有一门十分奇特的武功叫做“辟邪剑法”,你看这个小说第一次看到这种功夫的练法时,我想你当时一定笑歪了牙“呵呵,真好玩!”,可是现在我很痛心的告诉你:你选择的开发工作就是你人生路上的“辟邪剑法”,而你现在已经练了,并且无法再回头。
      
      相对同时刚出校门从事其它行业的同学而言优厚的薪水,以及不断学习更新的专业知识不仅仅让你感到生活的充实,更满足了你那不让外人知的虚荣心。在刚出校门的几年中,你经常回头看看被你落在后面的同学们,在内心怜悯他们的同时,你也会对自已天天加班的努力工作感到心里平衡:“有付出才会有回报”这句话在那几年中你说的最多,不管是对自已的朋友们还是的自己的爱人。第二句最常说的话是对公司的领导:“不行我就走人!”,实际上你也真的走过几回。对了,在这几年中,因为你的经济条件不错,你开始买房、开始谈恋爱、结婚、开始有了自已的小孩。有时候你会对自已说再过两年就去买车。当然其中可能有许多大件是需要分期付款的,但你对前途充满了信心,你确信这种日子会永远的持续下去,即使不是变得更好的话。
      
      日子总是在这种平淡中一天天的过去,就在那么不经意间,你突然发现自已已经快30岁了,或者已经30了,莫名的,你心里会漫延着一种说不清楚的不安情绪,你好像觉得前途并非像前几年那样变得越来越好,你也忽然发现你以前所瞧不起的同学里好像已经有不少开着车的了,也有几个人住着比你还大的房子,好像房款还是一次付清的,你突然明白你现在的生活比起你的同学来最多是中游偏上了。工作中最让你感到心里不舒服的是,你越来越不敢对你的领导说不了,即使比你来的晚的同事升职或提薪,你也只是在私下与朋友们一起喝酒时才敢发发牢骚,在头的面前你的声间越来越小、笑脸是越来越温柔。
      
      你终于开始迷茫“再过几年我会是在干什么呢?”,这句话常常出现在你的心里。计算机开发工作,是一种以年轻为资本的工作,说句通俗点的话是“吃青春饭的”,嗯,这句话好像在一种特别的行业也听到过。其标志就是一:工作的时间性非常强,一个开发项目被定的时限通常是很紧张的,更有甚者,有些号称开发管理的书里面还非常卑鄙的号召将一个项目切成多个小片,每个小片都定一个叫“里程碑”的东东来严格跟踪开发进度,加班加点在其它行业是需要加班工资的,而在开发行业,加班工资好像还没见到几个公司发过,是啊,反正有时间限制着,你干不完我再找你算账。所以开发工作通常有着其它工作所没有的精神上的压力。

      一旦一个人步入而立之年,因为家庭和孩子的负担,加上精力上面的衰退,加班工作时间变得越来越少,这点让很多老板们感到:这些人已经老了,不好用了。指示人事部门:“以后招开发人员限制在30岁以下!”,相对硬件开发而言,年龄方面限制会稍好一点点,但也是五十步笑百步。还有一个很重要的一点就是:计算机这个烂东东实在是发展得太快了,前两年买的顶级配置电脑,现在怎么看怎么像废品,这还是小事,更可气的是好像每天都需要学习新的知识,刚毕业时只会书本上的PASCAL,学会了用腐蚀的办法来做电路板,一上班就开始学习TURBOC和TANGER2。0,刚刚学会,还没来得及高兴,马上开始学Borland C++和Protel3。0,好不容易学会了,却发现需要学习VC和Protel98了。单片机也是啊:Z80的指令背的很熟,工作中没来得及用就要学8031,好好学吧,本来想着这辈子就吃它了,又发现又出来什么PIC、DSP、CPLD、FPGA、ARM等等.....这还不包括中间要学一大堆74系列、4000系列、XX系列.....IC卡居然里面还有CPU卡。如果学习的知识里每个字都能变成一分钱,我想所有的开发工程师都是腰缠万贯的富翁。
      
      一眼看去,这种日子好像见不到头,年轻时乐此不彼,但现在你一定对自已能坚持到什么时候感到怀疑了。我们都玩过像仙剑奇侠传这样的RPG游戏,刚开始时你只是一个一名不文的少年,随着你去打怪物、捡宝贝、学秘芨,最后终于有一天你会变成一个大英雄!那么你在实际生活中过得比那些小侠们还辛苦,为什么成不了一个生活中的大侠呢?呵呵,原因在这里:因为开发工作是邪门功夫,它虽然可以让你速成的变成小资,但它最大的特点是经验不积累!日新月异的知识更新,让你总是感到自已在退步,你就像在RPG中的主人公,开始时就给了你一把好剑和好盔甲,而且让你的级别很高,但让你的经验不累积,虽然刚开始打小怪物时你觉得自已很爽,但越到后来,你会发现你会死的很惨!比较一下你与其它非开发行业的同学你就可以知道了,例如和你学医的同学比起来。套用岳不群他老人家说华山剑宗和气宗的区别那段话:前十年你比你那些学医的同学收入和地位要好的多,但十年以后你和他基本上各方面都会持平,而二十年以后你的各方面远远不能与你学医的同学相提并论!嗯,你已经开始不笑辟邪剑法了吧。
      
      “敢问路在何方?路在脚下.....”,不过猴兄和八戒兄这么认为是可以的,你呢?总结了许多开发朋友在30岁以后的生活之路,让我们一起看看开发人员“路在何方?”那么开发人员在30岁以后都干些什么呢?

      出路一 继续做你这个很有“前途”的职业吧!

      偶掰着脚趾头仔细数了数,发现还真的有很多朋友在30岁以后还在从事开发工作,我这里说的从事,是指你还需要天天在电脑边上编程序和画电路板,与你手下是否有几个小兵无关,也与你是否头上顶着什么项目经理、主任工程师的帽子无关,只要你还需要亲自开发,你就属于这一类。其中有个年龄最大的朋友是63年的,从事医疗仪器的开发工作,35岁左右还在从事软硬件开发工作的仍有一大堆,分析这些仍然从事开发的朋友,基本上都有以下特点:

      1、痴迷工作或者痴迷电脑,晚上八点到十二点的这段时间,基本上是在电脑桌或工作台前度过的。
      2、不喜欢与人交住,朋友很少,常联系的人不超过五个。
      3、与朋友交往时谈工作多,但一般不主动谈钱。
      4、体型偏胖或偏廋,不在正常区间。
      5、无未来计划,对五年后自已生活怎么样、从事什么工作说不清楚。
      6、俭省,从不乱花钱。

      即使你是还不到30岁的开发人员,你也可以看看自己对以上几条是否符合,是否会在30岁后还从事开发职业,四条疑似,五条以上基本确诊你也是这类型的人。这些朋友们通常抱着过一天是一天的态度生活,到了这个年龄,也不敢再轻易的换工作了,年轻时的锐气慢慢的也消退了。唯一不变的希望是有一天从天上掉下来一大堆钱把自己砸伤。说实在话因为他们的性格所限,基本上可以确定他们以后不可能在职场上获得更好的发展,当个小头头,带几个人开发已经是他们发展的顶点。至于以后的人生之路,不仅他们自己迷茫,可能上帝也正在头痛。

      简单建议:要改变命运,先改变性格:坚持半年晚上不从事工作、游戏及电视,用此时间与人交往,你的人生会有改变。
      
      出路二 转行从事技术支持、行政或生产等工作

      还有一些朋友,从事了几年的开发工作,因为自已并非特别的爱好,或者领导上面的强制工作安排,他们转到了技术支持、服务或行政等工作,至少当时从表面上看起来,他们的薪水较开发要少一些,但真正的统计这些人,发现他们之中有半数的人获得了更好的发展,升职为服务部经理或行政经理等职,最历害的一个朋友已升职为总经理助理,进入高层。这类朋友当时转行通常并非自已志愿,属被逼无奈或者其它原因,但显然,拥有专业知识技术的他们显然在非技术部门中鹤立鸡群,遇到什么事情他们均可从专业的角度提出建言,久而久之,他们获得更多的升职和加薪机会也就不足为奇。因为不从事开发,所以经验开始积累,这类的职业通常会给你一个很安定的感觉,你到30多岁后会发现这类职业反而比开发工作更容易获得新的工作机会。

      简单建议:你如果确定在开发部无法获得很好的发展机会,不妨转到其它几个部门试试,换个活法,钱少点就少点吧,机会多。
      
      出路三  开发管理

      如果你现在已经是总工或开发部经理,或者你眼看就有机会被提升为这类职务,那么恭喜你,你走的是从“弼马温”到“斗战胜佛”这条金光大路,你不仅拥有很高的专业技能,而且很显然,也有着很强的人际交往能力,这类人根本不需要对未来有着任何的担心,即使在一无所有的时候也很容易白手起家。这种人算是练辟邪剑法练成了仙,嗯,我无话可说。你是不是这类人也很容易区别,就像围棋二十岁不称国手终身无望一样,你应该在工作三、四年以后,也就是说二十七岁左右就会发现自已工作中指手划脚的时间比亲自开发的时间要多了,而且大多数这类人在这个年龄手下应该有“兵”了,相反的,如果你快30岁了还天天埋头于电脑前编程序和画板子,或者30多岁了你还没升到部门经理(虽然你总是觉得自已很有希望),基本上可以确定你不是这类人。好了,如果你确定你是这类人,那么你唯一的想法就是尽快爬上中层和高层,因为有时候人生偶然性太大,不占住坑的萝卜很有可能被人拔出来!

      简单建议:天天去你的老板家里面拖地和擦桌子!哈......
      
      出路四 出国或考研

      有两个搞开发后出国的朋友,其中一个甚至打工打到了一个小公司总工的位置,数据库和软件方面水平巨牛,但仍感觉心里不踏实,于是将自己工作多年的钱忍痛掏出来,出国费加上机票大概将自已辛苦所攒的银子花完,然后又借了一些钱,在02年身上揣着一万美元跑去了加拿大,在加拿大不停的重复找工作,换工作,然后再找工作,找的工作基本上与计算机无关,不过工资总是在1500加元左右,呵呵,折成人民币与他在国内打工拿的基本上差不多,不过租个地下室就花了300加元,然后吃吃喝喝,再买个电脑上上网之类的,基本每月平均还要倒贴一点。前段时间给我的邮件里说,现在身上差不多只有5、6000美元了,准备开个小公司,看看能不能往国内倒腾点东东,做最后一搏。另外一个朋友去澳州,时间稍早一些,先是大概摘了一年多的葡萄,后来总算找了个技术工作,每天的工作是画机械图纸,收入还算不错将近3000澳元,买了个旧车,也算是过上了资本主义生活。不过前年回来一趟,唯一的感叹就是:在国外拿2000美元的生活,绝对不如在国内拿5000人民币的生活舒服。

      也有两个考研的朋友,不过其中一个严格的说不是做开发出身,偏重于市场方面的工作性质,不过我的朋友里面考研的不多,只好凑两个人说说,一个考研后在北京找了个工作,每个月5、6000元钱,但还是做开发,生活仍然与没考研之前没有任何的改变,前途仍然没见到什么大亮的光,还是搞不清楚以后再干些什么,标准的过一天算一天了。另外一个考研后在大学里面找了个工作,工资虽然比他原来打工少了不少,但毕竟终身有靠,稳定了下来,也算修成了正果,这位哥们心情一放松下来,也开始有时间琢磨着业余时间自已做点什么,好像现在慢慢的也开始有了点眉目。

      简单建议:这两条路,对开发人员来说都不算是很好,出国十年前是好事,现在难说,考研能成功转行的概率恐怕也不是很大,多半仍然去搞开发,只不过研究生可以多干几年罢了。
        
      出路五 转行到市场

      绞尽脑汁的想想,我所知道的人之中只有两个开发人员去做市场,这两个人都不能说是朋友,认识而已。他们都是主动要求去做市场,结果是这两个人均在市场都是干到一年左右,然后都自已开公司了。呵呵,很奇怪,极高的转行成功率!不过仔细想想,我对这两个人的思路佩服的五体投地。能下决心扔掉每月5、6000元的开发职位,从事一个自已并不熟悉的岗位,每月拿个2000多元+提成,但提成那是说不清楚的事情,这个决定,只能让人感觉到他们对自已的前途有清晰的把握和老谋深算的心机。而且他们不去服务不去生产,挖空心思说服领导去做市场(市场部门与开发部门通常是一个公司的核心部门,进入其实并不容易),可以说是有着长远的考虑的。有技术了,再与客户交成朋友,马上就会产生很大的机遇应该是正常的事情。

      有实力,有心机,也有着很强的决心力,这种人恐怕早在大学毕业时或更早的时候就已经决定了自已的人生之路,他们的每一步路在若干年前早就计划周全,现在看起来:学会技术->进入市场->寻找商机->开公司,一条多么清楚的人生之路。但就像我们上小学中学时,所有人都知道上大学是我们最清楚的人生路一样,最后只有少数人才能真正达到目标(当然,现在扩招的历害是另外一回事,我是说我们那个时候,也就是:“很久很久以前,当我像你那么大的时候”)。

      简单建议:你若是这类人,我的建议是:...嗯?...那个你,你别走啊,我还有个事想请你赞助一下啊.....
        
      出路六 开公司自已干

      呵呵,看到这一条,发现你的眼睛已经圆了,你肯定千百次的想过这个事情吧,咳咳,其实我从事开发的时候也是天天梦想着这种事情。总想着过两年找个机会就自已干,这个梦想一年又一年的折磨着你也给着你希望。看看吧,开发后来开公司的还真的不少,里面有成功的也有很多失败的,通常开公司都是几个人合伙开始的,有做技术的,有做市场的,几个人一拍即合、狼狈为奸,共同策划了一个大活动。一般说来能让这几个人下决心走出这一步,产品肯定是先进的,甚至是国内独一无二的,市场也是很大的,负责市场的那个哥们通常会拍着胸保证可以卖出去,并悄悄地告诉你某主管领导是他小舅子的同学的二叔,肯定没问题。于是你们几个人找地点、注册执照、买了几个破桌子,再攒了两台电脑,每个人又凑了几万银子,公司开张了!

      产品很快出来了,市场的哥们也不负重望,有几个客户表示要试用了,一切看起来都是如此的正常,“......你坐在老板桌前,不停的有人来汇报工作或者找你签字......人进人出中.....你又想起公司再穷也不能只有一把椅子的故事......”你在梦中笑出声来。是如此的顺利,你们很快就有单子了,很快的单子让你们凑的那点钱不够了,你们很高兴的每个人又增加了投入,拿出钱时你眼泪汪汪的数着钱说:“这就是我那生蛋的母鸡啊”。你们的产品确实不错,市场也经营的很好,客户慢慢的多了起来,单子来的时候一笔接着一笔,你每天都处于兴奋之中,唯一美中不足的是好像客户回款总是会拖一些日子,不过客户给你保证说:过几天,过几天就付给你们,因为回款总是在计划外,所以你们为了资金的流畅运行又凑了一些钱,这个时候你有一些心事了,因为你的存折上面的数字已经快趋向于零了。“没事,过两个月等回款了一切都OK了,谁干事业不吃点苦呢?”你这么安慰着自已又投入到工作中去,资金总是在回款和生产经营费用之间走着一个窄窄的小木桥,你的账上总是没有太多的钱,扩大了的公司规模和许多意外情况,使你又一次、二次、三次的与合作者们再次投入了自已的资金,当然,后来的钱你可能已经是借的了.....

      终于有一天,你的会计再一次告诉你,老板啊,账上又没现金了,吃过多次苦头的你终于下决心开始重视资金的运行了,你裁掉了一些不必要的人手,减少了开发的投入,要求市场人员签单的时候必须予付XX%的款,回扣也必须等收过款后再付,同时也开始对产品的生产成本开始进行控制。时间一天一天的过去,因为竟争对手的产品也对你的产品进行了仿造,你的产品慢慢变得不再先进,市场人员开始埋怨公司的合同资金方面规定太严格,不好签单,生产成本的下降通常也导致产品毛病的增多,客户也开始埋怨你的服务人员不能及时进行服务。

      终于有一天,你重新走进了人才交流中心,以前你是来招人的,现在你拿着自已的简历开始寻找一个工作......公司的成功与否,与产品有关,与市场有关,但更重要的是与资金有关,产品与市场都可以通过资金来弥补,而却没有任何东西可以代替资金,凡是倒下的公司,99%与资金链的断裂有关。在你决定要开公司以前,先估计一下你公司支持一年所需要的资金数额,包括人工费,生产,场地,广告宣传、市场费用、甚至电、水费等等等等,把你所想到的一切加在一起,得出的值就是。。慢。。如果你没有实际的开过公司的经验,你需要将此数字乘3,然后就是你开公司一年最少需要的费用,呵呵,公司的实际运营所需要的钱是你想像的3倍以上,你要是不信我也没办法。

      简单建议:开公司前最重要的是先确立你后续的资金来源!也就是说钱不够了怎么办?---因为你投入的钱肯定会不够的。
      
      出路七 第二职业

      这类的朋友有不少,他们没有脱离开发工作,但是在业余时间又不停的接项目或者在卖产品,在单位里面他们显得并不出众,比起其它人来说他们属于最不愿意加班的一类。为此他们白天通常工作很勤奋。这类人也许不一定可以挣很多钱,但平均下来他们一年之中通常都可以比同事们多挣个几万元。有时候比上班拿得还多。但令人疑惑的是,这类人在生活中更加注重稳定,基本上没见到他们跳过蹧,即使私下里面已经开了个小公司,他们通常也不会辞职。

      你的旁边有没有这类人呢?分辨他们很容易:--电话很多,而且更愿意来电话时离开办公室找个没人的旮旯通话。神秘兮兮给人一种“这家伙是不是有二奶啊?”的感觉的人,通常是这类人。这类人是女性最佳的选择对象:很顾家,不象那些富人容易花心,而比起一般人来说,他们收入相对要高得多。

      简单建议:这好像是开发人员最佳的出路了,但比较丰厚的收入通常让这类人不愿意去冒风险.....到现在为止我所认识的这类人还没有一个真正算是成功的。
      
      好了,虽然偶的经历远远说不上丰富,也没有什么成功之处可以自满的,但或许因为比其它朋友痴长了几岁,见过的人可能会稍多一些,所以斗胆写出了以上的一些文字,让您掉牙了。下面是偶走过开发这条路上总结出来的一点心得,你可以不看,但看了就千万别把嘴咧的太大:
      
      一、不管是给别人打工还是自已干,都要全心全意的工作,因为你所做的任何一点工作都会让自已的人生多一点筹码,这一点最最重要!这样的例子我至少可以举出两起,优秀的开发人员被其它新公司挖走,并给一定的股份,成为新公司的股东的例子。当时与这样的开发人员一个部门同时工作或更早工作的有许多人,他们平时经常偷点懒,能少干点工作就少干点,有时候还笑话那个平时努力工作的人傻,几年过去了,究竟谁比谁傻?
      
      二、多与市场人员交朋友,你接触他们时可能总会觉得他们知识比你少,甚至素质比你低,可能比你还有点黄。但实际上他们比你更懂这个社会!参加到他们这个圈子中去,和他们一起赌赌钱、一起聊聊天、一起洗洗桑拿、一起.....你会通过他们接触到另外一个世界。
      
      在网上或其它地方,如果有机会参与到除本职工作外的一些项目或产品的开发中(包括你的朋友拉你去做点小生意之类的非开发性质的工作),那怕是帮忙的性质,也要积极介入,至少你会交到很多的朋友,这样你的人生会多出很多的机会。

    Posted Apr 17 2006, 05:56 PM by wicky with 1 comment(s)
    Filed under:
  • 给年轻工程师的十大忠告

    http://dev.csdn.net/article/84018.shtm

    诸位,咱当电子工程师也是十余年了,不算有出息,环顾四周,也没有看见几个有出息的!回顾工程师生涯,感慨万千,愿意讲几句掏心窝子的话,也算给咱们师弟师妹们提个醒,希望他们比咱们强!

    [1]  好好规划自己的路,不要跟着感觉走!根据个人的理想决策安排,绝大部分人并不指望成为什么院士或教授,而是希望活得滋润一些,爽一些。那么,就需要慎重安排自己的轨迹。从哪个行业入手,逐渐对该行业深入了解,不要频繁跳槽,特别是不要为了一点工资而转移阵地,从长远看,这点钱根本不算什么,当你对一个行业有那么几年的体会,以后钱根本不是问题。频繁地动荡不是上策,最后你对哪个行业都没有摸透,永远是新手!

    [2] 可以做技术,切不可沉湎于技术。千万不可一门心思钻研技术!给自己很大压力,如果你的心思全部放在这上面,那么注定你将成为孔乙己一类的人物!适可而止为之,因为技术只不过是你今后前途的支柱之一,而且还不是最大的支柱,除非你只愿意到老还是个工程师!

    [3] 不要去做技术高手,只去做综合素质高手!在企业里混,我们时常瞧不起某人,说他“什么都不懂,凭啥拿那么多钱,凭啥升官!”这是普遍的典型的工程师的迂腐之言。8051很牛吗?人家能上去必然有他的本事,而且是你没有的本事。你想想,老板搞经营那么多年,难道见识不如你这个新兵?人家或许善于管理,善于领会老板意图,善于部门协调等等。因此务必培养自己多方面的能力,包括管理,亲和力,察言观色能力,攻关能力等,要成为综合素质的高手,则前途无量,否则只能躲在角落看示波器!技术以外的技能才是更重要的本事!!从古到今,美国日本,一律如此!

    [4] 多交社会三教九流的朋友!不要只和工程师交往,认为有共同语言,其实更重要的是和其他类人物交往,如果你希望有朝一日当老板或高层管理,那么你整日面对的就是这些人。了解他们的经历,思维习惯,爱好,学习他们处理问题的模式,了解社会各个角落的现象和问题,这是以后发展的巨大的本钱,没有这些以后就会笨手笨脚,跌跌撞撞,遇到重重困难,交不少学费,成功的概率大大降低!

    [5] 知识涉猎不一定专,但一定要广!多看看其他方面的书,金融,财会,进出口,税务,法律等等,为以后做一些积累,以后的用处会更大!会少交许多学费!!

    Devil [6] 抓住时机向技术管理或市场销售方面的转变!要想有前途就不能一直搞开发,适当时候要转变为管理或销售,前途会更大,以前搞技术也没有白搞,以后还用得着。搞管理可以培养自己的领导能力,搞销售可以培养自己的市场概念和思维,同时为自己以后发展积累庞大的人脉!应该说这才是前途的真正支柱!!!

    [7] 逐渐克服自己的心里弱点和性格缺陷!多疑,敏感,天真(贬义,并不可爱),犹豫不决,胆怯,多虑,脸皮太薄,心不够黑,教条式思维。。。这些工程师普遍存在的性格弱点必须改变!很难吗?只在床上想一想当然不可能,去帮朋友守一个月地摊,包准有效果,去实践,而不要只想!不克服这些缺点,一切不可能,甚至连项目经理都当不好--尽管你可能技术不错!

    Music [8] 工作的同时要为以后做准备!建立自己的工作环境!及早为自己配置一个工作环境,装备电脑,示波器(可以买个二手的),仿真器,编程器等,业余可以接点活,一方面接触市场,培养市场感觉,同时也积累资金,更重要的是准备自己的产品,咱搞技术的没有钱,只有技术,技术的代表不是学历和证书,而是产品,拿出象样的产品,就可技术转让或与人合作搞企业!先把东西准备好,等待机会,否则,有了机会也抓不住!

    [9] 要学会善于推销自己!不仅要能干,还要能说,能写,善于利用一切机会推销自己,树立自己的品牌形象,很必要!要创造条件让别人了解自己,不然老板怎么知道你能干?外面的投资人怎么相信你?提早把自己推销出去,机会自然会来找你!搞个个人主页是个好注意!!特别是培养自己在行业的名气,有了名气,高薪机会自不在话下,更重要的是有合作的机会...

    [10] 该出手时便出手!永远不可能有100%把握!!!条件差不多就要大胆去干,去闯出自己的事业,不要犹豫,不要彷徨,干了不一定成功,但至少为下一次冲击积累了经验,不干永远没出息,而且要干成必然要经历失败。不经历风雨,怎么见彩虹,没有人能随随便便成功!

     

    Posted Apr 17 2006, 05:43 PM by wicky with no comments
    Filed under:
  • Oracle: 快速查看正在执行的SQL语句

    1、用v$session找到相应的session id或sql_address,可以用username, machine, status等条件:

    SELECT SID, username, status, osuser, machine, terminal, program, TYPE, sql_address
      FROM v$session

    2. 用v$sql找到相应的SQL语句:

    SELECT sql_text
      FROM v$sql
     WHERE address = ( SELECT sql_address
                        FROM v$session
                       WHERE SID = 第一步找到的SID )
    或者直接用
     
    SELECT sql_text
      FROM v$sql
     WHERE address = 第一步找到的sql_address
     
    通常这个两步法比较快,在服务器比较忙的时候也能出结果。

     
    Posted Apr 16 2006, 01:30 PM by wicky with 2 comment(s)
    Filed under:
  • CS2: Add Archive List to Default Theme

    1) Add this line to Skin-BlogSideBar.ascx

    <Blog:ArchiveList runat="Server" id="al"/>

    2) Modify Skin-ArchiveList.ascx to match theme

    <div class="CommonSidebarArea">       
     <h4 class="CommonSidebarHeader"><CS:ResourceControl ResourceName="Weblog_Archive"  runat="Server" /></h4>
     <div class="CommonSidebarContent">
      <asp:Repeater runat="server" id="Categories">
      <ItemTemplate>
       <div class="CommonSidebarContentItem">
       <CS:Href id="Link" runat="server" />
       </div>
      </ItemTemplate>
      </asp:Repeater>
     </div>
    </div>

     

  • Workarounds for "FDBK23918:'asp' is an unrecognized tag prefix or device filter" (VS2005)

    http://lab.msdn.microsoft.com/ProductFeedback/ViewWorkaround.aspx?FeedbackID=FDBK23918#1

    FDBK23918#1: Stop using nested Masters

    Workaround Description:
    I got this problem when using nested master files.

    Workaround Steps:
    I combined my nested masters into one, so that my aspx pages only use a base master file. Problem went away.



    FDBK23918#2: Open Master Files

    Workaround Description:
    Resolves the issue described in this bug.

    Workaround Steps:
    Open the master file(s) in studio while working on the specific file. Leaving those files open in the background repairs the intellisence.

  • Oracle SQL: LIKE Condition

    SQL: LIKE Condition


    The LIKE condition allows you to use wildcards in the where clause of an SQL statement. This allows you to perform pattern matching. The LIKE condition can be used in any valid SQL statement - select, insert, update, or delete.

    The patterns that you can choose from are:

    % allows you to match any string of any length (including zero length)

    _ allows you to match on a single character


    Examples using % wildcard

    The first example that we'll take a look at involves using % in the where clause of a select statement. We are going to try to find all of the suppliers whose name begins with 'Hew'.

    SELECT * FROM supplier
    WHERE supplier_name like 'Hew%';


    You can also using the wildcard multiple times within the same string. For example,

    SELECT * FROM supplier
    WHERE supplier_name like '%bob%';

    In this example, we are looking for all suppliers whose name contains the characters 'bob'.


    You could also use the LIKE condition to find suppliers whose name does not start with 'T'. For example,

    SELECT * FROM supplier
    WHERE supplier_name not like 'T%';

    By placing the not keyword in front of the LIKE condition, you are able to retrieve all suppliers whose name does not start with 'T'.


    Examples using _ wildcard

    Next, let's explain how the _ wildcard works. Remember that the _ is looking for only one character.

    For example,

    SELECT * FROM supplier
    WHERE supplier_name like 'Sm_th';

    This SQL statement would return all suppliers whose name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th'. For example, it could return suppliers whose name is 'Smith', 'Smyth', 'Smath', 'Smeth', etc.


    Here is another example,

    SELECT * FROM supplier
    WHERE account_number like '12317_';

    You might find that you are looking for an account number, but you only have 5 of the 6 digits. The example above, would retrieve potentially 10 records back (where the missing value could equal anything from 0 to 9). For example, it could return suppliers whose account numbers are:

    123170
    123171
    123172
    123173
    123174
    123175
    123176
    123177
    123178
    123179.


    Examples using Escape Characters

    Next, in Oracle, let's say you wanted to search for a % or a _ character in a LIKE condition. You can do this using an Escape character.

    Please note that you can define an escape character as a single character (length of 1) ONLY.

    For example,

    SELECT * FROM supplier
    WHERE supplier_name LIKE '!%' escape '!';

    This SQL statement identifies the ! character as an escape character. This statement will return all suppliers whose name is %.


    Here is another more complicated example:

    SELECT * FROM supplier
    WHERE supplier_name LIKE 'H%!%' escape '!';

    This example returns all suppliers whose name starts with H and ends in %. For example, it would return a value such as 'Hello%'.


    You can also use the Escape character with the _ character. For example,

    SELECT * FROM supplier
    WHERE supplier_name LIKE 'H%!_' escape '!';

    This example returns all suppliers whose name starts with H and ends in _. For example, it would return a value such as 'Hello_'.

     

    Posted Apr 10 2006, 02:06 PM by wicky with 4 comment(s)
    Filed under:
  • 老调重弹 - 行进中开火

    行进中开火 
     

    作者: 周思博 (Joel Spolsky)
    译: Siyan Li 李思延
    编辑: Paul May 梅普華
    2002年1月6日


    时不时,总有一阵儿,我什么事也干不了。

    我也去办公厅,东瞄瞄,西看看,每十秒钟查一次电子邮件,网上逛一圈。也许干点儿象付运通卡账单之类不需要大脑的事。不过要回去哗啦哗啦写程序,可没门儿。

    这种不出活的状态,一般通常会持续一两天。在我的软件开发生涯中也有过几个星期干不了活的时候。就像他们说的,我不在状态,我进入不了情况,我找不到组织。

    人人都有情绪波动,有的人温和一些,有的响动大点儿,也有的可以整个乱套。但不管怎么着,那段不出活期似乎总是跟忧郁有点儿关系。

    我不由得联想到那些专家说,人们基本上控制不了自己吃什么。任何节食计划都长不了。大家总是悠回各自的正常体重。也许作为一个软件工程师,我也不能控制什么时候最能出活。我唯一希望的就是发呆那段能被哗哗干活那段扯平,最终还能混碗饭吃。


    自从我干上软件开发这一行起,我平均每天只有两三个的高效时间。这真让我头大。我在微软实习的时候,另外一个实习生告诉我,他每天12点上班,5点下班。5个钟头还包括午餐时间,但他的同事还对他特别满意。因为他干的活比一般人都多。其实我也一样。我每天只有两三个小时的高效时间。看着别人那么卖力的干,还有点不好意思。不过呢,我总是组里出活最多的。由此可见,“人件理论”和极限编程都坚持不加班,每周只干40小时,还是有点道理的。他们都清楚这么做不会降低一个小组的生产能力。

    每天只能干两小时还没让我太担心,真让我担心的是完全干不了活的那些天。

    我老想这是怎么回事儿。我努力回忆我出活最多的时候。估计是微软把我搬到一间漂亮的新办公室的时候。舒适豪华的办公室,窗外风景如画,窗对面樱桃花开满了石头堆砌的庭院。所有的一切都那么恰到好处。我马不停蹄地干好好几个月,一口气把Excel Basic的详细设计搞定。用象纪念碑那么高的一叠纸,详细描素了一个超大型目标模型和编程环境,工作之细致,令人难以置信。我自始至终就没停过手。去波士顿参加MacWorld I的时候,我都带着一台手提电脑,坐在哈佛商学院的大阳台上把Windows类别的所有文件都写完了。

    按步就班并不难。通常我一天是这样度过的:1,去上班。2,查电子邮件和上网等等。 3,考虑是否应该吃完中饭在开始干活。4,吃完中饭回来。5,查电子邮件逛网。6,终于决定应该开始工作了。7,查电子邮件逛网,东瞄瞄,西看看。8,再次决定确实应该开始开始干活了。9,打开该死的编辑器。10,一直写程序写到晚上7:30,写到忘记时间。

    在以上第8步和第9步之间似乎有点缺陷,因为我不是每次都能顺利地执行下去。

    对我来说,启动是唯一的难题。静止物体在不受外力作用的情况下会保持静止。大脑里有些物质的质量大得不可思议,让它加速太难了。但是只要速度上去了,在全速行使的情况下,倒不用使什么劲就能继续走下去。就象骑着自行车去作一次自费横穿美国的旅行,一开始,你根本想象不出要花那么多时间让车轮动起来,可是一旦动起来了,让它们继续转就不是一件很难的事了。

    也许高效率的关键就:启动起来。配对编程法之所以成功,说不定就靠两个人在一起,互相强迫对方启动起来。

    我在以色烈当伞兵时,一次,有个将军来给我们讲实战战术。他告诉我们,步兵战术其实只有一种:行进中开火。你一边开火一边朝着敌人冲过去,火力让敌人抬不起头来,不能朝你开火 (当一个军人喊:“掩护我”的时候,他的意思就是“在我冲过街时候,你朝敌人猛烈开火,迫使他猫起来,没法朝我开火)。前进了,你就可以占领阵地,接近敌人,这样你的胜算要大的多。你要是不往前冲,敌人就有时间来搞清楚形势,这可不妙。你要是不开火,敌人就要朝你开火,撂倒你。

    我很长一段时间都在想着这个教导。我想通了不论是战斗机空中格斗还是大规模舰队攻击,大部份军事战略战术都是以行进中开火作为基础的。我又化了十五年时间才想通了行进中开火也是一个人在现实生活中成功的基本原则。你每天都得往前进点儿,不用想你写的程序怎么差劲,怎么卖不出去,只要你不停地写,不停地改,滴水也能穿石。同时, 要注意你的竞争对手朝你开火。他们是不是想让你全心全意应付他们的扫射,好让你往前走不了呢?

    想想这些年来,微软开发出来的资料存取方法,从OBDC,RDO,DAO,ADO,OLEDB直到现在的 ADO,.NET,不停翻新,技术上有必要吗?还是因为那个设计组实在蹩