Saturday, December 20, 2008

Tips from Shanghai trip (TSP-08)

1. Having >20kg luggage, go for taxi (>100 RMB)

2. Having <20kg, style="font-weight: bold;">TAI PING YANG, establishing in XU JIA HUI area (also the name of metro)

4. YU YUAN Garden is very nice for tourist. You will see many chinese's character building and these are store where you can buy something chinese people think you like. And I like them! The price is cheap (after divide by two!!!)

5. Don't believe chinese people when you ask for direction of bus... They want to help you but just I don't know why they were telling me the different way all the time!!!

6. Map at Airport is very useful, take it!

7. Cruising is very nice at night

8. Another interesting place for shopping IT stuff is HUANG PI NAN LU

9. Air pollution here exceeds the limit that one Bangkok girl can handle well, let think about how bad it is!!!

10. You should have a good sleep...

Thursday, December 11, 2008

The trouble with love is...by Kelly Clarkson

Love can be a many splendored thing
Can't deny the joy it brings
A dozen roses, diamond rings
Dreams for sale and fairy tales
It'll make you hear a symphony
And you just want the world to see
But like a drug that makes you blind,
It'll fool ya every time

The trouble with love is
It can tear you up inside
Make your heart believe a lie
It's stronger than your pride
The trouble with love is
It doesn't care how fast you fall
And you can't refuse the call
See, you got no say at all

Now I was once a fool, it's true
I played the game by all the rules
But now my world's a deeper blue
I'm sadder, but I'm wiser too
I swore I'd never love again
I swore my heart would never mend
Said love wasn't worth the pain
But then I hear it call my name

(The trouble with) The trouble with love is
It can tear you up inside
Make your heart believe a lie
It's stronger than your pride
The trouble with love is
It doesn't care how fast you fall
And you can't refuse the call
See, you got no say at all

Every time I turn around
I think I've got it all figured out
My heart keeps callin' and I keep on fallin'
Over and over again
This sad story always ends the same
Me standin' in the pourin' rain
It seems no matter what I do
It tears my heart in two

(The trouble with love is) The trouble with love, yeah
(It can tear you up inside) It can tear you up inside
(Make your heart believe a lie) Make your heart believe a lie
It's stronger than your pride

(The trouble with love is)
It's in your heart
It's in your soul (doesn't care how fast you fall)
You won't get no control
(and you can't refuse the call)
See, you got no say at all

(The trouble with love is) Oh, yeah
(It can tear you up inside)
(Make your heart believe a lie)

Monday, December 8, 2008

มาเรียนภาษา ซี กันเถอะ : goodbye world!

Introduction to C Programming...


#include
int main()
{
printf("Goodbye, cruel world!\n");
return(0);
}


1. Compiling and linking your source code

The compiler translates the information in the source code file into instructions the computer can understand. The linker then converts that information into a runnable program.

The GCC compiler recommended and used in this book combines the compiling and linking steps. An object file is created by GCC but it is automatically deleted when the final program file is created.

Object code files end in OBJ or sometimes just O. The first part of the object file name is the same as the source code filename.

Compiling GOODBYE.C: at terminal being in your source code's directory and then...
gcc goodbye.c -o goodbye
Nothing happen! The only time you see a message is if you made an error.

2. Running the final result
In the Unix-like operating systems, you must specify the program's path or location before the program name. Type this command.
./goodbye
Press the Enter key and the program runs, displaying this marvelous text on your screen:
Goodbye, cruel world!




มาเรียนภาษา ซี กันเถอะ The stuff you need to know before you read all the other stuff in this book...

ขอได้รับคำขอบคุณจาก ซีฟอร์ดัมมี่ เซคเคินอิดิชั่น แอนด์ บิททอแรนท์...

The stuff you need to know before you read all the other stuff in this book...

you need two things to program in C on your computer:
- A compiler
- A place to put your programs

For Mac OS X:
GCC compiler is installed and ready to used.
To confirm this, open a terminal window and type the following line at the command prompt
gcc -v

Making programs, you need two tools:
- an editor
- a compiler

For the various UNIX operating systems, you have multiple editor choices.
The simplest text editor is Easy Editor, activated with the ee command.
The author' favorite editor for working with C is vim, a variant on the infamous vi editor in UNIX. Unlike vi, vim uses colors to code text.

Compiling and linking:
This step transforms the meek and mild text file into a robust and useable program on your computer.
The main thrust of programming the individual examples in this book involves the following three steps.
1. Ensure that you're in the work folder

2. Use your text editor to create your source code file

3. Compile and link the source code:
Compiling and linking are both handled by the GCC command. As an example, here's what you need to type to compile and link the GOODBYE.C source code created in Step 1:
gcc goodbye.c -o goodbye
- gcc, the command to compile and link the source code
- goodbye.c, the name of the source code file
- -o, the output switch
- goodbye, the name of the final program
If you leave off the -o switch and its option, GCC creates the program file named a.out. The author doesn't recommend this. Instead, remember the -o option and specify a nmae for the output program. The name can be the same as the source code file, but without the .c extension.

4. Run the program
UNIX runs only programs found on the path, and the author doesn't recommend to put your learn directory on the path.
To get the operating system to notice your program, you have to be specific about where the program lives (in the current folder, for example). you do that by prefixing ./ to the program's name. To run the goodbye program, type the following at the prompt:
./goodbye
and the program runs.

Tip: For each program you create, there are two files on disk: the source code file (a text file) and the program file. That's generally how things go in this book.
Tip: The GCC compiler automatically sets the permission bits on the resulting program file, allowing it to be run. Usually, it's -rwxr-xr-x
If you create your own programs that you want to run, copy them to a bin directory beneath your home directory, and put that directory on the path.


Wednesday, December 3, 2008

Paris ตอนที่ สาม

เดินฝ่าฝนกันไปกับจูเลียนด้วยร่มหักๆออราเคิลที่ติดสอยห้อยตามมาจากเมืองไทยเพียงอันเดียว แน่นอนว่าไอ้จูเลียนเป็นคนถือ แล้วกรู (เจ้าของร่ม) ก็ต้องเปียกเป็นธรรมดา (ไม่เข้าใจเหมือนกันว่าไอ้การที่ผู้ชายถือร่มตามมารยาทแล้วสุดท้ายผู้หญิงเปียกเนี่ย มันดียังไง) ก็ฝ่าๆๆๆๆกันไป ไอ้จูเลียนก็ไม่ได้ช่วยอธิบายอะไรเลย ข้าพเจ้าก็ต้องเห็นเอง ดูเอง เข้าใจเอาเอง ว่ามันมีไรบ้างแถวนั้น แต่เอาเหอะ อย่างน้อยก็ได้เห็นอ่ะนะ จะเอาไรมากกะเพื่อนผู้ชาย

เดินไปได้สักพัก (สองป้ายเมโทร...ไกลเชีย) ก็เจอกับเพื่อนจูเลียนซักที หญิงท่านนี้มีนามว่า อาลีน (มะใช่ อาหลิงอ้า อาหลิง ลื้อมายืนตงนี้ทามมาย...) เป็นคนสวิส พูดอังกฤษกะฝรั่งเศสโคตรรรรร ชัด เธอเรียนโทอยู่ในปารีสทางด้านการแปล ใช่แล้วเธอเป็นนักแปล โหย ทึ่งเจงๆ...

จากนั้นก็ชวนกันไปนั่งดื่มในบาร์ที่เรียกว่า ฟูร์มีบาร์ (ตามที่ได้เล่าไปในตอนก่อนหน้านี้แล) สองคนนั้นเค้าหนาวกัน ดิฉันกลับร้อนคะ สองคนนั้นเลยสั่งกาแฟ ชอคโกแลตร้อนมาดื่มกันแก้หนาว ข้าพเจ้ารึ ขอโค้กแล้วกัน... (ฮา) ก็เลยมาถึงเรื่องที่จูเลียนมันชอบว่าเราว่าเป็นสาวมีปัญหาด้านฮอโมน ระหว่างที่มันเล่าเรื่องนี้ให้อาลีนฟัง ข้าพเจ้าก็ถอดพูลโลเวอร์ฮ่ะ (มันร้อนเจงๆนะ ขอบอก ไอ้การกึ่งเดินกึ่งวิ่งมาไกลสองป้ายเมโทรท่ามกลางฝนเนี่ย) ก็คุยๆๆๆ (พวกมันนะที่คุย... คนไม่เคยรู้จัก ไม่ชอบคุยอยู่แล้วเป็นการส่วนตัว) แล้วสาวเจ้าก็บอกว่าจะพาไปดูรอบๆ 

Monday, November 24, 2008

UML: state diagram

"To understand complex classes better, particularly those that act in different manners depending on their state, you should develop one or more UML 2 state machine diagrams, formerly called state chart diagrams in UML 1.x, describing how their instances work. "

"UML state machine diagrams depict the various states that an object may be in and the transitions between those states."

"A state represents a stage in the behavior pattern of an object, and like UML activity diagrams it is possible to have initial states and final states."

"An initial state, also called a creation state, is the one that an object is in when it is first created, whereas a final state is one in which no transitions lead out of. "

"A transition is a progression from one state to another and will be triggered by an event that is either internal or external to the object."

"The notation for the labels on transitions is in the format event [guard][/method list]. It is mandatory to indicate the event which causes the transition. Guard, conditions that must be true for the transition to be triggered, are optionally indicated."

"States are represented by the values of the attributes of an object....

It is possible to indicate the invocation of methods within a state. The notation used within the state (in this invocation of methods case) is the same as that used on transitions, the only difference being that the method list is mandatory and the event is optional....

Had there been no event indicated those methods would be invoked continuously (in a loop) whenever the object is in that state....

Methods to be invoked when the object enters the state are indicated by the keyword entry.
Methods to be invoked as the object exits the state are indicated by the keyword exit.

The capability to indicate method invocations when you enter and exit a state is useful because it enables you to avoid documenting the same method several times on each of the transitions that enter or exit the state, respectively." จะมาอธิบายเพิ่มด้วยรูปกับตัวอย่างอีกทีนะ

" You can have recursive transitions, also called self transitions, that start and end in the same state."

For the sake of convention, we say an object is always in one and only one state, implying transitions are instantaneous. Although we know this is not completely true (every method is going to take some time to run), this makes life a lot easier for us to assume transitions take no time to complete.


Depict Models Simply and Model in Small Increments

Sunday, November 23, 2008

Paris ตอนที่ สอง

ตอนนี้กลับมาถึงโรงแรมแล้ว หลังจากตะลุยฝนเกือบทั่วปารีส แต่อย่างน้อยก็ได้ไกด์พิเศษคือเพื่อนของไอ้จูเลียนมาช่วยพาไปโน่นนี่

เอาล่ะ อย่างแรกหลังจากตะลุยผ่าเมโทรของปารีสกันมาจนถึงโรงแรมได้ ก็ปฎิบัติการณ์หาของกินก่อนเลย เริ่มด้วยซูชิแถวๆโรงแรม แต่เจ้ากรรมวันอาทิตย์ร้านปิด แต่จริงๆก็ดีแล้วแหละ เราเลยได้มาเจอร้านอาหารญี่ปุ่นเลยได้เข้าไปกิน แหะๆๆ อร่อยแอนด์อิ่ม อิอิ

หลังจากนั้นเราก็เร่ิมเดินทางไปยัง ตู เดอ ไอเฟิล ท่ามกลางฝน (ห้ามลืม) เลยถ่ายรูปไม่ค่อยได้เลย แต่ก็อุตส่าห์เอามาได้รูปนึง ฮ่าๆ จากนั้นเราก็เดินผ่านสวนใหญ่ๆที่มองดูแล้วเนี่ย หน้าร้อนหรือใบไม้ผลิต้องงามแน่ๆ (เสียดาย) ผ่านสวนไปเราสองคน (ฉันกับไอ้จูเลียน) ก็มองหาป้ายเมโทรกันให้ขวั่ก มันถึงกับต้องโทรหาเพื่อน (กลุ้ม) สุดท้ายได้ความประมาณว่าให้ไปเจอเพื่อนจูเลียนที่ "บาร์มด" (fourmi bar) ก็ฝ่าฝนกันไป 

พอเริ่มเข้าเขตที่ชื่อว่า Pigalle ก็เริ่มรู้สึกเหมือนลอนดอนบนถนนสายหนึ่ง จากนั้นก็เริ่มนึกถึงบางลำภู ที่มีของปลอม ของถูกๆให้ซื้อหา (เกรดห่วยหน่อย) ขอบอกหน่อยว่าเขตนี้ในอดีตมี "ผู้หญิงทำงาน" อยู่เยอะมาก ปัจจุบันก็ได้ผันตัวเอง(หมายถึงถนน) มาเป็นร้าน sex shop แต่ที่น่าสนใจก็คือ Moulin Rouge เค้าอยู่บนถนนนี้ด้วยล่ะ เราเดินผ่านไปอย่างรวดเร็ว... ไม่ใช่กลัวอะไร แต่ฝนตกหนักขึ้นไปอีก เฮ้อ กรรมจริงๆ

Paris ตอนที่ หนึ่ง

ตอนนี้ซีนั่งอยู่ในเขตที่นั่งชั้นหนึ่งของรถไฟด่วน ทีจีวี ของฝรั่งเศส ก่อนหน้านี้ห้านาทีซีกำลังอ่านหนังสือเกี่ยวกับทฤษฎีกราฟ อ่านได้สักพัก ก็รู้สึกเวียนศรีษะ เพราะรถไฟมันไม่ได้นิ่งๆเสียทีเดียว ทำให้ต้องพักสายตาเสียหน่อย แล้วก็ให้รู้สึกได้ว่า ชีวิตของเรามันไม่ได้ลำบากจริงๆ เคยเข้าใจว่า ชิวิตของเรานี้มันลำบาก แต่พอนึกให้ดีแล้ว นี่ไม่ใช่ความลำบาก ที่ผ่านมา ชีวิตเราไม่ได้ลำบากยากเข็ญเลย

สิ่งที่ทำให้เกิดความรู้สึกเหล่านี้ก็คือการได้พูดคุยกับเพื่อนชาวต่างชาติหลายๆคน โดยเฉพาะคนที่เรามองว่าเค้าดูดี มีความรู้ มีชีวิตที่ดีปานกลางของที่นี่
ทั้งที่เราคิดว่าคนพวกนี้น่าจะสบายและรู้จักหลายสิ่งหลายอย่าง ที่เราคิดว่า "ธรรมดา" สำหรับเรา สิ่งที่เราคิดว่าเป็นของธรรมดาเหล่านั้นกลับกลายเป็นบางอย่างที่แปลก และไฮคลาสสำหรับเขาอย่างไม่น่าเชื ่อ เช่นการขึ้นลิฟท์บริษัทๆหนึ่งโดยต้องกดรหัสสี่ตัวเข้าไปเพื่อให้ลิฟท์ทำงาน

ส่วนเราคุ้นเคยกับการพิมพ์ลายน้ิวมือ แล้วตามด้วยรหัสประจำตัวหกหลัก และรหัสผ่านประตูอีกสี่หลัก เพื่อเข้าบริษัทๆหนึ่ง

คนยุโรปส่วนใหญ่ยังเป็นพวกหลังเขา... เป็นพวกบาวาเรียน (คนป่าในยุโรปแถบเยอรมัน ขึ้นชื่อเรื่องของความป่าเถื่อนในอดีต) อันนี้เราไม่ได้พูดเองนะ แต่ว่าอาจารย์ที่ปรึกษาคนนึง (คนเบลเยียม) พูดเอาไว้ แต่เราเห็นด้วยอย่างเต็มที่

Tuesday, November 18, 2008

Deep Blue Sky Day

I wake up this morning with some deadly ugly word, "you cannot do anything as always". And I hope today will be MY day for once.

Finally I found it's not true (again), since I need to re-install my macbook pro.

What's the problem?

NS-2 cannot be installed. It shows "error: X11/Xlib.h : no such file or directory"
ok...
"locate X11/Xlib.h"...
a lot of them can be found!!!
ok...
tried to open X11 itself...
"The application X11 quit unexpectedly"
ok...
"Relaunch"
"The application X11 quit unexpectedly"

ok...
"Relaunch"
"The application X11 quit unexpectedly"
"Relaunch"
"The application X11 quit unexpectedly"
"Relaunch"
"The application X11 quit unexpectedly"
"Relaunch"
"The application X11 quit unexpectedly"
"Relaunch"
"The application X11 quit unexpectedly"

WTFFFFFFFFFFFFFFFFFF
...
hu calm down calm down
"Report"
"Library not loaded: /usr/X11/lib/libXfont.1.dylib"

ok...
"locate libXfont.1.dylib"
>/Applications/CrossOver Games.app/Contents/SharedSupport/X11/lib/libXfont.1.dylib
>/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libXfont.1.dylib
>/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libXfont.1.dylib
>/usr/X11/lib/libXfont.1.dylib

... T_T ...

R E - I N S T A L L


end news

Sunday, November 16, 2008

ปริญญาเอก...ชีวิตนี้ผมขึ้นอยู่กับใคร

การใช้ชีวิตในช่วงนี้ ช่างยุ่งเหยิงเสียจริงๆ
ไหนจะเรียนเขียน C++ ไหนจะ UML ไหนจะใช้คลัสเตอร์ ไหนจะ Terminal ทำให้ต้องเรียน UNIX
ไหนจะ ns-2 ไหนจะ OpNet
ไหนจะ...บลาๆๆๆๆๆๆๆ


ทำให้ได้รู้ว่าการเรียนเอก ชีวิตไม่ได้เป็นของเราแต่เพียงผู้เดียว ใครคิดว่าพวกวันแมนโชว์นั้นเหมาะกับการเรียนเอก ก็คงจะคิดผิดเสียแล้วหากคนผู้นั้นไม่ใช่วันแมนโชว์ของแท้ คือเป็นพวกอัจฉริยะ และเรียนรู้ทุกเรื่องที่เกียวกับศาสตร์ที่เกี่ยวข้องก่อนมาเรียนเอก (ซึ่งต้องยอมรับกันว่า ทุกวันนี้การที่จะรู้ทุกสิ่งทุกอย่าง ออลอินวันในคนๆเดียวช่างเป็นเรื่องตลกเพราะเป็นไปไม่ได้อีกต่อไป)

ที่ว่าชีวิตไม่ได้เป็นของเราผู้เดียว เพราะ ชีวิตเราถูกกำหนดชะตาจากอาจารย์ที่ปรึกษาและพวกเอ็กเปิดทั้งหลาย
เราว่าไงท่านอาจจะไม่สนได้ แต่ท่านว่าอย่างไรมันก็ต้องเป็นไปตามนั้นแล

ที่พูดนี่ไม่ได้น้อยใจนะ แต่มันเป็นแบบนั้นแบบสัจธรรม เพราะโลกนี้วิชาการมันไม่ได้มีมุมมองเดียว ในเมื่อไม่มีสิ่งถูกเพียงสิ่งเดียว เราก็ต้องทำตามไม้บรรทัดที่คนอื่นวางไว้ให้ โดยเฉพาะคนนั้นเป็นคนตัดสินอนาตตเรา...

โอ้วแม่เจ้า ชีวิตข้ามิใช่ของข้าอีกต่อไป...