<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Kr@z7_&#38;_U3vNtv_$&#62;</title>
	<atom:link href="http://krazv7rvn9.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://krazv7rvn9.wordpress.com</link>
	<description>FOSS Advocating...</description>
	<lastBuildDate>Mon, 29 Mar 2010 16:50:58 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='krazv7rvn9.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/f5ec47441a7c8f4395fc5ec2e585a029?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Kr@z7_&#38;_U3vNtv_$&#62;</title>
		<link>http://krazv7rvn9.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://krazv7rvn9.wordpress.com/osd.xml" title="Kr@z7_&#38;_U3vNtv_$&#62;" />
	<atom:link rel='hub' href='http://krazv7rvn9.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MySQL hỗ trợ tiếng Việt.</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/29/mysql-h%e1%bb%97-tr%e1%bb%a3-ti%e1%ba%bfng-vi%e1%bb%87t/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/29/mysql-h%e1%bb%97-tr%e1%bb%a3-ti%e1%ba%bfng-vi%e1%bb%87t/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:50:58 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/29/mysql-h%e1%bb%97-tr%e1%bb%a3-ti%e1%ba%bfng-vi%e1%bb%87t/</guid>
		<description><![CDATA[Implement Vietnamese Collation in MySQL MySQL has yet to integrate support for Vietnamese Collation (Bug #4745). You can, in the meantime, add the missing collation simply by replacing the Index.xml file in &#60;MySQL Server 5.x&#62;\share\charsets directory with this Index.xml, which implements the Vietnamese collation for both utf8 and ucs2 charsets. As a result, you will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=137&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Implement Vietnamese Collation in MySQL</h3>
<p>MySQL has yet to integrate support for Vietnamese Collation (<a href="http://bugs.mysql.com/bug.php?id=4745">Bug #4745</a>). You can, in the meantime, add the missing collation simply by replacing the Index.xml file in &lt;MySQL Server 5.x&gt;\share\charsets directory with this <a href="http://vietunicode.sourceforge.net/howto/Index.xml">Index.xml</a>, which implements the Vietnamese collation for both utf8 and ucs2 charsets. As a result, you will have native support for both sort and compare operations in MySQL 5.x Community Server. (Be sure to restart the database server for it to read in the new collations.)</p>
<p>Using MySQL Administrator or Query Browser tool, you can set the Charset and Collation for Table and Columns when you get to MySQL Table Editor dialog. With the modified Index.xml installed, you can see the new Vietnamese Collations after selecting either utf8 or usc2 for Charset.</p>
<p>With the new collations, you can run the query as follows, assuming your table has a column with one character of the <a href="http://vietunicode.sourceforge.net/charset/vietalphabet.html">Vietnamese alphabetical set</a> in each row:</p>
<blockquote><pre>SELECT letter FROM letters WHERE letter='a' COLLATE utf8_vietnamese1_ci;</pre>
</blockquote>
<p> would return &#8216;a&#8217;, &#8216;à&#8217;, &#8216;ả&#8217;, &#8216;ã&#8217;, &#8216;á&#8217;, &#8216;ạ&#8217;, and their capitals, not necessarily in any order. The same result would also be returned for any diacritical variation of the character &#8216;a&#8217; in the WHERE clause.</p>
<p>On the other hand, the query</p>
<blockquote><pre>SELECT letter FROM letters WHERE letter='a' COLLATE utf8_vietnamese2_ci;</pre>
</blockquote>
<p> would return only &#8216;a&#8217; and &#8216;A&#8217;.</p>
<p>To put the result set in Vietnamese alphabetical order, add the ORDER BY clause with appropriate collation:</p>
<blockquote><pre>SELECT letter FROM letters WHERE letter='a' COLLATE utf8_vietnamese1_ci ORDER BY letter COLLATE utf8_vietnamese2_ci;</pre>
</blockquote>
<p><strong>References</strong>:</p>
<ul>
<li><a href="http://bugs.mysql.com/file.php?id=6814">http://bugs.mysql.com/file.php?id=6814</a></li>
<li><a href="http://blogs.mysql.com/peterg/2008/05/19/instructions-for-adding-a-new-unicode-collation/">http://blogs.mysql.com/peterg/2008/05/19/instructions-for-adding-a-new-unicode-collation/</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/charset-collate.html">Using COLLATE in SQL Statements</a></li>
</ul>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=137&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/29/mysql-h%e1%bb%97-tr%e1%bb%a3-ti%e1%ba%bfng-vi%e1%bb%87t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Aethros 9285 và 928X trên Karmic 9.10</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/20/aethros-9285-va-928x-tren-karmic-9-10/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/20/aethros-9285-va-928x-tren-karmic-9-10/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 11:40:47 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/20/aethros-9285-va-928x-tren-karmic-9-10/</guid>
		<description><![CDATA[Trên Ubuntu Karmic 9.10, các card wifi này đều hoạt động, nhưng tín hiệu kém, yếu hơn nhiều so với khi chạy trên windows. Để có tín hiệu mạnh hơn, ta phải làm 2 việc: - Cài đặt wicd thay cho Gnome network manager. sudo apt-get install wicd - Cài đặt module backport cho kernel [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=136&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trên Ubuntu Karmic 9.10, các card wifi này đều hoạt động, nhưng tín hiệu kém, yếu hơn nhiều so với khi chạy trên windows.<br />
Để có tín hiệu mạnh hơn, ta phải làm 2 việc:<br />
- Cài đặt wicd thay cho Gnome network manager.<br />
sudo apt-get install wicd<br />
- Cài đặt module backport cho kernel<br />
sudo apt-get install linux-backports-modules-karmic<br />
Có 2 lệnh vậy thôi mà làm mình mất 2 ngày để lục lọi từ ubuntuforums đến các thể loại hầm bà lằng khác! Thật sự bó tay! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=136&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/20/aethros-9285-va-928x-tren-karmic-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Lật ngược cái webcam lại nào!!!</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/20/l%e1%ba%adt-ng%c6%b0%e1%bb%a3c-cai-webcam-l%e1%ba%a1i-nao/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/20/l%e1%ba%adt-ng%c6%b0%e1%bb%a3c-cai-webcam-l%e1%ba%a1i-nao/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 08:31:52 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/20/l%e1%ba%adt-ng%c6%b0%e1%bb%a3c-cai-webcam-l%e1%ba%a1i-nao/</guid>
		<description><![CDATA[Sau hai ngày lăn lộn, cuối cùng cũng lộn ngược được cái webcam của ASUS K40IN về đúng chiều! Chấm dứt 2 hôm cầm lộn ngược máy tính để skype Thêm dòng này vào trong /etc/apt/sources.list.d/libv4l.list: deb http://ppa.launchpad.net/libv4l/ppa/ubuntu karmic main Rồi chạy lệnh: sudo apt-get install libv4l-0 Với mỗi 1 chương trình dùng webcam, ví [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=135&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sau hai ngày lăn lộn, cuối cùng cũng lộn ngược được cái webcam của ASUS K40IN về đúng chiều! Chấm dứt 2 hôm cầm lộn ngược máy tính để skype <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Thêm dòng này vào trong /etc/apt/sources.list.d/libv4l.list: deb <a href="http://ppa.launchpad.net/libv4l/ppa/ubuntu">http://ppa.launchpad.net/libv4l/ppa/ubuntu</a> karmic main<br />
Rồi chạy lệnh:<br />
sudo apt-get install libv4l-0<br />
Với mỗi 1 chương trình dùng webcam, ví dụ như skype, thay vì chạy lệnh /usr/bin/skype để kích hoạt chương trình, ta phải chạy một lệnh loằng ngoằng hơn: LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype</p>
<p>Done!</p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=135&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/20/l%e1%ba%adt-ng%c6%b0%e1%bb%a3c-cai-webcam-l%e1%ba%a1i-nao/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu Karmic 9.10 on ASUS K40IN T6600</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/19/ubuntu-karmic-9-10-on-asus-k40in-t6600/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/19/ubuntu-karmic-9-10-on-asus-k40in-t6600/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 06:42:11 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/19/ubuntu-karmic-9-10-on-asus-k40in-t6600/</guid>
		<description><![CDATA[dinhtrung@dinhtrung-laptop:~$ lspci 00:00.0 Host bridge: nVidia Corporation MCP79 Host Bridge (rev b1) 00:00.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1) 00:03.0 ISA bridge: nVidia Corporation MCP79 LPC Bridge (rev b3) 00:03.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1) 00:03.2 SMBus: nVidia Corporation MCP79 SMBus (rev b1) 00:03.3 RAM memory: nVidia Corporation [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=134&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>dinhtrung@dinhtrung-laptop:~$ lspci<br />
00:00.0 Host bridge: nVidia Corporation MCP79 Host Bridge (rev b1)<br />
00:00.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)<br />
00:03.0 ISA bridge: nVidia Corporation MCP79 LPC Bridge (rev b3)<br />
00:03.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)<br />
00:03.2 SMBus: nVidia Corporation MCP79 SMBus (rev b1)<br />
00:03.3 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)<br />
00:03.5 Co-processor: nVidia Corporation MCP79 Co-processor (rev b1)<br />
00:04.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)<br />
00:04.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)<br />
00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)<br />
00:09.0 PCI bridge: nVidia Corporation MCP79 PCI Bridge (rev b1)<br />
00:0b.0 SATA controller: nVidia Corporation MCP79 AHCI Controller (rev b1)<br />
00:10.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)<br />
00:15.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)<br />
00:16.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)<br />
02:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce<br />
G102M] (rev b1)<br />
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)<br />
04:00.0 Network controller: <strong>Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)</strong></p>
<p>dinhtrung@dinhtrung-laptop:~$<br />
dinhtrung@dinhtrung-laptop:~$<br />
dinhtrung@dinhtrung-laptop:~$ lsusb<br />
Bus 001 Device 002: ID 04f2:b071 <strong>Chicony Electronics Co., Ltd 2.0M UVC WebCam / CNF7129</strong><br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 002 Device 002: ID 1c4f:0003 SiGma Micro<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
dinhtrung@dinhtrung-laptop:~$</p>
<p>Nói chung vấn đề lớn nhất gặp phải với dòng máy này là:<br />
- Không cấu hình được Touchpad.<br />
- Webcam bị lộn ngược.<br />
- Wifi chập chờn lúc được lúc không.<br />
Còn lại thì ổn cả.</p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/134/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=134&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/19/ubuntu-karmic-9-10-on-asus-k40in-t6600/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Sử dụng Google Calendar trên Thunderbird</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/15/s%e1%bb%ad-d%e1%bb%a5ng-google-calendar-tren-thunderbird/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/15/s%e1%bb%ad-d%e1%bb%a5ng-google-calendar-tren-thunderbird/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 05:25:04 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/15/s%e1%bb%ad-d%e1%bb%a5ng-google-calendar-tren-thunderbird/</guid>
		<description><![CDATA[Để sử dụng được Google Calendar trên Thunderbird, ta phải cài 2 extension là Lightning và Provider for Google Calendar. 1.Mở Thunderbird 3.03, Công cụ &#62; Tiện ích. 2.Trong thẻ Lấy thêm tiện ích, nhập vào từ khóa Lightning và Enter, rồi nhấn vào tiện ích Lightning. 3. Nhập tiếp Google Calendar để tìm kiếm [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=133&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Để sử dụng được Google Calendar trên Thunderbird, ta phải cài 2 extension là Lightning và Provider for Google Calendar.<br />
1.Mở Thunderbird 3.03, Công cụ &gt; Tiện ích.<br />
2.Trong thẻ Lấy thêm tiện ích, nhập vào từ khóa Lightning và Enter, rồi nhấn vào tiện ích Lightning.<br />
3. Nhập tiếp Google Calendar để tìm kiếm Provider for Google Calendar, rồi cài thêm tiện ích này.<br />
4. Khởi động lại Thunderbird.<br />
Sau khi khởi động lại, ta có thể bắt đầu cấu hình Lightning để đồng bộ dữ liệu với Google Calendar như sau:<br />
- Mở Lightning bằng cách chọn Sự kiện và tác vụ &gt; Lịch.<br />
- Chọn Tập tin &gt; Lịch mới.<br />
- Chọn Google Calendar.<br />
- Mở trang calendar.google.com, bấm vào danh sách lịch và chọn Cài đặt lịch cho cuốn lịch muốn đồng bộ.<br />
- Nhấp vào nút XML ở phần Địa chỉ lịch. Cóp vào trong Thunderbird.</p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=133&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/15/s%e1%bb%ad-d%e1%bb%a5ng-google-calendar-tren-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Điền Form với jQuery Populate.</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/15/di%e1%bb%81n-form-v%e1%bb%9bi-jquery-populate/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/15/di%e1%bb%81n-form-v%e1%bb%9bi-jquery-populate/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 17:47:16 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/15/di%e1%bb%81n-form-v%e1%bb%9bi-jquery-populate/</guid>
		<description><![CDATA[jQuery Populate là một plugin giúp tự động điền dữ liệu vào form từ một chuỗi JSON. Plugin này giúp ta tự động điền giá trị của Form ngay khi người dùng mở trang web, hoặc cập nhật thông tin từ server. Với PHP5, ta có thể cung cấp json dễ dàng nhờ hàm json_encode() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=132&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.keyframesandcode.com/resources/javascript/jQuery/demos/populate-demo.html">jQuery Populate</a> là một plugin giúp tự động điền dữ liệu vào form từ một chuỗi JSON. Plugin này giúp ta tự động điền giá trị của Form ngay khi người dùng mở trang web, hoặc cập nhật thông tin từ server.<br />
Với PHP5, ta có thể cung cấp json dễ dàng nhờ hàm json_encode() được tích hợp sẵn.<br />
Ví dụ đơn giản:</p>
<pre>&lt;form id="my-form" method="post"&gt;</pre>
<pre> &lt;label&gt;Username&lt;/label&gt;</pre>
<pre> &lt;input name="username" value="" id="username" maxlength="40" type="text"&gt;&lt;br&gt;</pre>
<pre> &lt;label&gt;Role&lt;/label&gt;</pre>
<pre> &lt;select name="role" id="role"&gt;</pre>
<pre> &lt;option value="0"&gt;admin&lt;/option&gt;</pre>
<pre> &lt;option value="1"&gt;editor&lt;/option&gt;</pre>
<pre> &lt;option value="2"&gt;user&lt;/option&gt;</pre>
<pre> &lt;/select&gt;&lt;br&gt;</pre>
<pre> &lt;label&gt;Sex&lt;/label&gt;</pre>
<pre> &lt;input name="sex" value="male" class="check" id="aa8da" type="radio"&gt;</pre>
<pre> &lt;input name="sex" value="female" class="check" id="c19cb" type="radio"&gt;</pre>
<pre> &lt;input name="sex" value="unknown" class="check" id="ccf23" type="radio"&gt;</pre>
<pre> &lt;hr&gt;</pre>
<pre> &lt;input name="submit" value="Gửi" id="submit" type="submit"&gt;</pre>
<pre> &lt;input name="reset" value="Nhập lại" id="reset" type="reset"&gt;&lt;br&gt;</pre>
<pre>&lt;/form&gt;</pre>
<pre>&lt;button type="button" id="populate-form"&gt;Populate Default Values&lt;button&gt;</pre>
<pre>&lt;button type="button" id="request-populate-form"&gt;Request and Populate&lt;/button&gt;</pre>
<pre>&lt;script type="text/javascript"&gt;</pre>
<pre> $(document).ready(function(){</pre>
<pre> $("#populate-form").click(function(){</pre>
<pre> $("#my-form").populate({"username" : "Username that you like", "Role" : 1, "Sex" : "unknown"});</pre>
<pre> });</pre>
<pre> $("#request-populate-form").click(function(){</pre>
<pre> $.getJSON("populate.php", function(jsonobj){$("#my-form").populate(jsonobj)});</pre>
<pre> });</pre>
<pre> });</pre>
<pre>&lt;/script&gt;</pre>
<p> Ở form trên, có 2 nút. Nút Populate Default Value demo việc sử dụng jQuery Populate để điền form ngay khi người dùng mở trang web.<br />
Nút Request and Populate demo việc gửi một truy vấn tới server, cụ thể là tới file populate.php để lấy các giá trị cần điền vào form. Trên server ta cần tạo thêm một PHP file tên là populate.php với nội dung sau:</p>
<pre>&lt;?php</pre>
<pre> $data = array('username' =&gt; 'demo', 'role' =&gt; 2, 'sex' =&gt; 'unknown');</pre>
<pre> echo json_encode($data);</pre>
<pre>?&gt;</pre>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=132&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/15/di%e1%bb%81n-form-v%e1%bb%9bi-jquery-populate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Trung đổi số điện thoại, mong mọi người update giúp.</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/10/trung-d%e1%bb%95i-s%e1%bb%91-di%e1%bb%87n-tho%e1%ba%a1i-mong-m%e1%bb%8di-ng%c6%b0%e1%bb%9di-update-giup/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/10/trung-d%e1%bb%95i-s%e1%bb%91-di%e1%bb%87n-tho%e1%ba%a1i-mong-m%e1%bb%8di-ng%c6%b0%e1%bb%9di-update-giup/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 07:13:09 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/10/trung-d%e1%bb%95i-s%e1%bb%91-di%e1%bb%87n-tho%e1%ba%a1i-mong-m%e1%bb%8di-ng%c6%b0%e1%bb%9di-update-giup/</guid>
		<description><![CDATA[Hi all, Tuần vừa rồi mình mất máy di động nên giờ số điện thoại cũ : 01685287522 mình không còn sử dụng nữa. Hiện tại mình đang dùng hai số này: - 0926843166 - 01997785235 Mong mọi người update lại giúp Trung nhé. Thanks. Filed under: Ubuntu<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=131&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi all,<br />
Tuần vừa rồi mình mất máy di động nên giờ số điện thoại cũ : 01685287522 mình không còn sử dụng nữa.<br />
Hiện tại mình đang dùng hai số này:<br />
- <strong>0926843166<br />
- 01997785235<br />
</strong><br />
<strong>Mong mọi người update lại giúp Trung nhé. Thanks.</strong></p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=131&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/10/trung-d%e1%bb%95i-s%e1%bb%91-di%e1%bb%87n-tho%e1%ba%a1i-mong-m%e1%bb%8di-ng%c6%b0%e1%bb%9di-update-giup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Sử dụng tính năng tạo bài viết qua Email trên WordPress</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/07/s%e1%bb%ad-d%e1%bb%a5ng-tinh-nang-t%e1%ba%a1o-bai-vi%e1%ba%bft-qua-email-tren-wordpress/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/07/s%e1%bb%ad-d%e1%bb%a5ng-tinh-nang-t%e1%ba%a1o-bai-vi%e1%ba%bft-qua-email-tren-wordpress/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 19:14:16 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/2010/03/07/s%e1%bb%ad-d%e1%bb%a5ng-tinh-nang-t%e1%ba%a1o-bai-vi%e1%ba%bft-qua-email-tren-wordpress/</guid>
		<description><![CDATA[WordPress cho phép ta tạo các bài viết thông qua Email. Sau khi đăng nhập vào WordPress admin (http://yourname.wordpress.com/wp-admin), ta chọn mục Trang web của tôi. Trong trang này, ta thấy ở phía bên phải có cột Post by Email. Bấm dấu kiểm trong hộp đó, ta nhận được một địa chỉ email đặc biệt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=130&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WordPress cho phép ta tạo các bài viết thông qua Email.<br />
Sau khi đăng nhập vào WordPress admin (<a href="http://yourname.wordpress.com/wp-admin">http://yourname.wordpress.com/wp-admin</a>), ta chọn mục<strong> Trang web của tôi</strong>.<br />
Trong trang này, ta thấy ở phía bên phải có cột <strong>Post by Email</strong>. Bấm dấu kiểm trong hộp đó, ta nhận được một địa chỉ email đặc biệt để gửi bài viết tới.<br />
Ngoài ra, ở ngay cột trước đấy, ta còn có thể yêu cầu WordPress lấy tin từ Facebook, Twitter và đăng tải lên ngay khi ta viết tin trên các ứng dụng này. Quy trình sẽ bao gồm việc đăng nhập vào tài khoản Facebook hay Twitter để xác nhận.</p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/ubuntu/'>Ubuntu</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=130&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/07/s%e1%bb%ad-d%e1%bb%a5ng-tinh-nang-t%e1%ba%a1o-bai-vi%e1%ba%bft-qua-email-tren-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Xóa dữ liệu trùng lặp trong MySQL</title>
		<link>http://krazv7rvn9.wordpress.com/2010/03/07/xoa-d%e1%bb%af-li%e1%bb%87u-trung-l%e1%ba%b7p-trong-mysql/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/03/07/xoa-d%e1%bb%af-li%e1%bb%87u-trung-l%e1%ba%b7p-trong-mysql/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 19:01:10 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[trùng lặp]]></category>
		<category><![CDATA[xóa]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/?p=128</guid>
		<description><![CDATA[Với 3 lệnh đơn giản, ta có thể lọc toàn bộ một bảng MySQL, xóa đi các dòng có một trường giống nhau. mysql &#62; CREATE TABLE new_table as --------&#62; SELECT * FROM old_table WHERE 1 GROUP BY [tên_cột_cần_lọc]; mysql &#62; DROP TABLE old_table; mysql &#62; RENAME TABLE new_table TO old_table; Peace of cake, huh? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=128&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Với 3 lệnh đơn giản, ta có thể lọc toàn bộ một bảng MySQL, xóa đi các dòng có một trường giống nhau.<br />
<code>mysql &gt; CREATE TABLE new_table as<br />
--------&gt; SELECT * FROM old_table WHERE 1 GROUP BY [tên_cột_cần_lọc];<br />
mysql &gt; DROP TABLE old_table;<br />
mysql &gt; RENAME TABLE new_table TO old_table;</code><br />
Peace of cake, huh?</p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/web-dev/'>Web Dev</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=128&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/03/07/xoa-d%e1%bb%af-li%e1%bb%87u-trung-l%e1%ba%b7p-trong-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>
	</item>
		<item>
		<title>Thiết kế CSDL với Dia</title>
		<link>http://krazv7rvn9.wordpress.com/2010/02/23/thi%e1%ba%bft-k%e1%ba%bf-csdl-v%e1%bb%9bi-dia/</link>
		<comments>http://krazv7rvn9.wordpress.com/2010/02/23/thi%e1%ba%bft-k%e1%ba%bf-csdl-v%e1%bb%9bi-dia/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:40:08 +0000</pubDate>
		<dc:creator>krazv7rvn9</dc:creator>
				<category><![CDATA[GNOME Desktop]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[CSDL]]></category>
		<category><![CDATA[dia]]></category>
		<category><![CDATA[sơ đồ]]></category>
		<category><![CDATA[tedia2sql]]></category>
		<category><![CDATA[vẽ hình]]></category>

		<guid isPermaLink="false">http://krazv7rvn9.wordpress.com/?p=125</guid>
		<description><![CDATA[Bản dịch từ http://left.subtree.org/2007/12/05/database-design-with-dia/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=125&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><a href="http://left.subtree.org/2007/12/05/database-design-with-dia/"><span style="color:#333333;"><span style="font-family:'Trebuchet MS', 'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;"><strong>Thiết kế CSDL với Dia</strong></span></span></span></a></h2>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Trong bài viết này, tôi sẽ giới thiệu sơ bộ về cách tạo cấu trúc CSDL với </span></span></span><a href="http://live.gnome.org/Dia"><span style="color:#b85b5a;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Dia</span></span></span></a><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">. Trong quá trình thiết kế, việc sử dụng hình ảnh để mô tả một CSDL quan hệ sẽ giúp nhà phát triển có cái nhìn trực quan và tổng quát về hệ thống. Tuy nhiên, quá trình mô tả bằng hình vẽ gặp nhiều khó khăn, nhất là khâu cập nhật mỗi khi có thay đổi trong việc thiết kế. Mỗi khi tạo thêm một cột mới, hoặc thay đổi thiết kế, bạn phải sửa lại sơ đồ của mình để đồng bộ nó với nội dung SQL cần thực thi. Ngoài ra, vì mỗi một hệ CSDL đều có cú pháp riêng, khiến cho việc đồng bộ sơ đồ CSDL với tập lệnh tạo ra CSDL đó cho mỗi nền CSDL thành ra càng khó khăn hơn. Vì vậy, bài viết này sẽ hướng dẫn bạn cách ứng dụng Dia để thiết kế CSDL hiệu quả hơn.</span></span></span></p>
<p><a href="http://live.gnome.org/Dia"><span style="color:#b85b5a;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Dia</span></span></span></a><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;"> là một chương trình để thiết kế sơ đồ. Trong bài viết này, ta sẽ sử dụng tính năng thiết kế UML trong Dia để tạo sơ đồ CSDL. Ngoài ra, bằng việc sử dụng tedia2sql, một văn lệnh Perl giúp chuyển đổi từ sơ đồ Dia sang lệnh SQL, ta có thể lấy được mã lệnh tương ứng với CSDL trên nền CSDL mình cần.</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Trước tiên, ta phải cài đặt Dia và tedia2sql. Tải tedia2sql tại </span></span></span><a href="http://tedia2sql.tigris.org/servlets/ProjectDocumentList"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">đây,</span></span></span></a><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;"> và Dia tại </span></span></span><a href="http://live.gnome.org/Dia/Download"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">đây</span></span></span></a><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">. Cách cài đặt thì tùy vào bản phân phối Linux bạn có. Nếu không dùng Linux, thì bạn nên thử xem! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Cũng dễ thôi mà!</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Mở Dia, tạo một đồ hình mới và lưu nó dưới dạng &#8220;employee.dia&#8221;. Chọn bộ đối tượng UML từ danh sách các mẫu đồ hình. Bằng cách sử dụng các đối tượng UML ta có thể biểu diễn các bảng và định nghĩa cụ thể các thành phần cấu thành nên CSDL của mình. Dưới đây xin phép tổng hợp lại các thành phần UML chính và cách sử dụng chúng:</span></span></span></p>
<p><img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_menu.jpg" alt="Các đối tượng UML trong Dia" /></p>
<col width="452"></col>
<table border="0" cellspacing="0" cellpadding="2" width="642">
<col width="183"></col>
<tbody></tbody>
<tbody>
<tr>
<td width="183"></td>
<td width="452"><img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_class.png" alt="Đối tượng Lớp" /><strong>Class</strong> <em>(Lớp) </em>biểu 			diễn một bảng trong CSDL. Tên lớp chính là tên bảng 			trong CSDL, và các thuộc tính của lớp sẽ tương ứng 			với các trường trong bảng. Thuộc tính có thể là 			public (công), private (riêng) hay protected (được bảo 			vệ). Những thuộc tính được bảo vệ sẽ tương ứng 			với khóa chính của bảng. Ta sẽ đi sâu tìm hiểu lớp 			trong phần sau.</p>
<p><img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_component.png" alt="Đối tượng Thành phần" /><strong>Component</strong> <em>(Thành 			phần)</em> là một đối 			tượng đặc biệt, cho phép ta mô tả danh sách các giá 			trị mặc định sẽ được chèn vào trong bảng, giống 			như viết các câu lệnh &#8220;insert into ..&#8221; 			trong tệp lệnh SQL.</p>
<p><img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_small_package.png" alt="Đối tượng Gói nhỏ" /><strong>Small Package</strong> <em>(Gói nhỏ)</em> biểu diễn một 			ánh xạ kiểu. Các ánh xạ kiểu được sử dụng để 			thêm các kiểu dữ liệu SQL một cách tùy ý, như kiểu 			TINYINT trong MySQL chả hạn.</td>
</tr>
</tbody>
</table>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Giờ ta sẽ bắt tay vào việc tạo bảng đầu tiên. Chọn đối tượng Class trong mục đối tượng UML rồi bấm chuột trái vào trong cửa sổ soạn thảo sơ đồ. Bấm chuột phải trong lớp mới tạo và chọn “Show properties” (“Thuộc tính”). Hộp thoại thuộc tính lớp sẽ hiện lên. Ta sẽ phải chỉnh sửa lại một số thuộc tính được liệt kê dưới đây.</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Trước hết, trong thẻ &#8220;Class&#8221; (“Lớp”), gõ tên bảng (employee) vào trong trường “Class Name” (“Tên lớp”). Tiếp đó nhấn chọn thẻ “Attributes” (“Thuộc tính”) rồi gõ vào các thuộc tính lớp, ứng với các cột trong bảng. Trong trường “Type: “ (“Kiểu: “), nhập kiểu dữ liệu SQL mà cột này sử dụng, như INT, VARCHAR hay BOOL. Nếu muốn đồ hình của mình hỗ trợ nhiều nền tảng CSDL khác nhau, hãy sử dụng các kiểu dữ liệu chuẩn ANSI SQL 1992, hoặc sử dụng ánh xạ kiểu. Ta sẽ bàn luận thêm về ánh xạ kiểu sau. Trong trường “Value: “ (“Giá trị”), ta nhập giá trị mặc định của trường (“NOT NULL” chả hạn). Nếu cột được thêm vào là một khóa chính, ta chọn “Protected” trong trường “Visibilitiy: “ (“Khả kiến”). Lưu ý rằng với các khóa chính, ta không cần nhập “NOT NULL” vào trong ô “Value :”. Ảnh chụp màn hình dưới đây minh họa cho quá trình sửa thuộc tính của Lớp.</span></span></span><br />
<img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_attributes.jpg" alt="Hộp thoại thuộc tính Lớp" /><br />
<span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Tiếp tục tạo thê các bảng có trong CSDL. Ví dụ, ta có 2 bảng &#8220;employee&#8221; và &#8220;department&#8221; với các cột như hình vẽ bên dưới (lưu ý là dấu &#8216;#&#8217; ở phía trước một thuộc tính biểu diễn độ khả kiến “Protected”, ứng với trường khóa chính của bảng):</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Ví dụ trên mô tả quan hệ của 2 bảng chứa dữ liệu về nhân viên và phòng ban mà họ làm việc. Giả dụ ta có một danh sách các phòng ban mặc định, được thêm vào ngay khi CSDL được tạo ra. Để thực hiện điều này, ta sử dụng đối tượng “Component” trong các đối tượng UML. Chọn đối tượng &#8220;Component&#8221; và thêm nó vào trong cửa sổ soạn thảo đồ hình. Bấm phải vào đối tượng mới thêm, và chọn “Properties” (“Thuộc tính”).</span></span></span><br />
<img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_employee.jpg" alt="Sơ đồ minh họa với 2 bảng" /><br />
<span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Trong hộp thoại hiện ra, ta nhập giá trị sẽ dùng trong câu lệnh “INSERT INTO” vào trường &#8220;Stereotype: &#8220;. Lấy ví dụ, để thêm vào danh sách mặc định các phòng ban, ta cần viết các câu SQL sau:</span></span></span></p>
<pre><span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><span style="color:#a52a2a;"><strong>insert</strong></span> <span style="color:#6a5acd;">into</span> department (department_id, name) <span style="color:#6a5acd;">values</span> (<span style="color:#bb8844;">1</span>, <span style="color:#bb8844;">'Marketing'</span>);</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><span style="color:#a52a2a;"><strong>insert</strong></span> <span style="color:#6a5acd;">into</span> department (department_id, name) <span style="color:#6a5acd;">values</span> (<span style="color:#bb8844;">2</span>, <span style="color:#bb8844;">'Production'</span>);</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><span style="color:#a52a2a;"><strong>insert</strong></span> <span style="color:#6a5acd;">into</span> department (department_id, name) <span style="color:#6a5acd;">values</span> (<span style="color:#bb8844;">3</span>, <span style="color:#bb8844;">'Design'</span>);</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Vì vậy, trường &#8220;Stereotype: &#8221; sẽ chứa nội dung là &#8220;department (department_id, name)&#8221;. Nhấn OK để đóng hộp thoại thuộc tính thành phần. Tiếp đến, trong hộp đối tượng Component, ta nhập các giá trị muốn thêm vào, mỗi giá trị một dòng.</span></span></span><br />
<img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_employee2.jpg" alt="Sơ đồ với đối tượng Thành phần, tương ứng với dữ liệu mặc định" /><br />
<span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Giờ ta sẽ nói về ánh xạ kiểu. Các ánh xạ kiểu được dùng khi bạn muốn cấu hình các kiểu dữ liệu tự định nghĩa. Ví dụ, ta có thể tạo ánh xạ kiểu cho dữ liệu có thuộc tính auto_increment trong MySQL. Đây là một tính năng mà MySQL hỗ trợ, nhưng các nền CSDL khác thì chưa chắc đã có. Giả dụ rằng ta có một trường khóa chính với thuộc tính auto_increment này. Nhưng ta muốn CSDL của mình vừa dùng được cho MySQL, vừa dùng được cho Apache Derby. Vì cách khai báo trên 2 nền CSDL này khác nhau, nên ta sẽ sử dụng một ánh xạ kiểu tự chọn và đặt SQL riêng cho từng nền CSDL.</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Các ánh xạ kiểu được tạo bằng đối tượng Small Package.</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Trong trường &#8220;Stereotype: &#8221; ta nhập nền CSDL muốn dùng. Ví dụ, &#8220;mysql: typemap&#8221;. Để biết các nền CSDL nào mà tedia2sql hỗ trợ, hãy gõ lệnh <em>tedia2sql &#8211;help</em>. Một số nền CSDL phổ dụng là: postgres, mysql, sybase, oracle, db2, và innodb. Nhấn OK để đóng hộp thoại Thuộc tính. Bên trong hộp Small Package, ta nhập các kiểu tùy chọn của CSDL đó. Ví dụ, ta sẽ tạo một kiểu dữ liệu tùy chọn với tên “identity”. Khi tạo tệp lệnh SQL từ sơ đồ, tedia2sql sẽ thay thế kiểu dữ liệu này với kiểu dữ liệu ta định nghĩa trong hộp Small Package. Dưới đây là một số ví dụ:</span></span></span></p>
<table border="0" cellspacing="0" cellpadding="2" width="575">
<col width="252"></col>
<col width="315"></col>
<tbody>
<tr>
<td width="252">MySQL typemaps</p>
<pre><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">identity: int unsigned auto_increment</span></span>
<span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">bigid: bigint unsigned auto_increment</span></span></pre>
</td>
<td width="315">Apache Derby typemaps</p>
<pre><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">identity: int generated by default as identity</span></span>
<span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">bigid: long generated by default as identity</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Thực hiện lại việc cấu hình Small Package cho Apache Derby dùng Stereotype &#8220;db2: typemap&#8221;. Giờ ta đã định nghĩa xong các kiểu dữ liệu tự chọn. Ta có thể thay đổi kiểu dữ liệu của trường employee_id từ &#8220;int&#8221; thành &#8220;identity&#8221;. Sơ đồ của ta giờ có dạng như hình vẽ bên dưới:</span></span></span><br />
<img src="http://left.subtree.org/wp-content/themes/subtree/images/dia_employee3.jpg" alt="Sơ đồ với đối tượng Small Package, tương ứng với kiểu dữ liệu đặc tả" /><br />
<span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Cuối cùng, ta sẽ dùng tedia2sql để tạo CSDL tương ứng từ sơ đồ cho nền CSDL MySQL và Apache derby. Tuy nhiên, trước khi chạy tedia2sql, ta phải vá lại chương trình này, để sửa lại lỗi định dạng lệnh SQL của tedia2sql để hỗ trợ các ánh xạ kiểu. Sửa lại văn lệnh tedia2sql (/usr/bin/tedia2sql) và chú thích lại các dòng trong hàm parseTypeMap(..) sau:</span></span></span></p>
<pre><span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><span style="color:#008b8b;">$defStr</span> =~ <span style="color:#a52a2a;"><strong>s/</strong></span><span style="color:#bb8844;">s</span><span style="color:#a52a2a;"><strong>//g</strong></span>; <span style="color:#0000ff;"># ignore spaces</span></span></span></span>
<span style="color:#333333;">     <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">-- thành --</span></span></span>
<span style="color:#0000ff;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">#   $defStr =~ s/s//g; # ignore spaces</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Giờ ta có thể tạo CSDL mình cần:</span></span></span></p>
<pre><span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">$ tedia2sql -i employee.dia -o employee-mysql.sql -t mysql -d</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">$ tedia2sql -i employee.dia -o employee-derby.sql -t db2 -d</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Hai lệnh trên sẽ tạo 2 tệp SQL ứng với nền MySQL và Apache derby. Nếu bạn xem các tệp tin này, bạn sẽ thấy tedia2sql xử lý các ánh xạ kiểu như thế nào:</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">MySQL</span></span></span></p>
<pre><span style="color:#0000ff;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">-- employee</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><span style="color:#a52a2a;"><strong>create</strong></span> <span style="color:#6a5acd;">table</span> employee (</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">employee_id                int unsigned auto_increment </span></span><span style="color:#a52a2a;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>not</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">null</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">department_id             int </span></span><span style="color:#a52a2a;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>not</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">null</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">first_name                </span></span><span style="color:#2e8b57;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>varchar</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">(</span></span><span style="color:#bb8844;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">255</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">) </span></span><span style="color:#a52a2a;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>not</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">null</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">last_name                 </span></span><span style="color:#2e8b57;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>varchar</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">(</span></span><span style="color:#bb8844;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">255</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">),</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">start_date                </span></span><span style="color:#2e8b57;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>date</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">constraint pk_Employee primary key (employee_id)</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">) ;</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Apache Derby</span></span></span></p>
<pre><span style="color:#0000ff;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">-- employee</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><span style="color:#a52a2a;"><strong>create</strong></span> <span style="color:#6a5acd;">table</span> employee (</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">employee_id                int generated </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">by</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">default</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">as</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> identity  </span></span><span style="color:#a52a2a;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>not</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">null</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">department_id             int </span></span><span style="color:#a52a2a;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>not</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">null</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">first_name                </span></span><span style="color:#2e8b57;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>varchar</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">(</span></span><span style="color:#bb8844;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">255</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">) </span></span><span style="color:#a52a2a;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>not</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"> </span></span><span style="color:#6a5acd;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">null</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">last_name                 </span></span><span style="color:#2e8b57;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>varchar</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">(</span></span><span style="color:#bb8844;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">255</span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">),</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">start_date                </span></span><span style="color:#2e8b57;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;"><strong>date</strong></span></span></span><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">,</span></span></span>
<span style="color:#333333;">  <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">constraint pk_Employee primary key (employee_id)</span></span></span>
<span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">) ;</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Các tập tin trong ví dụ trên:</span></span></span></p>
<ul>
<li><a href="http://www.qnot.org/code/employee.dia"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">employee.dia</span></span></span></a></li>
<li><a href="http://www.qnot.org/code/employee-mysql.sql"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">employee-mysql.sql</span></span></span></a></li>
<li><a href="http://www.qnot.org/code/employee-derby.sql"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">employee-derby.sql</span></span></span></a></li>
</ul>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Ta có thể chạy thử các tệp SQL được tạo bởi tedia2sql và tạo CSDL employee như sau:</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">MySQL</span></span></span></p>
<pre><span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">$ mysql -u user -p dbname &lt; employee-mysql.sql</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Apache Derby</span></span></span></p>
<pre><span style="color:#333333;"><span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">$ java -cp derby.jar:derbytools.jar \</span></span></span>
<span style="color:#333333;">       <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">-Dderby.system.home=/path/to/dbroot \</span></span></span>
<span style="color:#333333;">       <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">-Dij.protocol=jdbc:derby: \</span></span></span>
<span style="color:#333333;">       <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">-Dij.database='employee;create=true'</span></span></span>
<span style="color:#333333;">    <span style="font-family:'Andale Mono', 'Courier New', 'Lucida Console', Monaco, Courier;"><span style="font-size:xx-small;">org.apache.derby.tools.ij employee-derby.sql</span></span></span></pre>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Đối với các dự án cỡ trung và nhỏ, việc tạo CSDL bằng Dia và tạo tệp SQL thông qua tedia2sql thực sự giúp bạn tiết kiệm không ít thời gian. Bạn có thể xuất trực tiếp sơ đồ thành ảnh jpg, png, eps, tiff, pdf để trình bày với các thành viên khác trong nhóm. Ngoài ra, tedia2sql còn hỗ trợ rất nhiều tính năng, như đánh chỉ mục, khóa ngoại lai, views v..v&#8230; Xin xem thêm: </span></span></span><a href="http://tedia2sql.tigris.org/usingtedia2sql.html"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">hướng dẫn sử dụng tedia2sql</span></span></span></a><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;"> và </span></span></span><a href="http://dia-installer.de/doc/en/index.html"><span style="color:#114477;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Hướng dẫn Dia</span></span></span></a><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">.</span></span></span></p>
<p><span style="color:#333333;"><span style="font-family:'Lucida Grande', Verdana, Arial, sans-serif;"><span style="font-size:x-small;">Chúc vui!</span></span></span></p>
<br />Filed under: <a href='http://krazv7rvn9.wordpress.com/category/gnome-desktop/'>GNOME Desktop</a>, <a href='http://krazv7rvn9.wordpress.com/category/web-dev/'>Web Dev</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krazv7rvn9.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krazv7rvn9.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krazv7rvn9.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krazv7rvn9.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krazv7rvn9.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krazv7rvn9.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krazv7rvn9.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krazv7rvn9.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=krazv7rvn9.wordpress.com&amp;blog=8015759&amp;post=125&amp;subd=krazv7rvn9&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://krazv7rvn9.wordpress.com/2010/02/23/thi%e1%ba%bft-k%e1%ba%bf-csdl-v%e1%bb%9bi-dia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20f2da0892aaad8a5669a31297ce0d6f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">krazv7rvn9</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_menu.jpg" medium="image">
			<media:title type="html">Các đối tượng UML trong Dia</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_class.png" medium="image">
			<media:title type="html">Đối tượng Lớp</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_component.png" medium="image">
			<media:title type="html">Đối tượng Thành phần</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_small_package.png" medium="image">
			<media:title type="html">Đối tượng Gói nhỏ</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_attributes.jpg" medium="image">
			<media:title type="html">Hộp thoại thuộc tính Lớp</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_employee.jpg" medium="image">
			<media:title type="html">Sơ đồ minh họa với 2 bảng</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_employee2.jpg" medium="image">
			<media:title type="html">Sơ đồ với đối tượng Thành phần, tương ứng với dữ liệu mặc định</media:title>
		</media:content>

		<media:content url="http://left.subtree.org/wp-content/themes/subtree/images/dia_employee3.jpg" medium="image">
			<media:title type="html">Sơ đồ với đối tượng Small Package, tương ứng với kiểu dữ liệu đặc tả</media:title>
		</media:content>
	</item>
	</channel>
</rss>
