MongoDB 只支援《英文和數字的全文檢索》,但是不能正確進行《中文全文檢索》。於是我將所有非英文 unicode 字元通通轉成其 unicode 16進位數字碼,放入 keywords 欄位中,這樣就可以先將查詢的中文轉成數字碼後,再進行檢索 ...這種方法讓 mongoDB 也能支援《中文的全文檢索》了!===========================================
範例:文章:.... 我是陳鍾誠 .... => ... 6211 662f 9673 937e 8aa0 ...檢索:包含《誠》字的文章 => mdTable.find({"$text":{"$search":"8aa0"}}).toArray();
Han-Chiuan Luo, Ph.D. (羅漢全博士) 台灣大學資訊工程博士, 淡水商工(高職)資料處理科專任教師,淡江大學兼任助理教授。
2016年12月16日 星期五
讓 MongoDB 也能處理中文的方法
https://www.facebook.com/ccckmit/posts/10154670232536893 by 金門大學 陳鍾誠教授
2016年5月12日 星期四
2016年4月20日 星期三
2016年3月2日 星期三
2016年1月7日 星期四
2015年12月4日 星期五
2015年12月3日 星期四
如何在網誌和內文中放入背景音樂
設定起始音量的方法
JavaScript :
How to set a specific starting volume for tag audio
在 Dropbox 中儲放背景音樂
Dropbox Public
DropboxTunes
Dropbox-啟用公開資料夾(Public)
現在 Dropbox 啟用 Public 資 料夾 要轉用付費帳號才行,
一般資料夾(檔案)的分享 不能有 web server 送出背景音樂的功能。
Google Drive 的分享也是無法達成背景音樂的功能。
目前,要完成 背景音樂的功能 還是要找個 web server 將檔案掛上去。
也許可以考慮利用 YouTube 。
在 Google Drive 中儲放背景音樂
之後
其實可以用
JavaScript :
backgroundAudio=document.getElementById("bgAudio");
backgroundAudio.volume=0.5;
Move the script to right before the "body" tag, or do :window.onload = function() {
var backgroundAudio=document.getElementById("bgAudio");
backgroundAudio.volume=0.5;
}
How to set a specific starting volume for tag audio
在 Dropbox 中儲放背景音樂
Dropbox Public
DropboxTunes
Dropbox-啟用公開資料夾(Public)
現在 Dropbox 啟用 Public 資 料夾 要轉用付費帳號才行,
一般資料夾(檔案)的分享 不能有 web server 送出背景音樂的功能。
Google Drive 的分享也是無法達成背景音樂的功能。
目前,要完成 背景音樂的功能 還是要找個 web server 將檔案掛上去。
也許可以考慮利用 YouTube 。
在 Google Drive 中儲放背景音樂
使用Google雲端硬碟代管網頁(請記得務必設定可公開檢視)
http://googledrive.com/host/資料夾ID (資料夾 和 mp3檔 都要公開)
如下
http://googledrive.com/host/0B5vsTE4Mtt6LcWV4WUNIbHRkd3c
之後
點選 mp3 音樂檔,就會看到那個可以播放的音樂網址
https://213044a59227f6f36301224dfb542430d9052549.googledrive.com/host/0B5vsTE4Mtt6LcWV4WUNIbHRkd3c/Untitled-SupremeMasterChingHai.mp3
http://googledrive.com/host/0B5vsTE4Mtt6LcWV4WUNIbHRkd3c/Untitled-SupremeMasterChingHai.mp3
公告:這項功能將於 2016 年 8 月 31 日停用
您可以在 2016 年 8 月 31 日之前繼續使用這項功能,屆時 googledrive.com/host/ID 將會失效。
2015年12月1日 星期二
PhoneGap 只用JavaScript,就能開發在所有手機平台上運行的 apps
Easily create apps using the web technologies you know and love: HTML, CSS, and JavaScript.
http://phonegap.com/
http://phonegap.com/
2015年11月13日 星期五
2015年11月1日 星期日
2015年10月16日 星期五
2015年9月23日 星期三
研討室預約行事曆 內嵌碼
老師好,
如果您已經預約儲存了研討室的使用時段,
請 check 以下的連結,才能確定是否寫入正確的位置:
如果沒有寫入,通常是因為您將事件寫在 自己私人的行事日曆,
而不是寫在 研討室預約 這個日曆哦!
每個人都會有幾個日曆(研討室預約才是公共的日曆),
建立事件時,要記得挑選寫在哪一個日曆。
sso.ntpc.edu.tw >> Google Application >> 右上角,Google 應用程式 >> Calendar >> 選 資料科研討室預約 這個日曆, 所有 Google Calendar 都可以一次預約多次的週期性活動。
下週會請科學會同學,
將研討室預約的日曆嵌入科網頁當中,
如果您有個人網站(Moodle, 或是 協作平台),
也可以將網址內嵌進自己的網頁當中:內嵌碼如下
在自己的網頁上。
如果,我們要有電子商務的特色,無紙化網站化 是必須走出的一步。
使用頂尖企業的工具,學習頂尖企業的流程, 才有可能跟上產業工作水平。
2015年8月21日 星期五
2015年7月14日 星期二
Mongoose
var mongoose = require('mongoose');
// 連線到localhost上的MongoDB,使用test資料庫
mongoose.connect('mongodb://localhost/test');
// 定義存取Cat資料表的模式,定義一個欄位name,是字串態別
var Cat = mongoose.model('Cat', {
name: String,
age: Number
});
// 建立一筆貓的新資料,name欄位是Zildjian
var kitty = new Cat({ name: 'Zildjian', age: 10 });
// 存入該資料到MongoDB
kitty.save(function (err) {
if (err) {
// 存入失敗
console.log('Something\'s wrong');
return;
}
// 存入成功
console.log('meow');
});
var kitty = new Cat();
kitty.name = 'Kitty';
kitty.age = 5;
kitty.save();
Cat.find(function(err, cats) {
for (var index in cats) {
var cat = cats[index];
console.log(cat.name);
}
});
Cat.find({ name: 'kitty' }, function(err, cats) {
for (var index in cats) {
var cat = cats[index];
console.log(cat.name);
}
});
// 尋找age大於等於5的資料
Cat.find({ age: { $gte: 5 } }, function(err, cats) {
// Do stuffs
});
// 尋找name裡面包含kitty字串的資料
Cat.find({ name: /kitty/i }, function(err, cats) {
// Do stuffs
});
Cat.remove({
name: 'Zildjian' }, function(err) {
if (err)
console.log('刪除失敗');
else
console.log('刪除成功');
});
// 尋找name為Zildjian的資料,然後修改成Blue,並且把age改成11
Cat.update({
name: 'Zildjian' }, { name: 'Blue', age: 11 }, function(err) {
if (err)
console.log('修改失敗');
else
console.log('刪除成功');
});
Cat.update({
name: 'Zildjian' }, { $set: { age: 11 } }, function(err) {
if (err)
console.log('修改特定欄位失敗');
else
console.log('刪除特定欄位成功');
});
訂閱:
文章 (Atom)
