Devhelp

Devhelp คือเครื่องมือช่วยค้นหา Document ใน Ubuntu สามารถทำการติดตั้งได้ดังนี้

sudo apt-get install devhelp

เวลาใช้งานก็เข้าไปที่
Applications → Programming  → Devhelp

ที่มา: Programming

Development Tools on Ubuntu

Development Tools

There are many development tools available for Ubuntu. A list of some of these is included below.

Integrated Development Environments (IDEs) and source-code editors

  • Anjuta is an Integrated Development Environment (IDE) for C and C++.
  • Bluefish is a powerful editor for experienced web designers and programmers.
  • Eclipse is an IDE for Java and other programming languages. It forms the basis for closed-source programs such as JBuilder.
  • Eric is a fully featured Python and Ruby IDE.
  • Geany is a general-purpose IDE which can handle manydifferent programming and markup languages.
  • IDLE is the Python IDE built with the Tkinter GUI toolkit.
  • KDevelop is a IDE for KDE which supports many programming languages.
  • MonoDevelop is an IDE for writing Mono/.NET applications in C# and other languages.
  • NetBeans is a Java IDE that features support for CVS and a form builder.
  • Quanta is a powerful IDE for web development and features support for DocBook editing.

Source-code management systems

  • Bazaar-NG is a decentralised version control system used for Ubuntu development.
  • CVS is an advanced version control system used by many open-source projects.
  • Subversion (SVN) is a powerful version control system intended as a replacement for CVS.

Other tools

  • Glade is a user interface designer for building GNOME and GTK applications.

ปล. ก่อนจะ complie ได้ต้องทำการติดตั้ง build-essential package ซะก่อน

โปรแกรมตัดคำภาษาไทย SWATH

โปรแกรมการตัดคำภาษาไทยที่สามารถเลือกวิธี การตัดคำได้สองวิธี คือ การตัดคำแบบเลือกคำที่ยาวที่สุด(longest matching) และการตัดคำโดยเลือกแบบเหมือนมากที่สุด (maximal matching algorithms) ซึ่งนอกเหนือจากการใช้งานได้ดีกับข้อความที่เป็น text ธรรมดา โปรแกรมยังสามารถ รองรับไฟล์ในรูปแบบต่างๆ ได้แก่ html, rtf

ที่มา: โปรแกรมตัดคำภาษาไทย

Python เรียกใช้ Command line

การเรียกใช้ command line จาก Python สามารถเรียกได้โดยใช้คำสั่ง popen
import os
ipFile = “ip.txt”
opFile = “op.txt”
cmd = ‘swath <%s> %s’ % (ipFile, opFile)
f = os.popen(cmd)

หรือใช้ Popen
import subprocess
subprocess.Popen([r”gzip”,”-d”, “x.txt.gz”]).wait()

ที่มา: Subprocess managementMaking System Calls in Perl and Python

การให้สิทธิใน MySQL

การให้สิทธิใน MySQL ใช้คำสั่ง Grant เช่น

[code]
grant all on *.* to jack@localhost identified by ‘xxxx’;
[/code]

เป็นการให้สิทธิทั้งหมดแก่ user jack@localhost

แต่ถ้าต้องการให้สิทธิบางส่วนเช่น ให้สิทธิเฉพาะฐานข้อมูลที่กำหนดให้ใช้คำสั่ง

[code]
grant all on mydb.* to jack@localhost identified by ‘xxxx’;
[/code]

Link

การติดตั้ง tesseract-ocr

การติดตั้ง Tesseract บน Ubuntu 10.04
ทำการติดตั้งด้วยคำสั่ง
sudo apt-get install tesseract-ocr-eng
ผลจากการใช้คำสั่งนี้ คือจะทำการติดตั้ง 2 packages คือ
tesseract-ocr 2.04-2 และ tesseract-ocr-eng 2.00-1

หลังจากติดตั้งเสร็จ ส่วนของ tessdata จะเก็บอยู่ที่ /usr/share/tesseract-ocr/tessdata

การใช้งานเบื้องต้น

ให้พิมพ์คำสั่งตามรูปแบบนี้ tesseract <path to tiff image> <output file> เช่น

$ tesseract input.tif output

จะได้ไฟล์ output ชื่อ output.txt โดย tesseract จะเติม .txt ให้อัตโนมัติ

การทดสอบ Tesseract

ได้ทำการทดสอบ tesseract ด้วยไฟล์รูปภาพจำนวน 3 ไฟล์ โดยไฟล์แรกเป็นตัวอักษร A-Z ผลลัพธ์ได้ถูกต้อง 100% ดังนี้

A B C D E
F G H I J
K L M N O
P Q R S T
U V W X Y
Z

ไฟล์ที่สองเป็นตัวอักษร a-z ผลลัพธ์ได้ผิดพลาดไป 1 ตัว คือตัว z ดังนี้

a b c d c
f g h i j
k 1 m n 0
p q r s t
u v w x y
`
ไฟล์ที่สามเป็นตัวอักษร ก-ฮ ผลลัพธ์ได้ผิดพลาดไปทั้งหมด เนื่องจาก tesseract ยังไม่สนับสนุนภาษาไทย

D °I1 9 °JJ Q
‘1] il ‘1f **5 ill
Q! S] Q S °“
QI EM Y6] $1 0
14 1a u 11 1]
w nl w v~| n
ll El *5 E1 ’J
Fl EI H 14 W
B 8
ไฟล์ภาพที่ใช้ทดสอบสามารถดาว์นโหลดได้ ดังแสดงด้านล่างนี้

ที่มา: OCR – Optical Character Recognitiontesseract-ocr

AngsanaEn22-1

AngsanaEn22-2

AngsanaTh24

ภาษาไทยกับ Eclipse

เมื่อทำการติดตั้ง Eclipse เรียบร้อยแล้ว จะสามารถใช้งานภาษาไทยใน Eclipse ได้ทันที แต่ถ้ามีปัญหาไม่สามารถใช้ได้ ให้ไปกำหนด Default Encoding ของ Eclipse ซะใหม่

โดยไปที่ Window > Preferences > General > Workspace แล้วทำการเปลี่ยน Text file encoding ดังรูป

eclipse

ที่มา: Setting the default text encoding for Eclipse

How to Use Print Screen Function on Mac

ทำได้ 3 วิธีด้วยกัน

  1. Capture ทั้งหน้าจอ Hold down Apple key ⌘ + Shift + 3 simultaneously to get a picture of your entire desktop. If your audio is turn on, you will hear a click similar to that of a camera. You will then find a picture on your desktop entitled “Picture N” ,n being the first unused number.
  2. Capture บางส่วนของหน้าจอที่ต้องการ Hold down Apple key ⌘ + Shift + 4 and release to capture a certain area of the screen. A cropping tool will appear and you can select the area of the screen you would like to capture.
  3. Capture โปรแกรมที่ต้องการ To do a screen capture of a specific application window, Hold down Apple key ⌘ + Shift + 4 and release. Click the spacebar and a camera icon will appear. Move this icon to the application window you want to capture and press “Enter.”

ที่มา: How to Use Print Screen Function on Mac