วันพฤหัสบดี, ธันวาคม 01, 2548
Java : Windows Font Look And Feel
สำหรับ application ที่เจาะจงว่าจะรันบนวินโด้ โดยเฉพาะนั้น เพื่อให้รูปแบบของฟอนต์สอดคล้องกับของวินโด้แต่ดั้งเดิม ควรเลือกใช้ Tahoma ขนาดตั้งแต่ 12 - 15
Java : เกี่ยวกับเรื่องของ ชิ้นส่วนภาชนะ Container Components
ใน Swing นั้น, เรามี Top-level Container อยู่คือ JFrame, JDialog และ JApplet.
สิ่งที่ควรสำเหนียก เวลาใช้พวก class เหล่านี้คือ
ตัวอย่างของ containment hierarchy ลำดับชั้นของภาชนะ
Features ของ JComponent ที่น่านำไปใช้ในโปรแกรม
การใช้ Text Components
อ้างอิง
จาวา ติวโตเรี่ยล
สิ่งที่ควรสำเหนียก เวลาใช้พวก class เหล่านี้คือ
- ทุก component ที่จะปรากฏบนจอ จะต้องอยู่ใน containment hierarchy---เป็นต้นไม้ของ component ซึ่งมี top-level container เป็นราก
- ทุก GUI component ถูกยัดใส่ลงภาชนะ ได้แค่ครั้งเดียว. ถ้าเราเอา component ไหนยัดลงไปใน container หนึ่งแล้ว และจับมันยัดลงไปใน container อื่นอีก, ก็หมายความว่า มันต้องถูกเอาออกมาจาก container แรกก่อนจึงถูกนำไปยัดใส่ container ที่สองได้
- ทุก top-level container มี content pane ซึ่งกล่าวอย่างคร่าวๆได้ว่า content pane นั้น บรรจุ visible components ใน GUI ของ top-level container ทั้งโดยตรงและโดยอ้อม.
- เราสามารถเลือกที่จะใส่ menu bar ไปที่ top-level container หรือไม่ก็ได้. ซึ่ง menu bar นั้นจะถูกวางอยู่ภายใน top-level container, แต่อยู่นอก content pane. ในบาง look and feels, เช่น Mac OS look and feel, มีทางเลือกให้เราวางตำแหน่งของ menu bar ที่อื่นซึ่งเหมาะสมกว่าได้, เช่นที่ส่วนบนสุดของหน้าจอ เป็นต้น. ดังภาพข้างล่าง
ตัวอย่างของ containment hierarchy ลำดับชั้นของภาชนะ
Features ของ JComponent ที่น่านำไปใช้ในโปรแกรม
- Tool tips กำหนดข้อความโดย
setToolTipText(), ช่วยบอกเวลา user เอาเมาส์มาวางไว้. ดูเพิ่มเติมได้ที่ How to Set the Look and Feel - Support for layout ใน
Componentclass แม้จะมี methods ซึ่งเอาไว้ดู layout hint เช่นgetPreferredSizeandgetAlignmentX. ทางเลือกอื่นสำหรับ set layout hints,JComponentclass เพิ่ม setter methods —setPreferredSize,setMinimumSize,setMaximumSize,setAlignmentX, andsetAlignmentY. ขึ้นมา ดูเพิ่มที่ Laying Out Components Within a Container - Key bindings ทำให้ components ตอบสนองเมื่อ user กดปุ่ม keyboard ที่กำหนดไว้. เช่นเวลาเคอร์เซอร์อยู่บนปุ่ม การกด space bar ก็เหมือนกับการกดคลิ๊กบนปุ่มนั้น. look and feel เซต bindings ของการกดและปล่อย ปุ่ม Space และส่งผลนั้นไปที่ปุ่ม. เพิ่มเติมเกี่ยวกับ key bindings ดูที่ How to Use Key Bindings
.
การใช้ Text Components
| Method | Purpose |
|---|---|
void addMouseListener(MouseListener) void removeMouseListener(MouseListener) | Add or remove a mouse listener |
void addMouseMotionListener(MouseMotionListener) void removeMouseMotionListener(MouseMotionListener) | Add or remove a mouse motion listener |
void addKeyListener(KeyListener) void removeKeyListener(KeyListener) | Add or remove a key listener |
void addComponentListener(ComponentListener) void removeComponentListener(ComponentListener) | Add or remove a component listener |
void setTransferHandler(TransferHandler) TransferHandler getTransferHandler() | Set or remove the transferHandler property. The TransferHandler supports exchanging data via cut, copy, or paste to/from a clipboard as well a drag and drop. See Drag and Drop |
boolean contains(int, int) boolean contains(Point) | Determine whether the specified point is within the component. The argument should be specified in terms of the component's coordinate system. The two int arguments specify x and y coordinates, respectively. |
Component getComponentAt(int, int)Component getComponentAt(Point) | Return the component that contains the specified x, y position. The top-most child component is returned in the case where components overlap. This is determined by finding the component closest to the index 0 that claims to contain the given point via Component.contains(). |
อ้างอิง
จาวา ติวโตเรี่ยล
วันอังคาร, พฤศจิกายน 29, 2548
Eclipse plug-in UML editors และ GUI builder
บันทึกไว้กันลืม UML editors ที่ใช้วาด UML ลองหาๆ ดูจาก
http://www.eclipseplugincentral.com
แล้ว list มาดังนี้
-- UML editors --
http://www.eclipseplugincentral.com
แล้ว list มาดังนี้
-- UML editors --
- UMLet ที่ http://homepage.mac.com/martin.auer/umlet/ อันนี้ฟรี
- SDE ที่ http://www.visual-paradigm.com/product/sde/ec/index.jsp อันนี้ commercials
- EclipseUML ที่ http://www.eclipseuml.com/screenshot.html ฟรีำสำหรับ non-commercial
- VE ที่ www.eclipse.org ฟรีแท้ๆ
- Jigloo ที่ http://www.cloudgarden.com/jigloo/ ฟรีสำหรับ non-commercial
วันจันทร์, พฤศจิกายน 21, 2548
โปรแกรมฟรีแวร์ สำหรับ การเงินและการบัญชี Grisbi
นึกอยากจะทำบัญชีส่วนตัวขึ้นมา เพื่อจะได้ควบคุมการใช้จ่ายเงินอย่างมีประสิทธิภาพ จะได้ควบคุมเงินออมไว้ลงทุน ก็เลยไปคุ้ยๆ หาฟรีแวร์ที่น่าจะใช้ได้มา ไปเจอใน FreeBSD ports
จะหมู่หรือจ่าเดี๋ยวต้องไปลองก่อน เขียนโน้ตไว้เฉยๆ รายละเอียดอยู่ที่ Grisbi
อื่นๆ
gnucash
finance/emma
follow up: เท่าที่ลองดูแล้วคิดว่า GnuCash น่าใช้ที่สุด
จะหมู่หรือจ่าเดี๋ยวต้องไปลองก่อน เขียนโน้ตไว้เฉยๆ รายละเอียดอยู่ที่ Grisbi
อื่นๆ
gnucash
finance/emma
follow up: เท่าที่ลองดูแล้วคิดว่า GnuCash น่าใช้ที่สุด
วันเสาร์, ตุลาคม 29, 2548
เข้ารหัสเสียงให้เนียนๆ
เกิดสงสัยอยากจะเข้ารหัสไฟล์เสียงแบบ ogg ให้รองรับ 5.1 channel หรือ 6 channel
โดยแปลงจาก VOB หรือ AC3 จะทำอย่างไร. รวบรวมแหล่งข้อมูลไว้ดังนี้
FAQ เกี่ยวกับ audio ครอบคลุมทุกเรื่อง ดีใช้ได้
http://forum.doom9.org/showthread.php?s=&threadid=68300
*ฟอรัมข้างบนกล่าวว่า การจะเข้ารหัส ogg แบบ 5.1 ch นั้นจำเป็นต้อง correct channel coupling
ทำให้บิตเรตสูงและขนาดของไฟล์ผลลัพธ์จะมีขนาดเกือบเท่า AC3 ไฟล์ต้นฉบับ ดังนั้น ทำไม่คุ้ม
ฺฺBeLight GUI สำหรับ Besweet ใช้ง่ายกว่าน่าลอง
http://belight.corecodec.org/
Audio guide ของ doom9
http://www.doom9.org/index.html?/audio-guides.htm
โดยแปลงจาก VOB หรือ AC3 จะทำอย่างไร. รวบรวมแหล่งข้อมูลไว้ดังนี้
FAQ เกี่ยวกับ audio ครอบคลุมทุกเรื่อง ดีใช้ได้
http://forum.doom9.org/showthread.php?s=&threadid=68300
*ฟอรัมข้างบนกล่าวว่า การจะเข้ารหัส ogg แบบ 5.1 ch นั้นจำเป็นต้อง correct channel coupling
ทำให้บิตเรตสูงและขนาดของไฟล์ผลลัพธ์จะมีขนาดเกือบเท่า AC3 ไฟล์ต้นฉบับ ดังนั้น ทำไม่คุ้ม
ฺฺBeLight GUI สำหรับ Besweet ใช้ง่ายกว่าน่าลอง
http://belight.corecodec.org/
Audio guide ของ doom9
http://www.doom9.org/index.html?/audio-guides.htm
วันอังคาร, ตุลาคม 25, 2548
ssh port forwarding
เมื่อสัปดาห์ก่อนไปร่วม 研究会 ที่ 未来館 พักโรงแรมแล้วอยากจะส่งเมล์ขึ้นมาแต่มันส่งไม่ได้เพราะว่า
ตั้งแต่เปลี่ยนมาใช้ FreeBSD ก็พึ่งจะอยากส่งเมล์จากนอกมหาลัยเป็นครั้งแรก
ไม่รู้จะเซตยังไง เลยส่งผ่านเว็บไป.
วันนี้มาค้นๆ ดู มีสองทางออก
ต้องตั้ง SMTP เซตติ้งใน thunderbird ให้มันส่งไปที่พอร์ต 1025 ด้วย
reference:
http://www.ssh.com/support/documentation/online/ssh/adminguide/32/Port_Forwarding.html
ตั้งแต่เปลี่ยนมาใช้ FreeBSD ก็พึ่งจะอยากส่งเมล์จากนอกมหาลัยเป็นครั้งแรก
ไม่รู้จะเซตยังไง เลยส่งผ่านเว็บไป.
วันนี้มาค้นๆ ดู มีสองทางออก
- ใช้ SMTP ของ localhost เพราะว่า มันรัน Sendmail อยู่แล้ว
- ใช้ ssh port forwarding ผ่าน เฟ้ป
$ ssh -L 1025:วินเมล์:25 xoguy@เฟ้ปnote:
ต้องตั้ง SMTP เซตติ้งใน thunderbird ให้มันส่งไปที่พอร์ต 1025 ด้วย
reference:
http://www.ssh.com/support/documentation/online/ssh/adminguide/32/Port_Forwarding.html
วันศุกร์, ตุลาคม 07, 2548
Expocity: ทำ gnome windows changer ให้เป็นแบบ Mac
วันนี้ลง Expocity เพื่อให้เปลี่ยนวินโด้แบบเท่ๆ อย่างแมค
พอกด alt+tab ปุ๊บ มันจะขึ้นหน้าจอที่ย่อส่วนแล้วของทุกวินโด้มาให้เลือก
ก่อนอื่นก็ pkg_deinstall -fv metacity ก่อน จากนั้นจึง
portinstall -PPv expocity
แล้วก็ startx เป็นอันเรียบร้อย
พอกด alt+tab ปุ๊บ มันจะขึ้นหน้าจอที่ย่อส่วนแล้วของทุกวินโด้มาให้เลือก
ก่อนอื่นก็ pkg_deinstall -fv metacity ก่อน จากนั้นจึง
portinstall -PPv expocity
แล้วก็ startx เป็นอันเรียบร้อย
วันพฤหัสบดี, ตุลาคม 06, 2548
ติดตั้ง OpenOffice.org บน FreeBSD โดยใช้ package
มีปัญหา ติดตั้งแล้วไม่เวิร์ค ลบทิ้งไปแล้ว ไว้แก้ได้แล้วจะมาโพสต่อ
มาโพสต่อ ลงจาก OOopackages มันจะไม่เวิร์ค ต้องใช้ package จาก ftp.freebsd.org
ก็รันคำสั่ง pkg_add -v openoffice.org-1.1.5 ธรรมดาตรงๆ ก็เรียบร้อย
เลือกใช้ JVM ของ linux ไม่รู้ว่ามีผลรึเปล่า แต่ก็เอาวะเวิร์คก็พอละ
ติดตั้ง ORBit-0.5.X จากแพคเกจก่อน แล้วก็ ดาวน์โหลด ไฟล์ package จาก ลิ๊งค์ข้างล่างนี้
ftp://ooopackages.good-day.net/pub/OpenOffice.org/FreeBSD/1.1.5m57/FreeBSD5/
ด้วย root permission รัน pkg_install
# pkg_add -v OOo_1.1.5.20050705_FreeBSD54Intel_install.tbz
# pkgdb -u
ด้วย user permission เปลี่ยน dir ไปที่ home/Applications
$ openoffice.org-1.1.5-m57
เพื่อเรียก installer ขึ้นมา แล้วก็ตอบคำถามไปตามที่จำเป็น
มาโพสต่อ ลงจาก OOopackages มันจะไม่เวิร์ค ต้องใช้ package จาก ftp.freebsd.org
ก็รันคำสั่ง pkg_add -v openoffice.org-1.1.5 ธรรมดาตรงๆ ก็เรียบร้อย
เลือกใช้ JVM ของ linux ไม่รู้ว่ามีผลรึเปล่า แต่ก็เอาวะเวิร์คก็พอละ
ติดตั้ง ORBit-0.5.X จากแพคเกจก่อน แล้วก็ ดาวน์โหลด ไฟล์ package จาก ลิ๊งค์ข้างล่างนี้
ftp://ooopackages.good-day.net/pub/OpenOffice.org/FreeBSD/1.1.5m57/FreeBSD5/
ด้วย root permission รัน pkg_install
# pkg_add -v OOo_1.1.5.20050705_FreeBSD54Intel_install.tbz
# pkgdb -u
ด้วย user permission เปลี่ยน dir ไปที่ home/Applications
$ openoffice.org-1.1.5-m57
เพื่อเรียก installer ขึ้นมา แล้วก็ตอบคำถามไปตามที่จำเป็น
วันพุธ, กันยายน 07, 2548
sig-alternative document class
สำหรับเป็น Template มีคำสั่ง เฉพาะที่น่าจดน่าจำดังนี้
- \centering
- \begin{table} \centering \caption \begin{tabular}
- \begin{table*}, \begin{figure*} สำหรับ กว้างคลุมทั้ง 2 คอลัมน์
- \epsfig, \psfig
- \newtheorem{theorem}{Theorem}
- \newdef{definition}{Definition} ใช้กับ \begin{definition}
- \secit ใช้ทำตัวเอียงสำหรับ text ที่อยู่ตรง section โดยเฉพาะ
- \ttlit สำหรับ Title
- proof environment, \begin{proof}
วันจันทร์, กันยายน 05, 2548
เปลี่ยนมาใช้ WindowMaker แทน Gnome
How to switch to Thai keyboard layout in WindowMaker (or virtually any X11 window manager)
GNOME มันเดี้ยงๆ มาตั้งหลายวันแล้ว ไม่รู้ทำไม ก็เลยคิดจะลองเปลี่ยนมาใช้ WindowMaker ดู
แต่ว่ามีปัญหาเล็กน้อย คือติดเรื่อง การเปลี่ยนคีย์บอร์ดเลย์เอาท์ ภาษาไทย แต่วันนี้แก้ปัญหาได้แล้ว
พึ่งรู้ว่ามันง่ายขนาดนี้ แค่เติม
แล้วก็ toggle layouts ด้วย alt+shift, ใช้ LED ของ scroll lock เป็นตัว indicator (ไฟติด
คือใช้ layout ภาษาไทย)
ไฟล์ xorg.conf ทั้งหมด ก็เป็นดังข้างล่างนี้
---------------------------------------
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/WindowsFonts/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection
Section "Module"
Load "dbe"
Load "dri"
Load "extmod"
Load "glx"
Load "record"
Load "xtrap"
Load "freetype"
Load "type1"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
#### Thai Keyboard Switching config., Added by Chaiwat ####
# Option "XkbRules" "xorg"
Option "XkbLayout" "us,th"
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
EndSection
# VMware SVGA
Section "ServerFlags"
# Option NoTrapSignals
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "vmmouse"
Option "Protocol" "SysMouse"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5"
# Option "Emulate3Buttons"
# Option "Emulate3Timeout" "50"
# Option "ChordMiddle"
EndSection
Section "Monitor"
Identifier "vmware"
VendorName "VMware, Inc"
HorizSync 1-10000
VertRefresh 1-10000
ModeLine "640x480" 100 640 700 800 900 480 500 600 700
ModeLine "800x600" 100 800 900 1000 1100 600 700 800 900
ModeLine "1024x768" 100 1024 1100 1200 1300 768 800 900 1000
ModeLine "1152x864" 100 1152 1200 1300 1400 864 900 1000 1100
ModeLine "1152x900" 100 1152 1200 1300 1400 900 1000 1100 1200
ModeLine "1280x1024" 100 1280 1300 1400 1500 1024 1100 1200 1300
ModeLine "1376x1032" 100 1376 1400 1500 1600 1032 1100 1200 1300
ModeLine "1400x1050" 100 1400 1500 1600 1700 1050 1100 1200 1300
ModeLine "1600x1200" 100 1600 1700 1800 1900 1200 1300 1400 1500
ModeLine "2364x1773" 100 2364 2400 2500 2600 1773 1800 1900 2000
EndSection
Section "Device"
Identifier "VMware SVGA"
Driver "vmware"
EndSection
Section "Screen"
Identifier "Screen 1"
Device "VMware SVGA"
Monitor "vmware"
# Don't specify DefaultColorDepth unless you know what you're
# doing. It will override the driver's preferences which can
# cause the X server not to run if the host doesn't support the
# depth.
Subsection "Display"
# VGA mode: better left untouched
Depth 4
Modes "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 8
Modes "1376x1032"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1376x1032"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1400x1050"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1400x1050"
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 1"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
GNOME มันเดี้ยงๆ มาตั้งหลายวันแล้ว ไม่รู้ทำไม ก็เลยคิดจะลองเปลี่ยนมาใช้ WindowMaker ดู
แต่ว่ามีปัญหาเล็กน้อย คือติดเรื่อง การเปลี่ยนคีย์บอร์ดเลย์เอาท์ ภาษาไทย แต่วันนี้แก้ปัญหาได้แล้ว
พึ่งรู้ว่ามันง่ายขนาดนี้ แค่เติม
Option "XkbLayout" "us,th"ลงไปก็เรียบร้อย ราบรื่น. รายละเอียดก็คือ บอกว่าจะใช้ keyboard layout แบบ us กับ th,
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
แล้วก็ toggle layouts ด้วย alt+shift, ใช้ LED ของ scroll lock เป็นตัว indicator (ไฟติด
คือใช้ layout ภาษาไทย)
ไฟล์ xorg.conf ทั้งหมด ก็เป็นดังข้างล่างนี้
---------------------------------------
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/WindowsFonts/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection
Section "Module"
Load "dbe"
Load "dri"
Load "extmod"
Load "glx"
Load "record"
Load "xtrap"
Load "freetype"
Load "type1"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
#### Thai Keyboard Switching config., Added by Chaiwat ####
# Option "XkbRules" "xorg"
Option "XkbLayout" "us,th"
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
EndSection
# VMware SVGA
Section "ServerFlags"
# Option NoTrapSignals
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "vmmouse"
Option "Protocol" "SysMouse"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5"
# Option "Emulate3Buttons"
# Option "Emulate3Timeout" "50"
# Option "ChordMiddle"
EndSection
Section "Monitor"
Identifier "vmware"
VendorName "VMware, Inc"
HorizSync 1-10000
VertRefresh 1-10000
ModeLine "640x480" 100 640 700 800 900 480 500 600 700
ModeLine "800x600" 100 800 900 1000 1100 600 700 800 900
ModeLine "1024x768" 100 1024 1100 1200 1300 768 800 900 1000
ModeLine "1152x864" 100 1152 1200 1300 1400 864 900 1000 1100
ModeLine "1152x900" 100 1152 1200 1300 1400 900 1000 1100 1200
ModeLine "1280x1024" 100 1280 1300 1400 1500 1024 1100 1200 1300
ModeLine "1376x1032" 100 1376 1400 1500 1600 1032 1100 1200 1300
ModeLine "1400x1050" 100 1400 1500 1600 1700 1050 1100 1200 1300
ModeLine "1600x1200" 100 1600 1700 1800 1900 1200 1300 1400 1500
ModeLine "2364x1773" 100 2364 2400 2500 2600 1773 1800 1900 2000
EndSection
Section "Device"
Identifier "VMware SVGA"
Driver "vmware"
EndSection
Section "Screen"
Identifier "Screen 1"
Device "VMware SVGA"
Monitor "vmware"
# Don't specify DefaultColorDepth unless you know what you're
# doing. It will override the driver's preferences which can
# cause the X server not to run if the host doesn't support the
# depth.
Subsection "Display"
# VGA mode: better left untouched
Depth 4
Modes "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 8
Modes "1376x1032"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1376x1032"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1400x1050"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1400x1050"
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 1"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
วันอังคาร, สิงหาคม 30, 2548
เวลา startx เข้า GNOME แล้วมี error message No volume control elements and/or devices found
Refer from--> https://listman.redhat.com/archives/k12osn/2005-July/msg00646.html
Les Mikesell wrote:
Les Mikesell wrote:
On Thu, 2005-07-28 at 14:23, Eric Harrison wrote:
The only way I can consistently eliminate this problem is by removing
the mixer from the panel by default:rm -rf /etc/gconf/gconf.xml.defaults/apps/panel/applets/mixerAfter sleeping on it... "rm -rf" is a bit harsh, removing the
read/write/execute permissions is much less destructive:
chmod a-wrx /etc/gconf/gconf.xml.defaults/apps/panel/applets/mixer
Is there any way to turn it into what you really want instead: either
a window belonging to a local app running on the terminal or better
yet a proxy that hooks to one when needed?
วันจันทร์, สิงหาคม 29, 2548
Enable DMA mode ใน FreeBSD
เพิ่มส่วนนี้ลงไปใน /boot/loader.conf
hw.ata.atapi_dma="1"
hw.ata.ata_dma="1"
วันอาทิตย์, สิงหาคม 28, 2548
mount_smbfs จาก FreeBSD ไปยัง Win2000 ไฟล์เซิร์ฟเวอร์
mount_smbfs: can not setup kernel iconv table (default:tolower): syserr = Operation not permitted
อ้างอิงได้จาก web นี้:
http://www.onlamp.com/pub/a/bsd/2001/11/15/Big_Scary_Daemons.html
ไปเจอกระทู้นึง มันบอกว่า
which options did you include ?
อ้างอิงได้จาก web นี้:
http://www.onlamp.com/pub/a/bsd/2001/11/15/Big_Scary_Daemons.html
ไปเจอกระทู้นึง มันบอกว่า
which options did you include ?
I think you need
options LIBMCHAIN
options LIBICONV
as well as
options NETSMB #SMB/CIFS requester
and possibly
options NETSMBCRYPTO #encrypted password support for SMB
Someone please correct me if i'm wrong though, as i'm still pretty much a
FreeBSD noob.
> -----Original Message-----
> From: Jan Karabas [mailto:karabas at savbb.sk]
> Sent: 21 August 2003 11:41
> To: freebsd-questions at freebsd.org
> Subject: Samba & Iconv
>
>
> Hi, I have one small problem with mounting drives of computers
> with Winxxx.
> If I want to mount some shared drive, mount_smbfs fails with this
> message:
>
> bash-2.05b$ mount_smbfs //janci at NEDELA/TEMP ~/mnt/NEDELA/D
> mount_smbfs: can not setup kernel iconv table
> (default:tolower): syserr =
> Operation not permitted
>
> How can I set up "kernel iconv table?". Maybe I forgot
> something, when I
> compiled my kernel...
>
> Help me please. Thanks
>
วันเสาร์, สิงหาคม 13, 2548
FreeBSD printing
อ้างอิงจาก http://www.engr.colostate.edu/~reinholz/freebsd/cups.htm
http://www.linuxprinting.org/cups-doc.html
1. แก้ไฟล์ /etc/make.conf
2. install cups
3. install gimp or gimp-print ด้วยการ make install clean จาก ports ไม่งั้นมันไม่มี driver มาให้
5. start cupsd
7. เลือก Manage Printers
8. ใส่ชื่อ แล้วเลือก LPD/LPR
9. ใส่ชื่อ เป็น lpd://ps-printer-name เลือก driver ให้เหมาะสม
10. Config printer ให้เหมาะสม เวลาสั่งพิมพ์ใช้คำสั่ง lpr -P
* หมายเหตุ application ที่มันเบสบน Linux นั้นมันจะใช้ binary ที่ /compat/linux/usr/local/bin
ซึ่งจะหา lp กับ lpr ไม่เจอ. ต้องทำลิ้งเอง
http://www.linuxprinting.org/cups-doc.html
1. แก้ไฟล์ /etc/make.conf
- เพิ่ม สามบรรทัดนี้
CUPS_OVERWRITE_BASE=yesเพื่อเซตเกี่ยวกับการ build package ต่างๆ ที่เกี่ยวกับ CUPS ในภายภาคหน้า
NO_LPR=yes
WITH_CUPS=yes
2. install cups
3. install gimp or gimp-print ด้วยการ make install clean จาก ports ไม่งั้นมันไม่มี driver มาให้
$ sudo cp RIIC8103.PPD /usr/local/share/cups/model/4. ไม่ต้องแก้ BrowseAddress ใน /usr/local/etc/cups/cupsd.conf
ก๊อป Ricoh C8100 PPD driver จากของเครื่อง Mac OS X ไปไว้ใน cups driver directory
* เพิ่มเติม สำหรับ Tiger (10.4) นั้นสามารถก๊อปได้จาก /etc/cups/ppd/xxxxx.ppd
5. start cupsd
cd /usr/local/etc/rc.d6. ชี้ browser ไปที่ http://localhost:631/
cp cups.sh.sample cups.sh
./cups.sh start
7. เลือก Manage Printers
8. ใส่ชื่อ แล้วเลือก LPD/LPR
9. ใส่ชื่อ เป็น lpd://ps-printer-name เลือก driver ให้เหมาะสม
10. Config printer ให้เหมาะสม เวลาสั่งพิมพ์ใช้คำสั่ง lpr -P
* หมายเหตุ application ที่มันเบสบน Linux นั้นมันจะใช้ binary ที่ /compat/linux/usr/local/bin
ซึ่งจะหา lp กับ lpr ไม่เจอ. ต้องทำลิ้งเอง
FreeBSD: multilingual input ภาษาไทยและญี่ปุ่น
สำหรับภาษาไทย
แค่ไปเลือก Desktop > Preferences > Keyboard แล้ว เพิ่ม Keyboard layout ของ ภาษาไทยลงไป
แล้วไปแก้ ค่าให้เปลี่ยน layout โดยใช้ Alt+Shift แทน
สำหรับภาษาญี่ปุ่น
ซับซ้อนกว่า
1. Install anthy
2. Install uim อันนี้ควรลงจาก ports เพราะต้องเลือก Anthy support option.
3. ต้องไป enable Anthy โดย รัน uim-pref-gtk แล้วติ๊กเลือก Specific default IM แล้วเลือก
Default input method เป็น Anthy
สำหรับค่า ENVIRONMENT VARIABLE
ใน .xinitrc เพิ่ม
export GTK_IM_MODULE=uim-anthy
export XMODIFIERS="@im=uim-anthy"
uim-xim &
exec gnome-session
ใน .bashrc เพิ่ม
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
แค่ไปเลือก Desktop > Preferences > Keyboard แล้ว เพิ่ม Keyboard layout ของ ภาษาไทยลงไป
แล้วไปแก้ ค่าให้เปลี่ยน layout โดยใช้ Alt+Shift แทน
สำหรับภาษาญี่ปุ่น
ซับซ้อนกว่า
1. Install anthy
2. Install uim อันนี้ควรลงจาก ports เพราะต้องเลือก Anthy support option.
3. ต้องไป enable Anthy โดย รัน uim-pref-gtk แล้วติ๊กเลือก Specific default IM แล้วเลือก
Default input method เป็น Anthy
สำหรับค่า ENVIRONMENT VARIABLE
ใน .xinitrc เพิ่ม
export GTK_IM_MODULE=uim-anthy
export XMODIFIERS="@im=uim-anthy"
uim-xim &
exec gnome-session
ใน .bashrc เพิ่ม
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
FreeBSD: Install และ upgrade อย่างง่ายๆ ด้วย package
เวลา make install จาก ports tree มันช้า เสียเวลาทำมาหากิน
วิธีที่รวดเร็วกว่านั้นคือการใช้ portupgrade และ portinstall แทน
แต่ถ้าไม่จำเป็นก็ลงเป็น package ไปจะง่ายกว่า
วิธีที่รวดเร็วกว่านั้นคือการใช้ portupgrade และ portinstall แทน
- Install package ใหม่
- $ portinstall -nPPvr
- Upgrade package ที่มีอยู่แล้ว
- $ portupgrade -nPPvr
- ก่อนลง ด้วย package ควรดูก่อนว่า โปรแกรมที่เราจะลงนั้นมี option อะไรให้เลือกหรือเปล่า โดย
แต่ถ้าไม่จำเป็นก็ลงเป็น package ไปจะง่ายกว่า
- การลง package ที่เป็น localization เช่นของ japanese ports อย่าลืม ja- นำหน้าด้วย เช่นจะลง uimของ japanese ports ก็ต้อง portupgrade -nPPvr ja-uim ถ้าใช้ uim เปล่าๆ จะหาไม่เจอ
วันอาทิตย์, สิงหาคม 07, 2548
Fonts Thai ทำอย่างไรให้ไม่อุบาทว์ ใน X11 FreeBSD 5.3
ติดตั้งฟอนต์ไทยลงไปลองหลายวิธี แรกๆ ดูจากเว็บ อ.ชัชวาล แต่ว่ามันน่าเกลี๊ยด น่าเกลียด
เลยเอาใหม่วะ ลองดู เคยทำได้นี่หว่า
ผลลัพธ์ ออกมา โอเคเว๊ย ไม่เลว
สรุปวิธีการดังนี้
1. ก๊อปปี้ TrueType ฟอนต์ จาก Windows มา ที่ /usr/X11R6/lib/X11/fonts/WindowsFonts
*หมายเหตุ ลองดูพวก user/group และก็ permission ให้ดีๆ ด้วยว่ามันโอมั้ย! จะให้ดี
ควร run คำสั่งด้วย root จะไม่มีปัญหา
2. cd เข้าไปที่ WindowsFonts สร้างไฟล์ scalable fonts "fonts.scale" ใช้คำสั่ง
# ttmkfdir -o fonts.scale
3. สร้างไฟล์ "encoding.dir" และ "fonts.dir" ใช้คำสั่ง
# mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings
4. เพิ่ม FontPath ลงไป ใน /usr/X11R6/lib/X11/xorg.conf
FontPath "/usr/X11R6/lib/X11/fonts/WindowsFonts"
5. ดูให้แน่ๆว่าตรง Module มี Load "freetype" โหลดอยู่อ๊ะป่าว?
6. startx เท่านี้ก็เรียบร้อย ได้ font สวยงาม มาใช้ แล้ว
เลยเอาใหม่วะ ลองดู เคยทำได้นี่หว่า
ผลลัพธ์ ออกมา โอเคเว๊ย ไม่เลว
สรุปวิธีการดังนี้
1. ก๊อปปี้ TrueType ฟอนต์ จาก Windows มา ที่ /usr/X11R6/lib/X11/fonts/WindowsFonts
*หมายเหตุ ลองดูพวก user/group และก็ permission ให้ดีๆ ด้วยว่ามันโอมั้ย! จะให้ดี
ควร run คำสั่งด้วย root จะไม่มีปัญหา
2. cd เข้าไปที่ WindowsFonts สร้างไฟล์ scalable fonts "fonts.scale" ใช้คำสั่ง
# ttmkfdir -o fonts.scale
3. สร้างไฟล์ "encoding.dir" และ "fonts.dir" ใช้คำสั่ง
# mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings
4. เพิ่ม FontPath ลงไป ใน /usr/X11R6/lib/X11/xorg.conf
FontPath "/usr/X11R6/lib/X11/fonts/WindowsFonts"
5. ดูให้แน่ๆว่าตรง Module มี Load "freetype" โหลดอยู่อ๊ะป่าว?
6. startx เท่านี้ก็เรียบร้อย ได้ font สวยงาม มาใช้ แล้ว
วันพุธ, สิงหาคม 03, 2548
Line Tracer Car H8 JAIST team
ไว้เขียนเปเปอร์เสร็จแล้ว จะทำ
- เพิ่ม sensor เป็น 2 จุุด.
- Decompose and rewrite MAIN_TASK to multi tasks.
- Use interrupt if possible.
- เขียน blog และอัพรูปขึ้นมาเก็บไว้เตือนค.จำ
วันจันทร์, สิงหาคม 01, 2548
วันนี้เกิดไอเดีย กระจายเสียงแบบ wireless IEEE 802.11a/b/g
เพราะคอมเจ๊งเนี่ยแหละ ไอ่เครื่องที่ปกติเอาไว้เปิดเพลงก็เลยใช้ไม่ได้
อืม ลง iTunes ที่เครื่อง Fujitsu ไว้ แต่มันก็เคลื่อนย้ายลำบาก เลยคิดว่า
น่าจะมี อะไรที่ทำให้มันไปออกลำโพงได้เป็น wireless นะ
ค้นดูที่ apple's site อ่าว มันก็มีผลิตภัณฑ์ คือ AirPort Express เป็น
อย่างที่เราต้องการเดี๊ยะเลยนี่หว่า ราคา ประมาณ 14,000 เยน
อืม ไว้ wireless station ที่ใช้เจ๊งเมื่อไหร่จะเปลี่ยนเป็นอันนี้ละกันนะ
แต่จริงๆก็อยากได้ ถ้าไอ่ T-Engine ที่ตั้งทิ้งไว้อยู่นั่น เอามาพัฒนา
เป็น AirTunes ได้ก็เยี่ยมเลยเพราะมันมี PC-Card slot เสียบ wireless
card ของ Buffalo ได้พอดี แล้วมันก็เหมือนจะมี mp3 decoder เป็น
hardware อยู่ด้วย adapter แปลง หัวเสียบ jack ก็ซื้อมาแล้ว
มีเวลาเมื่อไหร่จะลองทำดู
อืม ลง iTunes ที่เครื่อง Fujitsu ไว้ แต่มันก็เคลื่อนย้ายลำบาก เลยคิดว่า
น่าจะมี อะไรที่ทำให้มันไปออกลำโพงได้เป็น wireless นะ
ค้นดูที่ apple's site อ่าว มันก็มีผลิตภัณฑ์ คือ AirPort Express เป็น
อย่างที่เราต้องการเดี๊ยะเลยนี่หว่า ราคา ประมาณ 14,000 เยน
อืม ไว้ wireless station ที่ใช้เจ๊งเมื่อไหร่จะเปลี่ยนเป็นอันนี้ละกันนะ
แต่จริงๆก็อยากได้ ถ้าไอ่ T-Engine ที่ตั้งทิ้งไว้อยู่นั่น เอามาพัฒนา
เป็น AirTunes ได้ก็เยี่ยมเลยเพราะมันมี PC-Card slot เสียบ wireless
card ของ Buffalo ได้พอดี แล้วมันก็เหมือนจะมี mp3 decoder เป็น
hardware อยู่ด้วย adapter แปลง หัวเสียบ jack ก็ซื้อมาแล้ว
มีเวลาเมื่อไหร่จะลองทำดู
สมัครสมาชิก:
บทความ (Atom)