“未来的世界:方向比努力重要,能力比知识重要,健康比成绩重要,生活比文凭重要,情商比智商重要! ”    ——清华大学校长留给毕业生的一段话

发布新日志

  • LoadRunner Winsock 10053错误的真正原因

    2007-09-13 23:05:50

     最近使用LoadRunner进行Winsock协议的性能测试时, 测试的WebServer是JBoss,经常出现10053错误,现象如下:当我用lrs_create_socket创建连接之后,当这个socket 连接的请求次数达到100次后,这个连接就不可用了,必须close后再重新create。LoadRunner提示错误:Error : socket0 - Software caused connection abort. Error code : 10053.

      经过多次探索,终于发现该错误是由于Apach HTTPServer中HTTP 1.1 版本KeepAlive参数 的配置原因导致的。从我对多个不同WebServer的测试结果来看,在一个Socket连接进行100个请求时出错的有JBoss和Tomcat,其它 Web服务器如IIS、WebLogic均没有该问题。
    下面介绍几个相关的参数:KeepAlive 、KeepAliveTimeout、MaxKeepAliveRequests。

    KeepAlive Directive
    Descrīption: Enables HTTP persistent connections
    Syntax: KeepAlive On|Off
    Default: KeepAlive On
    Context: server config, virtual host
    Status: Core
    Module: core

      在HTTP 1.0中,一次连接只能作传输一次HTTP请求,而KeepAlive参数用于支持HTTP 1.1版本的一次连接、多次传输功能,这样就可以在一次连接中传递多个HTTP请求。虽然只有较新的浏览器才支持这个功能,但还是打开使用这个选项。

    The Keep-Alive extension to HTTP/1.0 and the persistent connection feature of HTTP/1.1 provide long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images. To enable Keep-Alive connections, set KeepAlive On.

    For HTTP/1.0 clients, Keep-Alive connections will only be used if they are specifically requested by a client. In addition, a Keep-Alive connection with an HTTP/1.0 client can only be used when the length of the content is known in advance. This implies that dynamic content such as CGI output, SSI pages, and server-generated directory listings will generally not use Keep-Alive connections to HTTP/1.0 clients. For HTTP/1.1 clients, persistent connections are the default unless otherwise specified. If the client requests it, chunked encoding will be used in order to send content of unknown length over persistent connections.

    ----------------------

    KeepAliveTimeout Directive
    Descrīption: Amount of time the server will wait for subsequent requests on a persistent connection
    Syntax: KeepAliveTimeout seconds
    Default: KeepAliveTimeout 15
    Context: server config, virtual host
    Status: Core
    Module: core

      KeepAliveTimeout测试一次连接中的多次请求传输之间的时间,如果服务器  已经完成了一次请求,但一直没有接收到客户程序的下一次请求,在间隔超过了  这个参数设置的值之后,服务器就断开连接。

    The number of seconds Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the Timeout directive applies.

    Setting KeepAliveTimeout to a high value may cause performance problems in heavily loaded servers. The higher the timeout, the more server processes will be kept occupied waiting on connections with idle clients.

    ----------------------

    MaxKeepAliveRequests Directive
    Descrīption: Number of requests allowed on a persistent connection
    Syntax: MaxKeepAliveRequests number
    Default: MaxKeepAliveRequests 100
    Context: server config, virtual host
    Status: Core
    Module: core

      MaxKeepAliveRequests为一次连接可以进行的HTTP请求的最大请求次数。将其值设为0将支持在一次连接内进行无限次的传输请求。事实上没有客户程序在一次连接中请求太多的页面,通常达不到这个上限就完成连接了。

      The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on. If it is set to 0, unlimited requests will be allowed. We recommend that this setting be kept to a high value for maximum server performance.

    For example:MaxKeepAliveRequests 500

      最后,虽然这个问题是由于HTTPServer的参数配置引起的,但只有LoadRunner才会出现这个问题,如果用Rational Robot实现同样的功能则没有该问题,由此估计和测试工具对Socket连接的实现策略也有一定的关系。

  • LoadRunner的协议选择、Winsocket、C/S应用程序

    2007-09-13 23:03:45

    很多时候一提到不是基于浏览器的应用,很多人就会想到用WinSocket协议来录制,仿佛Form窗体都可以用Winsocket 。

            从道理上讲网络通讯的底层都是基于Socket的,例如TCP、UPD等,似乎所有的程序都可以用Socket协议来录制。但是事实不是这样的,因为选择的协议决定了LoadRunner如何捕获数据包。否则会多捕获很多无用的数据。

            因此,不是所有的程序都是适合WinSocket协议的。实际上,那些基于Socket开发的应用才真正适合Socket协议来进行录制。其他的,例如基于数据库的应用,就不太时候Socket协议,甚至可能录制不到脚本。

            很多C/S程序,一定要选择合适的协议。根据作者的经验,C/S的程序多数需要手工开发很多脚本,因为录制的很多回放时候或多或少都会有些问题,但是可以参考录制的结果。

            所以测试一个程序,一定要搞清楚开发人员用了什么技术、数据流是什么协议封装的。

            附件是我们自己开发的Controller,我们自己用面向对象实现了并发测试架构(目前支持并发、迭代、thinktime、参数文件、启动时间间隔,集合点功能正在开发中)。借助我们自己开发的Agent,能很好的测试我们的C/S架构的程序。
            这个工具和LoadRunner配合起来,可以完成大多数性能测试
            这个工具主要为我们测试视频播放效果而开发,呵呵。这是LoadRunner不太擅长的。

     

  • 关于点击率吞吐量的曲线

    2007-09-13 23:02:57

    因为在客户端发request的时候,是不会管服务器的状态的。

            下面打个比方,具体数据,不可做任何参考,只是我临时编的。
            比如:服务器可以同时每秒处理100次点击,这时,需要调用服务器的一些资源来处理,像:JDBC连接、内存、开socket等等,其他的用户呢?应该都在排队状态,而服务器处理完了前面的用户后,需要一些时间来释放这些被占用的资源,假设为1秒,如果LR采样的时长为2秒,那么服务器处理的用户应该为50次点击/每秒,按这种理想状态,点击率的图应该是比较平稳的。
            但是,系统受的压力会随着点击的增加而增加,系统性能也就慢慢的下降,例如释放资源的速度开始变慢、换页开始频繁,那么,后面的点击造成的请求,很有可能需要等待的时间随机变长。但是采样的频率是不变的,所以后面的采样值应该慢慢的变小。
            也就是像有些图中所显示的那样:随着场景时间的持续,点击率,吞吐量等图的曲线慢慢的下降。

            而出现超时的现象也很好解释了,无非是有些请求,等待的时间太长了。

            有些图呢是比较稳定的,曲线平稳,这时可以认为,系统可以承受当前用户量的压力。

            而有些场景会出很多超时的错,这就有可能是系统承受不了这种的压力,或者配置上有些问题。

            需要综合分析了。

  • LoadRunner中浏览器仿真的设置对测试结果的影响

    2007-09-13 22:58:37

    测试环境描述:

            客户端 5台 Windows2000机器。服务器端  20台机器 一台F5(负载均衡设备,提供一个唯一的IP供客户端访问)

            客户端绑定Host后,使用域名http://www.****.com来访问。
            为了说明问题,简化的脚本说明如下。
            协议:http/html vuser_init:登陆;Action:查询某笔交易,查询成功的前提是用户必须登陆;vuser_end:退出  运行时设置参数Browser Emulation采用的是默认值。场景设置的是Goal-Oriented。
            在运行时发现,登陆都能成功,但是在执行Action时,部分成功,部分失败。为了查明失败的原因,在Vuser Generator中调试脚本,设置Action运行100次。每次运行时,总有一部分成功,一部分失败,而且是不规律的。这时候联想到服务器端有好多台 机器,是不是因为把查询交易的请求分发到不同服务器导致查询时因为没有登陆而失败呢。

            那么有什么办法让每一个Vuser访问固定的一台机器呢?这也符合实际的业务情况,当一个用户登陆后,他所进行的一系列动作都是在同一台服务器上完成的, 否则会不定时的让用户重新登陆。此时查看Browser Emulation,发现有一个设置“Simulate a new user on each iteration”。根据LR给出的解释是:在每一次迭代完成后,VuGen会把所有的http状态设置为vuser_init完成后的状态,然后以新 的用户进行下一次迭代。现实的情况是,如果每次Action迭代时,F5会根据当前服务器的使用情况把请求分发到空闲的机器上。这时就出现了上面所说的问 题。把此选项去掉后测试成功。
  • 关于LoadRunner中参数值的引用(转)

    2007-09-13 22:54:08

    昨天在研究脚本的时候偶然遇到一个问题,今天正好有了点时间,就拿来再研究一下。
      问题是这样的:我想用strcpy函数把一个字符串赋给一个变量,再将这字符串做一个参数化,然后我想看看参数化是否成功,于是我用了lr_message函数把它打印出来。脚本代码很简单,如下所示:
      Action()
    {
        char a[10];
        strcpy(a,"{a}");
        lr_message(a);
        return 0;

      其中,{a}我已经做了参数化,参数值为11。
      运行这个脚本后,发现运行日志里打印出来的a值显示为{a}。
      在尝试了N遍以后,我把lr_message(a);这句代码改成lr_message(lr_eval_string(a));后问题解决,运行日志里打印出了我所期望的值11。
      问题虽然解决了,但我还是很纳闷,为什么在用lr_message的时候不能直接引用参数,而我记得之前在web_url、web_submit_data等函数里都是可以直接引用参数化的值,而从来没有出现过问题。也许是在LoadRunner里,这几个函数对参数值的引用方式不同吧,不知道我这样想是否正确,希望大家批评指正!

      昨天和Zee讨论了一个下午,结论还是没有明确。今天上午继续试验,试验结果表明Zee说的是正确的,不能直接将C语言里的变量直接当作LR变 量使用,而需要做一些转换。事实上,执行strcpy(a,"{a}");后,并没有真正将参数值传给a。需要这样写:strcpy(a, lr_eval_string("{a}"));这样就没问题了。

      不过,问题还没有结束,在tuxedo协议中,用 lrt_strcpy函数则没有这个问题存在,例如:lrt_strcpy(sendBuf1, sendBuf);则可以成功地将sendBuf中的参数值赋值给sendBuf1。目前怀疑是该函数在内部已经进行过转换,但并不肯定,尚待证实。 

      再次针对以上问题进行试验,我在lrt_strcpy(sendBuf1, sendBuf);语句的前后各加了一句调试信息:lr_output_message("sendBuf:%s",sendBuf);
    和lr_output_message("sendBuf1:%s",sendBuf1);
      打印出来的结果截然不同,前者的输出显示没有传入参数值,而后者则成功传入参数。这表明确实是lrt_strcpy这个函数在搞鬼。
  • 通过LoadRunner监控Linux的资源状况

    2007-09-13 22:48:41

      我们在使用LR进行性能测试的时候,经常有需要监控OS的资源使用情况的需求。对于 Windows系统,这个工作进行起来很方便,直接在LR的资源监控窗口中添加需要被监控的机器名或IP即可,但对于Linux/Unix系统,则要稍微复杂一些,我在这里简单介绍一下如何在LR中监控Linux/Unix系统的资源使用情况:

      Linux

      对于Linux系统,要想通过LR监控Linux/Unix系统的资源使用情况,需要运行rstatd服务。如果OS没有安装rstatd(可 以查找一下系统中是否存在rpc.rstatd这个文件,如果没有,则说明系统没有安装 rstatd),则需要进行安装。rstatd安装步骤如下:

      获得rstatd的安装介质(rstatd.tar.gz)。rstatd可以从 redhat的安装CD中获得,或者从网站上下载(给出一个下载地址,sourceforge的: //heanet.dl.sourceforge.net/sourceforge/rstatd)。

      将rstatd.tar.gz拷贝到Linux系统中,解压,赋予可执行权限,进入rpc.rstatd目录,依次执行如下命令:

      #./configure

      #make

      #make install

      结束后,运行./rpc.rstatd命令,启动服务。这个时候,你就可以在LR中监控Linux资源了。

      Unix

      对于Unix系统,比如Solaris,AIX或者HP UX等,它们的配置过程比较简单——在inetd.conf(在/etc目录下)文件中去掉rstatd前面的注释,然后启动rstatd服务即可。

  • QTP知识点收集

    2007-08-26 23:57:34

    http://www.51testing.com/?26649/action_viewspace_itemid_808.html

    http://www.51testing.com/index.php?uid/26649/action/viewspace/itemid/570/php/1

     

     

    Select * From Flights,Orders where Flights.Flight_Number = Orders.Flight_Number and Orders.Departure_Date > now order by Orders.Order_Number desc

    Environment.Value("iOrderNo") = RandomNumber.Value(1,15)

    DbTable("DbTable").SetTOProperty "Source", "Select * From Flights,Orders where Flights.Flight_Number = Orders.Flight_Number and Orders.Order_Number = " & Environment.Value ("iOrderNo")

     

  • QTP数据库验证点配置.udl

    2007-08-26 23:03:58

     

    solem.udl

    内容:

     

    [oledb]
    ; Everything after this line is an OLE DB initstring
    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=qcsiteadmin_db;Data Source=BWF-ZXF

  • QTP执行DOS调用脚本

    2007-08-26 14:04:14

     
     
    Dim oShell
    Set ōShell =CreateObject ("Wscrīpt.shell")
    oShell.run "cmd /K wscrīpt e:\test.vbs"
    Set ōShell = Nothing
  • LR中 Rand 几种实现。。

    2007-08-26 00:43:56

    Code 1:
    #include "web_api.h"
    Action()
    {
    char string[1024] ;
    char num[1024];
    int s; //定义变量S,目的是接收新生成的随机数
       int i;//循环变量
       char str[10];//定义数组接受整型变量转化为字符串的赋值
       for(i=0;i<=9;i++)//循环生成10个随机数
           {
           s=rand();//调用库函数,生成随机数
    //s=rand()%200; //限制随机数的范围最大为200.
    //s=rand()%100+200; //限制随机数的范围为200---300.
    // lr_output_message("s=%d",s);
         if (!itoa(s, str, 10))//将int型转为字符串
              {
               lr_output_message("Cannot convert i to  char");
              //lr_output_message("str=%s",str);
              }
             //sprintf (str, "log_%s.txt", str);
            lr_save_string(str,"num");//建立参数num接受转换过后的值
          // lr_output_message("num : %s", lr_eval_string("The row count is: {num}"));
                strcpy(string, "XXXX!!!");
                strcat(string,lr_eval_string("{num}"));
                lr_output_message("New String is :: %s",string);
            //获取参数值,并循环输出该参数的值
         }
     //lr_output_message("New file name %s", str);
    }
     
    Code 2:
    #include "web_api.h"
    Action()
    {
    char string[1024] ;
    char num[1024];
    int s; //定义变量S,目的是接收新生成的随机数
       int i;//循环变量
       char str[10];//定义数组接受整型变量转化为字符串的赋值
       for(i=0;i<=9;i++)//循环生成10个随机数
           {
           s=rand();//调用库函数,生成随机数
    //s=rand()%200; //限制随机数的范围最大为200.
    //s=rand()%100+200; //限制随机数的范围为200---300.
    // lr_output_message("s=%d",s);
          if (!itoa(s, str, 10))//将int型转为字符串
              {
               lr_output_message("Cannot convert i to  char");
              //lr_output_message("str=%s",str);
              }
    //sprintf (str, "log_%s.txt", str);
            lr_save_string(str,"num");//建立参数num接受转换过后的值
    // lr_output_message("num : %s", lr_eval_string("The row count is: {num}"));
             strcpy(string, "我是中国人!!!"); //copy后面的值给前面的字符串
             strcat(string,lr_eval_string("{num}"));//连接两字符串
    lr_output_message("New String is :: %s",string);
            //获取参数值,并循环输出该参数的值
            lr_save_datetime("%H:%M:%S", DATE_NOW + ONE_DAY, "next");
            lr_output_message(lr_eval_string("{next}"));
         }
    //lr_output_message("New file name %s", str);
    }
     
     
    Code3 :srand 函数
    #include "web_api.h"
    Action()
    {
    //srand is called before rand
     srand(time(NULL));
    /* Generate some random numbers */
    lr_output_message("A number between 0 and 100: %d\n", rand() % 100);
    lr_output_message ("A number between 20 and 30: %d\n", rand() % 10+20);
    return 0;
    }
     
     
    Code 4 : rand取系统时间连接
    #include "web_api.h"
    Action()
    { char next[1024];
    char string[1024] ;
    char num[1024];
    int s; //定义变量S,目的是接收新生成的随机数
       int i;//循环变量
       char str[10];//定义数组接受整型变量转化为字符串的赋值
       for(i=0;i<=9;i++)//循环生成10个随机数
           {
           s=rand();//调用库函数,生成随机数
    //s=rand()%200; //限制随机数的范围最大为200.
    //s=rand()%100+200; //限制随机数的范围为200---300.
    // lr_output_message("s=%d",s);
          if (!itoa(s, str, 10))//将int型转为字符串
              {
               lr_output_message("Cannot convert i to  char");
              //lr_output_message("str=%s",str);
              }
       //sprintf (str, "log_%s.txt", str);
            lr_save_string(str,"num");//建立参数num接受转换过后的值
            lr_save_datetime("%H%M%S", DATE_NOW + ONE_DAY, "next");
            lr_output_message("num : %s", lr_eval_string("The row count is: {num}"));
                    strcpy(string, lr_eval_string("{next}"));
            strcat(string,lr_eval_string("{num}"));
            lr_output_message("New String is :: %s", string);
            //获取参数值,并循环输出该参数的值
        }
        return 0;
    }
  • LR中常用的C函数(转Zee版)

    2007-08-26 00:15:50

    1        strcat

    char *strcat ( char *to, const char *from );

    功能:链接两个字符串。

    例子:

    这个例子是用strcat链接字符串:zee和slo@hotmail.com

    脚本如下:

         char test[1024], *a = "slo@hotmail.com";

         strcpy(test, "zee");

         strcat(test, a);

         lr_output_message("We can see %s",test);


    运行后在executon log中看到如下语句:

    Starting action Action.
    Action.c(16): We can see zeeslo@hotmail.com

    2        strchr
    char *strchr ( const char *string, int c );

    功能:返回字符串中指定字符后面的字符串。

    例子:

    这个例子是返回第一个出现e字符以后所有的字符,和最后一次出现e字符以后所有的字符。

    脚本如下:
         char *string = "Zee is a tester";
         char *first_e, *last_e;

         first_e = (char *)strchr(string, 'e');
         lr_output_message("We can see the first occurrence of e: %s",first_e);
         last_e = (char *)strrchr(string, 'e');
         lr_output_message("We can see the last occurrence of e: %s", last_e);

    运行后在executon log中看到如下语句:
    Starting action Action.
    Action.c(12): We can see the first occurrence of e: ee is a tester
    Action.c(14): We can see the last occurrence of e: er
    3        Strcmp&stricmp
    int strcmp ( const char *string1, const char *string2 );大小写敏感。
    int stricmp ( const char *string1, const char *string2 );大小写不敏感。

    功能:比较字符串。

    例子:

    按是否区分大小写对比两个字符串,并打印出它们的大小关系。

    脚本如下:
         int result;
         char tmp[20];
         char string1[] = "We can see the string:ZEE";
         char string2[] = "We can see the string:zee";

         result = strcmp( string1, string2 ); /*区分大小写,比较字符串 */

         if( result > 0 )
              strcpy( tmp, "大于" );
         else if( result < 0 )
              strcpy( tmp, "小于" );
         else
              strcpy( tmp, "等于" );

         lr_output_message( "strcmp: String 1  %s string 2", tmp );

         result = stricmp( string1, string2 ); /* 不区分大小写,比较字符串 */

         if( result > 0 )
              strcpy( tmp, "大于" );
         else if( result < 0 )
              strcpy( tmp, "小于" );
         else
              strcpy( tmp, "等于" );

         lr_output_message( "stricmp: String 1 %s string 2", tmp );     

    运行后在executon log中看到如下语句:
    Starting action Action.
    Action.c(22): strcmp: String 1  小于 string 2
    Action.c(33): stricmp: String 1 等于 string 2
       
    4        strcpy
    char *strcpy ( char *dest, const char *source );

    功能:复制一个字符串到另一个字符串中。

    例子:

    复制一个字符串到字符数组中,并打印出来。

    脚本如下:

         char test[1024];

         strcpy(test, "what can we see?       ");

         lr_output_message("%s", test);

    运行后在executon log中看到如下语句:
    Starting action Action.
    Action.c(10): what can we see?      
    5        Strdup
    char *strdup ( const char *string );

    复制一个字符串。

    例子:

    在这个例子中,Vuser的组名被转换为小写字母。但是lr_whoami把组名作为静态buffer返回。这样的buffer不能被操作。如果有操作需要,就复制这个静态buffer。

    脚本如下:

         int id;
         char *groupname_static, *groupname;

         /* 从VuGen中得到组名 */
         lr_whoami(&id, &groupname_static, NULL);
         lr_output_message("groupname=%s", groupname_static);

         /*复制这个静态组名以便我们可以操作它  */
         groupname = (char *)strdup(groupname_static);
         groupname = (char *)strlwr(groupname);
         lr_output_message("lower case groupname=%s", groupname);

         free(groupname);
    上述脚本用vugen保存为:CHANGE

    在controller中运行(设置为总是发送消息)
    运行后在log中看到如下语句:
    Starting action Action.        [MsgId: MMSG-15919]
    Action.c(11): groupname=CHANGE        [MsgId: MMSG-17999]
    Action.c(16): lower case groupname=change        [MsgId: MMSG-17999]

    6        Strlen
    size_t strlen ( const char *string );

    功能:返回字符串长度(bytes).

    例子:

    这个例子很简单,就是得到一个字符串中的字符的个数。然后打印出来。

    脚本如下:

         char *str = "Zee is a tester";
         unsigned int len;

         len = strlen(str);

         lr_output_message("The  sentence has %d letters",len);

    运行后在log中看到如下语句:
    Action.c(13): The  sentence has 15 letters
    7        Strncat
    char *strncat ( char *to_string, const char *from_string, size_t n );

    把一个字符串连接到另一个字符串后面。

    例子:

    在这里,我随便写了两个字符串,用此函数把他们连接起来,并打印出来。

    脚本如下:


       char str1[]="Zee is ";
        char str2[]="a tester.";
        lr_output_message("What can we see?");
        lr_output_message("The str1 is %s.",str1);

        strncat(str1,str2,20);
    lr_output_message("The str1 is %s.",str1);


    运行后在log中看到如下语句:
    Action.c(9): What can we see?
    Action.c(10): The str1 is Zee is .
    Action.c(13): The str1 is Zee is a tester..
    注:我们可以看到,没有连接前的str1是:Zee is,连接后的字符串是:Zee is a tester。也可以看看strcat函数。
    8        strncmp
    int strncmp ( const char *string1, const char *string2, size_t n );

    对比两个字符串的前n位。

    例子:

    对比两个字符串,并把对比结果打印出来。这里我和上面的strcmp一起写。

    脚本如下:

        char result;
        char str1[]="Zee is a tester.";
        char str2[]="Zee is a tester.";
        char str3[]="zee is a tester?";
       
        result = strcmp(str1,str2);

        if(result > 0)
             lr_output_message("str1 is greater than str2.");
        else if(result < 0)
             lr_output_message("str1 is less than str2.");
        else
             lr_output_message("str1 is equal to str2.");
       
        result = strncmp( str1, str3 , 30);


        if(result > 0)
             lr_output_message("str1 is greater than str3.");
        else if(result < 0)
             lr_output_message("str1 is less than str3.");
        else
             lr_output_message("str1 is equal to str3.");

    运行后在log中看到如下语句:
    Starting iteration 1.
    Starting action Action.
    Action.c(18): str1 is equal to str2.
    Action.c(28): str1 is less than str3.

  • LR录制方式的区别(URL和HTML)转)

    2007-08-25 22:04:57

    1、基于浏览器的应用程序推荐使用HTML-Based scrīpt。
    2、不是基于浏览器的应用程序推荐使用URL-Based scrīpt。
    3、如果基于浏览器的应用程序中包含了Java scrīpt并且该脚本向服务器产生了请求,比如DataGrid的分页按钮等,也要使用URL-Based scrīpt方式录制。
    4、基于浏览器的应用程序中使用了HTTPS安全协议,使用URL-Based scrīpt方式录制。
    5、录制过程中不要使用浏览器的“后退”功能,LoadRunner对其支持不太好。
  • SQL 获取日期(转)

    2007-08-25 21:53:49

    一个月第一天的SQL 脚本

    一个月第一天的SQL 脚本:

         Select DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)

    本周的星期一

         Select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)

    一年的第一天

         Select DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)

    季度的第一天

         Select DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)

    当天的半夜

         Select DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)

    上个月的最后一天

          Select dateadd(ms,-3,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0))

     
     

    去年的最后一天

         Select dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate()), 0))

     

    本月的最后一天

         Select dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate())+1, 0))

     

    本年的最后一天

         Select dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate())+1, 0))

     

    本月的第一个星期一

         select DATEADD(wk, DATEDIFF(wk,0,                           

                    dateadd(dd,6-datepart(day,getdate()),getdate())  

                                                     ), 0)      

  • 字符倒序 C

    2007-08-19 13:15:35

    #include<stdio.h>
    #include<string.h>
    main()
    {
    char str[100];
    int n;
    printf("input string:");
    gets(str);
    n=strlen(str);
    for(;n>=0;n--)
    printf("%c",str[n]);
    getch();
    }
  • C 冒泡排序

    2007-08-19 11:26:25

    #include <stdio.h>
    void main()
    {
     int i, n=10, j, m;
     int a[]={18,65,49,72,88,5,36,22,30,56};
     printf("\nThese integers are as below:\n\n");
     for (i=0; i<n; i++)
     {
      printf("%6d",a[i]);
      if ((i+1)%10==0)
       printf("\n");
     }

     for (i=1; i<n; i++)
     {
      for (j=0; j<n-i; j++)
      {
       if (a[j]>a[j+1])
       {
        m=a[j];
        a[j]=a[j+1];
        a[j+1]=m;
       }
      }
     }

     printf("\nThe sorted integers:\n\n");
     for (i=0; i<n; i++)
     {
      printf("%6d",a[i]);
      if ((i+1)%10==0)
       printf("\n");
     }
    }


     

  • Status-Code

    2007-08-15 15:57:01

    1xx : 信息响应类,表示接收到请求并且继续处理
    2xx : 处理成功响应类,表示动作被成功接收、理解和接受
    3xx : 重定向响应类,为了完成指定的动作,必须接受进一步处理
    4xx : 客户端错误,客户请求包含语法错误或者是不能正确执行
    5xx : 服务端错误,服务器不能正确执行一个正确的请求
  • 事先3项准备

    2007-08-13 17:32:11

    面试在求职过程中,可以说是压力最大的一个环节。面对外国老板连珠炮似的提问,如果能回答得从容不迫、简明扼要,恰当中肯,而且合乎老外的口味,那么肯定会大大增加你的录取机会。

    事先3项准备

    1. 对目标公司所在地、规模、在全球的活动概况等要事先有所了解,包括总公司在国内设立分公司的时间、业绩表现、经营规模,以及今后打算开展的业务等,若能得到业界的评价更好。如无法得到书面资料,也要设法从该公司或其他同业中获得情报。

    2. 面试时自我介绍内容应强调应征的动机以及想应征的岗位,因此收集好相关岗位的情报,自我介绍时才能胸有成竹,切合主题。

    3. 准备好所有证书材料,譬如与专业能力相关的证书,或参加培训的资料,最好和应征职务有直接关联,不但可证明自己在这一方面所做的努力,也表示具有这个潜能。

    谈吐3P原则

    自我介绍时应该记住“3P原则”:Positive(自信),Personal(个性),Pertinent(中肯)。

    谈吐自信,就是要积极地进行自我肯定,让面试人充分了解你的优点与潜能。突出个性,就是要把自己与众不同的特点发挥出来,强调自己的专业与能力。语气中肯,就是要实事求是,不要言过其实,夸夸其谈,也不要涉及和自己无关的事情。

    自我介绍应简洁明了,给面试人留下思路清晰、反应快捷、逻辑性强的印象。自我介绍时间不宜太长,话不宜太多,最好控制在五分钟之内。不要一谈起自己就口若悬河,滔滔不绝,以免言多语失。另外,在自我介绍时应避免过多地使用“I”(我),不要每个句子一开头就冒出一个“I”字,给人留下自我标榜、以自我为中心的印象。

    灵活的应聘者往往会把“我”开头的话,变成“你”字打头。例如,面试人说:Would you please say something about yourself?(请你谈谈自己的情况好吗?)应聘者则说:Do you want me to talk about my personal life or to say something about the job?(你想让我谈谈我个人的生活呢,还是与这份工作有关的问题?)这样,你的谈话就把面试人摆了进去。这种谈话的方式所产生的效果是不言而喻的。面试毕竟是面试人与应聘者互相沟通的一种场合,应聘者时常把面试人摆进自己的谈话当中去,自然而然就起到了互相沟通的作用。

    围绕3方面表现

    回答问题时口齿要清晰、语调适中。内容要有条理、避免重复。介绍工作经历采用倒序,从最近一份工作谈起,着重强调有利于新工作的职务经历。最好能说明曾担任何种职务、实际成绩、业绩等,以及自己的工作对原来公司的影响。凡和此次应征不相关的内容,尽量避免提及。话题紧扣以下3方面来展现自己的优势。

    1. 能力。当你知道招聘单位目前急于用人时,首先把自己的专长讲足说够,然后顺理成章地得出结论:I think your unit needs a man like me.(我想,贵单位需要象我这样的人才。)用这样的句式,让面试人认为你是站在他们的立场上说话,在替他们的发展考虑问题,于是更容易接受你。陈述自己的任职资格时,可以这么开头:Im qualified for the job because……(我能胜任这项工作,是因为……)接着陈述理由。当面试人在审视你究竟能不能胜任此职时,参照的标准已不再是他心目中的标准,而是你列举的理由。

    2. 业绩。外国公司面试喜欢用事实说话,为了证明你的能力,你可以把过去的经历联系起来,说明你曾经为以前的公司解决过跟现在雇主所面临的类似问题:I explored Shanghai market and sold 50,000 sets in one year.(我开发了上海市场,一年销售出去5万套。)

    3. 诚意。某个问题发表完见解之后,可以附带加上一句:Id like to hear your opinion.(我很想听听你的意见。)这句话表明了你对面试人的尊敬,很容易使他(她)产生亲切感。当面试人在试探你的应聘诚意时,应该及时表态:So far as that is concerned, you must have understood my determination.(谈到这里,您一定已经明白我的决心。)问些与工作内容相关的问题,能表现你对这份工作的兴趣。如:What other responsibilities do you think this job will include? (您觉得这份工作所包含的职责还有哪些?)

  • 面试对策

    2007-08-13 17:31:18

    听起来很可怕的东东.第一次去面试的人确实会觉得可怕.

    这里我们就来好好学习一下英语面试中会遇到的各种各样的问题:

    其中最难回答的莫过于薪水和跳槽原因等问题的回答.确实是很尴尬的问题

    1,如何应对薪水的提问

    面试的时候,薪水期望是不可避免要被问到的问题。回答的太直接、要求的太高可能会让公司对你望而却步,要求的太少又会让自己难以实现理想的薪水目标。那么,该如何回答这样的问题呢?下面两个案例可以给您一些启发。

    Case One

    Interviewer: I\'d like to know the salary you expect.

    我想了解一下,你期望的薪水是多少?

    Applicant: My salary requirement may be too high, and I hope my primary will not be lower than RMB 4,000. First, I think I am an excellent graduate. Though there will be a transition period, I will soon make profits for the company. What\'s more, I think if a company is willing to pay a high salary for a post, it also indicates its importance. And only in this situation can I be convinced that I can get more learning opportunities and better prospects.

    我的薪酬要求可能偏高,我希望我的起薪不低于4000元。首先我认为自己是一名优秀的大学毕业生,虽然刚到企业需要一段过渡期,但很快我就能为企业创造价值。而且,我也认为,一个企业如果可以开出较高的薪水,可以证明企业对这个职位的重视度。在这样的情况下,我才有信心能从企业获得更多的学习机会和更好的发展机遇。

     

    Case Two

    Interviewer: I\'d like to know your salary expectations.

    我想了解一下,你期望的薪水是多少?

    Applicant: Since I am a recent graduate , there will be a transition period after I enter the company. So at the beginning, the profits I make for the company will be limited and I don\'t have specific requirements. But man has to survive. So I hope the salary will be enough to help me to be economically independent from my parents.

    因为我是一个刚毕业的大学生,进入企业将有一段时间的适应期,一开始为企业创造的价值有限,所以我对薪金没有特定的要求。但人总是要生存的,所以,我希望我的薪金能够让我独立,在经济上不再依赖父母。

     

    面试:如何回答工作期望问题

    工作期望是面试中一个必问问题之一。通常面试官都会问你想从工作中的到什么,或是你三到五年内的计划。那么,该如何回答这样的问题呢?下面两个案例会给你一点启示。

     

    Case One

     

    Interviewer: What do you want most from your work?

    你最希望从工作中得到什么?

     

    Applicant: I hope to get a kind of learning, to get skills from my work. Though I have studied in school for nearly 16 years, I have only learned knowledge. In the university, I got no chance to see real life and didn\'t get working skills. So I want to learn some working skills and become a professional in an industry.

    我最希望得到的是一种学习,能让我学到工作的技能。虽然我已经在学校学习了快16,但只是学习到了知识,在学校里,没有机会接触到真正的社会,没有掌握一项工作技能,所以我最希望获得一项工作的技能,能够成为某一个行业领域的专业人士。

     

    Interviewer: Why did you choose us?

    你为什么选择到我们公司来应聘?

     

    Applicant: As the saying goes, "well begun is half done". Your company is a famous one in the industry and boasts a high reputation. I hope to choose your company as the beginning of my career. I can not only learn new things, but set a solid foundation for my future career as well.

    俗话说"良好的开端是成功的一半"。贵公司是行业内的知名公司,享有很高的声誉。我希望选择贵公司作为事业的开端,不仅可以学到新东西,而且为我将来的发展打下良好的基础。

     

    Case Two

     

    Interviewer: What do you hope this job will give you?

    你最希望这份工作给予你什么?

    Applicant: I hope this job will give me a chance to take responsibility. In more than ten years\' of study as a student, I have never taken any responsibility in any real sense or earned money for a company. I think people can only become mature by taking on responsibility. I hope this work will give me the chance to develop fully.

    我希望这份工作可以给我一个承担职责的机会。在过去十几年的学习生涯中,作为一名学生,我从来没有在真正意义上承担过责任,为一个企业盈利。我认为,人是通过承担一定的责任才能成长、成熟的,我希望这份工作能够给予我发展的机会。

     

    以上例子从学习和承担职责的角度出发,都十分注重能力的培养,这会让面试官觉得求职者不是一个功利心很强的人,给面试官留下好印象。

     

     

     

    面试:如何应对角色扮演的问题

    角色扮演是各大外企招聘时经常采用的方式之一。回答这类问题的要点是应聘者一定要设身处地、把自己当作角色中的人物。另外,基于任何角色提出的问题根本的目的是要考察应聘者对公司的态度,所以在角色扮演时,要把自己想象成该角色,也要站在全公司的角度来考虑问题,所谓大处着眼、小处着手,方能立于不败之地。

    Case One

    Interviewer: You are a director of our company and you are in charge of a project. There are six people in the project team. Due to different opinions, the team is split into two parts at a meeting and they are debating ferociously. At this time, as a leader, what will you do to coordinate the two parts? If the two parts disagree, what will you do then?

    如果你已经成为我公司的一名主管,由你负责管理一个项目。在该项目的团队中一共有六个人。在一次会议上,由于观点不同,团队分成两派,,进行了激烈的争论,这时,你作为领导者该如何协调?如果两方不能达成共识,你又会怎么办?

     

    Applicant: First, I will listen to both sides carefully, and make my own judgment. If I prefer one side, I will give facts and data to persuade the other side. If my opinion is between the two sides, I will also give facts and data to prove my opinion right. It is better that the two sides will agree on it. If not, I will stick to my opinion and allow the colleagues who keep reserved opinions to give more data and communicate with me. In short, my principle is that everything should be based on data and facts. Every colleague has the right to express his opinion. I will try my best to make all people agree on one thing. If I fail, I will make my decision, as a leader.

    首先我会仔细聆听双方的观点和理由,并作出我的判断。如果我倾向于其中一方的观点,我会拿出数据和事实来说服另一方;如果我的观点是介于两者之间,我同样会基于数据和事实来证明我的立场。如果最后大家能够达成共识自然最好。如果不能,我会坚持我的观点,但允许持保留意见的同事拿出更多的数据来和我沟通。总之,我的原则是,用数据和事实说话,每一位同事都有权表达他的观点,我会尽量让大家达成共识。如果不行,那作为领导者,我会做出一个决定。

     

    点评:该求职者能够基于数据和事实说话,既不是独断专行,也不做和事老,这充分表现了他处理问题的成熟程度。

     

    Case Two

    Interviewer: You are now a team member and if your leader has made a decision but you don\'t quite agree with this decision and other members don\'t express any special opinions, what will you do?

    如果你现在是一个项目的团队成员,如果你的领导已经作出了一个决定,但你个人对这个决定不十分赞同,而其他的成员没有表达特别的意见,那你会怎么做?

     

    Applicant: If my leader has made a decision, but I myself don\'t quite agree with this decision and other members don\'t express any special opinion, I will still express my opinion. If the leader doesn\'t agree with me, I will make my own judgment. If this decision isn\'t very important, then as a team member, I will act according to what the leader has decided. If this is a key decision, I will gather related information to support my view and try to persuade my leader.

    如果我的领导已经做出了一个决定,但我个人对这个决定不十分赞同,而其他的成员没有表达特别的意见,这时候问我仍然会提出我的意见。如果领导不同意,那我会做出自己的判断。如果我们这个决定并不是十分重要的,那么作为团队成员,我会遵照领导的决定来执行;如果是一个关键的决定,我会搜集相关的材料为我自己的观点寻找支持,力求说服领导。

     

    点评:虽然只是一个团队成员,但该求职者仍然能够大胆地提出自己地意见,并且能够就问题做出理性的判断,能够让面试官觉得该求职者是真正站在公司的立场上看待问题,并且体现了他处理问题的成熟性。

     

    面试对策:通用类问题

    是不是为即将到来的英语面试发愁呢?不知道考官会出什么为题?不知道该怎样应对?小编这里为你收集了一些面试中常常问到的各方面、各领域的问题,归纳成五类、供大家参考。今天我们来看看通用类问题。

    1. Tell me about yourself!

    对策:Keep your answer to one or two minutes; don\'t ramble. Use your resume summary as a base to start from..

    2. What do you know about our company?

    对策:Do your homework before the interview! Spend some time online or at the library researching the company. Find out as much as you can, including products, size, income, reputation, image, management talent, people, skills, history and philosophy. Project an informed interest; let the interviewer tell you about the company.

    3. Why do you want to work for us?

    对策:Don\'t talk about what you want; first, talk about their needs: You would like to be part of a specific company project; you would like to solve a company problem; you can make a definite contribution to specific company goals.

    4. What would you do for us? What can you do for us that someone else can\'t?

    对策:Relate past experiences that show you\'ve had success in solving previous employer problem(s) that may be similar to those of the prospective employer.

    5. What about the job offered do you find the most attractive? Least attractive?

    对策:List three or more attractive factors and only one minor unattractive factor.

    6. Why should we hire you?

    对策:Because of your knowledge, experience, abilities and skills.

    7. What do you look for in a job?

    对策:An opportunity to use your skills, to perform and be recognized.

    8. Please give me your definition of a .... (the position for which you are being interviewed).

    对策:Keep it brief -- give an action- and results-oriented definition.

    9. How long would it take you to make a meaningful contribution to our firm?

    对策:Not long at all -- you expect only a brief period of adjustment to the learning curve.

    10. How long would you stay with us?

    对策:As long as we both feel I\'m contributing, achieving, growing, etc.

    面试对策:管理类问题

    应聘管理人员职务的时候,面试官肯定会问到你的管理经验和方法,该如何回答这类问题呢?下面就给大家提供一些对策。

    1. You may be overqualified for the position we have to offer.

    对策:Strong companies need strong people. A growing, energetic company is rarely unable to use its employees\' talents. Emphasize your interest in a long-term association, pointing out that the employer will get a faster return on investment because you have more experience than required.

    2. What is your management style?

    对策:(If you\'ve never thought about this, it\'s high time you did.) "Open-door management" is best... And you get the job done on time or inform your management.

    3. Are you a good manager? Give an example. Why do you feel you have top managerial potential?

    对策:Keep your answer achievement- and task-oriented; emphasize management skills -- planning, organizing, interpersonal, etc.

    4. What do you look for when you hire people?

    对策:Skills, initiative, adaptability.

    5. Did you ever fire anyone? If so, what were the reasons and how did you handle it?

    对策:Give a brief example of a time when you faced this, and stress that it worked out well.

    6. What do you see as the most difficult task in being a manager?

    对策:Getting things planned and done on time within the budget.

    7. What do your subordinates think of you?

    对策:Be honest and positive...they can check your responses easily.

    8. What is your biggest weakness as a manager?

    对策:Be honest and end on a positive note, e.g. "I don\'t enjoy reprimanding people, so I try to begin with something positive first."

     

    面试对策:离职和跳槽

    春节后刮起了“跳槽风”,既然是换工作,那面试的时候不可避免要被问到为什么会离职以及关于以前公司的一些事情,这时该如何回答才合适呢?下面就给您提供一些对策。

    1. Why are you leaving your present job?

    对策:Refine your answer based on your comfort level and honesty. Give a "group" answer if possible, e.g. our department was consolidated or eliminated.

    2. How do you feel about leaving all of your benefits?

    对策:Concerned but not panicked.

    3. Describe what you feel to be an ideal working environment.

    对策:One in which people are treated as fairly as possible.

    4. How would you evaluate your present firm?

    对策:It\'s an excellent company that afforded me many fine experiences.

     

    面试对策:经验与业绩

    对于换工作的人士来说,面试时几乎不可避免都会被问到工作经验与业绩。对于这类问题的回答,下面给您一些tips

    1. How have you helped increase sales? Profits?

    对策:Explain in some detail, citing figures and specific examples.

    2. Have you helped reduce costs? How?

    对策:Describe in some detail with specifics.

    3. How much money did you account for?

    对策:Give examples as to your responsibilities. Explain how the budget was determined, and your role in overseeing your department\'s portion.

    4. How many people did you supervise on your last job?

    对策:Explain the structure of your department and your role as manager.

    5. Do you like working with figures more than words?

    对策:Be honest but positive.

    6. In your current or last position, what features did you like the most? Least?

    对策:Be honest but put a positive spin on your least favorite duties.

    7. In your current or last position, what are or were your five most significant accomplishments?

    对策:Explain in some detail, citing figures and specific examples if needed. Don\'t take too much time.

    面试对策:针对简历的问题

    面试的时候,面试官都会针对你的简历提出一些问题。下面就为大家提供一些应对此类问题的对策。

    1. Why haven\'t you found a new position before now?

    对策:Finding a job is easy; finding the right job is more difficult. Stress that you are being selective, and are looking for the right "fit".

    2. Had you thought of leaving your present position before? If so, what do you think held you there?

    对策:Explain that your job is no longer challenging and that you feel your talents are best used elsewhere.

    3. What do you think of your boss?

    对策:Be as positive as you can, even if you don\'t really believe it.

    4. Would you describe a situation in which your work was criticized?

    对策:Be as positive as you can and emphasize what you learned from the situation.

    5. What other types of jobs or companies are you considering?

    对策:Keep your answer related to this company\'s field, and don\'t give out specific company names.

    面试对策:工作习惯与方式

    工作习惯与方式方面的问题也是面试中常常会问到的,比如问你能否在压力下工作、能否接受加班等等。对于这类问题的回答,下面给大家提供一些tips

    1. If I spoke with your previous boss, what would he say are your greatest strengths and weaknesses?

    对策:Emphasize your skills, and don\'t be overly negative about your weaknesses. It\'s always safer to identify a lack of a skill as an area for improvement rather than a shortcoming.

    2. Can you work under pressures, deadlines, etc.?

    对策:Yes, it\'s a way of life in business. Be sure to cite examples of your success.

    3. How have you changed the nature of your job?

    对策:Explain how you have improved the efficiency, productivity, and the like.

    4. Do you prefer staff or line work? Why?

    对策:It depends on the job and its challenges.

     

    5. In your present position, what problems have you identified that had previously been overlooked?

    对策:Keep it brief and don\'t brag.

    6. Do you feel you might be better off in a different size company? Different type company?

    对策:It depends on the job -- elaborate slightly.

    7. How do you resolve conflict on a project team?

    对策:Explain that communication is important, and that you would first you discuss the issues privately.

    8. What was the most difficult decision you ever had to make?

    对策:Try to relate your response to the prospective employment situation.

     

    面试对策:薪资问题

    薪资问题是个比较棘手的问题,说得多了恐怕公司不能支付、也不会雇用你,说得少了又离实现自己的目标太远。因此建议各位在求职之前要好好研究一下该行业和职位的工资水平。现在网上晒工资的人很多,你会找到你想要的数据的,以此作为谈判的基础,就会容易的多。

    1. How much are you looking for?

    对策:Answer with a question, e.g., "What is the salary range for similar jobs in your company?" If the interviewer doesn\'t answer, then give a range of what you understand you are worth in the marketplace.

    2. How much do you expect, if we offer this position to you?

    对此:Be careful; the market value of the job may be the key answer, e.g., "My understanding is that a job like the one you\'re describing may be in the range of ______."

    3. What kind of salary are you worth?

    对策:Have a specific figure in mind... don\'t be hesitant.

    面试对策:性格问题
    关于性格的问题是面试中可能会被问到的问题之一。下面是一些如何回答此类问题的对策。
    1. Do you generally speak to people before they speak to you?
    对策:It depends on the circumstances.
    2. What was the last book you read? Movie you saw? Sporting event you attended?
    对策:Talk about books, sports or films to show that you have balance in your life.
    3. What is the toughest part of a job for you?
    对策:Be honest. Remember, not everyone can do everything.
    4. Are you creative?
    对策:Yes. Give examples that relate to your current job.
    5. How would you describe your own personality?
    对策:Balanced is a good word to use, but remember the type of company you are interviewing at. Some companies may want someone who is aggressive and a go-getter.
    6. Are you a leader?
    对策:Absolutely! Cite specific examples using your current job as a reference point.
    7. What are your future goals?
    对策:Avoid, "I would like the job you advertised." Instead, give long-range goals.
    8. What are your strengths?
    对策:Present at least three and relate them to the company and job you are interviewing for.
    9. What are your weaknesses?
    对策:Don\'t say that you don\'t have any. Try not to cite personal characteristics as weaknesses, but be ready to have one if the interviewer presses. Turn a negative into a positive answer: "I am sometimes intent on completing an assignment and get too deeply involved when we are late."
    面试对策:职业目标
    有关职业目标的问题是面试中常常会被问到的问题之一,对于此类问题的回答可不要按照自己的想法"直抒胸臆",而是应该和你应聘的行业和职位结合起来。
    1. If you could start your career again, what would you do differently?
    对策:Nothing ... I am happy today, so I don\'t want to change my past.
    2. What career options do you have at the moment?
    对策:"I see three areas of interest..." Relate those to the position and industry.
    3. How would you describe the essence of success? According to your definition of success, how successful have you been so far?
    对策:Think carefully about your answer and relate it to your career accomplishments.

     

  • 实用。。

    2007-08-13 17:30:08

    Question: Why are you wanting to leave your current job?

    Answer: There is no room for the kind of career growth and advancement I would like.

    问:你为什么要离开目前这份工作?

    答:那里缺乏一个让我在事业上成长和晋升的空间。

    Q:What kind of opportunities are you looking for?

    A:I am looking for a company who recognizes and rewards hard work.

    问:你所寻找的是什么样的机会?

    答:我希望找到能认同并酬劳辛勤工作的公司。

    Q:what is your biggest accomplishment on the job?

    A:I think it would have to be building team spirit among my co-workers.

    问:你在工作上取得的最大成就是什么?

    答:我认为是我在同事之间建立起了团队精神。

    Q:How did you do that?

    A:It was a gradual process,involving many factors.

    问:你是怎么做到的呢?

    答:那时一个渐进过程,牵涉到很多因素。

    Q:Why do you want to be a part of our organization?

    A:I think it will be a mutually beneficial relationship.

    问:你为什么想加入我们公司?

    答:我的加入对双方都有利。

    Q:How so?

    A:I think this company and I have a lot to offer each other.

    问:怎么说?

    答:我认为贵公司与我都有许多东西可以彼此提供。

    Q:Why should we hire you?

    A:Because I am a hard worker and will perform to the best of my abi1ity.

    问:我们为什么应该雇佣你呢?

    答:因为我工作刻苦,而且会竭力得去做。

    Q:Do you know what’s involved in a job like this?

    k Yes,I know what’s involved.

    :你知道这样的工作需要付出什么样的心力吗?

    答:是的,我知道要付出什么。

     

    Q Can you sell yourself in two minutes Go for it. (你能在两分钟內自我推荐吗?大胆试试吧!) 

    A With my qualifications and experience, I feel I am hardworking, responsible and diligent in any project I undertake. Your organization could benefit from my analytical and interpersonal skills.(依我的资格和经验,我觉得我对所从事的每一个项目都很努力、负责、勤勉。我的分析能力和与人相处的技巧,对贵单位必有价值。) 

     

    QGive me a summary of your current job descrīption. (对你目前的工作,能否做个概括的说明。) 

    AI have been working as a computer programmer for five years. To be specific, I do system analysis, trouble shooting and provide software support. (我干了五年的电脑程序员。具体地说,我做系统分析,解决问题以及软件供应方面的支持。) 

     

    QWhy did you leave your last job(你为什么离职呢?) 

    A Well, I am hoping to get an offer of a better position. If opportunity knocks, I will take it.(我希望能获得一份更好的工作,如果机会来临,我会抓住。) 

    AI feel I have reached the "glass ceiling" in my current job. / I feel there is no opportunity for advancement. (我觉得目前的工作,已经达到顶峰,即沒有升迁机会。) 

     

    QHow do you rate yourself as a professional(你如何评估自己是位专业人员呢?)

    A With my strong academic background, I am capable and competent. (凭借我良好的学术背景,我可以胜任自己的工作,而且我认为自己很有竞争力。) 

    AWith my teaching experience, I am confident that I can relate to students very well. (依我的教学经验,我相信能与学生相处的很好。) 

     

    Q What contribution did you make to your current (previous) organization(你对目前/从前的工作单位有何贡献?) 

    A I have finished three new projects, and I am sure I can apply my experience to this position. (我已经完成三个新项目,我相信我能将我的经验用在这份工作上。) 

     

    QWhat do you think you are worth to us(你怎么认为你对我们有价值呢?)

    AI feel I can make some positive contributions to your company in the future. (我觉得我对贵公司能做些积极性的贡献。) 

     

    QWhat make you think you would be a success in this position (你如何知道你能胜任这份工作?) 

    AMy graduate school training combined with my internship should qualify me for this particular job. I am sure I will be successful. (我在研究所的训练,加上实习工作,使我适合这份工作。我相信我能成功。) 

     

    QAre you a multi-tasked individual(你是一位可以同时承担数项工作的人吗?) or 

    Do you work well under stress or pressure(你能承受工作上的压力吗?) 

    AYes, I think so. 

    AThe trait is needed in my currentor previous) position and I know I can handle it well. (这种特点就是我目前(先前)工作所需要的,我知道我能应付自如。) 

    QWhat is your strongest trait(s)(你个性上最大的特点是什么?)

    AHelpfulness and caring.(乐于助人和关心他人。) 

    AAdaptability and sense of humor.(适应能力和幽默感。) 

    ACheerfulness and friendliness.(乐观和友爱。) 

     

    Q How would your friends or colleagues describe you?(你的朋友或同事怎样形容你?) 

    A (pause a few seconds) (稍等几秒钟再答,表示慎重考虑。) 

    They say Mr. Chen is an honest, hardworking and responsible man who deeply cares for his family and friends. (他们说陈先生是位诚实、工作努力,负责任的人,他对家庭和朋友都很关心。)

    AThey say Mr. Chen is a friendly, sensitive, caring and determined person. (他们说陈先生是位很友好、敏感、关心他人和有决心的人。) 

     

    QWhat personality traits do you admire(你欣赏哪种性格的人?) 

    A (I admire a person who ishonest, flexible and easy-going. (诚实、不死板而且容易相处的人。) 

    A (I like) people who possess the "can do" spirit. ("实际行动"的人。)

    QWhat leadership qualities did you develop as an administrative personnel(作为行政人员,你有什么样的领导才能?)

    AI feel that learning how to motivate people and to work together as a team will be the major goal of my leadership. (我觉得学习如何把人们的积极性调动起来,以及如何配合协同的团队精神,是我行政工作的主要目标。) 

    AI have refined my management style by using an open-door policy. (我以开放式的政策,改进我的行政管理方式。)

     

  • 六个经典的英语面试问题

    2007-08-13 17:27:13

    1. "work experience" is the type of work you've done in the past. If you haven't started working yet you can say "Right now I'm still a student." or "I'm a recent grad and Ihaven't started working yet." In the second sentence, "recent grad" is short for "recent graduate" and means that you have jusfinished school.
      请告诉我你过去的工作经验,工作经验就是你过去所做的工作。如果尚未开始工作,就可以回答“Right now I'm still a student.”(现在我还是个学生。)或者说“I'm a recent grad and I haven't started working yet.”(我刚刚毕业,还没有开始工作。)“recent grad”“recent graduate”的缩写,意思是刚刚毕业。
     2.Second One: What's your greatest weakness?
    This is a popular question that western employers like to ask to make candidates nervous! In fact, they ask this to know how you respond to a difficult question. You shouldn't answer by telling your greatest weakness since you might not get the job! Instead, you can tell them something that isn't directly related to the job position.
      你最大的缺点是什么?西方老板特别爱问这个问题,让面试者感到很紧张。事实上,他问这个问题是看你对棘手问题的反应。你没必要如实回答你的弱点,因为那有可能让你得不到这份工作。相反,你可以告诉他们一些与工作不直接相关的事情。
     3. Third One: Why do you feel you are qualified for this job?
      This question is a good opportunity to brag a little bit. You should talk about some extra skills you have that maybe wasn't included in your resume, or talk about your greatest strength in more detail.
      你为什么觉得自己胜任这份工作?这时候你要充分发挥你的自夸本领。你可以讲述一些简历资料里面没有包括的技能;或者是再详细强调一下你的特长
     4.Fourth One: What kind of salary did you have in mind?
      Salary is how much money you earn, usually per year. When asked this, it's best to answer with a salary range or approximation and not an exact figure. This shows that you are familiar with the industry if you know what the approximate salary should be.
      你期望的薪水是多少?“salary”就是你赚多少钱,通常是年收入。回答这个问题时,最好说出一个大致范围,而不是一个确切的数字。如果你能说出这个工资范围,那就说明你对此行业非常了解。
     5.Fifth One: If hired, when could you start work?
      When answering this it's best not to say you can start right away. This might make you seem very desperate for a job. A safe answer would be "I can start at the beginning of next month."
      如果雇佣的话,你什么时候开始工作?回答这个问题时。一定要注意!不要说我马上可以工作。那会让对方认为你非常迫切地需要这份工作。一个非常保险的回答可以是“I can start at the beginning of next month.”(我下月初可以开始上班。)
     6. Sixth One: What kind of work does the posi-tion involve?
      You can ask this to clarify exactly what kind of work you'll be doing.
      这个职位包括哪些工作?通过问这句话,你可以清楚地了解到你的工作内容。

1032/6<123456>
Open Toolbar