วันพุธที่ 23 พฤศจิกายน พ.ศ. 2554

Why we can't find document.referer ?

INFO: Internet Explorer Does Not Send Referer Header in Unsecured Situations


When linking from one document to another in Internet Explorer 4.0 and later, the Referer header will not be sent when the link is from an HTTPS page to a non-HTTPS page. The Referer header also will not be sent when the link is from a non-HTTP(S) protocol, such as file://, to another page.

MORE INFORMATION

The Referer header is a standard HTTP header in the form of "Referer: <URL>," which indicates to a Web server the URL of the page that contained the hyperlink to the currently requested URL. When a user clicks on a link on "http://example.microsoft.com/default.htm" to "http://example.microsoft.com/test.htm," the theoretical example.microsoft.com Web server will be sent a referer header of the form "http://example.microsoft.com". 

However, Internet Explorer will not send the Referer header in situations that may result in secure data being sent accidentally to unsecured sites. For example, Internet Explorer will not send the Referer header for each of the following example hyperlinks from one document URL to another document URL:
  javascript:somejavascriptcode --> http://example.microsoft.com file://c:\alocalhtmlfile.htm  --> http://example.microsoft.com https://example.microsoft.com --> http://www.microsoft.com 					
This prevents local file names from being sent inadvertently to Web servers when linking from local content to Web sites that might snoop on such information. Also, many secure (HTTPS) Web servers store secure information such as credit-card data in the URL during a GET request to a CGI or ISAPI server application. This information can be unwittingly sent in the Referer header when linking out of an "https://" server to an "http://" server elsewhere on the Web. Internet Explorer attempts to prevent this bad practice by not sending the Referer header when transitioning from an HTTPS URL to a non-HTTPS URL.
http://support.microsoft.com/kb/178066

--
Im'


วันศุกร์ที่ 18 พฤศจิกายน พ.ศ. 2554

Exception in Java Programming

For awhile, I develop many enterprise software based on JavaEE Blue-Print Pattern. Basically, I have to write a three layer of Programming, Such as User-Interface, Service, Data Access.

I have seen some mistake about Exception used. For example, In UI-Layer which have to call 2-3 service. my co-worker always try-catch for each service call. That is not right.

private void uiAction(){
try {
// Call abcService

} catch (Exception ex){}

try {
// Call defService

} catch (Exception ex){}

}

What's the result?
This code will have a hidden bug about data-flow and it's hard to find.

It should be...


private void uiAction(){
try {

// Call abcService

// Call defService

} catch (Exception ex){
// Display an error to user.
alert(ex)
}

}

Just a simple pattern. You will meet a zero-defect soon. Don't hide any exception.

Anyway, There are 2 kind of Exception, One is Programmatic, Another one is Data-Flow Exception. So you should know how to handle for exception as well.










วันอังคารที่ 18 ตุลาคม พ.ศ. 2554

วันจันทร์ที่ 17 ตุลาคม พ.ศ. 2554

Reset root password ของ MySQL | howforge.com

Reset root password ของ MySQL | howforge.com:

'via Blog this'

เรามาดูวิธี reset root password ของ mysql กัน ทำดังนี้

  1. เ พิ่ม "skip-grant-tables" ลงใน file my.cnf โดยปกติทั่วไปจะเก็บอยู่ที่ /etc/my.cnf โดยเพิ่มในส่วนของ [mysqld] สำคัญมากห้ามลืม อย่าใส่ผิดที่ ไม่ัอย่างนั้นจะไม่สามารถ reset password ได้
  2. สั่ง restart mysql service ซะ ในที่นี้ ผมใช้ RH base เป็นหลัก ใครใช้อย่างไหน ก็ restart อย่างนั้นล่ะ
    ถ้าเป็น RH สั่งแบบนี้
    # /etc/init.d/mysqld restart

    หรือแบบนี้

    # service mysql restar

Running JAX-WS with Tomcat « Technical blog

Running JAX-WS with Tomcat « Technical blog:

'via Blog this'

วันพฤหัสบดีที่ 13 ตุลาคม พ.ศ. 2554

Vaain-Tree Lazy HierachicalContainer







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Have a tree with some unexpanded root items
final Tree tree = new Tree("My Tree");
tree.addItem("One Node");
tree.addItem("Another Node");
tree.addItem("Third Node");

// When an item is expanded, add some children
tree.addListener(new Tree.ExpandListener() {
int childCounter = 0;

public void nodeExpand(ExpandEvent event) {
// No children for the first node
if (event.getItemId().equals("One Node")) {
tree.setChildrenAllowed(event.getItemId(), false);

getWindow().showNotification("No children");
} else {
// Add a few new child nodes to the expanded node
for (int i=0; i < 3; i++) {
String childId = "Child " + (++childCounter);
tree.addItem(childId);
tree.setParent(childId, event.getItemId());
}

getWindow().showNotification("Added nodes");
}
}
});

// When an item is collapsed, remove all children
tree.addListener(new Tree.CollapseListener() {
public void nodeCollapse(CollapseEvent event) {
// Remove all children of the collapsing node
removeItemsRecursively(tree, event.getItemId());

getWindow().showNotification("Removed nodes");
}

void removeItemsRecursively(Tree tree, Object item) {
// Find all child nodes of the node
Collection children = tree.getChildren(item);
if (children == null)
return;

// The list is unmodifiable so must copy to another list
LinkedList children2 = new LinkedList();
for (Iterator i = children.iterator(); i.hasNext();)
children2.add((String) i.next());

// Remove the children of the collapsing node
for (Iterator i = children2.iterator(); i.hasNext();) {
String child = i.next();
removeItemsRecursively(tree, child);
tree.removeItem(child);
}
}
});

layout.addComponent(tree);



PagedTable Add-on - vaadin.com

PagedTable Add-on - vaadin.com:

'via Blog this'

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

Pantipcafe. For Android, Version 5.80

What's New?
-Give, Pantip's member user can give a score to someone that you like. Just one score per give.

Anyway, I don't have a time to test this feature when user's give-point is empty. User will get a real response message from Pantip's Server. That will be handle in next version.




วันอังคารที่ 20 กันยายน พ.ศ. 2554

วันศุกร์ที่ 16 กันยายน พ.ศ. 2554

เจาะใจ - 20110908 - เจาะกระแสร้อนคนดนตรี via TV Thailand for Android http://bit.ly/q3bQzP

เจาะใจ - 20110908 - เจาะกระแสร้อนคนดนตรี via TV Thailand for Android http://bit.ly/q3bQzP

กลัวกรุงเทพรถติดรถเยอะ

เห็นผู้คนบ่นเหลือเกินเรื่องนโยบายคืนภาษีสรรพสามิตร
  • กลัวกรุงเทพรถติดรถเยอะ 
ลองไปพิจาราณา
  • จำนวนประชากรที่เพิ่มขึ้นต่อพื้นที่ 
  • เข้าใจความเป็นเมืองหลวงหรือเมืองเศรษฐกิจหรือไม่

สำนักงานสถิติแห่งชาติ

ข้อมูลสถิติและสารสนเทศการขนส่งและจราจร

รถจดทะเบียนใหม่ ปี 2549-2554
http://www.otp.go.th/th/pdf/Statistic/carregister/newcarregis_54(jan-jun)





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

Sponge ฉลาดสุดๆ - 20110915 - เมลามีน อาหารปลอม,ห้องน้ำชายหญิงเท่าเทียมกัน,ระบบนำส่งนาโนต้านมะเร็ง,เพลิงผายลม via TV Thailand for Android http://bit.ly/qMfWfq

Sponge ฉลาดสุดๆ - 20110915 - เมลามีน อาหารปลอม,ห้องน้ำชายหญิงเท่าเทียมกัน,ระบบนำส่งนาโนต้านมะเร็ง,เพลิงผายลม via TV Thailand for Android http://bit.ly/qMfWfq

Debugging Hibernate Query-Parameter


How to display hibernate sql parameter values – Log4j

http://www.mkyong.com/hibernate/how-to-display-hibernate-sql-parameter-values-log4j/

  # Direct log messages to stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n   # Root logger option log4j.rootLogger=INFO, stdout   # Hibernate logging options (INFO only shows startup messages) log4j.logger.org.hibernate=INFO   # Log JDBC bind parameter runtime arguments log4j.logger.org.hibernate.type=trace


--
Im'


วันอังคารที่ 13 กันยายน พ.ศ. 2554

วันเสาร์ที่ 3 กันยายน พ.ศ. 2554

[เนชั่นทันข่าว] 17:21 น. ปชป.อัดรัฐบาลไม่เข้าใจปัญหาน้ำท่วมทำแก้ปัญหาช้า

17:21 น. ปชป.อัดรัฐบาลไม่เข้าใจปัญหาน้ำท่วมทำแก้ปัญหาช้า
http://breakingnews.nationchannel.com/read.php?newsid=527558

#nnanews

ทั้งเพื่อไทยและปชป ดูสรยุทธช่องสามเป็นตัวอย่าง แล้วเลียนแบบซะ

วันศุกร์ที่ 26 สิงหาคม พ.ศ. 2554

Jazz ยามดึก

Jazz ยามดึก
http://www.pantip.com/cafe/isolate/topic/M10987813/M10987813.html

ข้อสรุปรายการอาหารนายก

http://www.oknation.net/blog/sigree/2011/08/23/entry-1

5 เพื่อความชัดเจน ผมขอระงับการเผยแพ่ร บล็อก 
http://www.oknation.net/blog/sigree/2011/08/19/entry-5
ซึ่งเป็นต้นเรื่องไว้ก่อน  และจะดูความชัดเจนของเอกสารฉบับนี้อีกครั้งก่อนดำเนินการต่อไป


--
Im'


วันศุกร์ที่ 19 สิงหาคม พ.ศ. 2554

ปัญหาทั่วไปใน Version 5.7

  1. Icon แสดงไม่ตรงกับภาพ, ในกรณีนี้เป็นปัญหาจากการ Upgrade ข้าม Version ทำให้ Database (sqlite) มีการผิดพลาด, วิธีแก้ไข ให้ทำการ Uninstall แล้ว Install App ใหม่อีกครั้ง
  2. SocketException อันนี้เป็นเรื่องปกติ ในการสื่อสารระหว่าง Peer ด้วยกัน (Client to Server), Connection Reset by peer แสดงถึง Server ได้ Reject Connection อาจจะเป็น TCP-Ack/Flag สักตัว ทำให้ Socket บน Server เต็มแล้ว Reject Request กลับมา ปัจจุบันยังไม่ได้ Implement Auto-Retry. วิธีแก้คือ Refresh ข้อมูลใหม่

วันจันทร์ที่ 25 กรกฎาคม พ.ศ. 2554

วันพฤหัสบดีที่ 21 กรกฎาคม พ.ศ. 2554

วันจันทร์ที่ 4 กรกฎาคม พ.ศ. 2554

[PantipCafe] กองทุนรวมหุ้นแบงค์ไหน ปันผลดีๆ บ้างครับ

กองทุนรวมหุ้นแบงค์ไหน ปันผลดีๆ บ้างครับ
http://tinyurl.com/43vus2f

[ไทยรัฐ] 15 ปีบนตำนานแห่งความสำเร็จของ PORSCHE BOXSTER

15 ปีบนตำนานแห่งความสำเร็จของ PORSCHE BOXSTER
http://tinyurl.com/3w4uyhq

#thairath

[PantipCafe] ข้อจำกัดของความฉลาด

ข้อจำกัดของความฉลาด
http://tinyurl.com/3vlakvt

[PantipCafe] "น้ำใจนักกีฬา" เธอคือสิ่งที่ขาด

"น้ำใจนักกีฬา" เธอคือสิ่งที่ขาด
http://tinyurl.com/3p8xlny

วันพุธที่ 29 มิถุนายน พ.ศ. 2554

วันจันทร์ที่ 20 มิถุนายน พ.ศ. 2554

วันเสาร์ที่ 18 มิถุนายน พ.ศ. 2554

[PantipCafe] สารคดีชีวิตสัตว์โลก :: ผู้หญิงกับการลงทุน

สารคดีชีวิตสัตว์โลก :: ผู้หญิงกับการลงทุน
http://tinyurl.com/6hw52o8

[สนุก! ข่าวประจำวัน]หนุ่มวินรับได้ค่าจ้าง1500บ.แจกซีดีชุมนุม

หนุ่มวินรับได้ค่าจ้าง1500บ.แจกซีดีชุมนุม
http://tinyurl.com/3o2unmm


#sanook

[PantipCafe] โปรแกรม คํานวน ดอกเบี้ย เงินกู้ บ้าน ธนาคาร Home loan management planner

โปรแกรม คํานวน ดอกเบี้ย เงินกู้ บ้าน ธนาคาร Home loan management planner
http://tinyurl.com/62grfk8

วันศุกร์ที่ 10 มิถุนายน พ.ศ. 2554

[PantipCafe] ผุดรถไฟฟ้าสาย"สีเหลือง" ลาดพร้าว-บางกะปิ 12.6กิโลฯ ใช้งบฯ1.6หมื่นล้าน

ผุดรถไฟฟ้าสาย"สีเหลือง" ลาดพร้าว-บางกะปิ 12.6กิโลฯ ใช้งบฯ1.6หมื่นล้าน
http://tinyurl.com/3w28c8t

[PantipCafe] ทำไมต้องปลดป้าย "อย่าให้....เข้าสภา" เพราะนึกว่า ปชป. พท. หรือ พรรคต่างๆจัดให้ พธม. ซะอีก

ทำไมต้องปลดป้าย "อย่าให้....เข้าสภา" เพราะนึกว่า ปชป. พท. หรือ พรรคต่างๆจัดให้ พธม. ซะอีก
http://tinyurl.com/3kjq6lv

[PantipCafe] เอาคลิปมาฝากครับ Thailand's got Talent Special Season

เอาคลิปมาฝากครับ Thailand's got Talent Special Season
http://tinyurl.com/4xhdm42

[PantipCafe] วิธีต่างๆในการสร้างเซลไฟฟ้าพลังงานแสงอาทิตย์เองที่บ้าน

วิธีต่างๆในการสร้างเซลไฟฟ้าพลังงานแสงอาทิตย์เองที่บ้าน
http://tinyurl.com/3t7hgg6

วันพฤหัสบดีที่ 9 มิถุนายน พ.ศ. 2554

วันพุธที่ 1 มิถุนายน พ.ศ. 2554

วันอังคารที่ 24 พฤษภาคม พ.ศ. 2554

[PantipCafe] ถ้าถามผมว่า Android ทำอะไรได้บ้าง

ถ้าถามผมว่า Android ทำอะไรได้บ้าง
http://tinyurl.com/434s6tc

[PantipCafe] ขอแนวทางครับ..มีพี่น้องที่เริ่มจากศูนย์-แล้วปัจจุบันลืมตาอ้าปากได้..ทำอย่างไรครับ

ขอแนวทางครับ..มีพี่น้องที่เริ่มจากศูนย์-แล้วปัจจุบันลืมตาอ้าปากได้..ทำอย่างไรครับ
http://tinyurl.com/3g28pwx

[Bangkok Post] Internet summit to discuss rules

Internet summit to discuss rules
http://tinyurl.com/3cvydsu

#bangkokpost

[PantipCafe] ศึกแผงลอย "สยามสแควร์"ยื้อ 8 เดือน "จุฬาฯ" เกินต้านยอมถอย แฉ! "เจ้าหน้าที่" ไม่ร่วมมือ!!!

ศึกแผงลอย "สยามสแควร์"ยื้อ 8 เดือน "จุฬาฯ" เกินต้านยอมถอย แฉ! "เจ้าหน้าที่" ไม่ร่วมมือ!!!
http://tinyurl.com/3vv3m9j

วันจันทร์ที่ 16 พฤษภาคม พ.ศ. 2554

วันเสาร์ที่ 14 พฤษภาคม พ.ศ. 2554

วันพุธที่ 11 พฤษภาคม พ.ศ. 2554

วันพุธที่ 4 พฤษภาคม พ.ศ. 2554

วันศุกร์ที่ 15 เมษายน พ.ศ. 2554

Human Error กับ 12Call+Internet Unlimited กรุณาเติมเงินอย่างต่อเนื่อง

Human Error กับ 12Call+Internet Unlimited กรุณาเติมเงินอย่างต่อเนื่อง

ปกติผมใช้ 12Call และสมัคร Internet Unlimited แต่ดันพลาดนิดเดียวเองครับ
สิ่งที่ผมพลาดคือ จำวันเติมเงินผิดไป 1 วัน ระบบก็จัดการยกเลิก Internet Unlimited ตามปกติ โดยไม่มี SMS มาบอกกล่าวกันเลย สิ่งที่ผมต้องเผชิญคือ การต่อ Internet ราคานาทีล่ะ 1 บาทครับ รู้ตัวอีกทีก็เหลือ 0.25 จากเงิน 1135.25 ที่มีอยู่

จบแล้วครับ Human Error ของผมเองครับ :)
ทั้งหมดนี้ ประเด็นเดียวที่คาใจ AIS ควรมี่ SMS แจ้งเตือนว่าได้ถอด Promotion Internet ของผมออกแล้วด้วย ซึ่งจะได้ไม่ต้องเสียเงินมากมายอะไรเช่นนี้ ครับ


เมื่อ Unlimited 650 ได้หมดไปแล้ว ตอนนี้เข้าสู่ยุค Unlimited 790-799 กันทุกค่ายเลยครับ


[PantipCafe] ชีวิตที่มีความสุข อาจจะเป็น ชีวิตที่ได้ทำสิ่งดี ๆ เพื่อตัวเองและคนอืน

ชีวิตที่มีความสุข อาจจะเป็น ชีวิตที่ได้ทำสิ่งดี ๆ เพื่อตัวเองและคนอืน
http://tinyurl.com/3qlbtg8

#readOnly.

Device Statistic On PantipCafe for Android


In this week, I have to say good-bye to Wellcom A88. It's out already.

วันพุธที่ 13 เมษายน พ.ศ. 2554

วันเสาร์ที่ 26 มีนาคม พ.ศ. 2554

วันอังคารที่ 22 มีนาคม พ.ศ. 2554

วันศุกร์ที่ 18 มีนาคม พ.ศ. 2554

วันอังคารที่ 15 มีนาคม พ.ศ. 2554

Device Statistic


On the device section, It's unbelievable., Samsung Galaxy Tab is the top.

com.ac.reader
1
Samsung Galaxy Tab
20.2% (1,071)
2
Samsung Galaxy S
16.3% (864)
3
LG Optimus One
8.9% (471)
4
Samsung Galaxy Spica
4.3% (228)
5
HTC Desire
4.1% (215)
6
GT-S5830
3.4% (180)
7
a99
3.2% (167)
8
A88
3.0% (161)
9
Motorola Defy
3.0% (159)
10
touchstone
2.7% (145)

วันอังคารที่ 8 มีนาคม พ.ศ. 2554

วันจันทร์ที่ 7 มีนาคม พ.ศ. 2554

[ไทยรัฐ] 'อย่ามองว่าไร้สาระ...' เปิดโฉมหน้า 2 คนไทยพิมพ์เอสเอ็มเอสเร็วสุดในประเทศ...!

'อย่ามองว่าไร้สาระ...' เปิดโฉมหน้า 2 คนไทยพิมพ์เอสเอ็มเอสเร็วสุดในประเทศ…!
http://tinyurl.com/48z4jvx

#thairath #readOnly.

[ไทยรัฐ] ทางหนีทีไล่ ของหนุ่มลั้ลลา กับปัญหาเซ็กซ์ชั่วข้ามคืน

ทางหนีทีไล่ ของหนุ่มลั้ลลา กับปัญหาเซ็กซ์ชั่วข้ามคืน
http://tinyurl.com/4l2bcnb

#thairath #readOnly.

[PantipCafe] ไทยรัฐ ฟ้อง Apple ปล่อยแอพไทยรัฐปลอม ลง Appstore

ไทยรัฐ ฟ้อง Apple ปล่อยแอพไทยรัฐปลอม ลง Appstore
http://tinyurl.com/699zxuc

#readOnly.

วันศุกร์ที่ 4 มีนาคม พ.ศ. 2554

Fix Fource Crash V 5.1.3

เมื่อวานได้แก้ ArrayIndexOutOfBoundsException ไปนะครับ
สาเหตุส่วนใหญ่ เกิดจากการ SubString นะครับ เพราะว่า PantipCafe ไม่มี API ในการดึงข้อมูล
โปรแกรมนี้ต้องดึง HTML มาใส่ DTO ให้เหมาะสม

ส่วนวันนี้แก้

android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@4a02f9b0 is not valid; is your activity running?
at android.view.ViewRoot.setView(ViewRoot.java:505)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:241)
at com.ac.reader.Topic.showAlertDialog(Topic.java:313)


showAlertDialog <- AsyncTask หา View ไม่เจอ มักจะเกิดในตอนที่ โหลดกระทู้อยู่ แล้วเห็นว่ามันนาน แล้วกด Back แล้วเปิดกระทู้ใหม่ ในตอนที่ AsyncTask ทำงานเสร็จแบบมี Error เช่น Network Connection Reset จะหา View เดิม เพื่อเปิดหน้าจอ Alert ไม่ได้ ก็เลย Error ตามที่เห็นครับ



What's News
- แก้ Force Close รอบสอง :)
- Reorder Setting
- New value on Setting Item/Page

ตอนนี้กำลังไล่แก้ Force Close อยู่นะครับ ช่วยกัน Submit Bug มาเรื่อยๆ นะครับ
ขอบคุณครับ



วันอาทิตย์ที่ 27 กุมภาพันธ์ พ.ศ. 2554

[PantipCafe] PantipCafe for Android Test

PantipCafe for Android Test
http://tinyurl.com/4b4ndxt

#readOnly.

PantipCafe for Android Version 5.1.

PantipCafe for Android Version 5.1.
https://market.android.com/details?id=com.ac.reader

What's News?
  • สามารถตั้งกระทู้ได้เกือบทุกห้อง ยกเว้นห้องราชดำเนินครับ
  • เปลี่ยนชื่อนิดนึงครับ - readOnly. ที่เป็น Signature มาตั้งนาน
Limitation
  • หลังจากสร้างกระทู้เสร็จแล้วใน Version นี้จะมีแค่ ข้อความบอกว่าเสร็จแล้วเท่านั้น ขอติดไว้ก่อนครับ คาดว่า ถ้าเป็น Version ผมส่งกระทู้เสร็จเรียบร้อยจะพาไปหน้า กระทู้นั้นเลย
  • Facebook Share อันนี้ผมก็ใช้ไม่ได้นานแล้วเหมือนกันครับ ทางเทคนิคแล้ว ก็ส่งค่าตามที่ Intent_VIEW มีให้ใส่ คิดว่าน่าจะรอให้ Facebook Update ให้สามารถผ่าน Share ผ่านตัว App เองได้เลย ไม่ต้องพาไปหน้า share.php

Usage Status
v5.1.0
(447)
7696 total
5029 active installs (65%)



:)


Open Source Web Animation with Android - Views: Part A

Open Source Web Animation with Android - Views: Part A

วันศุกร์ที่ 25 กุมภาพันธ์ พ.ศ. 2554

วันพุธที่ 23 กุมภาพันธ์ พ.ศ. 2554

วันเสาร์ที่ 19 กุมภาพันธ์ พ.ศ. 2554