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?