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
ไหนจะ...บลาๆๆๆๆๆๆๆ


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

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

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

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