Sunday, January 28, 2007

Computer and music are same essence stuff that you thought?

突然看到Spring framework的作者Rod Johnson居然是音乐学博士毕业^_^看来Shawn对于自由文化运动产物的同源性看法没有出错.音乐的变革(Punk&Mental)和计算机文化运动的爆发属于同一时代,而根源在于北美是基督教文化,而基督教文化的核心就是那本世界上最有智慧的书---<圣经>

PS:决定下学期搬过去和成电的兄弟一起住,May God bless us.....

成都电锯在线的兄弟们:

Saturday, January 27, 2007

Jad dig into eclipse

今天开始做"right things"了,在sourceforge上有jad的eclipse插件,作为一位Java novice这东西以后应该可以用,所以参照JadClipse网站的配置,中途在devx.com上找到了个比较完整的教程,devx的教程里用了spring framework来测试的jad.大家有兴趣可以参考参考^_^

听着Halo的战歌让人精神很爽,期待赚钱后买新PC就可以玩玩NEXT-GEN的游戏,当然HALO系列和UNREAL肯定非常期待.今天看到了一篇blog关于N多语言的列表,其中他用了The king of langs来形容lisp^_^看来函数式语言对于真正热爱计算机的人还是非常有吸引力.

PS:推荐听U2的歌---A Man And A Woman.非常喜欢U2和Switchfoot~技术一流就不说了,歌词也很棒.

The Factor programming language

前2天偶然发现了这个东东,试着去研究了一下感觉还不错,factor的语法抽象超过了scheme而且功能强大应用领域也比较多,语言包里有很多demo:
  • Factory X11 window manager
  • Onigiri Weblog server
  • Wee-URL URL shortening web app
  • Graphics demos: Wolfram automata, boids, L-systems
  • HTTP server
  • Message-passing distributed concurrency
  • Date and time library
  • Pattern matching
  • Lazy lists
  • Parser combinators
  • Cryptography and extra math routines
  • Unit conversion
  • Tetris and Space Invaders games
  • XML parser, XML-RPC client and server
  • USB interface
  • Bindings for Cairo, PostgreSQL, SQLite
  • Various smaller examples, such as a raytracer, mandelbrot fractal viewer, and IRC bot.
Shawn尝试了2种搭建平台的方式,第1种很简单,只需要在factorcode下载语言包即可,Shawn使用的版本是0.87,第2种方式是在自己的机器上编译,可以参考Doug的文章,但有一点要注意MinGW(MinGW早期版本安装配置可以到这里看看)必须是5.0以上版本才可编译通过,不然老在msys里面打转可不怎么爽,Shawn开始使用的3.1版本结果打死也搞不出来,而5.0以上版本需要在线更新,国内连接到sourceforge的服务器很慢,所以最好的版本发知道报名直接下载然后让MinGW安装程序帮你安装,Shawn使用的是MinGW-5.1.2.exe安装程序需要以下几个包:
binutils-2.16.91-20060119-1.tar.gz
gcc-core-3.4.2-20040916-1.tar.gz
mingw32-make-3.81-1.tar.gz
mingw-runtime-3.11.tar.gz
w32api-3.8.tar.gz

本来今天准备通宵配置和编译,不过祷告还是很有用,几个小时就搞定~可以早点睡觉了,试过几个DEMO里面的程序的确很cool~搞这东西和Shawn改干的"正事"有点偏题(Shawn:JAVA),但毕竟开源社区的东东对Shawn诱惑太大了^_^看来需要个gf来管教管教咯~OK屁话不多说了睡觉去也..Have a good night,bro~

PS:Shawn这家伙搞什么东西老偏题,平时不专注,专注起来简直不是人,谁让这家伙外号叫Shawn the Rock.

Thursday, January 25, 2007

Funny things about secure code

Thanks for Leo burrow a good book of Writing Secure Code to me.It's a really heart-stirring stuff~When I getted start to read the Chapter 5 which discuss about Stack overrun.Actually I was never thinking about that shit.Here I will posting some funny stuff that will be reference and enjoy for newbie like me.

Environment:Windows XP+Visual C++(RELEASE MODE)

/*
StackOverrun.c

*/
#include 
#include

void foo(const char* input)
{
char buf[10];

//小心这可是stack骗局哦
//我们可以看到参数的漏洞
printf("My stack looks like:\n%p\n%p\n%p\n%p\n%p\n% p\n\n");

//头号公敌:stack overrun
strcpy(buf, input);
printf("%s\n", buf);

printf("Now the stack looks like:\n%p\n%p\n%p\n%p\n%p\n%p\n\n");
}

void bar(void)
{
printf("Augh! I've been hacked!\n");
}

int main(int argc, char* argv[])
{
printf("Address of foo = %p\n", foo);
printf("Address of bar = %p\n", bar); //打印函数的地址
if (argc != 2)
{
printf("Please supply a string as an argument!\n");
return -1;
}
foo(argv[1]);
return 0;
}

After the complied,you can try about his:
>StackOverrun.exe shawntherockisanewbie
Address of foo = 00401000
Address of bar = 00401060
My stack looks like:
00000000
00000000
00000000
7FFDA000
00401091
004010BB

shawntherockisanewbie
Now the stack looks like:
00000000
00000000
77616873
6568746E
6B636F72
6E617369

Now,Windows will pop-up a error-warnning window "The instruction at"0x6e617369" referenced memory at "0x6e617369" .The memory could not be "read"".
Whis is "0x6e617369"?Because the letter "n"'s ASCII is 6e.

How to improve this problem in this case?It's too easy to figure it out.

#include
#include

void foo(const char* in)
{
char buf[64]; //Win32程序可不能接受超过64的字符串命令

strncpy(buf, in, sizeof(buf));
buf[sizeof(buf)] = '\0'; //胜利!
printf("%s\n", buf);
}

void bar(const char* in)
{
printf("Augh! I've been hacked!\n");
}

int main(int argc, char* argv[])
{
if(argc != 2)
{
printf("Usage is %s [string]\n", argv[0]); //提示用法
return -1;
}

printf("Address of foo is %p, address of bar is %p\n", foo, bar); //显示出当前的函数地址
foo(argv[1]); //把接受到的字符传到foo()函数
return 0;
}

The console program of Windows that cant accept more than 64 char.

PS:Secure code tech is not specify to any programming language.
You can get used to it to any programming language what you like in your project.

Wednesday, January 24, 2007

Turn off the NTLM in Windows Server 2003

下午用TELNET连接TOMCAT老是不成功,在排错中先想到了NTLM验证的问题,因为以前没在2003上搞结果搞了天都没把NTLM关掉, 最后终于搞出来了,W2K和WIN2003的tlntadmn也就一点点的差别,Windows server 2003如下:
>tlntadmn
Alt Key Mapped to 'CTRL+A' : YES
Idle session timeout : 1 hours
Max connections : 2
Telnet port : 23
Max failed login attempts : 3
End tasks on disconnect : YES
Mode of Operation : Console
Authentication Mechanism : NTLM, Password
Default Domain : CITYPW
State : Stopped

之后输入:
>tlntadmn config sec=-NTLM
The settings were successfully updated.

当然之后测试TOMCAT也不是因为其他什么大毛病,是自己每次测试HTTP少打了个Enter,妈的Windows下telnet是不显示的,这点没LINUX爽.也算我笨吧~这里帖出来供大家参考

Friday, January 19, 2007

Once a Quaker,always a Quaker!!!


Thank God given this opporunity to know a new quaker today when I was going to the RockShow.You known what,cause of Im busting my ass to try for a project,so I got a bit of time pressure recently.God is really known my heart that more than myself which pick a right time to relax just for me---the RockShow.I havent know the new quaker when Van was leave here till today.That guy(new quaker) told me that He is passed to Tire1 of Nightmare level in Quake3:Arena~its awesome.Maybe We can play together next time.

Thank God:
1,Knew a quaker.---Once a Quaker,always a Quaker!!!
2,Enjoy the RockShow.---One RockShow can changing the world!!!

Sunday, January 14, 2007

Shawn推荐电影


德州电锯狂人这次重拍的确比较爽,艺术化的效果让人联想到DOOM3的风格,看了2遍这几天都回味无穷.Shawn很少推荐电影,但这部一定要看^_^ 如果不适应id software游戏的朋友就要小心点了,毕竟N多人觉得是"恐怖片".

这几周比较忙所以没怎么写关于计算机的blog,加上还要应付学校恶心的考试.最近在谈一个关于内部系统的项目,如果能拿到手Shawn初步打算使用Java的BS方案来搞,希望朋友们多多给点建议:citypw@gmail.com

Saturday, January 13, 2007

这点可以看出韩国人的团结吗?

今天和几个朋友在外面吃饭,还是像已往一样Shawn点了个 bacon burrito,吃的很爽^_^但付帐的时候有发生了一件事,当我和朋友排队去付帐时一个亚洲模样的女孩(Shawn:开始以为是中国人)急急忙忙的插到我们前面,我正在想这女孩也太....正在这时另外一个还在吃饭的女孩放下手中的食物冲了过来,还撞了我一下,用很生疏的E文说了句"sorry"(Shawn:当时以为是日本人,因为听说日本人E文都比较烂).之后跑到前面插队的那个女孩拉到旁边JJYY的说了一通,但应该是韩语,之后插队女孩过来说了句"sorry"就到后面排队去了,而那个撞我的女孩又回到了座位上吃东西.

不知道这个场景如果您亲自遇到会有什么感触?其他不说但足够Shawn反思一下了.

Thursday, January 11, 2007

让Shawn有所感触的视频

视频地址:http://www.tudou.com/player/player.swf?iid=3657137

昨晚找到<德州电锯狂人前传> 一下子看了2边,很8错的电影,和id风格有相似之处.看到3点过才睡觉,早上11点起床后看到一个朋友给我发的视频, 看的简直有一种说不出来的感觉,说实话自己以前对李连杰印象不是很好,但看了视频后至少改变了一些看法.他完全放下了国际巨星的架子而非常诚恳的让大家做捐钱做慈善,甚至给人一种很无奈的低声下气的求别人做善事,国人是他妈的该反省一下了,进20年中国经济的高速发展造就了很多富人,但在慈善事业方面我们远远的落后于我们的经济发展速度,美国每年的实际慈善捐款超过2900亿美元,而中国最近10年的实际捐赠不过400亿人民币,中国的有钱人很多,但这样的数字让我们寒心.

God bless Chinese charity business!!!

Wednesday, January 03, 2007

Happy new year!!

The new air is coming.I read some tech article when I was go home. It's really a great start in this year that I should called "new fresh 2007".Im surprised about Cayla sent me message for new year greeting but exactly it's Africa American english.You know what,I really wanna posting here and show you how the funny thing which from a beauty girl.Because of I dont wanna get Cayla's lump when we are hang out next time,so....^_^

Today,I was going to meet with Jar for launch and we talk a lot of about music.Thank Jar's good food.I deciding to busting my ass for study about programming to Glory to God in new air.God bless us!!!

Is this the New Year, or just another night?
Is this the new fear, or just another fright?
Is this the new tear, or just another desperation?

Is this the finger, or just another fist?
Is the kingdom, or just a hit and miss?
I've missed direction,
most in all this desperation

Is this what they call freedom?
Is this what you call pain?
Is this what they call discontented fame?

Monday, December 18, 2006

最近体会最深的文章片段

Master of Doom的最后一章John Carmack谈到:
In the information age,the barriers just aren't there.The barriers are self-imposed.If you want to set off and go develop some grand new thing,you dont need millions of dollars of capitalization.You need enough pizza and Diet Coke to stick in your refrigerator,a cheap PC to work on,and the dedication to go through with it.We slept on floors.We waded across rivers.

某次访谈John Carmack说:
游戏的程序就是一行行的代码,需要你的灵魂才能赋予它以生命,有了生命的游戏才能带给大家快乐,也才能给你所想要的,你的游戏是你的热情,是你的汗水,是你的喜怒哀乐,是你的梦想,你的游戏,其实就是你自己. 我从未度过没有编程的一天,这就是我的全部.

昨天看Bible时有一段经文很不错,在撒木耳记下(2 Samuel):
22:3 我的神,我的磐石,我所投靠的。他是我的盾牌,是拯救我的角,是我的高台,是我的避难所。我的救主阿,你是救我脱离强暴的。
The God of my rock; in him will I trust: he is my shield, and the horn of my salvation, my high tower, and my refuge, my saviour; thou savest me from violence.

22:4 我要求告当赞美的耶和华,这样,我必从仇敌手中被救出来。
I will call on the LORD, who is worthy to be praised: so shall I be saved from mine enemies.

今天开始看Intoduction to Algorithm(Second Edition),在Preface里作者根据针对不同的人群有了不同的建议,这里摘录To Professionals:
The wide range of topics in this book makes it an excellent handbook on algorithms. Because each chapter is relatively self-contained, you can focus in on the topics that most interest you.

Most of the algorithms we discuss have great practical utility. We therefore address implementation concerns and other engineering issues. We often provide practical alternatives to the few algorithms that are primarily of theoretical interest.

If you wish to implement any of the algorithms, you will find the translation of our pseudocode into your favorite programming language a fairly straightforward task. The pseudocode is designed to present each algorithm clearly and succinctly. Consequently, we do not address error-handling and other software-engineering issues that require specific assumptions about your programming environment. We attempt to present each algorithm simply and directly without allowing the idiosyncrasies of a particular programming language to obscure its essence.

偶然间在某XX的blog上看到了David Chappell在TechEd-Boston(2006)上的话:
If you are a developer, and you don’t like change, you should get out of this business as early as possible.

If you are a Developer, you should always reset yourself, reset what you learn and do thing before, fundamentally.

看到了一个问Java创始人James Gosling的问题,从他的名字和他喜欢的音乐类型来看他或许是位弟兄,不过也有可能只是受了文化的影响:
What are your favourite music bands/performers/compositors?
James:
I tend to like folk musicians: Christine Lavin, Woody Guthrie, Pete Seeger…

Wednesday, December 13, 2006

Small Raiden



3天前在study-hood的楼顶上偶然间发现了这只小狗,居然也是小的黑色日本松狮,然后就去和它玩发现它非常的像Raiden,已经很久都没有发觉自己爱心的一面了^_^这几天真的很高兴,通常这只小Raiden白天被主人放到楼顶上,下午5点左右然后主人带回家,我呢,就每天中午饭后去看它,下午也忍不住去看它几次,真的太像Raiden了,可能因为都是日本松狮的原因连动作都跟Raiden很像,偶买了N多鸭肝每天去味它2个,太可爱而生性狂野的小家伙!现在已经和小Raiden成为很好的brother了~每天看我去了都兴奋,我又开始像和以前Raiden玩耍一样和小家伙玩,我基本算一个不相信感觉的人,但这次真的感觉很棒.

或许这是Lord Jesus给我的锻炼爱心的机会吧,记得曾经Jill还有几个MM都说我对狗比对人还好^_^明年就要毕业了,但现在还没什么压力,感谢稣哥与我同在!!!

God bless small Raiden!!!

The First MIT Scheme's program(SICP's homework)

Dont forget parentheses in your program!I use the Scheme IDE which MIT website given us for suggestion.

Exercise 1.3. Define a procedure that takes three numbers as arguments and returns the sum of the two larger numbers.

Shawn@copyleft

(define a 200)
(define b 300)
(define c 100)
(define (max)
(cond ((> a b)
(and (> a c) a))
((> b c)
(and (> b a) b))
(else c)))

(define (second)
(cond ((= m b)
(cond (> (- b a) (- b c))
(- b a)
(else (- b c))))))


(define m (max))
(+ m (second))

Monday, December 11, 2006

Why I choose Java Enterprise Technology to learning?


I getted start to study the course about software development 2 years ago.Firstable I was learn the C++ which the part of non-Object Oriented.In early 2006,I start to used the OO C++ that can write some simple case.And I have to choose a solution to learn for cash.Actually I got 2 choice:Java or .NET.But I go forward to study both of development platform in the same time.Almostly I just write some simple code that based on J2SE and Winform.When I reconized that neither solution cant figure enterprise's problem out as quickly as possible that I start to thinking about go further.J2EE is a better choice that I thought.Becuase of Sun Microsystem announced that J2SE and J2ME will be open source code which based on GPLv2 license.You known what,J2EE include many module but all of basically architecture are J2SE.It will be better for developer.

If you read here,maybe you would be thinking about why I give up .NET?Cause of I went some seminar about Windows Vista development that I understood Microsoft wanna make the desktop development to easier.But I prefer solve the enterprise's problem to personal.Windows Vista's user experience and some grand new things looks like good(especially the WPF and CardSpace).But I have to say "no one is perfect".Like as some security provider claim that Windows Vista is still need anti-virus tools even the anti-spyware tools.

Im so sorry about my English gramar.Please help me to correct if you found some error.

God bless you and have a good day!!!

Tuesday, December 05, 2006

Chengdu Microsoft .NET Usergroup party(the 5th)

Nov 25th 2006, a bore afternoon,I went to the Chengdu Microsoft .NET Usergroup party.DP department of Microsoft's employee give a speech about the How to development of Windows Vista in the future.Here is some picture that you can enjoy it.If you wanna join us to next party,give me a mail.

Shawn: citypw(at) gmail(dot) com



Monday, December 04, 2006

Commandos 4:Strike Force玩后随笔

Commandos是一部很经典的游戏,记得我小学5年级就在玩第1个版本, 之后又推出的资料片也很不错,到了第2代变革已经是非常的大,在commandos 2以前的版本里只有贝雷帽可以搬油桶,也只能司机才能开车之类的限制,C2所有人都可以同时做很多我们认为"应该"能做的事情,而且C2的画面也非常的 好,采用3D的很多帖图,记得我当时玩C2的时候是每一关都认真的玩,它具有的游戏性是大家公认的.到了2003年edios发行C3的时候当时我玩了2 关就没什么兴趣继续了,感觉创新不大.

昨天偶然间发现朋友的抽屉里有commandos 4:Strike Force非常的兴奋,感谢老鼠让出机器给我们玩,因为只有他的电脑硬件才能达到要求,这次的变革是巨大的,首先游戏整体类型的改变,由以前的即时战术改 变为了FPS,画质也有了很大的飞跃,安装完成后进入游戏听着音乐我变得非常的兴奋,久别的感觉,记得上次玩Unreal II的时候有过这种兴奋,不过那已经是2003年的事情了~这2年除了有时候玩一下Quake3其他都没怎么玩,昨天下午花了4个小时打到了Norway 的那关,然后我觉得不再继续玩了,由于目前游戏整体质量的提高所以感觉不到有很大的变化,图形是8错了,但其他方面还需要很多改进,当然这不光是C4这一 部游戏的问题,记得去年Microsoft发布Xbox360后曾经宣布说Next-Gen的游戏其主要的变革在于图形,而声音,物理和AI相对来讲还无 法实现足够大的变革,因为目前的硬件在保证图形和网络的前提下很难再花其他资源用于计算如物理或者AI,物理卡是一个解决方案,但AI始终是最难解决的问 题,的确~目前CPU的发展已经遇到了一定的瓶颈,当然这是相对的,主频飞速上升的时代的已经成为历史,但以后的多核CPU也同样给程序员的编程增加了难 度,而游戏开发商就会增加成本,这期的<程序员>杂志上刊登了Herb Sutter写的那篇:
he Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software(原文:http://www.gotw.ca/publications/concurrency-ddj.htm),John Carmack在2004年的GDC中提到了多核CPU的开发会造成成本大大增加的风险,但更更大的问题在于目前的游戏太注重游戏图形的发展而忽略了其他 比如AI,FarCry的AI是有很大的进步,但比起人的思维能力还差的远,比如这样一个场景:我作为玩家(P)在FarCry的丛林里遇到了敌人的特种 部队(代号:E),E首先会思考:我是特种部队,对方也是特种部队.我(P)也会意识到E所思考的,同时E也会想到P知道他已经意识到了他的战术...这 种博弈树在经过几个分支之后E大概可以找出"最优策略"或者"最佳策略"然后行动,但这简单的一个运算或许同时面对5个E的时候AI可以做的很成功,但游 戏最终是要面对市场:玩家的需求,玩家可不需要只能限制于跟几个人战斗,但如果把大量的E(不同能力等级的,不光是特种部队)加到场景里,现在没有计算机 硬件可以完成这样的计算.多核或许是一个突破口,但要AI做的非常成功有待于新的计算模型的出现,如生物计算机和光计算机etc...

现 在的游戏是越来越商业化了,国内游戏的主流是ONLINE GAME的环境下很多人都遗忘了单机游戏,我不是说ONLINE不好,我的观点始终是建议年轻人少玩韩国的游戏,这只会扼杀你的创造性甚至比中国教育还要 严重,真的比较怀念以前和朋友玩DOOM和QUAKE的日子.OK,今天屁就放到这里,看资料去了!!!

God bless Chinese gamer!!!Please dont let the Korean game dull our mind and killing our potential.

Sunday, October 08, 2006

Marlboro was return my table!!!

Im restart to smoking now. Because I was practice marathon with my friend last year,that the cigarett was throw away from my life.Now,Marlboro is back to my table~cool~its my old friend that I knew it when I was 13.On a other hand,Daikatana getted into my computer.My memorize is very clearly that Daikatana's test version get into my first computer in 2000.This is the Mr.Romero's last PC game when Ion Storm is crashed before.Actually I really like Daikatana's graphic backgroud and gameplay.Here,I have to say "sorry" again,about my computer game which came from id software(include Daikatana) all are privacy version(not like GNU's copyleft).Cause of China has not any publisher to sale it.I was talk to John Romero in Internet last week.As Steven said,the world getting smaller.John agree with that DOOM3 lost the gameplay,but just the graphic is perfect.Of course,the new engine(DOOM3) that id software spend 4 years to developed that lead by John Carmack.I really miss the game feeling within id games like DOOM and QUAKE.The Daikatana is great.It was builded base on QUAKE2 engine that always dark light in the game.I really like this color style of id.

All right.I have to go to sleep.Because I shall going to that frenk'in classroom to sign my name.If I
will not do that,the fuc'in university will not allow my exam to pass.This is fuc'in Chinese education that can not teach you how to live in the real-world.Steven told me that American education has a same problem.But forsure its better than here that I thought.Anyway,GOD BE WITH US!!!