2011年5月24日 星期二

Solr Schema

<fields>:定義有哪些filed
<field>:定義該有的field,如果要用動態欄位可用<dynamicField>
  • name:必備,這個filed的名稱
  • type:必備,這個field的種類( boolean | string | int | float | long | double | date | point | ...)
  • indexed:選用,是否要用來作index
  • stored:選用,是否要儲存。通常在copyField指定的目標會設為false。
  • multiValued:選用,是否會有多個內容,如:(好折凳)產品功能可能會有好多個

<dynamicField>:定義模糊的field,如*_i、ignored_*,其他同field
如:age_i 就會對應到 *_i。

<copyField>:把某個 field 複製到某個 field 搜尋,通常會用在 copy 到 defaultSearchField。

<defaultSearchField>:定義預設的搜尋field

Solr Tips

什麼是Solr?
請參考http://mclee.foolme.net/2007/07/solr-enterprise-search.html

Solr用法
http://my.opera.com/jinglepot/blog/solr-schema-xml

注意!
改過 schema 後,要把
  1. solr 重新啟動
  2. 資料重新post進solr

SVN Export Only Changed File

參考網址:http://www.electrictoolbox.com/subversion-export-changed-files-cli-v2/

  1. 將網頁中的 script 存下來命名為svnexport (隨你高興)
  2. 可依照個人喜好放到/usr/local/bin下或哪邊方便使用
  3. 用法為PATH_TO_svnexport REPOS_PATH TARGET_PATH REVERSION_FROM,例如

    svnexport http://code.mycompany.tw/repos/myproject ./ 9527

    則會把從 reversion 9257開始,有更新的檔案整個目錄結構拉下來

2011年5月11日 星期三

Android Cocos2D Tutorial-1

參考網址:http://code.google.com/p/cocos2d-android-1/

建立專案後的動作:

  1. cocos2d-android.jar放進專案設上Build Path
  2. 將以下這張圖片放到asset資料夾內。

2011年5月10日 星期二

iOS Load Local Javascript

https://devforums.apple.com/message/32282#32282

如果要在iOS中讀取local的javascript檔案,需將javascript丟到project內。
再到Project設定中-> Build Phases中
  1. 選擇第三個 Compile Sources按「-」把該js刪掉
  2. 選擇第二個 Copy Bundle Resources 按「+」將該js加進來

Android 安裝App異常

有時候會出現Unknow Error 18
http://www.androidpolice.com/2011/04/19/fixing-the-couldnt-install-on-usb-storage-or-sd-card-problem-on-android/

http://www.android-hk.com/news/installing-sd-card-apps/

HTML on Touch Device


var supportTouch = "ontouchend" in document,
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
touchMoveEvent = supportTouch ? "touchmove" : "mousemove",
touchStopEvent = supportTouch ? "touchend" : "mouseup";

//以上為偵測裝置是否有支援touch,有則用touch沒有則用mouse。

$touchpad.bind(touchStartEvent, function(e) {
//Your Code Here
});
$touchpad.bind(touchMoveEvent, function(e) {
//Your Code Here
});
$touchpad.bind(touchStopEvent, function(e) {
//Your Code Here
});



Touch In This Area!