วันอังคารที่ 17 มีนาคม พ.ศ. 2552

Network : How to determine which program is using a given port ?

Question:
คือว่าการ์ดแลนกระพริบตลอดทั้งวัน เลยมีความสงสัยว่าโปรแกรมอะไรวิ่งอยู่ ณ ตอนนั้นก็นีกออกแค่คำสั่งเดียวคือ ใช้คำสั่ง netstat ใน command prompt แต่ผลได้ดังภาพ คือรู้แต่ port ที่วิ่งอยู่ แต่ไม่รู้โปรแกรมที่ใช้งาน port นั้นๆ



Solution:
ถ้าอยากรู้ว่า program ไหนวิ่งอยู่ port ไหน ใช้คำสั่ง netstat -a -n -p tcp -b ก็จะทราบได้ทันทีว่าโปรแกรมไหนใช้งาน port ไหนอยู่


Credit:

วันจันทร์ที่ 9 มีนาคม พ.ศ. 2552

JSF: How can I set the action and actionListener in Backing Beans ?

[ Set the action ]
public String button_action() {
Hyperlink hyperTmp = new Hyperlink();
// Create method expression
MethodExpression me = (MethodExpression)this.getApplication().getExpressionFactory().createMethodExpression(
getFacesContext().getELContext(), "#{Page1.LinkTest_action}", String.class,new Class[] {});

hyperTmp.setActionExpression(me);
}

public String LinkTest_action() {
// TODO: Process the action
}

[ Set the actionListener ]


public String button_action() {
Hyperlink hyperTmp = new Hyperlink();
// Create method expression
MethodExpression me = (MethodExpression) this.getApplication().getExpressionFactory().createMethodExpression(
getFacesContext().getELContext(), "#{Page1.
LinkTest_actionListener}", null, new Class[]{ActionEvent.class});
hyperTmp.setActionListenerExpression(me);
}

public void LinkTest_actionListener(ActionEvent actionEvent) {
Hyperlink hyperTmp = (Hyperlink) actionEvent.getComponent();
}

อ้างอิง

วันพฤหัสบดีที่ 4 กันยายน พ.ศ. 2551

OpenOffice : Creating Master Page in Impress

  1. สร้าง new presentation โดยเลือก Empty Presentation แล้วกด Create
  2. ไปที่ menu view > Master > กดเลือก Slide Master แล้วจะได้ตามภาพข้างล่าง
  3. ภึงขั้นตอนนี้ก็ตกแต่ง Master Page ให้เต็มที่ตามภาพ
  4. หลังจากนั้นก็ Save โดยไปที่ File > Template > Save
  5. ตั้งชื่อในช่อง New Template และก็เลือก Categories เป็น MyTemplate กด OK
  6. เป็นการเสร็จสิ้นการสร้าง Master Page ลองทดสอบโดยดูไปสร้าง New Presentation แล้วเลือก From Template โดยไปที่ My Template ก็จะเห็น Master Page ที่เราได้สร้างไว้ (ตามภาพข้างล่าง)