Posts

Showing posts from 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

Open Visio file with Dia

Image
Dia เปิดไฟล์ของ Visio (*.vsd) ตรง ๆ ไม่ได้ แต่เปิด XML Drawing (*.vdx) ได้ ดังนั้นก็ง่าย ๆ ด้วยการเปิดไฟล์ Visio แล้ว Save as เป็น XML Drawing (*.vdx) ดังตัวอย่าง

Centralized Log ภาคที่ 3 : Syslog-NG

1.ติดตั้ง Syslog-NG ที่ Log Server และ Server อื่น ๆ ที่เป็น linux apt-get install syslog-ng 2.Config Log Server (/etc/syslog-ng/syslog-ng.conf) options { recv_time_zone (+07:00); send_time_zone (+07:00); sync (0); time_reopen (100); log_fifo_size (1000); long_hostnames (off); use_dns (no); use_fqdn (no); create_dirs (yes); chain_hostnames(yes); keep_hostname (yes); }; source s_sys { file ("/proc/kmsg" log_prefix("kernel: ")); unix-stream ("/dev/log"); internal(); #udp(ip(0.0.0.0) port(514)); #tcp(ip(0.0.0.0) port(514) keep-alive(yes)); }; destination d_mysql { pipe("/var/log/mysql.pipe" template("INSERT INTO logs (host, facility, priority, level, tag, datetime, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes)); }; filter f_filter1 { facility (kern); }; filter f_f

Centralized Log ภาคที่ 2 : PHP SYSLOGVIEWER

1.ดาวน์โหลดและติดตั้ง PHP SYSLOGVIEWER wget http://jaist.dl.sourceforge.net/sourceforge/phpsyslogviewer/phpsyslogviewer-7.2.1.tar.bz2 tar xjvf phpsyslogviewer-7.2.1.tar.bz2 cd phpsyslogviewer-7.2.1 2.สร้างฐานข้อมูล mysql -u root -p mysql > create database syslogng; mysql > exit; mysql -u root -p syslogng < install/phpsyslogviewer.sql 3.สร้างรายชื่อผู้ใช้ vi install/newuser.sql.php php install/newuser.sql.php (ถ้ายังไม่มี php-cli ต้องลงก่อน apt-get install php5-cli) php install/newuser.sql.php | mysql -u root -p syslogng 4.สร้างและตั้งค่าหน้าเว็บ cp -R htdocs /var/www/phpsyslogviewer vi /var/www/phpsyslogviewer/config.php chown root:www-data /var/www/phpsyslogviewer/config.php chmod 440 /var/www/phpsyslogviewer/config.php 5.ลองเข้าดูได้ที่ http://192.168.0.251/phpsyslogviewer 6.เพิ่มความเร็วให้การป้อนข้อมูลลง mysql wget http://jaist.dl.sourceforge.net/sourceforge/phpsyslogviewer/speedupd-7.3.2.tar.bz2 tar xjvf speedupd-7.3.2.tar.bz2 cd speedup-7.3.2ฝ apt-get install debhelper

Centralized Log ภาคที่ 1 : NTP

ติดตั้ง NTP (Network Time Protocol) ตาม พรบ.ว่าด้วยการกระทำผิดเกี่ยวกับคอมพิวเตอร์ พ.ศ. 2550 กำหนดให้ ต้องตั้งนาฬิกาของอุปกรณ์บริการทุกชนิดให้ตรงกับเวลาอ้างอิงสากล (Stratum 0) โดยผิดพลาดไม่เกิน 10 มิลลิวินาที 1.ติดตั้ง apt-get install ntp (ที่ Log Server และ Server อื่น ๆ) 2.ตั้งค่า Log Server ( /etc/ntp.conf ) # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help driftfile /var/lib/ntp/ntp.drift # Enable this if you want statistics to be logged. #statsdir /var/log/ntpstats/ #statistics loopstats peerstats clockstats #filegen loopstats file loopstats type day enable #filegen peerstats file peerstats type day enable #filegen clockstats file clockstats type day enable # You do need to talk to an NTP server or two (or three). server 203.185.69.60 dynamic server time.navy.mi.th dynamic server time.nist.gov dynamic server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 broadcastdelay 0.008 keys /etc/ntp/keys # Access control configuration; see /usr/share/doc/ntp-doc/html/

Ubuntu : Squid error page

Image
เข้าไปแก้ไขได้ที่ /usr/share/squid/errors/English/ แล้วก็เลือก file ที่ต้องการแก้ไข เช่น หน้าสำหรับแสดงว่าถูก block ปกติจะชื่อ ERR_ACCESS_DENIED ตัวอย่าง ERROR: The requested URL could not be retrieved รายการ web ที่ถูก block ในช่วงเวลา 8:00-12:00 น. และ 13:00-17:40 น

Axapta : Open OpenOffice document and Save as

COM OpenOffice; COM oDeskTop; COM oDocument; COMVariant arg; COMVariant byte; Array Arr = new Array(Types::Class); Array oArr = new Array(Types::Class); str url,outFile; COM FileProperties; ; OpenOffice = new Com("com.sun.star.ServiceManager"); oDeskTop = OpenOffice.CreateInstance("com.sun.star.frame.Desktop"); // ############################################################# // เปิดไฟล์ arg = comVariant::createFromArray(Arr); url = "file://Axaptaserver/AxaptaSP4/Excel/Losses.xls"; oDocument = oDeskTop.LoadComponentFromURL(url, "_blank", 0, arg); // ############################################################# // ############################################################# // Save as เป็นอีกไฟล์ FileProperties = OpenOffice.Bridge_GetStruct('com.sun.star.beans.PropertyValue'); FileProperties.Name('Overwrite'); FileProperties.Value(true); oArr.value(1,FileProp

Axapta : Get next number sequence

Image
การเรียกใช้ Number sequence สำหรับ running no. ต่าง ๆ ทำได้โดยใช้คำสั่ง NumberSeq::newGetNum( ProdParameters :: numRefProdJournalId ()).num(); ตรง Parameter ก็เปลี่ยนไปขึ้นอยู่ว่าเป็น Number sequence ของ Module ไหน และจะใช้งานได้ Number sequence ต้องไม่ตั้งค่าให้เป็น Continuous JournalId myJournalId; ; myJournalId = NumberSeq::newGetNum(ProdParameters::numRefProdJournalId()).num(); myJournalId = NumberSeq::newGetNum(PurchParameters::numRefPurchaseOrderId()).num(); myJournalId = NumberSeq::newGetNum(InventParameters::numRefInventJournalId()).num(); myJournalId = NumberSeq::newGetNum(SalesParameters::numRefConfirmId()).num(); การตั้งค่า Number sequence ของแต่ละ module เข้าไปที่ Setup -> Parameters แล้วไปที่ tab Number sequences ตรง Reference แต่ละตัวสามารถ คลิกขวา Go to the main table เพื่อตั้งค่ารูปแบบ Running number ที่ต้องการได้

Axapta : Formatting style in Excel

static void ExcelFormating(Args _args) { #Excel SysExcelApplication excel; SysExcelWorkbooks books; SysExcelWorkbook book; SysExcelWorksheet sheet; SysExcelRange range; SysExcelStyles styles; SysExcelStyle style; SysExcelInterior interior; SysExcelFont font; COM _char, _r; ; excel = SysExcelApplication::construct(); excel.visible(true); books = excel.workbooks(); book = books.add(); sheet = excel.activeSheet(); range = sheet.range('A1'); styles = book.styles(); style = styles.add('MyStyle'); interior = style.interior(); interior.color(WinApi::RGB2int(246, 233, 206)); font = style.font(); font.bold(true); font.color(winapi::RGB2int(153, 204, 255)); range.style('MyStyle'); range

Axapta : Enable/Disable Dialog Control at runtime

Image
วิธี Enable/Disable หรือ Dialog Control ในขณะ runtime ทำได้โดย ดังนี้ 1.classDeclaration class SCI_Costing extends RunBase { FormStringControl SalesIdCtrl, ItemIdCtrl; FormCheckBoxControl bAllCtrl; SalesId salesId; ItemId itemId; NoYes bAll; #define.CurrentVersion(1) #localmacro.CurrentList salesId, itemId, bAll #endmacro } 2.สร้าง dialog แบบอนุญาตให้ update control ได้ โดยใช้ dialog.allowUpdateOnSelectCtrl(true) protected Object dialog(Dialog dialog, boolean forceOnClient) { DialogRunBase ret; ; ret = super(dialog, forceOnClient); ret.caption('Costing report by order'); ret.allowUpdateOnSelectCtrl(true); //อนุญาตให้ update control ได้ SalesIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'SalesId'); SalesIdCtrl.extendedDataType(extendedTypeNum('SalesId')); bAllCtrl = ret.formBuildDesign().addControl(FormControlType::CheckBox,'bAll');

Visual Basic : Sending newline to Crystal Report

วิธีส่งข้อมูลที่มีการ enter (vbNewLine) ไปให้ Formulas ของ Crystal Report ทำได้โดย ใส่เครื่องหมาย chr(34) (qoute) คร่อม chr(10) (Line Feed) ไปอีกที ดังนี้ CrysRpt.Formulas(0) = "FormulaName=" & Chr(34) & Replace$(txtName.Text, vbNewLine, Chr(34) & " & Chr(10) & " & Chr(34)) & Chr(34) ถ้าข้อมูล คือ บรรทัดที่ 1 บรรทัดที่ 2 พอใช้คำสั่งแล้ว ข้อมูลที่จะส่งไปก็จะเป็น FormulaName="บรรทัดที่ 1" & Chr(10) & "บรรทัดที่ 2"

Axapta : Get or Set Checkbox value

public void clicked() { Qty tmpQty1; Qty tmpQty2; FormCheckboxControl formCheckboxControl; ; super(); // ต้องรัน super ก่อน ไม่งั้นค่าไม่เปลี่ยน // รับค่าจาก design formCheckboxControl = element.design().control(control::ProdParmHistoricalCost_EndJob); // box::info(strfmt("%1",formCheckboxControl.value())); if(formCheckboxControl.value() == 1){ //ถ้า checked จะเป็น 1 tmpQty1 = ProdTable::find(ProdParmHistoricalCost.ProdId).QtySched; tmpQty2 = ProdTableJour::reportedFinishedGood(ProdParmHistoricalCost.prodId); if(tmpQty1 != tmpQty2){ if(box::yesNo("Sure?", DialogButton::Yes, "Confirm") == DialogButton::Yes) { if(box::yesNo("Sure?",DialogButton::Yes,"Confirm")== DialogButton::Yes){ formCheckboxControl.value(true); //สั่งให้ checked }else{ formCheckboxControl.value(false); //สั่งให้ ไม่ checked } }else{ formCh

Axapta : Dialog with lookup control

Image
วิธีสร้าง dialog แบบที่มี control ซึ่ง lookup ได้ เช่น เลือก SalesId แล้วให้อีก control นึง คือ ItemId lookup มาเฉพาะของ SalesId นั้น ทำได้ดังนี้ 1.declare control ไว้ ตาม extended data type ที่จะใช้ class LookupDialog extends RunBase { FormStringControl SalesIdCtrl, ItemIdCtrl; } 2.สร้าง dialog protected Object dialog(Dialog dialog, boolean forceOnClient) { DialogRunBase ret; ; ret = super(dialog, forceOnClient); ret.caption('Costing report by order'); SalesIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'SalesId'); SalesIdCtrl.extendedDataType(extendedTypeNum('SalesId')); ItemIdCtrl = ret.formBuildDesign().addControl(FormControlType::String,'ItemId'); ItemIdCtrl.extendedDataType(extendedTypeNum('ItemId')); return ret; } 3.Set ให้ control สามารถ override method ตอน runtime ได้ public void dialogPostRun(DialogRunbase dialog) { ; super(dialog); dialog.dialogForm().formRun().co

OpenOffice : Double line style

Image
วิธีขีดเส้นใน OpenOffice ให้มี 2 เส้น ทำได้ดังนี้ 1.ใช้เครื่องมือลากเส้น (Line ใน Drawing toolbar) ขีดไว้ แล้วคลิกขวาที่ เส้น เลือก Line... 2.คลิกที่ tab Shadow แล้วติ๊กที่ Use shadow 3.เลือกตำแหน่ง ,ระยะห่างระหว่างเส้นและสีของเส้นที่ 2

Solve Host to IP without DNS

แปลง Host เป็น IP โดยไม่ต้องพึ่ง DNS Server ทำได้โดย ระบุในไฟล์ ชื่อ hosts ของ Windows อยู่ที่ C:\WINDOWS\system32\drivers\etc\hosts ของ linux อยู่ที่ /etc/hosts รูปแบบคือ IP ช่องว่างตามด้วย host ตัวอย่างของ Windows # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost อันนี้ของ linux 192.168.0.250 IF-Nikom.sci.com IF-Nikom 192.168.0.1 axaptaserver.sci.com axaptaserver 192.

GeSHi Language Aliases

ทั้ง phpBB ของที่ทำงานและ wordpress ของที่นี่ ต่างก็ใช้ Syntax Hilight ของ GeSHi โดย phpBB เป็น phpBB3.0.5 ติดตั้ง mod bbGeSHi 0.7.5 และ wordpress ใช้ plugin wp-syntax .0.9.8 เวลาใช้มักจะลืมตัวย่อของภาษาอยู่เรื่อย ก็เลยต้อง list ไว้กันลืมซะหน่อย ABAP - abap Actionscript - actionscript ADA - ada Apache Log - apache AppleScript - applescript APT sources.list - ASM (m68k) - asm ASM (pic16) - asm ASM (x86) - asm ASM (z80) - asm ASP - asp AutoIT - autoit Backus-Naur form - Bash - bash Basic4GL - BlitzBasic - blitzbasic Brainfuck - bnf C - c C for Macs - c_mac C# - cpp C++ - csharp C++ (with QT) - cpp-qt CAD DCL - caddcl CadLisp - cadlisp CFDG - cfdg CIL / MSIL - COBOL - ColdFusion - cfm CSS - css D - d Delphi - delphi Diff File Format - diff DIV - div DOS - dos DOT language - dot Eiffel - eiffel Fortran - fortran FourJ's Genero - genero FreeBasic - freebasic GetText - glSlang - GML - gml gnuplot - Groovy - groovy Haskell - haskell HQ9+ -

ข้อคิดจากเพชรพระอุมา : 17

ตอนหลัง ๆ ยิ่งอ่านยิ่งมัน อ่านพรวด ๆ เลย สำหรับการเดินทางครั้งแรกนี้ คงต้องจบด้วยบทเพลงของแงซาย "เกิดมาเยี่ยงกษัตริย์ขัตติยราช แต่อนิจจา! อนาถนัก ต้องพลัดพรากถิ่นฐานแหล่งกำเนิด ซมซานพเนจรไปทั่วเขตแคว้นแดนกันดาร" "ทุกหุบห้วยละหารสำเนาไพร ข้าบุกบั่นไปปิ่มเลือดตากระเด็น มีดวงดารากรแทนประทีปส่อง ฝากอนาคตไว้กับหมู่เมฆอันเลื่อนลอย" "สุริยาประทานพลังฤทธิ์ให้แก่ข้า จันทราเปรียบเสมือนเพื่อนใจ หากสวรรค์ส่งข้ามาเกิดจริงแล้วไซร้ ข้าคงกลับคืนไปสู่เจ้าได้สมจินต์" รอข้าก่อน อาณาจักรสีทอง อันผ่องใส รอข้าก่อน ประชากรทั้งหลาย และรอข้าก่อน ศัตรูหมู่อมิตร ข้ากำลังจะกลับไป.. กลับไป..กลับไป..."

ข้อคิดจากเพชรพระอุมา : 16

ป่าโลกล้านปี เล่ม 1-4 - ตั้งแต่ อาถรรพ์นิทรานครแล้ว รู้สึกว่าชื่อตอนมันจะเหลื่อมกันไปหน่อย เนื้อหาที่ตรงกับชื่อตอนมันมีแค่ตอนต้น ๆ เอง แต่ยังไงก็ยังสนุก ตื่นเต้นเร้าใจอยู่ดี - เทอราโนดอน ( Pteranodon ) นกโบราณ ตัวเหมือนค้างคาว หัวเหมือนนก จับสัตร์ที่เล็กกว่าทุกชนิดเป็นอาหาร หากินในเวลากลางคืน - ผีโป่งค่าง ครึ่งปิศาจครึ่งสัตว์ รูปร่างคล้ายค่าง ที่มีอำนาจในการสะกดคนหรือสัตว์ทั่วไปให้หลงป่าและหลับไหลไม่ได้สติ แล้วก็จะมาสูบเลือดในกายจนคนหรือสัตว์นั้นตาย - ไม้สดบางชนิด ประเภทที่มีน้ำมัน ต่อให้เปียกก็ติดไฟได้ - ไทรเซราทอปส์ ( Triceratops ) ไดโนเสาร์พันธุ์เขา ที่เป็นต้นเหตุให้จอมพรานเกือบตาย - รู้น้อย พลอยรำคาญ แต่รู้มาก ก็ยากนาน (ไม่รู้ซะเลย ดีกว่ามั้ย) - คิว.อี.ดี. หรือ Q.E.D. ( Q uod E rat D emonstrandum) แปลว่า แก้ความกำกวม ภาษาไทย ใช้ ซ.ต.พ. (ซึ่งต้องพิสูจน์) ที่พี่ติ๊ก ชีโร่ เอามาร้องเป็นเพลงนั่นแหล่ะ สมัย ม.ต้น ผมลงเรียนวิชาเลือกทางคณิตศาสตร์วิชานึง ต้องคอยพิสูจน์ว่าทำไมมันจึงเป็นอย่างนี้ สนุกดี ประมาณ ทำไมเลขอะไรก็ตามยกกำลังศูนย์จึงได้ หนึ่ง, ทำไม -n จึงห่างจาก 0 เป็นระยะเท่าก

OpenOffice : Rows to repeat at top

Image
เวลาจะพิมพ์โดยให้มีแถวใดขึ้นอยู่บนหัวกระดาษทุกหน้า ใน Excel จะเข้าไปที่ 1.File > Page Setup... 2.แล้วก็คลิก tab Sheet 3.ในกลุ่มของ Print titles เลือก Rows to repeat at top ดังรูป ใน OpenOffice เข้าไปที่ 1.Format > Print Ranges > Edit... 2.แล้วก็เลือกตรง Rows to repeat

OpenOffice : Concatenate cells with newline

อยากรวม 2 Cell เข้าด้วยกัน โดยให้มีการขึ้นบรรทัดใหม่ด้วย เช่น A1 = Name B1 = Email แล้วต้องการให้ C1 = Name ขึ้นบรรทัดใหม่ แล้วก็ Email แบบนี้ Name Email ปกติเวลาจะขึ้นบรรทัดใหม่ใน Cell เดิม ก็จะใช้วิธีกด Ctrl + Enter แต่ถ้าจะใช้ Formula ก็ตามนี้ครับ =CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Cleanse the free space on a logical disk

เอาพื้นที่ของฉันคืนมา! ทั้งที่ ๆ ลบไฟล์ออกแล้ว แต่พื้นที่ว่างกลับไม่เพิ่มขึ้นซักเท่าไหร่ มาลองวิธีนี้ดูครับ วิธีที่ 1. download file จาก http://download.sysinternals.com/Files/SDelete.zip แตกไฟล์แล้วเรียก run ผ่าน cmd sdelete -c drive เช่น sdelete -c c:/ จาก http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx วิธีที่ 2. download file จาก http://www.feyrer.de/g4u/nullfile-1.02.exe แล้วก็ Double Click จากนั้นก็รอจนโปรแกรมทำเสร็จ จาก http://kakku.wordpress.com/2008/06/23/virtualbox-shrink-your-vdi-images-space-occupied-disk-size /

Determing SQL Server Database and Table Size

Example 1 (SQL Server table) Run the following SQL statement from Teratrax Database Manager, Query Analyzer, or SQL Server Management Studio. Replace the names in bold with your own: USE db1 GO EXEC sp_spaceused N'dbo.orders' GO Results * name: Table name for which space usage information was requested * rows: Number of rows existing in the table * reserved: Total amount of reserved space for table data and indexes * data: Amount of space used by table data * index_size: Amount of space used by table indexes * unused: Total amount of space reserved for table but no yet used Example 2 (SQL Server database) You can also run sp_spaceused without any parameters to display information about the whole database. Replace the names in bold with your own: USE db1 GO EXEC sp_spaceused GO Results First Recordset: * database_name: Name of the current database * database_size: Size of the current database in megabytes. database_size includes both data and log

Ubuntu : How To Remove Password Keyring

1. Open up your Home Folder by clicking Places>Home Folder 2. Press CTRL-H (or click View>Show Hidden Files) 3. Find a folder called .gnome2 (it has a period at the beginning of the name) and open it by double clicking on it 4. In side of the .gnome2 folder, there is another folder called keyrings. Open it up. 5. Delete any files you find within the keyrings folder 6. Restart the computer from : http://davestechsupport.com/blog/2009/01/16/how-to-remove-ubuntus-password-keyring/ or rm ~/.gnome2/keyrings/default.keyring

ข้อคิดจากเพชรพระอุมา : 15

อาถรรพ์นิทรานคร เล่ม 3-4 - ไดโนเทเรี่ยม ( Deinotherium ) ช้างโบราณที่มีงาชี้ลงข้างล่าง - สเตโกซอรัส ( Stegosaurus ) ไดโนเสาร์ที่มีเกล็ดงอกเรียงตามแนวสันหลังไปจนถึงหาง ใช้ป้องกันตัว - ไทรันโนซอรัส ( Tyrannosaurus ) เจ้ายักษ์ใหญ่ ราชันย์แห่งยุคไดโนเสาร์ ------------------------- รักมาก โกรธมาก ห่วงมาก หวงมาก หึงมาก จอมพรานกับแหม่มสาว คราวนี้จะเรียกว่า พลาดท่า หรือ ได้ที ดีน้อ

ข้อคิดจากเพชรพระอุมา : 14

อาถรรพ์นิทรานคร เล่ม 1-2 - สาง = เสือที่แก่แล้วจนสิ้นลาย - สาง = คนที่ร้อนวิชา จนแปลงร่างเป็นเสือได้ - Dinos (ไดโน) แปลว่า น่าสะพรึงกลัว สัตว์ใดที่ว่าร้าย ไม่ร้ายเท่ามนุษย์ โดยเฉพาะ มนุษย์ที่เรียกว่า สตรี ว้า พรานใหญ่พลาดท่าซะแล้ว

Delete Domain Controller using ntdsutil.exe

1.ntdsutil 2.metada cleanup 3.connections 4.connect to server 5.quit 6.select operation target 7.list domains 8.select domain 9.list sites 10.select site 11.list servers in site 12.select server 13.quit 14.remove selected server 15.quit 16.quit

Ubuntu : Run as root in GUI

Image
ใช้สิทธิเป็น root ชั่วคราว ใน GUI เพื่อความสะดวกได้โดยใช้คำสั่ง คล้าย ๆ กับ Run as ... ใน Windows gksudo nautilus gksu nautilus sudo nautilus เลือกเอาอันใดอันนึง หรือทำเป็น Shortcut ไว้เลย โดยคลิกขวาที่ Desktop แล้วเลือก Create Launcher... Type : Application Name : Nautilus (แล้วแต่จะตั้ง) Command : gksudo /usr/bin/nautilus (ใช้ whereis nautilus หาดู) Comment : Nautilus with root permission(อะไรก็ได้)

ข้อคิดจากเพชรพระอุมา : 13

จอมผีดิบมันตรัย เล่ม 3-4 - เสือสมิง คือ เสือที่ฆ่าคนตาย จนวิญญาณเข้าสิง - สมิงพราย คือ เสือที่เกิดจากหุ่นหรือรูปปั้น ซึ่งมีวิญญาณเข้าสิงหรือเกิดจากเวทย์มนต์ แบบควายธนู - นิรุกติศาสตร์ หรือ philology คือ การเรียนรู้ถึงภูมิหลัง และการใช้ในปัจจุบัน ของการสื่อสารของมนุษย์ - ว่านเสน่ห์จันทร์ ว่านที่เกิดที่ใดที่นั่นมีน้ำ และมักจะมีการเสียตัวเกิดขึ้น (น้ำในวรรคแรกหมายถึงน้ำสำหรับดื่มกินนะครับ) - ฮีสทีเรีย หรือ Histeria ไม่รู้จะอธิบายยังไง อ่านจาก link ก็แล้วกันครับ เป็นการง่ายยิ้มได้ไม่ต้องฝืน เมื่อชีพชื่นเหมือนบรรเลงเพลงสวรรค์ แต่คนที่ควรชมนิยมกัน ต้องใจมั่นยิ้มได้เมื่อภัยมา

ข้อคิดจากเพชรพระอุมา : 12

อันนี้ย้อนหลัง เพราะบังเอิญสนใจเรื่องว่าน ก็เลยหาข้อมูลดู สุดท้ายก็ยังตัดสินใจไม่ได้อยู่ดี ไม่รู้จะเชื่ออันไหน ความจริง อาจเป็นจริงอยู่ในช่วงเวลาใดช่วงเวลาหนึ่งเท่านั้น ว่านพระอาทิตย์ <-> ว่านแสงอาทิตย์ <-> ว่านกุมารทอง ชื่อสามัญ ว่านแสงอาทิตย์ Blood Lily ชื่อวิทยาศาสตร์ Haemanthus mutlifloreus พืชล้มลุก มีลำต้นอยู่ใต้ดิน ใบเป็นแผ่นเรียวยาว ในช่วงฤดูร้อน - ต้นฤดูฝนจะแทงช่อดอกคลุมขนาดใหญ่สีแดงโผล่พ้น ดินขึ้นมาสูงประมาณ 50 เซนติเมตร ส่วนที่เป็นพิษ หัวและใบ ทำให้ท้องเดิน อาเจียนหัวใจเต้นเร็วผิดปกติ ว่านแสงอาทิตย์ ชื่อวิทยาศาสตร์: Haemanthus multiflorus (Tratt.) Martyn วงศ์ : Amaryllidaceae ชื่อสามัญ : Blood Lily ชื่ออื่น : ว่านตะกร้อ ลักษณะ ทางพฤกษศาสตร์ : เป็นไม้ล้มลุกใบอวบน้ำ มีลำตัวเป็นหัวลักษณะคล้ายหอมหัวใหญ่ เจริญอยู่ใต้ดิน กลุ่มใบที่เกิดจากหัวชูขึ้นมาเหนือพื้นดิน ใบรูปหอกสีเขียวเข้มยาวประมาณ 8 นิ้ว เมื่อออกดอกจะชู้ก้านดอกเป็นลำตรงสีเขียวอ่อน จากกลางต้นสูงมาพ้นใบ ดอกออกติดกันแน่นเป็นทรงกลม สวยงามสะดุดตามาก ดอกของแสงอาทิตย์ช่อหนึ่ง ๆ มีเส้นผ่าศูนย์กลางประมาณ 3-4

ข้อคิดจากเพชรพระอุมา : 11

จอมผีดิบมันตรัยเล่ม 1-2 - กระทิงรู้จักแต่ขวิด ไม่กระทืบคน เหมือนพวกที่มีอิทธิพลบางคน - ศัตรูของศัตรู อาจถือได้ว่าเป็น มิตร (ผีกองกอย) - ทุกสิ่งในโลกนี้แม้จะมีของที่ร้ายกาจ แต่ก็มักจะมีของที่แก้กันอยู่เสมอ อย่าง กรดกับด่าง, งูกับพังพอน - พิษกับของแก้พิษ มักจะอยู่ใกล้กัน พิษตะขาบ กับ พริกขี้หนูยักษ์ + เนื้อตะขาบ (นอกเรื่องนิดหนึ่งเพื่อเป็นทฤษฎีสนับสนุน พิษดอกรัก กับ หญ้าไส้ขาด ของเอี้ยก้วย) คนทุกคนมีคุณค่า เว้นแต่คุณค่านั้นจะแสดงออกมาเมื่อไรและอย่างใดเท่านั้น

ข้อคิดจากเพชรพระอุมา : 10

ดงมหากาฬเล่ม 3-4 - Wellcome Mrs. Hoffman แหม่มมาเรีย - ผีตองเหลือง เรียกเผ่าตัวเองว่า มะราบรี ตามการพิมพ์ของ ณ บ้านวรรณกรรม ส่วนอันนี้จาก wiki ครับ http://en.wikipedia.org/wiki/Mlabri_people - หมาใน vs หมาไน เรียกอย่างไหนกันแน่ พอค้นก็ได้เจอบทความนี้ครับ http://www.tpschamnong.iirt.net/article/basa_5nt091.html และก็ได้คำคม แถมมาด้วย "We think our father's fools, so wise we grow; Our wiser sons no doubt will think us so." "พวกเราคิดบิดาเราเฉาฉงน เราเป็นคนมีปัญญาจะหาไหน บุตรของเราคงดีจริงยิ่งขึ้นไป จิตต์ใจเขาคงคิดเหมือนบิดา"

ข้อคิดจากเพชรพระอุมา : 9

ณ ที่ใด ดวงใจ ไม่ไหวหวั่น ขอฝ่าฟัน อุปสรรค และขวากหนาม ถึงสิ้นชาติ วาสนา ชะตาทราม จะฝากนาม โลกให้รู้กูก็ชาย ณ ที่นี้ไร้ญาติและขาดมิตร ยังก็แต่บ่าวสนิทพิสมัย เสมอเพื่อนเสมือนญาติไม่คลาดไกล เป็นเพื่อนตายเคียงกูคู่ชีวา ดงมหากาฬเล่ม 3

ข้อคิดจากเพชรพระอุมา : 8

ข้อคิดประจำวันนี้ (ดงมหากาฬเล่ม 3) - เขาว่ากันว่าจูเลียส ซีชาร์ เป็นคนแรกที่คลอดโดยวิธีผ่าท้อง เขาก็เลยเรียกการทำคลอดวิธีนี้ว่า ซีซาเรี่ยน เซ็คชั่น ( Caesarian Section )

Axapta Properties

1. Data Dictionary 2. Form 3. Report 4. Query 5. Menus 6. Menu Items

ข้อคิดจากเพชรพระอุมา : 7

ข้อคิดจากเพชรพระอุมาวันที่ 7 (ดงมหากาฬเล่ม 2) - เวลาที่มี สัตว์ใหญ่ หรือ คนใหญ่ ตาย มักจะมีฝนตก (ข้อนี้ยืนยันครับ เจอกับตัวบ่อย) ----------------------------------------------------- ส่งท้ายวันนี้ด้วยบทเพลงครับ จูบ... คุณคิดว่าไม่สำคัญ จูบ... เบา ๆ เท่านั้น ทำให้ฉันสั่นไปถึงหัวใจ

ข้อคิดจากเพชรพระอุมา : 6

ความรู้จากเพชรพระอุมาวันที่ 6 (ดงมรณะเล่ม 1) - ความเจ็บช้ำของคนอื่น ที่เราอาจมองว่าเป็นเรื่องเล็กน้อย ขำ ๆ ผ่านมานานแล้ว คงเอามาหยอกล้อเล่นได้ อาจทำร้ายจิดใจของเขาอย่างรุนแรง - คิดให้ดีก่อนพูด คำพูดนั้น ก่อนพูดออกไปเราเป็นนายมัน แต่เมื่อได้พูดไปแล้ว มันจะเป็นนายของเราตลอดไป

Delete all record in SQL Server table

TRUNCATE TABLE name vs DELETE FROM TABLE name TRUNCATE TABLE is functionally identical to DELETE statement with no WHERE clause: both remove all rows in the table. But TRUNCATE TABLE is faster and uses fewer system and transaction log resources than DELETE. The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the data pages used to store the table's data, and only the page deallocations are recorded in the transaction log. TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain. The counter used by an identity for new rows is reset to the seed for the column. If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement. You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint; instead, use DELETE stat

Axapta : Form Properties

Form Property Type   Description Form data source       AllowCheck   = If set Configuration keys and Security keys will be validated at runtime. AllowCreate   = Enables inserting new record for the data source. AllowDelete   = Enables deletion of table records for the data source. AllowEdit   = Enables editing of table records for the data source.