วันอาทิตย์ที่ 12 ธันวาคม พ.ศ. 2553

การใส่คำสั่ง plot ลงใน latex บน ubuntu

เนื่องจาก ubuntu รุ่นใหม่มีปัญหาเกี่ยวกับการทำงานระหว่าง pdflatex กับ gnuplot จึงแก้ปัญหาดังนี้
1. กำหนด --shell-escape --enable-write18 ลงในคำสั่ง pdflatex
2. ที่ /usr/share/texmf/tex/generic/pgf/modules/pgfmoduleplot.code.tex ให้แก้บรรทัดที่ 288 จาก
\xdef\pgf@gnuplot@head#1{set terminal table; set output "#1.table"; set format "%.5f"}
ไปเป็น
\xdef\pgf@gnuplot@head#1{set table; set output "#1.table"; set format "%.5f"}
ก็จะสามารถทำงานได้ครับ

วันศุกร์ที่ 10 ธันวาคม พ.ศ. 2553

PayBox

เพียงแค่สมัครสมาชิก รับเงินทันที 25$
PayBox

วันจันทร์ที่ 6 ธันวาคม พ.ศ. 2553

การใส่ Form ลงบน google gadget

1.log in google แล้วไปที่ google gadget editor
2.แก้ไขข้อความดังนี้แล้ว save ใน google
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Hello World!" />
<Content type="html">
<![CDATA[
<FORM action="http://example.com/example.php" method="post">
ชื่อ: <input type="text" name="name" /><br />
อีเมล์: <input type="text" name="email" /><br />
เบอร์โทรศัพท์: <input type="text" name="phone" /><br />
<INPUT type="submit" value="Submit">
</FORM>
]]>
</Content>
</Module>
3.คลิกไฟล์ ---เซฟ
4.คลิกปุ่มขวาที่ชื่อไฟล์ เลือกคำสั่ง Copy link location
5.นำ url ที่ได้ไปใส่ใน gadget ของ blog หรือ igoogle

วันเสาร์ที่ 4 ธันวาคม พ.ศ. 2553

Multiple virtual hosts in xampp/lampp in Ubuntu

Xampp ( for Windows) or Lampp (for UNIX based systems) is an Apache MySql PHP distribution which installs quickly and offers a good solution for testing websites on local machines. I myself use it and it has never disappointed me.

When working with multiple websites, there is no need to create sub-domains to the existing local domain name "localhost". Xampp/lampp enables you to work with a real domain name like "google.com", for example, but with the files hosted on your computer. The secret is the hosts files and the virtual hosts feature.

First of all you should find out where Xampp/lampp was installed on your computer. On my computer it is /opt/lampp/ .

Next, because you should get some admin privileges, open up a terminal and type gksudo nautilus . Nautilus will help you modify some files easily, directly from GEdit.

Now, with Nautilus, browse to /opt/lampp/etc/extra (change /opt/lampp to your own directory where xampp/lampp is installed, if different from mine). Now open this file: httpd-vhosts.conf

By default there are two VirtualHost sections, each contained between the tag. We will do some changes to these sections now. The first section we should change it to point to localhost . Should look like this:


ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs
ServerName localhost
ServerAlias localhost
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common

In this line DocumentRoot /opt/lampp/htdocs you should once again change /opt/lampp to the directory where xampp/lampp is installed in your system.

Next, for every other additional virtual host you will append the same block of code to your httpd-vhosts.conf file, but making some slight changes. For example, if you want to add the virtual host myhost.com , whose files are located in /opt/lampp/htdocs/myhost , you will add this code:


ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs/myhost
ServerName myhost.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common

Notice that DocumentRoot and ServerName has been changed. ServerAlias is not needed anymore. Save the file.

Next you should enable virtual hosts in the configuration file, located at /opt/lampp/etc . Open the file httpd.conf with nautilus, and find this line #Include etc/extra/httpd-vhosts.conf . Remove the # char from the beginning of the line, so it remains Include etc/extra/httpd-vhosts.conf only. Save the file.

Now we should add the domain name to the hosts file in order for the domain name to point to our ip address 127.0.0.1 , but not to look for it in the DNS database. So go to /etc/ with Nautilus, also, and open this file: hosts . Now at the end of the file append the following line : 127.0.0.1 myhost.com (or change myhost.com to the name of your own virtual host name). Do the same thing for all the other virtual hosts you have. Save the file.

Now we will need to restart Xampp/Lampp in order for the changes to take effect. Open a terminal window and run this command: gksudo /opt/lampp/lampp restart ( remember to change /opt/lampp if needed).

Now you should be able to work with your virtual hosts, by going with your browser to http://myhost.com or to http://the_name_of_your_own_virtual_host.your_own_tld . Good luck!


ที่มา http://www.blogger.com/post-create.g?blogID=6066341583614699750

การแก้ไขปุ่ม window button จากด้านซ้ายไปด้านขวาบน ubuntu 10.04

จากตอนเริ่มต้นที่ปุ่มอยู่ทางด้านซ้ายมือ

ให้กดปุ่ม Alt-F2 จะมี ไดอะล็อก Run Application ปรากฎขึ้นมา ให้พิมพ์ gconf-editor แล้วคลิก Run

จะเกิดป๊อบอัพนี้ขึ้นมา

จากนั้นให้ไปแก้ไขใน apps/metacity/general

ให้ ดับเบิ้ลคลอกที่ button_layout
เปลี่ยนข้อความเป็น
menu:maximize,minimize,close

จากนั้นคลิกที่ปุ่ม OK จะเป็นการเปลี่ยนแปลงค่า button_layout ตามรูป

แล้วจะเห็น window button อยูทางด้านขวามือดังภาพนี้

แหล่งที่มา http://www.howtogeek.com/howto/13535/move-window-buttons-back-to-the-right-in-ubuntu-10.04/