~经言/歌词~

I find that the harder I work, the more luck I seem to have.
~ Thomas Jefferson (1743-1826)

Sunday, November 22, 2009

颓废

这种颓废的日子,到底还要缠我多久?
这种颓废的时光,到底还要逗留多久?
这种颓废的心情,到底,
我,还要紧抱多久呢?

这种颓废的日子,到底开始了多久呢?
这种颓废的时光,到底虚度了多久呢?
这种颓废的心情,到底,
我,几时才要摆脱呢?

也许,是真的开始想想,
到底在什么时候,我成了现在的我?

还是,我,一直都是现在的我?
没有热情,只有冷眼?
没有激情,只有冷漠?
没有高亢,只有低迷?

二十多年,一路这样走来,
吃的苦,不多,但是多多少少还是有受过一些挫折。
日子难过,却年年过。
我一直都相信,只要秉着这念头,
再难过,再难熬的日头,
我能撑得过。

只是奇怪,是什么时候,
我开始懒懒散散得过日子了呢?

脑袋,动不了了。
心跳,好像只为了跳动了跳动。
噗通,噗通,噗通。。。

人生站的十字路口,这一刻,仿佛真的看到了。
也许,我早就过了那十字路口,
选择,早就做了。

只有向前走,才能让自己短暂性地,离开那路口,往下个路口前进。
路途的荆棘,不断地打击自己,不断地冲击着自己。
目标,突然好遥远。
出口,好像渐渐地看不到了。
一路的荆棘,慢慢的将路径渐渐的遮掩了起来。

也许,我真的应该快刀斩乱麻,好好的认真起来吧,要不然,就得永远的被困着了。

Saturday, November 14, 2009

又是一个星球六,日子,怎么就过得这么的快?而我的脚步,怎么就这么的慢?心,怎么就提不起劲?

十一月,不知不觉就过了两个星期,我,到底做了什么呢?

Friday, November 6, 2009

How to create a Native Library

Native library, first thing first comes across to my mind when i saw this thing was, "Gosh, what is this?". JNI, Java Native Interface, please dont ask me about anything about this, as i dont know anything of this but i know i do need to compile the code to generate a Native Library, which is basically a DLL file that written in C/C++.

Gosh, as i mentioned earlier, i dont know anything about JNI, and even now, after 1 day playing around with the code, i am still so confuse with what is JNI and what is the main purpose of using this (even though i have the e-book on my hand). Well, i admit this, i am not very interested to do study on this, haha.

Anyway, back to the topic, even though i might not understand what is the JNI, what is Native Library, now, i need to learn how to compile the C/C++ code to generate a DLL file for the Java code program usage.

Ignore how the code look like, just imagine in your directory, you have two different pieces of codes, one is written in Java and another one is written, um let's say in C++.
1. Open the command prompt, access to the folder, then type
'javah -jni sourceCode'
2. Then you will see there is a sourceCode.h file created in your directory
3. The next step is to create the native library or the DLL file (Windows)
'cl - Ic:\programfiles\java\jdk1.6.0_16\include - Ic:\programfiles\java\jdk1.6.0_16\include\win32
-MD -LD sourceCode.c - FesourceCode.dll'
(*in one line)

4. Then you will see there is a DLL file generated in the directory.
5. Type 'java sourceCode'
6. Then the output will be displayed on the screen.

The purpose of writing this blog, as i mentioned in last post, in just a place for me to keep steps down, just in case one day in the future i need this again.

Sigh*, getting older and older...

Thursday, November 5, 2009

How to set the environment variable for 'CL'..

LOL...as shown in the title, this question had bothered me around 2 hours...sweat*
Anyway, what is CL?mmm, basically i also not very know what it stands for, let me do some searching first, dating the Miss Google...

Opms, i cant find any name for CL from the net, but never mind, because the name wasnt too important as long as i know what is it for, haha. CL, actually is a, mmm, errr, LOL!!!Can i say CL actually is a command?Ya, it is a command i think, haha. And this Cl actually is used for us to do compilation on our C/C++ program code, through CMD, command prompt.

Why do we need set the environment for CL since we have such an advance IDE to compile and execute our code, such as Microsoft Visual C++ 6.0 (which is i normally used in University). Hmmm, i not very sure why CL needed, but at this moment, i do need CL to do some compilation. And pls dont ask me why i must using the CL, honestly, what i can answer you is that, because the code that i am compiling now, it does need me to compile it through the use of CMD instead of the IDE.

Ya, i get some codes from the internet, about the JNI application, god, what is JNI??Honestly, i dont know much about JNI, or i never know about JNI until today. Sigh* and Sweat*...

Anyway, the reason why CL is required or what is JNI is not the purpose of this post. This post, is just a post for me to note down, how to set the environment variable for CL just in case in the future, i need this but i forget about it...haha...Being honest, i had been using CL quite often during my training period, just a year ago, but now, hehe, i forget all!!!Gosh!!!But last time, i did not need to set any environment variable, but why now is it needed?Guess i am not doing a complete installation...=.=

I had been searching through the internet to find a solution for me, and after around 2 hours searching, good, at last, i got the answer.

Actually, it is simple and very very easy, what you need to do is just open the folder of Microsoft Visual Studio\VC98\Bin, then you will see a batch script file named
VCVARS32. This is the batch script file that will help us to automatically set the environment variable for C/C++ compiler.

Please do not try to double click the batch file, as nothing is going to happen if you do so.

What you need to do is open the command prompt, cmd, and access to the folder where
VCVARS32 stored. I guess i no need to show how to get to the folder of VCVARS32. Once you access to the Bin folder, you just need to type VCVARS32, and press Enter, everything is done.

Then you can try to compile your C/C++ program code using CL, by typing
'cl name.cpp'

You will get the output saying that
'/out:name.exe name.obj', and this is just a compilation, if you want to execute your C/C++ program, you can continue to type 'name.exe', then you will see your output displayed on the cmd.

I am gonna to note this down, because i believe that i am going to forget all these things very soon, maybe one week or one month later. In order to save my time to do the same searching again, hehe, written all the steps here always a better choice for me, haha.