Wei's profilew3ishi's blogPhotosBlogLists Tools Help

Wei Shi

Occupation
Location
email:w3ishi@gmail.com
msn:williamshi@hotmail.com
skype:w3ishi@gmail.com

w3ishi's blog

1/19/2009

Stay Hungry. Stay Foolish.

"你们的生命都有限,所以不要把时间浪费在他人的意愿上。不要被条条框框束缚,否则你就生活在他人思考的结果里。不要让他人的叽叽歪歪淹没了你内在的声音。最重要的是,要有遵从你的内心和直觉的勇气,他们常常最知道你想做什么。其他都是次要的。"
上面的文字是2006年从其它网站摘录下来并拷贝到我这里的,Steve Jobs的一篇演讲文稿(http://w3ishi.spaces.live.com/blog/cns!8DF952E0F550489C!113.entry)。当时我在这篇文章上做了一个独一无二的标记:"...不要让他人的叽叽歪歪淹没了你内在的声音...",“叽叽歪歪”其实是我自己加上的,Steve Jobs恐怕从没有说过这么没文化的话:) 但这个词多少也代表了当时自己的想法。想看中英文对照并且有视频的版本可以在http://www.rubik.com.cn/steve_jobs.htm找到。
 
我已经回到天津,在做一些自己认为有责任去做的事,并不是为了钱。当然,有钱赚是一件好事,但更多的是一种责任。我想,每一个“真正”投身于这个行业中的同行都有自己心目中的英雄,都明白我所说的“责任”是什么,我为能有你们这些同行而感到骄傲,大家都在用自己青春和汗水去兑现着这种责任,其中的味道恐怕只有我们自己才知道。能力越大,责任也就越大。既然有这种能力就应该去做些什么,而不是浪费掉。其实每个人都有这种能力,每个人都可以成为英雄,前提是敢于承担这种责任。
 
一切都在按预计的进行,虽然麻烦和困难不断出现。感谢关心我的朋友,我过得还好。
 
祝各位朋友新年快乐!
5/12/2008

PS3上成功安装Linux

前些日子买了台40g版的ps3,将硬盘升级为120g后又安装了linux,使用的是ydl6.0发行版。安装过程并没有什么特别,关于安装前对主机的设置,ydl的安装手册上也有说明。

PS3使用的是IBM Cell BE处理器,由一个PPE和8(ps3上禁用了一个,所以只剩下7个可用的。)个SPE组成。PPE其实就是一颗双核3.2GHz的 PowerPC处理器。每个SPE包括:一个SPU,一个私有内存空间(256K),128个寄存器,每个寄存器128位,一个MFC(memory flow controller)。

尝试着写了一些程序,初步印象感觉和在linux上使用affinity是差不多的,通过spe_create_thread()派生出指定绑定在某个spe上的线程。

编译步骤需要注意的有:

1.spe的入口程序使用spu-gcc来编译。

2.spu-gcc编译好的.o文件需要用ppu-embedspu这个脚本来处理,之后才能与PPE的程序链接。

3.ppe的程序直接可以用gcc来编译可以使用-lspe标志。

4.需要指定程序是-m64还是-m32的,否则会出错。

另外,如果安装的是ydl6.0,有可能会丢失ppu-embedspu.sh这个脚本,解决办法是配置好主机的Internet连接后,运行yum install *spu* *ppu*,会自动通过网络安装的相关的开发程序。

如果只使用gcc并且不调用与cell be sdk相关的函数,生成的程序只是一个运行在Power PC处理上普通的程序。

稍后我会尝试移植一些程序到这个平台。

5/6/2008

有些人活着,但他已经死了,有些人死了,但他还活着。

最近研究地形方面的问题,了解到一个人:Seumas McNally。这里http://www.gamedev.net/community/memorial/seumas/有关于他更多的信息。很惭愧,直到现在我还没能把握好生命里的每一分钟甚至每一天。如果把这些时间给Seumas,他一定会做出更多另人兴奋的事情。
有机会活在这个星球上,我感到很幸运,珍惜!
3/7/2007

lq2v1基本完成!

lq2v1基本完成!这将近一年的时间,经历了很多事情,甚至走了一些偏路,比如去了不该去的地方。不过,一切都过去了,就当是经验吧:)
从技术角度讲,真的不知道John Carmack从Doom以来都经历了哪些“磨难”。当你真正的深入进去,你才发现有很多问题需要解决,有些甚至是你从来都没有想过的,经常会另你束手无策。过几天lq2v1完善并完成它的使命后,我会尝试新的技术,毕竟在相关文档比较稀缺的情况下,quake2的很多技术细节还是需要看代码才能理解,有这时间不如去思考新的技术以及架构。非常感谢John  Carmack 以及id software能非常无私的公开他们的代码,他们能提供的信息已经非常多了!
10/25/2006

关于gnu rx-1.5的bug问题。

去年12月份完成regexplib,主要实现思想与gnu rx-1.5一致,但比gnu rx-1.5的实现要简单(以搞清原理为主要目的,没有考虑其他因素),主要是在nfa模拟那部分。在这过程中,发现了一些bug,给Tom Lord写信,可能是因为地址错误的原因,没有得到答复。前几天发现了Tom Lord的邮件地址,询问了这个问题,并得到答复。原来gnu rx-1.5已经不是最新版本了,最新的rx包含在gnu arch(http://www.gnuarch.org/)这个项目中,新版本已经修正了很多bug,并且提高了性能。Tom也不知道为什么gnu.org上为什么还要发布rx-1.5这个版本。以下是与Tom交流的部分内容,我的英语不是很好,好在他看懂了我的意思:
 
收件人: shi wei <w3ishi@gmail.com>
日期: 2006-10-21 上午3:16
主题: Re: hi, Mr lord, A bug about gnu rx1.5?
I'm not sure why the GNU project still distributes rx-1.5.   It is very old and, yes, I know it has bugs.   The most recent versions of Rx are much better: fast and much more accurate.   They are not distributed as a separate project but you can find a copy in GNU Arch.

I'm sorry your time got sucked into rx-1.5 -- the FSF should not be distributing it.

I am curious about your implementation.

If you want to join the GNU Arch project, the best thing to do is probably to join the mailing list and introduce yourself.

shi wei wrote:
Hello, Mr load:
In this year earlier, I was learn about regular expression and your source code "gnu rx-1.5". Through your idea I wrote my own regular expression lib. But when I learn your source code, I found a bug in it. I sent you a email( lord@gnu.org) about this bug, but no write back, I think you have change your email adress. Today I found your email adress"lord@emf.net", and try whether you can receive my email. The bug detail is for example use this kind of string and pattern:

/////////////////////////////////////////////////////////////////////////////////////
char *string = "@john-doe.i.am.com";
char *pattern = "@([A-Za-z0-9]*)(([\\.\\-]*[a-zA-Z0-9]*)*)\\.([A-Za-z]{2,3})";

// or

char *string = "aaa";
char *pattern = "((a*)*)(\\1)";

The programe may fall in a dead loop. The logical is:
/////////////////////////////////////////////////////////////////////////////////////

case r_concat:
       {
  switch (solns->step)
    {
      enum rx_answers concat_stat;
    case 1:
      solns->split_guess = solns->end;
#if 0
      solns->split_guess = ((solns->end - solns->start) > RX_MANY_CASES
       ? rx_best_end_guess (solns,
              solns->exp->params.pair.left, solns->end)
       : solns->end);
#endif

    concat_split_guess_loop:
      solns->left = rx_make_solutions (solns->regs,
           solns->verse,
           solns->exp->params.pair.left,
           solns->subexps,
           solns->cset_size,
           solns->start,
           solns->split_guess,
           solns->vmfn,
           solns->contextfn,
           solns->closure);
      if (!solns->left)
        {
   solns->step = -1;
   return rx_bogus;
        }
      solns->step = 2;

    case 2:
    concat_try_next_left_match:

      concat_stat = rx_next_solution (solns->left);

      if (concat_stat != rx_yes)
        {
new_tag_i_add:
   rx_free_solutions (solns->left);
   rx_free_solutions (solns->right);
   solns->left = solns->right = 0;
   solns->split_guess = solns->split_guess - 1;
#if 0
   solns->split_guess = ((solns->split_guess - solns->start) > RX_MANY_CASES
           ? rx_best_end_guess (solns,
           solns->exp->params.pair.left,
           solns->split_guess - 1)
           : solns->split_guess - 1);
#endif
   if (solns->split_guess >= solns->start)
     goto concat_split_guess_loop;
   else
     {
       solns->step = -1;
       return concat_stat;
     }
        }
      else
        {
   solns->step = 3;
   /* fall through */
        }

    case 3:
      solns->right = rx_make_solutions (solns->regs,
            solns->verse,
            solns->exp->params.pair.right,
            solns->subexps,
            solns->cset_size,
            solns->split_guess,
            solns->end,
            solns->vmfn,
            solns->contextfn,
            solns->closure);
      if (!solns->right)
        {
   rx_free_solutions (solns->left);
   solns->left = 0;
   solns->step = -1;
   return rx_bogus;
        }

      solns->step = 4;
      /* fall through */

    case 4:
    /* concat_try_next_right_match: */

      concat_stat = rx_next_solution (solns->right);
      if (concat_stat == rx_yes)
        {
   solns->final_tag = solns->right->final_tag;
   return concat_stat;
        }
      else if (concat_stat == rx_no)
        {
   rx_free_solutions (solns->right);
   solns->right = 0;
   solns->step = 2;
   goto concat_try_next_left_match;
        }
      else /*  concat_stat == rx_bogus */
        {
   rx_free_solutions (solns->left);
   solns->left = 0;
   rx_free_solutions (solns->right);
   solns->right = 0;
   solns->step = -1;
   return concat_stat;
        }
    }


 In case 4, if soln->right->start == soln->right->end, and soln->right is not match null, it will go to concat_try_next_left_match,
but if concat_try_next_left_match can match a again the string, it will not solns->split_guess--, so it will come to  concat_stat = rx_next_solution (solns->right); again...
 In my opinion, if case 4 rx_next_solution return rx_no, it have to estimate solns->right->regexp, if it can't nullable and solns->right->start == solns->right->end  goto new_tag_i_add.
 I am a newer in regular expression program, so I don't know if it is a bug? And my English is not good, can you understand me?
 
 A syntax tree may lead error, like this:


              r_concat
              /  \
         r_parens    r_cset
              /
             r_star
             /
            r_parens
            /
           r_concat
           / \
      r_star r_star
          /   \
    r_cset   r_cset

I want join some gnu project, such as http://www.gnuarch.org/revc/index.html, can you give me some idea about how can I start?
Expect your write back, and thank you very much!
 
ShiWei
2006-10-20