Posts

Showing posts from December, 2009

Easter Eggs : VLC Merry x'mas

Image
ไม่รู้เรียกว่า Easter Eggs ได้รึเปล่า แต่วันนี้ (25 ธ.ค) Icon ของ VLC เปลี่ยนไป มีหมวก Santa Claus โผล่มาด้วย ไม่รู้ว่า Icon มาจากไหน Update จาก internet รึว่า ทำเตรียมไว้ก่อนแล้ว ว่าง ๆ ต้องลองเปลี่ยนวันที่เครื่องดูซะแล้ว ว่ามีวันอื่นอีกรึเปล่า

Axapta : Detecting Type of Variable

static void typeDetect(Args _args) { DictType dictType; ; print "This ID is the TypeId, not the EDT ID - ", typeId(ItemId); print "This ID is what we need - ", typeId2ExtendedTypeId(typeId(ItemId)); print "This ID is wrong - ", new DictType(typeId(ItemId)).id(); dictType = new DictType(typeId2ExtendedTypeId(typeId(ItemId))); print "This ID is correct - ", dictType.id(); print dictType.name(); pause; }

JavaScript : AJAX for Province, Amphur, Tumbol

Image
เริ่มจาก ได้ฐานข้อมูล จังหวัด -> อำเภอ -> ตำบล ที่ดีมาก มาจากไหน ตั้งแต่เมื่อไหร่ ไม่รู้ แต่พอจะใช้ขึ้นมา เพิ่งพบว่า ที่ได้มานั้นมันดีจริง ๆ ดียังไง ให้เปิด ตรวจสอบหมายเลขบัตรประจำตัวประชาชน ประกอบครับ (ที่จริงต้องเปิด http://th.wikipedia.org/wiki/เลขประจำตัวประชาชนไทย ด้วย) มาดูฐานข้อมูลกันก่อน 1.จังหวัด ตารางเป็นแบบนี้ ข้อมูลเป็นแบบนี้ สังเกตดูนะครับ id มันคือ หลักที่ 2+3 ของเลขบัตรประจำตัวประชาชน 2.อำเภอ ตารางเป็นแบบนี้ ข้อมูลเป็นแบบนี้ id ของตารางนี้ ก็คือ หลักที่ 4+5 ของเลขบัตรประจำตัวประชาชน 3.ตำบล ตารางเป็นแบบนี้ ข้อมูลเป็นแบบนี้ อันนี้ หลักที่ 6-10 ค่อนข้างกว้าง จึงระบุไม่ได้ แต่ได้ 2 อันแรกก็ดูดีแล้วน่ะ AJAX กับ PHP ก็ต้องเริ่มจาก 1.เตรียมการสำหรับ form $ProvinceSelect.=" "; $SQL="SELECT id,name FROM sci._province ORDER BY id"; $NumRows=$myDB->Query($SQL); while($row=$myDB->GetRow()){ $ProvinceSelect.=" ".$row["name"]." "; } $ProvinceSelect.=" "; $AmphurSelect=" "; $AmphurSelect.=&q

ความรู้ราคา 9 บาท

Image
วันก่อนไปเดินห้าง ระหว่างรอใครบางคน ก็แวะร้านหนังสือ บังเอิญเจอ หนังสือเล่มเล็ก ๆ ของสำนักพิมพ์นานมีบุ๊คส์ เล็กจริง ๆ เล็กกว่าฝ่ามืออีก มีหลายเรื่องเลย ลองซื้อมาอ่านดูเล่มนึง ราคา 9 บาท เรื่อง สำนวนไทยยังไงต้องรู้ [caption id="attachment_698" align="alignnone" width="224" caption="เล็กอย่างนี้ อุตส่าห์มีที่คั่นให้ด้วย"] [/caption] พอเอามาเปิดอ่านดู ก็เจอสำนวนที่เราใช้กันโดยไม่รู้ที่มา เช่น - ข่าวโคมลอย มีที่มาจากสำนักพิมพ์ฉบับหนึ่งที่มี โลโก้เป็นรูปโคมลอย มักจะตีพิมพ์ข่าวในลักษณะตลก ๆ ไม่ค่อยน่าเชื่อถือ - ไกลปืนเที่ยง แต่ก่อนจะมีการยิงปืนบอกเวลาเที่ยงในพระนคร ซึ่งก็จะได้ยินเฉพาะในเมือง คนที่อยู่นอกเมืองก็จะไม่ได้ยิน (แต่ก่อนนึกว่าปืนเที่ยง หมายถึง ปืนแม่นซะอีก) พวกไกลปืนเที่ยงจึงหมายถึง พวกบ้านนอกนั่นเอง - ถีบหัวส่ง มาจากเรือที่เวลาเทียบท่าใช้หัวเรือเข้า เวลาจะออกก็ต้องถีบหัวเรือออก หมายถึง หมดประโยชน์แล้ว ไม่ต้องการแล้ว ไม่ใช่ถีบหัวกันจริง ๆ เด้อ มีอีกหลายสำนวนครับ แต่ขอตบท้ายด้วย - ชักแม่น้ำทั้งห้า ที่หมายถึง พูดจาหว่านล้อมเพื่อกดดัน ตอนแรก

Axapta : Find for update

ปกติจะ update ทีนึง ก็ใช้ select forupdate เพิ่งรู้ว่าทำแบบนี้ได้ด้วย ใช้ static method ที่ชื่อ find ซึ่ง table ส่วนใหญ่จะมีอยู่แล้ว แล้วก็ใส่ parameter forupdate เป็น true static void FindForUpdate(Args _args) { EmplTable myRow; ; ttsbegin; myRow = EmplTable::find('0154-3',true); myRow.Name ='Nikom'; myRow.update(); ttscommit; }

eXtplorer : PHP, AJAX File Manager

Image
แนะนำ file manager น่าใช้ครับ ใช้ร่วมกับ Joomla ได้ด้วย eXtplorer is a web-based File Manager. You can use it to * browse directories & files on the server and * edit, copy, move, delete files, * search, upload and download files, * create and extract archives, * create new files and directories, * change file permissions (chmod) and much more... You can even use eXtplorer to login to the FTP server (like net2ftp) and work as if you were using an FTP client. Access via WebDAV is also possible (requires some extra work and a database!). eXtplorer is released under a dual-license: You can choose wether you want to use eXtplorer under the Mozilla Public License (MPL 1.1) or under the GNU General Public License (GNU/GPL). Note that if you decide to distribute/use eXtplorer under the MPL, you are not allowed to use the ExtJS Javascript library. eXtplorer needs at least PHP 4.3 on the server and an up-to-date browser with Javascript enabled to run. http://extplore