Author Archive
Powerbuilder Resizing the Controls Automatically
Resizing the Controls Automatically We can make w_product_master window more useful, by simply resizing the DataWindow controls whenever the user resizes the window. To do this, we have to add some code to the resize event of the w_product_master: // Object: w_product_master // Event: Resize dw_query.x = 10 dw_query.y = 10 dw_query.Width = WorkSpaceWidth() – …
การตรวจสอบว่า มีไฟล์ไดบ้างที่ เขียนลงใน server เราวันนี้
1. สร้างไฟล์ logx ดังนี้ #touch –date “2013-11-03” /tmp/logx (เป็นการกำหนดค่าวันที่ๆเราต้องการ) #find /var/www/html -newer /tmp/logx (ค้นหาไฟล์ที่ถูกสร้างในวันข้างบน) #find /var/www/hmtl -daystart -ctime 10 -print 2. จะได้ดังรูป 3.ลองนำไปใช้ดูครับ กรณีมีผู้ไม่ประสงค์ดี เข้ามาเยือน Server ท่าน จะช่วยได้ในระดับหนึ่ง
MySQL function TO_DAYS() รู้ไหมว่าทำงานอย่างไร
Syntax TO_DAYS(date); ตัวอย่าง : SELECT TO_DAYS(‘2013-11-01’); โปรแกรม จะคืนค่า จำนวนวัน จากปีที่ 0 to 20131101
การ remove password mapdrive Windows 7
1. คลิก “Start’, ค้นหา“Credential Manager” หรือ เข้าไปที่ -> Control Panel -> Credential Manager 2. คลิก ส่วนของ “Manage your credentials”. 3. คลิก ลูกศรลง ของ credential ที่ต้องการ remove. 4. คลิก “Remove from vault”.
Creating ext4 filesystems
Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type: # mke2fs -t ext4 /dev/DEV or # mkfs.ext4 /dev/DEV Once the filesystem is created, it can be mounted as follows: # mount -t ext4 /dev/DEV /wherever If you have a sufficiently new system, the “-t ext4” should …
วิธีเปิดใช้งาน NET Framework 3.5 บน Windows 8 ในโหมดออฟไลน์
ขั้นตอนที่ 1: ใส่แผ่นดีวีดี Windows 8 E:\sources\sxs (ในกรณีที่e: DVD) ขั้นตอนที่ 2: เปิดCMD.EXEด้วยสิทธิ์ระดับผู้ดูแลระบบ ขั้นตอนที่ 3: เรียกใช้คำสั่งต่อไปนี้Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:E:\sources\sxs /LimitAccess และกด Enter จบ..
การ นับจำนวน record ทั้งหมดทุก table ที่อยู่ใน MySQL database
สามารถใช้คำสั่งดังนี้ SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘{your_db}’; หรือ SELECT TABLE_NAME,SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘your_db’ GROUP BY TABLE_NAME; code php <? $dtb = mysql_query(“SHOW TABLES”) or die (mysql_error()); $jmltbl = 0; $jml_record = 0; $jml_record = 0; while ($row = mysql_fetch_array($dtb)) { $sql1 = mysql_query(“SELECT * FROM ” . $row[0]); $jml_record = …
เมื่อ centOS เจอปัญหา ไม่เห็น network card [ Device eth0 does not seem to be present, delaying initialization]
Device eth0 does not seem to be present, delaying initialization แก้ไขดังนี้ #rm -f /etc/udev/rules.d/70-persistent-net.rules #reboot
การติดตั้ง และเริ่มใช้งาน Pentaho
ตาม link นี้เลยครับ ละเอียดมากๆๆๆ http://akbarahmed.com/2012/05/12/install-pentaho-bi-server-4-5-on-windows-7-x64/
Mysql – How to use UPDATE with SELECT
การดึงข้อมูล จาก table1 มา update ใน table2 UPDATE doctor INNER JOIN zz_muser ON doctor.fname = zz_muser.fname AND doctor.lname = zz_muser.lname SET doctor.shortname = zz_muser.username
การสำรองข้อมูล
แนะนำการสำรองข้อมูลทั้ง backup และ restore cp เป็นคำสั่งพื้นฐานเบื้องต้นที่ใช้คัดลอกข้อมูล ลินุกซ์นิยมรูปแบบคำสั่งเป็นประมาณว่า cp source target โดยที่ source หมายถึง directory หรือ file ต้นทาง ส่วน target หมายถึง directory หรือ file ปลายทาง ลองคำสั่ง cp -pv /etc/resolv.conf /tmp ใช้คัดลอกแฟ้มต้นทางคือ /etc/resolv.conf ไปเก็บไว้ที่ directory /tmp ค่า -p คือให้คงค่ารายละเอียดของต้นฉบับเดิมเช่นเวลา -v คือให้แสดงขั้นตอนขณะทำงาน ผลคือได้แฟ้มใหม่อยู่ที่ /tmp/resolv.conf ลองคำสั่ง cp -pv /etc/resolv.conf /tmp/mytest.txt ใช้คัดลอกแฟ้มต้นทางคือ /etc/resolv.conf ไปเก้บที่แฟ้ม /tmp/mytest.txt ผลคือได้แฟ้มใหม่อยู่ที่ /tmp/mytest.txt เนื้อหาเดียวกับ /etc/resolv.conf ลองคำสั่ง …
DATEDIF บน excel
=DATEDIF($A14,$B14,”Y”) & “-” & DATEDIF($A14,$B14,”YM”) & “-” & DATEDIF($A14,$B14,”MD”)
เมื่อ Mysql แจ้ง “lost connection to mysql server at ‘reading initial communication packet’ system error 0”
เจอปัญหาของ Mysql 5.5.28-0ubuntu0.12.04.2 (Ubuntu) เนื่องจากDatabases มี table 3220 table แรกๆ ก็ใช้งานได้ปกติ พอใช้ไปได้สัก 5 วัน ปรากฏว่าเจอ Error ตามรูปนี้ ทำให้ไม่สามารถ access ข้อมูลจาก tool ได้ แต่สามารถLogin เข้า Consol ที่หน้า Server ได้ ซึ่งก็ ไม่สามารถเรียกใช้ Database ได้เช่นกัน ปัญหานี้แก้ไม่ยากครับ เริ่มจาก (Ubuntu 12.04) pico /etc/mysql/my.cnf เพิ่ม open_files_limit = 8192 ในส่วน [mysqld] restart mysql เท่านี้ก็เสร็จแล้วคร๊าบ…..