<?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:media="http://search.yahoo.com/mrss"
	>

<channel>
	<title>वीर</title>
	<atom:link href="http://blog.vee-u.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.vee-u.com</link>
	<description>Vee Satayamas; วีร์ สัตยมาศ</description>
	<pubDate>Mon, 12 May 2008 17:12:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>th</language>
			<item>
		<title>แปลง .doc เป็น .odt บน Ubuntu ผ่าน command line interface</title>
		<link>http://blog.vee-u.com/2008/05/12/unoconv/</link>
		<comments>http://blog.vee-u.com/2008/05/12/unoconv/#comments</comments>
		<pubDate>Mon, 12 May 2008 17:09:03 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[command line]]></category>

		<category><![CDATA[convert]]></category>

		<category><![CDATA[doc]]></category>

		<category><![CDATA[format]]></category>

		<category><![CDATA[gnu/linux]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[microsoft word]]></category>

		<category><![CDATA[odt]]></category>

		<category><![CDATA[openoffice.org]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=275</guid>
		<description><![CDATA[แบบที่เขียนยาวๆ ดีๆ เป็นภาษาไทยสามารถเข้าไปดูได้ที่ http://www.biolawcom.de/blog/628 หรือภาษาอังกฤษก็มี http://dag.wieers.com/home-made/unoconv/
ผมและเพื่อนพยายามจะแปลงไฟล์จาก .doc ไปเป็น .อื่นๆ อีกมากมาย แต่ก็หาโปรแกรมไม่ค่อยได้. ถ้าทำทีละไฟล์ สองไฟล์ ก็เปิด OpenOffice.org มาแล้วก็เปิดไฟล์ .doc แล้ว save as เป็น .odt ก็ง่ายๆ. แต่ว่าถ้ามีสัก 10-20 ไฟล์ไรงี้ก็คงไม่ไหว. หรืออยากจะให้มันถูกเรียกผ่าน cron หรือเว็บ ใช้ command line ก็คงดีกว่า. มาเจอ unoconv ตรงกับความต้องการมากๆ. สามารถแปลงแบบ
unoconv -f odt titi.doc
แล้วก็ได้ titi.odt ออกมาเลย
แต่ว่าต้องไปเรียก soffice ให้ run ค้างไว้ก่อน แบบนี้
soffice -headless
ใส่ -headless เข้าไปพวก user interface ทั้งหลายก็จะไม่ออกมา ทำตัวเป็น daemon [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>แบบที่เขียนยาวๆ ดีๆ เป็นภาษาไทยสามารถเข้าไปดูได้ที่ <a href="http://www.biolawcom.de/blog/628">http://www.biolawcom.de/blog/628</a> หรือภาษาอังกฤษก็มี <a href="http://dag.wieers.com/home-made/unoconv/">http://dag.wieers.com/home-made/unoconv/</a></p>
<p>ผมและเพื่อนพยายามจะแปลงไฟล์จาก .doc ไปเป็น .อื่นๆ อีกมากมาย แต่ก็หาโปรแกรมไม่ค่อยได้. ถ้าทำทีละไฟล์ สองไฟล์ ก็เปิด OpenOffice.org มาแล้วก็เปิดไฟล์ .doc แล้ว save as เป็น .odt ก็ง่ายๆ. แต่ว่าถ้ามีสัก 10-20 ไฟล์ไรงี้ก็คงไม่ไหว. หรืออยากจะให้มันถูกเรียกผ่าน cron หรือเว็บ ใช้ command line ก็คงดีกว่า. มาเจอ unoconv ตรงกับความต้องการมากๆ. สามารถแปลงแบบ</p>
<p><em>unoconv -f odt titi.doc</em></p>
<p>แล้วก็ได้ titi.odt ออกมาเลย</p>
<p>แต่ว่าต้องไปเรียก soffice ให้ run ค้างไว้ก่อน แบบนี้</p>
<p><em>soffice -headless</em></p>
<p>ใส่ -headless เข้าไปพวก user interface ทั้งหลายก็จะไม่ออกมา ทำตัวเป็น daemon (service) ไปประมาณนั้น</p>
<p>แต่ถ้าใช้ Ubuntu 7.10 ก็มีปัญหานิดๆ เพราะไม่มี package unoconv วิธีแก้ก็คือเอาของ Ubuntu 8.04 มาลง. ผมเอา source package ของ Ubuntu 8.04 มา rebuild. ถ้าเอา package ที่ build มาแล้วมาลงเลยไม่รู้ใช้ได้เปล่า :-P. หรือถ้าใช้ Ubuntu 8.04 หรือ Debian lenny อยู่แล้วก็สั่ง aptitude install unoconv ได้เลย</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/275/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/275/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=275&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/05/12/unoconv/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>
	</item>
		<item>
		<title>ข้อมูล battery บน Ubuntu 7.10</title>
		<link>http://blog.vee-u.com/2008/05/12/batt/</link>
		<comments>http://blog.vee-u.com/2008/05/12/batt/#comments</comments>
		<pubDate>Mon, 12 May 2008 13:21:21 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[7.10]]></category>

		<category><![CDATA[battery information]]></category>

		<category><![CDATA[gnu/linux]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=274</guid>
		<description><![CDATA[
ระบบอื่นก็อาจจะดูได้เหมือนกัน &#8230; ผมไม่รู้. รู้แต่ว่าเปิดดูใน Ubuntu 7.10 แล้วประทับใจ
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://openil.files.wordpress.com/2008/05/mybatt.png"><img class="alignnone size-medium wp-image-273" src="http://openil.files.wordpress.com/2008/05/mybatt.png?w=300&h=287" alt="" width="300" height="287" /></a></p>
<p>ระบบอื่นก็อาจจะดูได้เหมือนกัน &#8230; ผมไม่รู้. รู้แต่ว่าเปิดดูใน Ubuntu 7.10 แล้วประทับใจ</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/274/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/274/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/274/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=274&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/05/12/batt/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>

		<media:content url="http://openil.files.wordpress.com/2008/05/mybatt.png?w=300" medium="image" />
	</item>
		<item>
		<title>OO.o 3 beta cannot display Thai text properly when &#8230;</title>
		<link>http://blog.vee-u.com/2008/05/10/ooo-3-beta-cannot-display-thai-text-properly-when/</link>
		<comments>http://blog.vee-u.com/2008/05/10/ooo-3-beta-cannot-display-thai-text-properly-when/#comments</comments>
		<pubDate>Sat, 10 May 2008 05:33:34 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[3 beta]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[defect]]></category>

		<category><![CDATA[gnu/linux]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[open office.org]]></category>

		<category><![CDATA[thai text]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://blog.vee-u.com/?p=272</guid>
		<description><![CDATA[
Open Office.org 3 beta cannot display Thai text properly when it was zoomed in.
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p></p>
<p>Open Office.org 3 beta cannot display Thai text properly when it was zoomed in.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/272/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/272/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=272&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/05/10/ooo-3-beta-cannot-display-thai-text-properly-when/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>
	</item>
		<item>
		<title>It isn&#8217;t Foxkeh nor IceWeasel</title>
		<link>http://blog.vee-u.com/2008/05/06/it-isnt-foxkeh-nor-iceweasel/</link>
		<comments>http://blog.vee-u.com/2008/05/06/it-isnt-foxkeh-nor-iceweasel/#comments</comments>
		<pubDate>Tue, 06 May 2008 17:22:28 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[dog]]></category>

		<category><![CDATA[foxkeh]]></category>

		<category><![CDATA[iceweasel]]></category>

		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=269</guid>
		<description><![CDATA[
It is just a dog in front of 7-11 in Univ.
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://openil.files.wordpress.com/2008/05/not_foxkeh.jpg"><img class="alignnone size-full wp-image-270" src="http://openil.files.wordpress.com/2008/05/not_foxkeh.jpg?w=400&h=242" alt="" width="400" height="242" /></a></p>
<p>It is just a dog in front of 7-11 in Univ.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/269/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/269/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/269/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=269&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/05/06/it-isnt-foxkeh-nor-iceweasel/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>

		<media:content url="http://openil.files.wordpress.com/2008/05/not_foxkeh.jpg" medium="image" />
	</item>
		<item>
		<title>Use Cake, Eat Cake</title>
		<link>http://blog.vee-u.com/2008/05/05/use-cake-eat-cake/</link>
		<comments>http://blog.vee-u.com/2008/05/05/use-cake-eat-cake/#comments</comments>
		<pubDate>Mon, 05 May 2008 15:52:44 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=267</guid>
		<description><![CDATA[
อาจารย์ซื้อมาฝาก
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://openil.files.wordpress.com/2008/05/cake.jpg"><img class="alignnone size-full wp-image-268" src="http://openil.files.wordpress.com/2008/05/cake.jpg?w=400&h=533" alt="" width="400" height="533" /></a></p>
<p>อาจารย์ซื้อมาฝาก</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/267/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/267/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=267&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/05/05/use-cake-eat-cake/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>

		<media:content url="http://openil.files.wordpress.com/2008/05/cake.jpg" medium="image" />
	</item>
		<item>
		<title>TinyMCE 3 plugin for JQuery</title>
		<link>http://blog.vee-u.com/2008/05/04/tinymce-3-plugin-for-jquery/</link>
		<comments>http://blog.vee-u.com/2008/05/04/tinymce-3-plugin-for-jquery/#comments</comments>
		<pubDate>Sun, 04 May 2008 19:31:34 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[3]]></category>

		<category><![CDATA[editor]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[rich text]]></category>

		<category><![CDATA[tinymce]]></category>

		<category><![CDATA[tinymce3]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=266</guid>
		<description><![CDATA[
$.fn.tinymce = function(options){
    return this.each(function(){ tinyMCE.execCommand(&#34;mceAddControl&#34;, false, this.id); });
}

function initMCE()
{
    tinyMCE.init({mode : &#34;none&#34;,
                  theme : &#34;advanced&#34;,
                  theme_advanced_toolbar_location : &#34;top&#34;,
                  theme_advanced_toolbar_align : &#34;left&#34;,
                  theme_advanced_statusbar_location : &#34;bottom&#34;,
                  theme_advanced_resizing : true});
}

initMCE();

Reference:

http://dev.jquery.com/wiki/Plugins/tinyMCE
http://www.google.com/notebook/public/04615848626219599281/BDRwQSwoQ-Jim3bUh
http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10267
http://wiki.moxiecode.com/index.php/TinyMCE:Commands

       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><pre name="code" class="javascript">
$.fn.tinymce = function(options){
    return this.each(function(){ tinyMCE.execCommand(&quot;mceAddControl&quot;, false, this.id); });
}

function initMCE()
{
    tinyMCE.init({mode : &quot;none&quot;,
                  theme : &quot;advanced&quot;,
                  theme_advanced_toolbar_location : &quot;top&quot;,
                  theme_advanced_toolbar_align : &quot;left&quot;,
                  theme_advanced_statusbar_location : &quot;bottom&quot;,
                  theme_advanced_resizing : true});
}

initMCE();
</pre>
<p>Reference:</p>
<ul>
<li><a href="http://dev.jquery.com/wiki/Plugins/tinyMCE">http://dev.jquery.com/wiki/Plugins/tinyMCE</a></li>
<li><a href="http://www.google.com/notebook/public/04615848626219599281/BDRwQSwoQ-Jim3bUh">http://www.google.com/notebook/public/04615848626219599281/BDRwQSwoQ-Jim3bUh</a></li>
<li><a href="http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10267">http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10267</a></li>
<li><a href="http://wiki.moxiecode.com/index.php/TinyMCE:Commands">http://wiki.moxiecode.com/index.php/TinyMCE:Commands</a></li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/266/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/266/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=266&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/05/04/tinymce-3-plugin-for-jquery/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>
	</item>
		<item>
		<title>Macbook ที่ใช้ Safari บน Windows</title>
		<link>http://blog.vee-u.com/2008/04/29/macbook-%e0%b8%97%e0%b8%b5%e0%b9%88%e0%b9%83%e0%b8%8a%e0%b9%89-safari-%e0%b8%9a%e0%b8%99-windows/</link>
		<comments>http://blog.vee-u.com/2008/04/29/macbook-%e0%b8%97%e0%b8%b5%e0%b9%88%e0%b9%83%e0%b8%8a%e0%b9%89-safari-%e0%b8%9a%e0%b8%99-windows/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 13:15:46 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[apple]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[macbook]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[ms]]></category>

		<category><![CDATA[safari]]></category>

		<category><![CDATA[windows]]></category>

		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=264</guid>
		<description><![CDATA[
เจ้าของเครื่องเขาใช้แบบนี้ ท่าทางสนุกดีเหมือนกัน.
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://openil.files.wordpress.com/2008/04/mac_safari_windows.jpg"><img class="alignnone size-full wp-image-265" src="http://openil.files.wordpress.com/2008/04/mac_safari_windows.jpg?w=400&h=533" alt="" width="400" height="533" /></a></p>
<p>เจ้าของเครื่องเขาใช้แบบนี้ ท่าทางสนุกดีเหมือนกัน.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/264/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/264/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/264/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=264&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/04/29/macbook-%e0%b8%97%e0%b8%b5%e0%b9%88%e0%b9%83%e0%b8%8a%e0%b9%89-safari-%e0%b8%9a%e0%b8%99-windows/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>

		<media:content url="http://openil.files.wordpress.com/2008/04/mac_safari_windows.jpg" medium="image" />
	</item>
		<item>
		<title>CakePHP + timestamp</title>
		<link>http://blog.vee-u.com/2008/04/25/cakephp-timestamp/</link>
		<comments>http://blog.vee-u.com/2008/04/25/cakephp-timestamp/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 18:12:51 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[aftersave]]></category>

		<category><![CDATA[beforesave]]></category>

		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[created]]></category>

		<category><![CDATA[hook]]></category>

		<category><![CDATA[model]]></category>

		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=263</guid>
		<description><![CDATA[เวลา save แล้วอยากให้ CakePHP ใส่ timestamp ให้ด้วยเวลาที่ row ที่ add เข้าไปถูก create เป็นครั้งแรก. ประมาณว่าต้องการเก็บว่า row นั้นสร้างมาแต่เมื่อไหร่. ผมใช้ callback function ใน model เอา เขียนสั้นๆ ก็เป็นอันใช้ได้.

class Corpus extends AppModel {
    function afterSave($created) {
        if($this-&#62;id &#38;&#38; $created) {
            $data = $this-&#62;read();
            $data[$this-&#62;name][&#34;created&#34;] = date(&#34;Y-m-d H:i:s&#34;);
            $this-&#62;save($data);
        }
    }
}

เวลาสั่ง save จาก controller, afterSave ก็จะถูกเรียกแล้วก็ไปแก้ column: created ให้เป็นเวลาปัจจุบัน. ถ้า row [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>เวลา save แล้วอยากให้ CakePHP ใส่ timestamp ให้ด้วยเวลาที่ row ที่ add เข้าไปถูก create เป็นครั้งแรก. ประมาณว่าต้องการเก็บว่า row นั้นสร้างมาแต่เมื่อไหร่. ผมใช้ callback function ใน model เอา เขียนสั้นๆ ก็เป็นอันใช้ได้.</p>
<pre name="code" class="php">
class Corpus extends AppModel {
    function afterSave($created) {
        if($this-&gt;id &amp;&amp; $created) {
            $data = $this-&gt;read();
            $data[$this-&gt;name][&quot;created&quot;] = date(&quot;Y-m-d H:i:s&quot;);
            $this-&gt;save($data);
        }
    }
}
</pre>
<p>เวลาสั่ง save จาก controller, afterSave ก็จะถูกเรียกแล้วก็ไปแก้ column: created ให้เป็นเวลาปัจจุบัน. ถ้า row นั้นถูกสร้างขึ้นใหม่ (ตรวจสอบได้จาก $created).</p>
<p><strong>update #1:</strong> แต่จะให้ดีใช้ beforeSave ดีกว่า. จะได้ save ครั้งเดียวไปเลย (ตาม comment ของ พี่ป๊อก) แล้วก็ดูเป็นธรรมชาติดีด้วย :-).</p>
<pre name="code" class="php">
class Corpus extends AppModel {
    function beforeSave() {
        $data[$this-&gt;name][&quot;created&quot;] = date(&quot;Y-m-d H:i:s&quot;);
        return true;
    }
}
</pre>
<p>แต่ถ้า edit แต่ไม่ได้ create corpus ก็คงต้องวิธีมาตรวจสอบเอา.</p>
<p><strong>update #2: ลองดูอีกนิด จริงๆ แล้วไม่ต้องใช้ before/after save เลย. CakePHP ทำ timestamp ให้เองแบบที่ต้องการเลย โดยที่ไม่ต้องทำอะไร &#8230; แป่ว</strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/263/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/263/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/263/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=263&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/04/25/cakephp-timestamp/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>
	</item>
		<item>
		<title>CakePHP 1.2 + ภาษาไทย + UTF-8 + MySQL</title>
		<link>http://blog.vee-u.com/2008/04/25/cakephp_utf8/</link>
		<comments>http://blog.vee-u.com/2008/04/25/cakephp_utf8/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 16:34:48 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[1.2]]></category>

		<category><![CDATA[1.2.x]]></category>

		<category><![CDATA[ภาษาไทย]]></category>

		<category><![CDATA[ไทย]]></category>

		<category><![CDATA[cake]]></category>

		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[charset]]></category>

		<category><![CDATA[configuration]]></category>

		<category><![CDATA[encoding]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[phpmyadmin]]></category>

		<category><![CDATA[thai]]></category>

		<category><![CDATA[unicode]]></category>

		<category><![CDATA[utf-8]]></category>

		<category><![CDATA[utf8]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=257</guid>
		<description><![CDATA[default encoding ของ MySQL เท่าที่ผมใช้ไม่ได้เป็น UTF-8. เวลาใช้ CakePHP ก็เลยต้องแก้ configuration นิดหน่อยเพื่อทำให้ ใช้ UTF-8 และ MySQL ได้เนียนๆ. ใน CakePHP รุ่นก่อนๆ หน้านี้บางทีก็ต้องไปแก้ AppModel ที่ไม่ค่อยเท่เท่าไหร่ เพราะน่าจะต้องมาแก้อีกเวลา port ไปใช้ database ตัวอื่นที่ไม่ใช่ MySQL.
ใน Cake 1.2.x สามารถตั้งค่า encoding/charset แบบรวมศูนย์ได้ใน app/config/database.php เลย. ตามตัวอย่างแบบด้านล่าง

class DATABASE_CONFIG {

    var $default = array(
        &#039;driver&#039; =&#62; &#039;mysql&#039;,
        &#039;persistent&#039; =&#62; false,
        &#039;host&#039; =&#62; &#039;localhost&#039;,
        [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>default encoding ของ MySQL เท่าที่ผมใช้ไม่ได้เป็น UTF-8. เวลาใช้ CakePHP ก็เลยต้องแก้ configuration นิดหน่อยเพื่อทำให้ ใช้ UTF-8 และ MySQL ได้เนียนๆ. ใน CakePHP รุ่นก่อนๆ หน้านี้บางทีก็ต้องไปแก้ AppModel ที่ไม่ค่อยเท่เท่าไหร่ เพราะน่าจะต้องมาแก้อีกเวลา port ไปใช้ database ตัวอื่นที่ไม่ใช่ MySQL.</p>
<p>ใน <a href="https://trac.cakephp.org/ticket/3295">Cake 1.2.x สามารถตั้งค่า encoding/charset แบบรวมศูนย์ได้ใน app/config/database.php</a> เลย. ตามตัวอย่างแบบด้านล่าง</p>
<pre name="code" class="php">
class DATABASE_CONFIG {

    var $default = array(
        &#039;driver&#039; =&gt; &#039;mysql&#039;,
        &#039;persistent&#039; =&gt; false,
        &#039;host&#039; =&gt; &#039;localhost&#039;,
        &#039;login&#039; =&gt; &#039;your_username&#039;,
        &#039;password&#039; =&gt; &#039;your_password&#039;,
        &#039;database&#039; =&gt; &#039;my2&#039;,
        &#039;prefix&#039; =&gt; &#039;&#039;,
        &#039;encoding&#039; =&gt; &#039;UTF8&#039; #ดูบรรทัดนี้เป็นสำคัญ
    );

    var $test = array(
        &#039;driver&#039; =&gt; &#039;mysql&#039;,
        &#039;persistent&#039; =&gt; false,
        &#039;host&#039; =&gt; &#039;localhost&#039;,
        &#039;login&#039; =&gt; &#039;user&#039;,
        &#039;password&#039; =&gt; &#039;password&#039;,
        &#039;database&#039; =&gt; &#039;test_database_name&#039;,
        &#039;prefix&#039; =&gt; &#039;&#039;,
    );
}
?&gt;
</pre>
<p>เพื่อม &#8216;encoding&#8217; =&gt; &#8216;UTF8&#8242; เข้าไปก็ทำให้ใช้ภาษาไทยและ UTF-8 ได้เนียนๆ แล้ว.</p>
<p><a href="http://openil.files.wordpress.com/2008/04/utf8cake.png"><img class="alignnone size-full wp-image-258" src="http://openil.files.wordpress.com/2008/04/utf8cake.png?w=400&h=405" alt="" width="400" height="405" /></a></p>
<p>พอมาเปิดใน phpmyadmin ที่ตั้งค่าให้ใช้ UTF-8 และภาษาไทย</p>
<p><a href="http://openil.files.wordpress.com/2008/04/utf8phpmy3.png"><img class="alignnone size-full wp-image-262" src="http://openil.files.wordpress.com/2008/04/utf8phpmy3.png?w=400&h=405" alt="" width="400" height="405" /></a></p>
<p>ก็แสดงผลออกมาได้ถูกต้อง.</p>
<p>สรุปว่าถ้าอยากใช้ UTF-8 กับ MySQL ใน CakePHP 1.2.x ก็เข้าไปตั้งค่าได้ใน app/config/database.php</p>
<p>อ้างอิง</p>
<ul>
<li><a href="http://kuntzz.wordpress.com/2008/02/18/cakephp-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%84%E0%B8%97%E0%B8%A2-utf8-%E0%B8%9A%E0%B8%99-mysql/">http://kuntzz.wordpress.com/2008/02/18/cakephp-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2%E0%B9%84%E0%B8%97%E0%B8%A2-utf8-%E0%B8%9A%E0%B8%99-mysql/</a></li>
<li><a href="https://trac.cakephp.org/ticket/3295">https://trac.cakephp.org/ticket/3295</a></li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/257/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/257/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=257&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/04/25/cakephp_utf8/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>

		<media:content url="http://openil.files.wordpress.com/2008/04/utf8cake.png" medium="image" />

		<media:content url="http://openil.files.wordpress.com/2008/04/utf8phpmy3.png" medium="image" />
	</item>
		<item>
		<title>ปรับแต่ง Pluralization บน CakePHP</title>
		<link>http://blog.vee-u.com/2008/04/25/%e0%b8%9b%e0%b8%a3%e0%b8%b1%e0%b8%9a%e0%b9%81%e0%b8%95%e0%b9%88%e0%b8%87-pluralization-%e0%b8%9a%e0%b8%99-cakephp/</link>
		<comments>http://blog.vee-u.com/2008/04/25/%e0%b8%9b%e0%b8%a3%e0%b8%b1%e0%b8%9a%e0%b9%81%e0%b8%95%e0%b9%88%e0%b8%87-pluralization-%e0%b8%9a%e0%b8%99-cakephp/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 09:26:43 +0000</pubDate>
		<dc:creator>वीर</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[1.2]]></category>

		<category><![CDATA[1.2.x]]></category>

		<category><![CDATA[ปรับ]]></category>

		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[customization]]></category>

		<category><![CDATA[inflection]]></category>

		<category><![CDATA[pluralization]]></category>

		<guid isPermaLink="false">http://openil.wordpress.com/?p=256</guid>
		<description><![CDATA[ก่อนที่จะใช้ CakePHP และ Ruby on Rails ก็คิดว่าโปรแกรมพวกนี้เจ๋งจริงๆ ทำ Pluralization ให้ได้เลย ไม่ใช่แค่เติม s ให้เฉยๆ ด้วย. แต่แล้วพอเอามาทำโปรแกรมก็เจอ corpus -&#62; corpora เข้าไป CakePHP ก็ทำ pluralization ให้ไม่ได้ซะงั้น. แต่ก็ไม่ใช่เรื่องใหญ่แต่อะไร สามารถปรับได้จากไฟล์ app/config/inflections.php
ในกรณีของผม ผมก็เพิม case นี้เข้าไปเลย

 $irregularPlural = array(&#34;corpus&#34; =&#62; &#34;corpora&#34;);

ก็เป็นอันว่าใช้ได้ :-).
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>ก่อนที่จะใช้ CakePHP และ Ruby on Rails ก็คิดว่าโปรแกรมพวกนี้เจ๋งจริงๆ ทำ Pluralization ให้ได้เลย ไม่ใช่แค่เติม s ให้เฉยๆ ด้วย. แต่แล้วพอเอามาทำโปรแกรมก็เจอ corpus -&gt; corpora เข้าไป CakePHP ก็ทำ pluralization ให้ไม่ได้ซะงั้น. แต่ก็ไม่ใช่เรื่องใหญ่แต่อะไร สามารถปรับได้จากไฟล์ app/config/inflections.php</p>
<p>ในกรณีของผม ผมก็เพิม case นี้เข้าไปเลย</p>
<pre name="code" class="php">
 $irregularPlural = array(&quot;corpus&quot; =&gt; &quot;corpora&quot;);
</pre>
<p>ก็เป็นอันว่าใช้ได้ :-).</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/openil.wordpress.com/256/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/openil.wordpress.com/256/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/openil.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/openil.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/openil.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/openil.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/openil.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/openil.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/openil.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/openil.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/openil.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/openil.wordpress.com/256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.vee-u.com&blog=1389597&post=256&subd=openil&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.vee-u.com/2008/04/25/%e0%b8%9b%e0%b8%a3%e0%b8%b1%e0%b8%9a%e0%b9%81%e0%b8%95%e0%b9%88%e0%b8%87-pluralization-%e0%b8%9a%e0%b8%99-cakephp/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/openil-128.jpg" medium="image">
			<media:title type="html">वीर</media:title>
		</media:content>
	</item>
	</channel>
</rss>