12 April 2011

ความหมายของ prefix "NS"

อ้างอิงจาก wiki ละกัน

NEXTSTEP, an object-oriented, multitasking operating system by NeXT, as well as a prefix for certain system-provided classes in the operating system, such as "NSString"

มันคือ nextstep นั้นเอง

http://en.wikipedia.org/wiki/NS

31 March 2011

The Windows Installer Service could not be accessed.

วิธีแก้ปัญหา
The Windows Installer Service could not be accessed. This can occur if you are running Windows in a safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance.”

ทำตามขั้นตอนดังนี้

Click Start
click Run
พิมพ์ MSIEXEC /UNREGISTER
click OK

Click Start
click Run
พิมพ์ MSIEXEC /REGSERVER
click OK
รอสักครู่

หลังจากนั้นลองทดสอบลงโปรแกรมดูอีกครั้งครับ

24 February 2011

when The ARP entry addition failed: Access is denied.

delete : netsh interface ip delete neighbors "Network card name here" "Gateway.IP.goes.here"

Add : netsh interface ip add neighbors "Network card name here" "Gateway.IP.goes.here" "MAC-address-of-gateway-with-dash-here"

20 January 2011

Java Access Specifiers [Access Modifiers]

The access to classes, constructors, methods and fields are regulated using access modifiers i.e. a class can control what information or data can be accessible by other classes. To take advantage of encapsulation, you should minimize access whenever possible.
Java provides a number of access modifiers to help you set the level of access you want for classes as well as the fields, methods and constructors in your classes. A member has package or default accessibility when no accessibility modifier is specified.
Access Modifiers
1. private
2. protected
3. default
4. public


19 January 2011

Windows 7 – Enable Telnet

It’s very rare that I use Telnet these days, so it took a long time for me to notice that by default it was not packaged with Windows 7. I did some research and found out that this was also true for Windows Vista. More than likely this was an attempt to make Windows more secure by default, as Telnet is very insecure and whenever you have the choice you should always use SSH. However, with that being said, you can quickly re-enable Telnet by following these steps:

1. Start
2. Control Panel
3. Programs And Features
4. Turn Windows features on or off
5. Check Telnet Client
6. Hit OK

After that you can start Telnet via Command Prompt.

copy ทั้งดุ้นมาจาก http://www.fettesps.com/windows-7-enable-telnet/

01 December 2010

Aggregation & Composition ใน ORM

Aggregation
ความสัมพันธ์แบบ Aggregation เป็นความสัมพันธ์แบบ whole/part ซึ่งส่วน whole และ part สามารถแยกกันทำงานอย่างอิสระเช่น กล่องใส่ของเล่น กับ ตุ๊กตา ถ้าหากไม่มีกล่องใส่ของเล่นเราก็ยังเล่นตุ๊กตาได้ และหากไม่มีตุ๊กตา เราก็ยังเอากล่องใส่ของเล่นไปใส่ ของเล่นอย่างอื่นได้

สัญลักษณ์ที่ใช้ใน UML จะเป็นรูปสี่เหลี่ยมขนมเปียกปูนแบบไม่ทึบ ชีไปทาง whole (กล่องใส่ของเล่น)

Composition
เป็นความสัมพันธ์แบบ whole/part แต่ว่าถ้าหากขาด part ส่วน whole ก็ไม่สามารถทำงานได้ และถ้าไม่มี whole ก็ไม่มี part เช่นมหาวิทยาลัย(University) กับ คณะ(Department) ถ้าไม่มีมหาวิทยาลัยก็ไม่สามารถมีคณะได้ และ หากไม่มีคณะมหาลัยก็ไม่สามารถทำงานได้ เป็นต้น

สัญลักษณ์ที่ใช้ใน UML จะเป็นรูปสี่เหลี่ยมขนมเปียกปูนแบบทึบชี้ไปทาง whole (University)

29 November 2010

ความแตกต่างของ Class Object และ Instance

ลองค้นหาความแตกต่างของ Object กับ Instance ก็ไปเจอ Alfred’s Computing Weblog ซึ่งอธิบายรายละเอียดได้ เข้าใจง่ายดี เลยเอามาลงเขียนเป็นไทยๆ ดูสำหรับคนที่อยากรู้ความแตกต่างของ Class Object และก็ Instance

Object เป็น ตัวที่ห่อหุ่ม state และ behavior เอาไว้โดยมี Class เป็นพิมพ์เขียวหรือต้นแบบของ object ส่วน Instance นัันจะมีได้เพียงหนึ่งเดียวและมีรูปแบบตามคลาส

Object
หากมองในโลกแห่งความจริง Object จะมี 2 ลักษณะเฉพาะคือ state และ behavior อย่างเช่นคน จะมี state เป็น ชื่อ,อายุ และมี behavior เป็น กิน,นอน รถมี state เป็น ความเร็ว,เกียร์ที่ใช้อยู่ โดยมี behavior เป็น เบรค,เปลี่ยนเกียร์ ซึ่งหากมองในด้านของ programming แล้ว state ก็คือ field และ behavior ก็คือ method นั้นเอง

Class
class นั้นเปรียบได้กับพิมพ์เขียวที่ใช้ในการสร้าง object ซึ่งจะเก็บรวบรวม state และ behavior เอาไว้

Instance
instance จะก๊อบเอาลักษณะของ class แล้วแสดงตาม object เมื่อเราทำการสร้าง instance ระบบจองเมโมรี่ไว้

หากมองเป็นโค๊ดจะได้รูปแบบ

Class
public Class Student {
String name;
Integer age;

public void eat(){
.................
}

public void sleep(){
................
}
}

Instance
Student zeroEngine;

Object
zeroEngine = new Student();

ที่มา : Alfred’s Computing Weblog