Category Archives: 程式設計

[WordPress] A Method for combining both of plain and custom URLs

In WordPress, we usually set the custom URLs for the purpose of SEO.For the old plain URLs which are previously published to other sites, we should maintain them by redirecting to the new custom URLs. The htaccess setting can simply … Continue reading

Posted in PHP, Web Design, wordpress, 程式設計, 網頁撰寫 | Leave a comment

Solve the problem of Causing IIS Express Slow Down

[Chinese/中文]最近我的Visual Studio 2013內建的IIS Express 實在跑太慢了,而且常常回報無服務回應的錯誤。根據此條目,看起來像是logger元件出問題。為了解決此一問題,我們可以嘗試以下步驟:1. 用系統管理員權限開啟命令提示字元視窗 (cmd console)2. 輸入以下指令  (1) cd  %systemroot%system32inetsrv  (2) appcmd set config /section:urlCompression /doStaticCompression:True  (3) appcmd set config /section:urlCompression /doDynamicCompression:False  (4) appcmd set config /section:httpLogging /dontLog:True [English]Recently, my Visual Studio 2013’s built-in IIS Express runs too slower and it often reports errors about no service response.According … Continue reading

Posted in visual studio, Windows, 程式設計, 網路, 軟體(Software) | Leave a comment

Resource Scheduler , Calculator, Short-Circuit in Hadoop YARN and HDFS

In order to execute the next-year plan, I search the research topics and technologies in Hadoop YARN and HDFS, then make a note as follows: Since Hadoop YARN was proposed, the new generation technology are continusly discussed. For knowing the … Continue reading

Posted in hadoop, Java, Programming, 學術研究, 程式設計 | Leave a comment

Process SequenceFile without Enabling Hadoop Platform

Recently I got a requirement for reading Hadoop’s SequenceFile without enabling Hadoop Platform. However, most examples introduce the read/write SequenceFile with Hadoop Platform. How do I read such files without hadoop? There’s a tricky solution in this case. 1. Download … Continue reading

Posted in hadoop, Java, Programming, 程式設計 | Leave a comment



Posted in browser, chrome, Programming, 程式設計 | 2 Comments

Print output while Processing HTML/XML data in Jsoup Project

Currently, I encountered one problem while retrieving XML data from one website. In my case, assume that the original XML document is like <result><device /><name>Allen’s device</name></result> If I use Jsoup.parse(File, “UTF-8”); without additional options, the returned document object will be like: … Continue reading

Posted in Java, Programming, XML, 程式設計, 網路 java | Leave a comment

How to fast calculate ( I mod N)?

Given integer I and an integer N which is power of 2, how does it work faster to calculate “I mod N”? OpenJDK’s java.util.HashMap.indexFor method gives us a best solution for it. It simply calculates ” I (bitwise AND) (N-1) … Continue reading

Posted in Java, Programming, 程式設計 | Leave a comment

The Problem of Ternary Operators in PHP

How do you think of the ternary operators in PHP? Recently, I’’ve used the code written as below: echo (1?”Y”:0?”N”:””); The code returns “N” but not “Y”. How does it work? It shoud be like: echo ((1?”Y”:0)?”N”:””); Finally, please follow … Continue reading

Posted in PHP, Programming, 程式設計 | Leave a comment

[PHP] Be discreet to use crypt function

Recently, the PHP’s crypt function crashed in my designed new system. In fact, in my database design, the length of password field is 64. It ran fine at CentOS 5.5 with PHP 5.2.x. However, when I moved this system to … Continue reading

Posted in Linux, PHP, Programming, Security, 程式設計, 資訊安全 | Leave a comment


如果要使用Lucene的斷詞程式,最好看一下 1. Lucene介紹投影片 (推薦) 2. Lucene簡介 (推薦) 3. 當前幾個主要的Lucene中文分詞器的比較 4.  Lucene 3.0的中文分詞系統 (推薦) 5. Lucene 最新版4.6.1 內建的Smart中文斷詞 (推薦) 6. IKAnalyzer for Lucene 4.x版本 目前的Lucene斷詞系統都以支援簡體中文為先,如果要用繁體的話,就是用繁體轉簡體的API來製作。 JCC: A Java Chinese Covertor 懶得研究這麼多的話,可以直接使用Solr (基於Lucene實現的一個production) 1. Apache Solr 介紹(有寫說怎麼設定使用Solr斷詞,但還是以簡體字為主)

Posted in Java, Programming, 程式設計, 資工, 軟體(Software) | Leave a comment