<?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>Eureka!</title>
	<atom:link href="http://eureka.ykyuen.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://eureka.ykyuen.info</link>
	<description>Dream BIG and go for it =)</description>
	<lastBuildDate>Thu, 23 May 2013 17:04:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='eureka.ykyuen.info' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9c99f3c76686bf5edf1ea460356f00f2?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Eureka!</title>
		<link>http://eureka.ykyuen.info</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://eureka.ykyuen.info/osd.xml" title="Eureka!" />
	<atom:link rel='hub' href='http://eureka.ykyuen.info/?pushpress=hub'/>
		<item>
		<title>PHP &#8211; Create multiple galleries in a single page using UberGallery</title>
		<link>http://eureka.ykyuen.info/2013/05/23/php-create-multiple-galleries-in-a-single-page-using-ubergallery/</link>
		<comments>http://eureka.ykyuen.info/2013/05/23/php-create-multiple-galleries-in-a-single-page-using-ubergallery/#comments</comments>
		<pubDate>Thu, 23 May 2013 08:00:37 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[UberGallery]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=12696</guid>
		<description><![CDATA[The UberGallery is a very handy PHP tool to create image galleries. After the setup, it will automatically detect the image files in the folder and generate the thumbnail view on the webpage. It also support multi-directory gallery. Done =) Reference: UberGallery Filed under: PHP Tagged: PHP, UberGallery<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=12696&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://www.ubergallery.net/" target="_blank">UberGallery</a> is a very handy <font color="#880088">PHP</font> tool to create <font color="#008000">image galleries</font>. After the setup, it will automatically detect the image files in the folder and generate the thumbnail view on the webpage.</p>
<p><a href="http://eureka.ykyuen.info/?attachment_id=13989" rel="attachment wp-att-13989"><img src="http://ykyuen.files.wordpress.com/2013/05/ubergallery-1.png?w=625&#038;h=441" alt="ubergallery-1" width="625" height="441" class="aligncenter size-full wp-image-13989" /></a><br />
<span id="more-12696"></span><br />
<a href="http://eureka.ykyuen.info/?attachment_id=13990" rel="attachment wp-att-13990"><img src="http://ykyuen.files.wordpress.com/2013/05/ubergallery-2.png?w=625&#038;h=444" alt="ubergallery-2" width="625" height="444" class="aligncenter size-full wp-image-13990" /></a></p>
<p>It also support <a href="http://www.ubergallery.net/multi-gallery/" target="_blank">multi-directory gallery</a>.</p>
<p>Done =)</p>
<p>Reference: <a href="http://www.ubergallery.net/" target="_blank">UberGallery</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/php/'>PHP</a> Tagged: <a href='http://eureka.ykyuen.info/tag/php/'>PHP</a>, <a href='http://eureka.ykyuen.info/tag/ubergallery/'>UberGallery</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/12696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/12696/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=12696&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/23/php-create-multiple-galleries-in-a-single-page-using-ubergallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2013/05/ubergallery-1.png" medium="image">
			<media:title type="html">ubergallery-1</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2013/05/ubergallery-2.png" medium="image">
			<media:title type="html">ubergallery-2</media:title>
		</media:content>
	</item>
		<item>
		<title>Symblic links in FTP</title>
		<link>http://eureka.ykyuen.info/2013/05/22/symblic-links-in-ftp/</link>
		<comments>http://eureka.ykyuen.info/2013/05/22/symblic-links-in-ftp/#comments</comments>
		<pubDate>Wed, 22 May 2013 04:00:20 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Symblic Link]]></category>
		<category><![CDATA[vsftpd]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13986</guid>
		<description><![CDATA[Actually there is no way to use symbolic links in FTP. A workaround is to mount the folder with the bind option. For example, i have a jailed FTP account and i want to allow it to access the /tmp/eureka folder. 1. Create the mount point folder in the user home directory. &#160; 2. Mount [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13986&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Actually there is no way to use <font color="FF00FF">symbolic links</font> in <font color="0000A0">FTP</font>. A workaround is to <font color="008000">mount</font> the folder with the <font color="FF8000">bind</font> option. For example, i have a <font color="FF0000">jailed</font> <font color="0000A0">FTP</font> account and i want to allow it to access the <font color="880088">/tmp/eureka</font> folder.</p>
<p>1. Create the <font color="008000">mount point folder</font> in the <font color="008888">user home directory</font>.</p>
<pre class="brush: plain; title: ; notranslate">
mkdir /home/&lt;username&gt;/eureka
</pre>
<p>&nbsp;</p>
<p>2. Mount the <font color="880088">/tmp/eureka</font> folder with the <font color="FF8000">bind</font> option.</p>
<pre class="brush: plain; title: ; notranslate">
mount --bind /tmp/eureka /home/&lt;username&gt;/eureka
</pre>
<p>&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://radu.cotescu.com/vsftpd-and-symbolic-links/" target="_blank">vsFTPd and Symbolic Links</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/linux/'>Linux</a> Tagged: <a href='http://eureka.ykyuen.info/tag/ftp/'>FTP</a>, <a href='http://eureka.ykyuen.info/tag/linux/'>Linux</a>, <a href='http://eureka.ykyuen.info/tag/symblic-link/'>Symblic Link</a>, <a href='http://eureka.ykyuen.info/tag/vsftpd/'>vsftpd</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13986/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13986/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13986&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/22/symblic-links-in-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu &#8211; Setup Jailed FTP user account in vsftpd</title>
		<link>http://eureka.ykyuen.info/2013/05/21/ubuntu-setup-jailed-ftp-user-account-in-vsftpd/</link>
		<comments>http://eureka.ykyuen.info/2013/05/21/ubuntu-setup-jailed-ftp-user-account-in-vsftpd/#comments</comments>
		<pubDate>Tue, 21 May 2013 06:10:00 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vsftpd]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13982</guid>
		<description><![CDATA[1. Edit /etc/vsftpd.conf as follow. /etc/vsftpd.conf &#160; 2. Create the /etc/vsftpd.chroot_list and enter the usernames which you want to jail. /etc/vsftpd.chroot_list &#160; 3. By default, the chroot folder has to be non-writable. The simplest way is to change the user home folder permission but this is not a perfect solution. If you are looking for [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13982&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>1. Edit <font color="#0000FF">/etc/vsftpd.conf</font> as follow.<br />
<font color="#0000FF">/etc/vsftpd.conf</font></p>
<pre class="brush: plain; title: ; notranslate">
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
</pre>
<p>&nbsp;</p>
<p>2. Create the <font color="#008000">/etc/vsftpd.chroot_list</font> and enter the <font color="#FF8000">usernames</font> which you want to <font color="#FF0000">jail</font>.<br />
<font color="#008000">/etc/vsftpd.chroot_list</font></p>
<pre class="brush: plain; title: ; notranslate">
userA
userB
userC
...
</pre>
<p><span id="more-13982"></span>&nbsp;</p>
<p>3. By default, the <font color="#880088">chroot</font> folder has to be <font color="#FF00FF">non-writable</font>. The simplest way is to change the user home folder permission but this is not a perfect solution. If you are looking for a better solution. please refer to <a href="https://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/#comment-2051" target="_blank">this</a>.</p>
<pre class="brush: plain; title: ; notranslate">
chmod a-w /home/&lt;username&gt;
</pre>
<p>&nbsp;</p>
<p>4. Restart the <font color="#008888">vsftpd</font>.</p>
<pre class="brush: plain; title: ; notranslate">
/etc/init.d/vsftpd restart
</pre>
<p>&nbsp;</p>
<p>5. Connect to the server using any <font color="#0000A0">FTP</font> client, the <font color="#FF0000">jailed</font> <font color="#0000A0">FTP</font> account should work.</p>
<p>Done =)</p>
<p>Reference:</p>
<ul>
<li><a href="http://askubuntu.com/questions/134191/how-to-create-an-ftp-account-for-one-folder" target="_blank">How to create an FTP account for one folder?</a></li>
<li><a href="http://beginlinux.com/blog/2009/10/ubuntu-9-10-chroot-jail-for-ftp/" target="_blank">Ubuntu 9.10: Chroot Jail for FTP</a></li>
<li><a href="http://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/" target="_blank">Fixing 500 OOPS: vsftpd: refusing to run with writable root inside chroot ()</a></li>
</ul>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/linux/'>Linux</a> Tagged: <a href='http://eureka.ykyuen.info/tag/chroot/'>chroot</a>, <a href='http://eureka.ykyuen.info/tag/ftp/'>FTP</a>, <a href='http://eureka.ykyuen.info/tag/linux/'>Linux</a>, <a href='http://eureka.ykyuen.info/tag/ubuntu/'>Ubuntu</a>, <a href='http://eureka.ykyuen.info/tag/vsftpd/'>vsftpd</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13982/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13982/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13982&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/21/ubuntu-setup-jailed-ftp-user-account-in-vsftpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>PDFit &#8211; Export your webpage into image/PDF with just a click</title>
		<link>http://eureka.ykyuen.info/2013/05/20/pdfit-export-your-webpage-into-imagepdf-with-just-a-click/</link>
		<comments>http://eureka.ykyuen.info/2013/05/20/pdfit-export-your-webpage-into-imagepdf-with-just-a-click/#comments</comments>
		<pubDate>Mon, 20 May 2013 04:00:24 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[PDFit]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13084</guid>
		<description><![CDATA[PDFit is a Firefox extension which allows you to convert any webpage into PDF. 1. Open the Firefox Add-ons page. (Ctrl + Shift + A) 2. Search for PDFit and install it. &#160; 3. Restart the Firefox. 4. You can find the PDFit functions on the right click menu. &#160; 5. You can also use [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13084&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font color="#008000">PDFit</font> is a <font color="#FF0000">Firefox</font> extension which allows you to convert any webpage into <font color="#0000FF">PDF</font>.</p>
<p>1. Open the <font color="#FF0000">Firefox</font> <font color="#FF8000">Add-ons</font> page. (<font color="#FF00FF">Ctrl + Shift + A</font>)</p>
<p>2. Search for <font color="#008000">PDFit</font> and install it.<br />
<span id="more-13084"></span><a href="http://eureka.ykyuen.info/?attachment_id=13945" rel="attachment wp-att-13945"><img src="http://ykyuen.files.wordpress.com/2013/05/pdfit-1.png?w=625" alt="pdfit-1"   class="aligncenter size-full wp-image-13945" /></a><br />
&nbsp;</p>
<p>3. Restart the <font color="#0000FF">Firefox</font>.</p>
<p>4. You can find the <font color="#008000">PDFit</font> functions on the <font color="#880088">right click menu</font>.<br />
<a href="http://eureka.ykyuen.info/?attachment_id=13947" rel="attachment wp-att-13947"><img src="http://ykyuen.files.wordpress.com/2013/05/pdfit-2.png?w=625&#038;h=479" alt="pdfit-2" width="625" height="479" class="aligncenter size-full wp-image-13947" /></a><br />
&nbsp;</p>
<p>5. You can also use <font color="#8A0808">hotkey</font> to save the <font color="#0000A0">PDF</font>.</p>
<ul>
<li><font color="#FF8000">Alt + 1 Save whole page as a image</font></li>
<li><font color="#347C12">Alt + 2 Save visible area as a image</font></li>
<li><font color="#FF00FF">Alt + 3 Save whole page as PDF</font></li>
<li><font color="#008888">Alt + 4 Save visible area as PDF</font></li>
</ul>
<p>&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://techie-buzz.com/tech-news/convert-any-web-page-to-image-pdf-in-firefox.html" target="_blank">Convert any Web Page to Image / PDF in Firefox</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/firefox/'>Firefox</a> Tagged: <a href='http://eureka.ykyuen.info/tag/firefox/'>Firefox</a>, <a href='http://eureka.ykyuen.info/tag/pdf/'>PDF</a>, <a href='http://eureka.ykyuen.info/tag/pdfit/'>PDFit</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13084/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13084/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13084&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/20/pdfit-export-your-webpage-into-imagepdf-with-just-a-click/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2013/05/pdfit-1.png" medium="image">
			<media:title type="html">pdfit-1</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2013/05/pdfit-2.png" medium="image">
			<media:title type="html">pdfit-2</media:title>
		</media:content>
	</item>
		<item>
		<title>陶傑 – 彭定康的預言</title>
		<link>http://eureka.ykyuen.info/2013/05/19/%e9%99%b6%e5%82%91-%e5%bd%ad%e5%ae%9a%e5%ba%b7%e7%9a%84%e9%a0%90%e8%a8%80/</link>
		<comments>http://eureka.ykyuen.info/2013/05/19/%e9%99%b6%e5%82%91-%e5%bd%ad%e5%ae%9a%e5%ba%b7%e7%9a%84%e9%a0%90%e8%a8%80/#comments</comments>
		<pubDate>Sun, 19 May 2013 04:00:55 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[知識份子]]></category>
		<category><![CDATA[英國]]></category>
		<category><![CDATA[陶傑]]></category>
		<category><![CDATA[香港]]></category>
		<category><![CDATA[共產黨]]></category>
		<category><![CDATA[吳三桂]]></category>
		<category><![CDATA[哲學]]></category>
		<category><![CDATA[山海關]]></category>
		<category><![CDATA[彭定康]]></category>
		<category><![CDATA[文藝復興]]></category>
		<category><![CDATA[歐洲]]></category>
		<category><![CDATA[中共]]></category>
		<category><![CDATA[中國]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=14054</guid>
		<description><![CDATA[彭定康臨走那一年預言：將來香港的自由，不一定由中國來剝奪，而更有可能是香港一些人自己主動一點點來葬送。 彭定康做港督前，從未與中國人打交道，來香港五年，對香港中國問題的本質了解如此透澈，彭定康真是天才。 十五年來，香港人的生存空間和精神空間一點點蒸發掉，冷靜地想：確實是許多自以為有點知識的香港人自己葬送的。 譬如，香港的「知識份子」根本不懂何謂「文化」──香港開埠以來，重工商，崇金融，輕文史，不讀哲學。香港的教育制度從來不研究「文化」這個課題。但二十年來，一伙沒有基礎的「文化人」趕西方時尚，濫稱「文化研究」，這伙笨蛋，沾了點美國東岸左派學院的皮毛，在香港講「文化包容」。 「文化」是什麼，「包容」又是什麼，在歐洲，這是文藝復興之後五百年的大課題，人家有深度的思想品味基礎。正如Chanel香水和Godiva朱古力，歐洲名牌每家都有一二百年的歷史故事。但大陸的自由行掃貨名牌，香港的「知識份子」掃貨名詞，他們把白人的名牌名詞穿在身上，目的如一，並不是內心的欣賞，而是皮相的炫耀。 於是「文化包容」的吳三桂，歡天喜地打開了山海關。這下好：大陸豪客的生活習慣大亂香港，他們「包容」了大半天，地產商也學着「包容」，租金房價越來越漲，「知識份子」就黑起一張臉：我們可以逢迎遷就，我們包容可以，你們不可以市場自由，你們是吸血鬼。 香港的學者、文化人、傳媒，自我愚弄半天，直到他們的記者在北京被暴打，中國在香港的代理人說：「你們要入鄉隨俗」。 「文化人」一下子都懵了，他們從來沒有想過「入鄉隨俗」和「文化包容」的語意學的關係，沒有想過哲學詭辯的正反邏輯陷阱，沒有想過所謂「文化」，延安出身的共產黨比你懂得多，對一群學藝未精的文化二毛子，輕輕可設置政治的騙局。 看到香港今天這等亂局，想起彭定康的預言，英國人精研歷史，深諳人性，彭定康多英明呀，而英國殖民地的「精英」，又是多虛妄多愚笨呀。 陶傑 2013-03-17 Reference: 彭定康的預言 Filed under: Politics Tagged: 知識份子, 英國, 陶傑, 香港, 共產黨, 吳三桂, 哲學, 山海關, 彭定康, 文藝復興, 歐洲, 中共, 中國<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=14054&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font color="#0000FF">彭定康</font>臨走那一年預言：<font color="#008000">將來香港的自由，不一定由中國來剝奪，而更有可能是香港一些人自己主動一點點來葬送。</font></p>
<p><font color="#0000FF">彭定康</font>做港督前，從未與中國人打交道，來香港五年，對香港中國問題的本質了解如此透澈，<font color="#0000FF">彭定康</font>真是天才。</p>
<p><font color="#FF0000">十五年來，香港人的生存空間和精神空間一點點蒸發掉，冷靜地想：確實是許多自以為有點知識的香港人自己葬送的。</font></p>
<p><font color="#880088">譬如，香港的「知識份子」根本不懂何謂「文化」──香港開埠以來，重工商，崇金融，輕文史，不讀哲學。香港的教育制度從來不研究「文化」這個課題。但二十年來，一伙沒有基礎的「文化人」趕西方時尚，濫稱「文化研究」，這伙笨蛋，沾了點美國東岸左派學院的皮毛，在香港講「文化包容」。</font><br />
<span id="more-14054"></span><br />
<font color="#FF8000">「文化」是什麼，「包容」又是什麼，在歐洲，這是文藝復興之後五百年的大課題，人家有深度的思想品味基礎。</font>正如Chanel香水和Godiva朱古力，歐洲名牌每家都有一二百年的歷史故事。<font color="#008888">但大陸的自由行掃貨名牌，香港的「知識份子」掃貨名詞，他們把白人的名牌名詞穿在身上，目的如一，並不是內心的欣賞，而是皮相的炫耀。</font></p>
<p>於是「文化包容」的吳三桂，歡天喜地打開了山海關。這下好：大陸豪客的生活習慣大亂香港，他們「包容」了大半天，地產商也學着「包容」，租金房價越來越漲，「知識份子」就黑起一張臉：我們可以逢迎遷就，我們包容可以，你們不可以市場自由，你們是吸血鬼。</p>
<p><font color="#8A0808">香港的學者、文化人、傳媒，自我愚弄半天，直到他們的記者在北京被暴打，中國在香港的代理人說：「你們要入鄉隨俗」。</font></p>
<p><font color="#008000">「文化人」一下子都懵了，他們從來沒有想過「入鄉隨俗」和「文化包容」的語意學的關係，沒有想過哲學詭辯的正反邏輯陷阱，沒有想過所謂「文化」，延安出身的共產黨比你懂得多，對一群學藝未精的文化二毛子，輕輕可設置政治的騙局。</font></p>
<p><font color="#0000A0">看到香港今天這等亂局，想起彭定康的預言，英國人精研歷史，深諳人性，彭定康多英明呀，而英國殖民地的「精英」，又是多虛妄多愚笨呀。</font></p>
<p><font color="#880088">陶傑<br />
2013-03-17</font></p>
<p>Reference: <a href="http://hk.apple.nextmedia.com/supplement/columnist/%E9%99%B6%E5%82%91/art/20130317/18197616" target="_blank">彭定康的預言</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/politics/'>Politics</a> Tagged: <a href='http://eureka.ykyuen.info/tag/%e7%9f%a5%e8%ad%98%e4%bb%bd%e5%ad%90/'>知識份子</a>, <a href='http://eureka.ykyuen.info/tag/%e8%8b%b1%e5%9c%8b/'>英國</a>, <a href='http://eureka.ykyuen.info/tag/%e9%99%b6%e5%82%91/'>陶傑</a>, <a href='http://eureka.ykyuen.info/tag/%e9%a6%99%e6%b8%af/'>香港</a>, <a href='http://eureka.ykyuen.info/tag/%e5%85%b1%e7%94%a2%e9%bb%a8/'>共產黨</a>, <a href='http://eureka.ykyuen.info/tag/%e5%90%b3%e4%b8%89%e6%a1%82/'>吳三桂</a>, <a href='http://eureka.ykyuen.info/tag/%e5%93%b2%e5%ad%b8/'>哲學</a>, <a href='http://eureka.ykyuen.info/tag/%e5%b1%b1%e6%b5%b7%e9%97%9c/'>山海關</a>, <a href='http://eureka.ykyuen.info/tag/%e5%bd%ad%e5%ae%9a%e5%ba%b7/'>彭定康</a>, <a href='http://eureka.ykyuen.info/tag/%e6%96%87%e8%97%9d%e5%be%a9%e8%88%88/'>文藝復興</a>, <a href='http://eureka.ykyuen.info/tag/%e6%ad%90%e6%b4%b2/'>歐洲</a>, <a href='http://eureka.ykyuen.info/tag/%e4%b8%ad%e5%85%b1/'>中共</a>, <a href='http://eureka.ykyuen.info/tag/%e4%b8%ad%e5%9c%8b/'>中國</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/14054/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/14054/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=14054&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/19/%e9%99%b6%e5%82%91-%e5%bd%ad%e5%ae%9a%e5%ba%b7%e7%9a%84%e9%a0%90%e8%a8%80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>宗教學暨神話學入門</title>
		<link>http://eureka.ykyuen.info/2013/05/17/%e5%ae%97%e6%95%99%e5%ad%b8%e6%9a%a8%e7%a5%9e%e8%a9%b1%e5%ad%b8%e5%85%a5%e9%96%80/</link>
		<comments>http://eureka.ykyuen.info/2013/05/17/%e5%ae%97%e6%95%99%e5%ad%b8%e6%9a%a8%e7%a5%9e%e8%a9%b1%e5%ad%b8%e5%85%a5%e9%96%80/#comments</comments>
		<pubDate>Fri, 17 May 2013 04:00:35 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Reading]]></category>
		<category><![CDATA[無神論]]></category>
		<category><![CDATA[納粹]]></category>
		<category><![CDATA[道家]]></category>
		<category><![CDATA[道教]]></category>
		<category><![CDATA[董芳苑]]></category>
		<category><![CDATA[香港]]></category>
		<category><![CDATA[儒家]]></category>
		<category><![CDATA[共產主義]]></category>
		<category><![CDATA[兼愛]]></category>
		<category><![CDATA[功利主義]]></category>
		<category><![CDATA[基督宗教]]></category>
		<category><![CDATA[墨家]]></category>
		<category><![CDATA[多神論]]></category>
		<category><![CDATA[宗教]]></category>
		<category><![CDATA[宗教學]]></category>
		<category><![CDATA[拜金主義]]></category>
		<category><![CDATA[普世價值]]></category>
		<category><![CDATA[民間信仰]]></category>
		<category><![CDATA[一神論]]></category>
		<category><![CDATA[中國]]></category>
		<category><![CDATA[人文科學]]></category>
		<category><![CDATA[伊斯蘭教]]></category>
		<category><![CDATA[佛家]]></category>
		<category><![CDATA[佛教]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=14026</guid>
		<description><![CDATA[本書是一本宗教學的入門書，作者講述有關宗教學的各種定義，包括宗教學宗旨、研究對象、研究方法等等，同時亦介紹了現時仍然存在的各個宗教與神話。 宗教學是一門人文科學，可以從不同的角度著手，當中包括歷史、現象學、心理學等等。 宗教的出現，隨了深深影響了人類的歷史外、它也會與當地的文化相互作用，例如基督宗教的理念，促使了平等、人權等普世價值的出現，甚至推動政治體制的改革。雖然中國的墨家也有兼愛，但只屬小眾，難以與儒、道、佛分庭抗禮。 從道德觀來看： 一神論的宗教道德觀 追求公義、博愛、人權、順服、聖戰 (如基督宗教、伊斯蘭教) 多神論的宗教道德觀 嚮往功利主義、獨善主義 (如道教、民間信仰) 無神論的宗教道德觀 強調自力修持、慈悲、戒殺、追求解脫、或忠黨愛國 (如佛教、納粹主義、共產主義) 在東方，或許是我們缺乏一神論的宗教而民間信仰卻比較流行，形成了如香港的拜金主義。 Filed under: Reading Tagged: 無神論, 納粹, 道家, 道教, 董芳苑, 香港, 儒家, 共產主義, 兼愛, 功利主義, 基督宗教, 墨家, 多神論, 宗教, 宗教學, 拜金主義, 普世價值, 民間信仰, 一神論, 中國, 人文科學, 伊斯蘭教, 佛家, 佛教<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=14026&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>本書是一本<font color="#008000">宗教學</font>的入門書，作者講述有關<font color="#008000">宗教學</font>的各種定義，包括<font color="#008000">宗教學</font><font color="#FF0000">宗旨</font>、<font color="#FF8000">研究對象</font>、<font color="#0000FF">研究方法</font>等等，同時亦介紹了現時仍然存在的各個<font color="#347C12">宗教</font>與<font color="#FF00FF">神話</font>。</p>
<p><font color="#008000">宗教學</font>是一門<font color="#0000A0">人文科學</font>，可以從不同的角度著手，當中包括<font color="#008888">歷史</font>、<font color="#880088">現象學</font>、<font color="#8A0808">心理學</font>等等。</p>
<p><font color="#347C12">宗教</font>的出現，隨了深深影響了人類的歷史外、它也會與當地的文化相互作用，例如<font color="#0000FF">基督宗教</font>的理念，促使了平等、人權等<font color="#FF00FF">普世價值</font>的出現，甚至推動政治體制的改革。雖然中國的<font color="#8A0808">墨家</font>也有<font color="#FF0000">兼愛</font>，但只屬小眾，難以與<font color="#FF0000">儒</font>、<font color="#008000">道</font>、<font color="#0000FF">佛</font>分庭抗禮。</p>
<p>從道德觀來看：</p>
<dl>
<dt>一神論的宗教道德觀</dt>
<dd>追求公義、博愛、人權、順服、聖戰 (如基督宗教、伊斯蘭教)</dd>
<dt>多神論的宗教道德觀</dt>
</dd>
<p>嚮往功利主義、獨善主義 (如道教、民間信仰)</dd>
<dt>無神論的宗教道德觀</dt>
<dd>強調自力修持、慈悲、戒殺、追求解脫、或忠黨愛國 (如佛教、納粹主義、共產主義)</dd>
</dl>
<p>在東方，或許是我們缺乏一神論的宗教而民間信仰卻比較流行，形成了如香港的<font color="#FF8000">拜金主義</font>。</p>
<p><a href="http://eureka.ykyuen.info/?attachment_id=14028" rel="attachment wp-att-14028"><img src="http://ykyuen.files.wordpress.com/2013/05/e5ae97e69599e5adb8e69aa8e7a59ee8a9b1e5adb8e585a5e99680.jpg?w=214&#038;h=300" alt="宗教學暨神話學入門" width="214" height="300" class="aligncenter size-medium wp-image-14028" /></a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/reading/'>Reading</a> Tagged: <a href='http://eureka.ykyuen.info/tag/%e7%84%a1%e7%a5%9e%e8%ab%96/'>無神論</a>, <a href='http://eureka.ykyuen.info/tag/%e7%b4%8d%e7%b2%b9/'>納粹</a>, <a href='http://eureka.ykyuen.info/tag/%e9%81%93%e5%ae%b6/'>道家</a>, <a href='http://eureka.ykyuen.info/tag/%e9%81%93%e6%95%99/'>道教</a>, <a href='http://eureka.ykyuen.info/tag/%e8%91%a3%e8%8a%b3%e8%8b%91/'>董芳苑</a>, <a href='http://eureka.ykyuen.info/tag/%e9%a6%99%e6%b8%af/'>香港</a>, <a href='http://eureka.ykyuen.info/tag/%e5%84%92%e5%ae%b6/'>儒家</a>, <a href='http://eureka.ykyuen.info/tag/%e5%85%b1%e7%94%a2%e4%b8%bb%e7%be%a9/'>共產主義</a>, <a href='http://eureka.ykyuen.info/tag/%e5%85%bc%e6%84%9b/'>兼愛</a>, <a href='http://eureka.ykyuen.info/tag/%e5%8a%9f%e5%88%a9%e4%b8%bb%e7%be%a9/'>功利主義</a>, <a href='http://eureka.ykyuen.info/tag/%e5%9f%ba%e7%9d%a3%e5%ae%97%e6%95%99/'>基督宗教</a>, <a href='http://eureka.ykyuen.info/tag/%e5%a2%a8%e5%ae%b6/'>墨家</a>, <a href='http://eureka.ykyuen.info/tag/%e5%a4%9a%e7%a5%9e%e8%ab%96/'>多神論</a>, <a href='http://eureka.ykyuen.info/tag/%e5%ae%97%e6%95%99/'>宗教</a>, <a href='http://eureka.ykyuen.info/tag/%e5%ae%97%e6%95%99%e5%ad%b8/'>宗教學</a>, <a href='http://eureka.ykyuen.info/tag/%e6%8b%9c%e9%87%91%e4%b8%bb%e7%be%a9/'>拜金主義</a>, <a href='http://eureka.ykyuen.info/tag/%e6%99%ae%e4%b8%96%e5%83%b9%e5%80%bc/'>普世價值</a>, <a href='http://eureka.ykyuen.info/tag/%e6%b0%91%e9%96%93%e4%bf%a1%e4%bb%b0/'>民間信仰</a>, <a href='http://eureka.ykyuen.info/tag/%e4%b8%80%e7%a5%9e%e8%ab%96/'>一神論</a>, <a href='http://eureka.ykyuen.info/tag/%e4%b8%ad%e5%9c%8b/'>中國</a>, <a href='http://eureka.ykyuen.info/tag/%e4%ba%ba%e6%96%87%e7%a7%91%e5%ad%b8/'>人文科學</a>, <a href='http://eureka.ykyuen.info/tag/%e4%bc%8a%e6%96%af%e8%98%ad%e6%95%99/'>伊斯蘭教</a>, <a href='http://eureka.ykyuen.info/tag/%e4%bd%9b%e5%ae%b6/'>佛家</a>, <a href='http://eureka.ykyuen.info/tag/%e4%bd%9b%e6%95%99/'>佛教</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/14026/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/14026/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=14026&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/17/%e5%ae%97%e6%95%99%e5%ad%b8%e6%9a%a8%e7%a5%9e%e8%a9%b1%e5%ad%b8%e5%85%a5%e9%96%80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>

		<media:content url="http://ykyuen.files.wordpress.com/2013/05/e5ae97e69599e5adb8e69aa8e7a59ee8a9b1e5adb8e585a5e99680.jpg?w=214" medium="image">
			<media:title type="html">宗教學暨神話學入門</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript &#8211; Calculate the number of days between two dates</title>
		<link>http://eureka.ykyuen.info/2013/05/16/javascript-calculate-the-number-of-days-between-two-dates/</link>
		<comments>http://eureka.ykyuen.info/2013/05/16/javascript-calculate-the-number-of-days-between-two-dates/#comments</comments>
		<pubDate>Thu, 16 May 2013 04:00:59 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13935</guid>
		<description><![CDATA[&#160; Done =) Reference: StackOverflow &#8211; jquery datepicker + date diff calculation Filed under: Javascript Tagged: Javascript<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13935&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<pre class="brush: jscript; title: ; notranslate">
// Checkin date
var checkin = '2013-04-04';
var checkin_date = new Date();
checkin_date.setYear(parseInt(checkin.substr(0, 4), 10));
checkin_date.setMonth(parseInt(checkin.substr(5, 2), 10) - 1);
checkin_date.setDate(parseInt(checkin.substr(8, 2), 10));

// Checkout date
var checkout = '2013-04-10';
var checkout_date = new Date();
checkout_date.setYear(parseInt(checkout.substr(0, 4), 10));
checkout_date.setMonth(parseInt(checkout.substr(5, 2), 10) - 1);
checkout_date.setDate(parseInt(checkout.substr(8, 2), 10));

// Calculate the difference
var days = (checkout_date - checkin_date)/1000/60/60/24;

// Output the result
console.log(Math.floor(days));
</pre>
<p>&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://stackoverflow.com/questions/8455383/jquery-datepicker-date-diff-calculation" target="_blank">StackOverflow &#8211; jquery datepicker + date diff calculation</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/javascript/'>Javascript</a> Tagged: <a href='http://eureka.ykyuen.info/tag/javascript/'>Javascript</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13935/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13935/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13935&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/16/javascript-calculate-the-number-of-days-between-two-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript &#8211; Create a date object from a date string</title>
		<link>http://eureka.ykyuen.info/2013/05/15/javascript-create-a-date-object-from-a-date-string/</link>
		<comments>http://eureka.ykyuen.info/2013/05/15/javascript-create-a-date-object-from-a-date-string/#comments</comments>
		<pubDate>Wed, 15 May 2013 04:00:24 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13103</guid>
		<description><![CDATA[Previously, we talked about how to convert a date object into string. Javascript – Get YYYY-MM-DD string from a Date object This time, we will do the opposite which parses a date string and create a date object. &#160; Done =) Reference: StackOverflow &#8211; javascript: how to parse a date string Filed under: Javascript Tagged: [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13103&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Previously, we talked about how to convert a <font color="#008000">date object</font> into <font color="#FF0000">string</font>.<br />
<a href="http://eureka.ykyuen.info/2013/01/21/javascript-get-yyyy-mm-dd-string-from-a-date-object/" target="_blank">Javascript – Get YYYY-MM-DD string from a Date object</a></p>
<p>This time, we will do the opposite which parses a <font color="#FF0000">date string</font> and create a <font color="#008000">date object</font>.</p>
<pre class="brush: jscript; title: ; notranslate">
// Assume we have the date string in YYYY-MM-DD formate
var datestring = '2013-05-03';

var date_obj = new Date();
date_obj.setYear(parseInt(datestring.substr(0, 4), 10));
date_obj.setMonth(parseInt(datestring.substr(5, 2), 10) - 1);
date_obj.setDate(parseInt(datestring.substr(8, 2), 10));

// Verify the date object
console.log(date_obj);
</pre>
<p>&nbsp;</p>
<p>Done =)</p>
<p>Reference: <a href="http://stackoverflow.com/questions/4680028/javascript-how-to-parse-a-date-string" target="_blank">StackOverflow &#8211; javascript: how to parse a date string</a></p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/javascript/'>Javascript</a> Tagged: <a href='http://eureka.ykyuen.info/tag/javascript/'>Javascript</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13103&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/15/javascript-create-a-date-object-from-a-date-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal 7 &#8211; Select node by language using EntityFieldQuery</title>
		<link>http://eureka.ykyuen.info/2013/05/14/drupal-7-select-node-by-language-using-entityfieldquery/</link>
		<comments>http://eureka.ykyuen.info/2013/05/14/drupal-7-select-node-by-language-using-entityfieldquery/#comments</comments>
		<pubDate>Tue, 14 May 2013 04:57:13 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Drupal 7]]></category>
		<category><![CDATA[Drupal Development]]></category>
		<category><![CDATA[EntityFieldQuery]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13398</guid>
		<description><![CDATA[Here is an example to select entities by the current language in EntityFieldQuery. &#160; Done =) Filed under: CMS Tagged: Drupal, Drupal 7, Drupal Development, EntityFieldQuery<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13398&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Here is an example to select <font color="#FF0000">entities</font> by the <font color="#0000FF">current language</font> in <font color="#008000">EntityFieldQuery</font>.</p>
<pre class="brush: php; highlight: [9]; title: ; notranslate">
// Get the current language
global $language;

// Setup the EntityFieldQuery
$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', '&lt;CONTENT TYPE&gt;') // ex. article
  -&gt;propertyCondition('status', 1) // published nodes
  -&gt;propertyCondition('language', $language-&gt;language, '='); // filter by current language

// Execute the query
$result = $query-&gt;execute();
</pre>
<p>&nbsp;</p>
<p>Done =)</p>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/cms/'>CMS</a> Tagged: <a href='http://eureka.ykyuen.info/tag/drupal/'>Drupal</a>, <a href='http://eureka.ykyuen.info/tag/drupal-7/'>Drupal 7</a>, <a href='http://eureka.ykyuen.info/tag/drupal-development/'>Drupal Development</a>, <a href='http://eureka.ykyuen.info/tag/entityfieldquery/'>EntityFieldQuery</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13398/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13398&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/14/drupal-7-select-node-by-language-using-entityfieldquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
		<item>
		<title>Drupal 7 &#8211; Trim text programmatically</title>
		<link>http://eureka.ykyuen.info/2013/05/13/drupal-7-trim-text-programmatically/</link>
		<comments>http://eureka.ykyuen.info/2013/05/13/drupal-7-trim-text-programmatically/#comments</comments>
		<pubDate>Mon, 13 May 2013 06:00:57 +0000</pubDate>
		<dc:creator>ykyuen</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Drupal 7]]></category>
		<category><![CDATA[Drupal Development]]></category>

		<guid isPermaLink="false">http://eureka.ykyuen.info/?p=13455</guid>
		<description><![CDATA[Drupal 7 provides the truncate_utf8() function for you to trim any string in PHP manually. Assume you have a lorem ipsum paragraph. truncate_utf8($string, $max_length, $wordsafe = FALSE, $add_ellipsis = FALSE, $min_wordsafe_length = 1) &#160; &#60;?php print truncate_utf8($str, 30); ?&#62; RETURN: Lorem ipsum dolor sit amet, co &#60;?php print truncate_utf8($str, 30, TRUE); ?&#62; RETURN: Lorem ipsum [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13455&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font color="#0000FF">Drupal 7</font> provides the <a href="http://api.drupal.org/api/drupal/includes!unicode.inc/function/truncate_utf8/7" target="_blank">truncate_utf8()</a> function for you to <font color="#008888">trim</font> any <font color="#FF0000">string</font> in <font color="#880088">PHP</font> manually. Assume you have a <font color="#008000">lorem ipsum</font> paragraph.</p>
<ul>
<li>truncate_utf8(<font color="#FF0000">$string</font>, <font color="#008000">$max_length</font>, <font color="#0000FF">$wordsafe</font> = <strong>FALSE</strong>, <font color="#FF8000">$add_ellipsis</font> = <strong>FALSE</strong>, <font color="#FF00FF">$min_wordsafe_length</font> = <strong>1</strong>)</li>
</ul>
<p><span id="more-13455"></span></p>
<pre class="brush: php; html-script: true; title: ; notranslate">
$str = &quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend velit in purus pharetra dictum. In hac habitasse platea dictumst. Sed convallis nunc quis massa posuere non hendrerit enim tempor. Morbi quis eros in lacus accumsan molestie. Maecenas euismod laoreet libero, a scelerisque dui varius aliquet. Mauris vitae augue augue, ac laoreet enim. Sed quis erat porttitor lectus eleifend feugiat. Aliquam erat volutpat. Vivamus aliquam ornare arcu at posuere. Pellentesque aliquet commodo ultricies. Nulla pellentesque nulla non nunc ultrices non pellentesque dolor consequat. Nunc vestibulum nisl feugiat sapien egestas tempus. Curabitur id enim elit.&quot;;
</pre>
<p>&nbsp;</p>
<dl>
<dt>&lt;?php print truncate_utf8($str, 30); ?&gt;</dt>
<dd><font color="#880088">RETURN:</font> Lorem ipsum dolor sit amet, co</dd>
<dt>&lt;?php print truncate_utf8($str, 30, TRUE); ?&gt;</dt>
<dd><font color="#880088">RETURN:</font> Lorem ipsum dolor sit amet,</dd>
<dt>&lt;?php print truncate_utf8($str, 30, TRUE, TRUE); ?&gt;</dt>
<dd><font color="#880088">RETURN:</font> Lorem ipsum dolor sit amet,&#8230;</dd>
</dl>
<p>&nbsp;</p>
<p>Please note that if the <font color="#FF0000">string</font> contains <font color="#FF8000">HTML</font>/<font color="#880088">PHP</font> tags, you have to strip all tags before the calling <a href="http://api.drupal.org/api/drupal/includes!unicode.inc/function/truncate_utf8/7" target="_blank">truncate_utf8()</a> or otherwise the <font color="#FF8000">HTML</font>/<font color="#880088">PHP</font> will be broken. For example:</p>
<ul>
<li><font color="#008000">&lt;?php print truncate_utf8(<strong>strip_tags(</strong>$str<strong>)</strong>, 30, TRUE, TRUE); ?&gt;</font></li>
</ul>
<p>&nbsp;</p>
<p>Done =)</p>
<p>Reference:</p>
<ul>
<li><a href="http://api.drupal.org/api/drupal/includes!unicode.inc/function/truncate_utf8/7" target="_blank">Drupal API &#8211; truncate_utf8()</a></li>
<li><a href="http://php.net/manual/en/function.strip-tags.php" target="_blank">PHP &#8211; strip_tags()</a></li>
</ul>
<br />Filed under: <a href='http://eureka.ykyuen.info/category/cms/'>CMS</a> Tagged: <a href='http://eureka.ykyuen.info/tag/drupal/'>Drupal</a>, <a href='http://eureka.ykyuen.info/tag/drupal-7/'>Drupal 7</a>, <a href='http://eureka.ykyuen.info/tag/drupal-development/'>Drupal Development</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ykyuen.wordpress.com/13455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ykyuen.wordpress.com/13455/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=eureka.ykyuen.info&#038;blog=8827782&#038;post=13455&#038;subd=ykyuen&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://eureka.ykyuen.info/2013/05/13/drupal-7-trim-text-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0577d848773f045e3f49ca30ef9fcfa0?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ykyuen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
