• Shortcuts : 'n' next unread feed - 'p' previous unread feed • Styles : 1 2

» Publishers, Monetize your RSS feeds with FeedShow:  More infos  (Show/Hide Ads)


Date: Saturday, 20 Oct 2007 05:59
Thanks othree for telling me Goston's introduction of GDI++, I've tried it to make my 32" LCD-TV looks better on the highest resolution, since its best resolution is only 1360x768 and fonts looked crappy on 1920x1080@60Hz.


  • Download gdi0424.zip, or follow the description on gdi++ FreeType 版 to find the most recent stable version.
  • Replace "gdi++.dll" and "gdi++.exe" in the extracted folder "C:\gdi++" that indicated on the above.

  • Execute gditray.exe in "C:\gdi++" and click "Enable."
  • Open some application which uses 新細明體, to see if it encountered "fragile" problem or not.
    • If so, unfortunately, it has to be excluded. Go to "C:\gdi++\ini\", clone your own .ini from 0.ini, say mine.ini, and edit lines like this:

    • [General]
      Name=mine

      [Exclude]
      細明體
      新細明體
      標楷體

    • Save mine.ini in UTF-16LE encoding.
    • Change "Use Preferences" to "mine".
    • If "Font Substitution" and "ForceChangeFont" are desired, remember to change them all consistently in 0.ini, 1.ini, 2.ini, and mine.ini. It's weird, though.
  • At least until today, do NOT use freetype.dll from gdi++.dll @ wiki FreeType.dll, they are all unstable to gditray.exe.
  • However, official freetype2 binary from FreeType for Windows works for me.
    • Exit gditray.exe.
    • Download freetype-bin-zip
    • Extract freetype6.dll from downloaded archive, rename it to freetype.dll, and then replace the old one in "C:\gdi++" with it.
    • Download freetype-dep-zip , extract zlib1.dll from the archive and then put it into "C:\gdi++".
    • Start gditray.exe.

  • Optionally, newer replacements on GDI++ Uploader are OK to give them a try.
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Wednesday, 17 Oct 2007 03:10
誠摯地向大家推薦,門市絕對買不到,海邊找沒有;就算有,起重機吊回來也沒 power,由蕭老師開光加持的 ——

開運消波塊!
Author: "Mike Tian-Jian Jiang"
Send by mail Print  Save  Delicious 
Date: Monday, 15 Oct 2007 18:30

歴史は生きている

—— 朝日新聞

Thanks whiteg's information. Looks interesting.
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Monday, 15 Oct 2007 18:28

Programming Collective Intelligence

Building Smart Web 2.0 Applications
By Toby Segaran


Unfortunately, seems not cover Markov families.
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Monday, 15 Oct 2007 18:28

Adobe Thermo demo video

When seeing photoshop layers were converted into a scroll bar associated with dynamic data, what can I say?

Boom! XD
XD: Adobe's Approach to Application DesignXD: Adobe's Approach to Application Design
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Monday, 15 Oct 2007 18:27

Kill and disable the process of LVPrcSrv (Logitech Process Monitor)!


「無法存取 Windows Installer 服務」?

I tried standard solutions 「當您嘗試新增或移除程式時,出現「錯誤 1719:無法存取 Windows Installer 服務」錯誤訊息」 and 「嘗試安裝 Office 時,出現「無法存取 Windows Installer 服務」錯誤訊息」(although I was not trying to install Office), no luck.

Is there anything wrong with my recent Windows Update? Hmmm...... Gotcha, Logitech!

Many thanks to Gary Lee: http://garywlee.blogspot.com/2007/03/windows-installer.html
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Saturday, 01 Sep 2007 23:17
Especially for VC8.

Update:
I should clarify the situation of this problem. As the convention, if a SomePlainOldApi asked for a char***, i.e. a pointer of char** as output parameter, the memory management will be usually done in it. From the caller, it's unnecessary, unsafe, and incorrect, either allocating it before calling SomePlainOldApi(), or releasing it after that. Once again, as the convention, a FreeDataOfSomePlainOldApi() was expected to free char**.

Seems no problem now? Well, I'm still curious about why the local pointer of the SomePlainOldApi worked ok? Let me think in this way: why do I need free()? Here comes the answer. Once a memory is allocated in the heap, it will be dangled after the dynamic library unloaded without explicitly releasing. Always remember FreeDataOfSomePlainOldApi().


char** returnArray;
//@warning
// The char** is usually allocated in
// the SomePlainOldFunction(), not here.
/*
* static const size_t ROW = 100;
* static const size_t COLUMN = 100;

* char** returnArray = new char* [ROW];
* for(size_t i = 0; i < ROW; i++) {
* returnArray[i] = new char[COLUMN];
* for(size_t j = 0; j < COLUMN; j++)
* returnArray[i][j] = '\0';
* }
*/
size_t usedRow =
SomePlainOldApi(
&returnArray;, someCondition);
for(size_t i = 0; i < usedRow; i++) {
char* aResultString = *(returnArray + i);

// using aResultString here

//@warning
// Ignore the next warning, memory releasing
// should be done by FreeDataOfSomePlainOldApi()
//@warning
// How to free() the *(returnArray + i)
// and returnArray correctly here?
for(size_t j = 0; j < strlen(aResultString); j++)
aResultString[j] = 0;
aResultString = 0;
}

//@warning
// Since the char** is not allocated
// in this scope by operator new[],
// ignore next warning.
//@{
//@warning
// delete [] should be applied, theoretically.
// for(size_t i = 0; i < ROW; i++)
// delete [] returnArray[i];
//@}

//delete [] returnArray;
returnArray = 0;
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Thursday, 16 Aug 2007 23:38
In Wikimania 2007, unstable WiFi and video streaming took most of my days; the rest of them contributed on introducing, time keeping, or just monitoring misc things. They can be all taken for communicating, no matter to which ghost in what kind of shell.

I don't really like Social Constructivism, and actually I hate Strong Programme[1]. I'm just a programmer. Someone may see me as one of the IT crowd, that's partially true, like what I did mostly in Wikimania 2007.

Sometimes, impacts of programmers can be stronger, with or without intention and consciousness. Dr. Ping Yeh noticed that the xml:lang attribute of Wikimania 2007 official site is totally wrong as "wikimania2007." He believes that causes problems to search engines on recognizing localized pages. We discussed this issue with an OmegaWiki's committer, Gerard Meijssen, who showed as more about l10n content, changed dynamically by cookie, which is usually ignored by search engine crawlers since their default preference is en_US. The first one can be fixed[2], and the later one is even harder but more important, as my friend Jedi always said, think twice on Web Content Accessibility Guidelines.

Fortunately(?), we have English as a Global Language. That's why you can read this not-that-important blog entry.

I won't say that Wikipedia or Wikia search will be another example of social construction, just like the poor Simplified-Traditional Chinese conversion and the flame war of it on Chinese Wikipedia do not represent the whole community of Chinese, but their influences increase. With or without the faith of Strong Programme, information is often asymmetric, especially to someone, who majors in Information Science, knows how to control a system and pretends it as social choice at the same time. If on a Wikipedia's fight, a programmer......

Besides what Mr. Mac or Silent Bob shown in Die Hard 4.0, there's always more than one way, for a programmer (or hacker if you prefer), to participate in the public.

I don't take side on the arguments between Simplified Chinese and Traditional Chinese, but better semi-automated converters lead more alternatives, that are obviously required for social choices. Like other topics, there's no truly contribution to Wikipedia by myself. The reality is that it's a mission impossible to hold and join the event at the same time. Honestly, I just hope next time others will do much better than what I've done in Wikimania 2007 Hacking Days and Hacking Days Extra.




1. The title is just my bad taste of not-funny jokes.
2. Ping and I sent a patch to MediaWiki on xml:lang, but later I found a side-effect of it, so the case was closed temporarily, until we get a better solution. Today, it's still hard to find non-English pages of Wikimania 2007 in Google and Yahoo.
Author: "Mike Tian-Jian Jiang" Tags: "感"
Send by mail Print  Save  Delicious 
Date: Thursday, 09 Aug 2007 14:51
白話講是,你不尊重我,我也不打算尊重你。

最近有不少記者想跑某個會議的新聞,其實是衝著某人的名氣和他前陣子發想鄉民搜尋引擎的話題性而來。這倒無可厚非,只是,好歹做點功課嘛?

咱們政府某單位也不遑多讓,寄了包東西要會議幫忙宣揚國威…… 連收件單位名稱也寫錯,可以用「查無此人」退回嗎?

好吧,也有句話說是「得饒人處且饒人」。折衷一下,照片在會議結束後就噴霧處理。當然,想備份起來笑罵一番者,請自便。
Author: "Mike Tian-Jian Jiang" Tags: "感"
Send by mail Print  Save  Delicious 
Date: Sunday, 29 Jul 2007 20:59
I thought I wrote this issue before, but apparently the memory is not reliable. What if your program could not run on your client's environment, even the code has not been touched at all?

You may be installed the Service Pack 1 of Visual Studio .NET 2005.

In March, my colleagues and I encountered that our input method cannot run on some machines, especially on those didn't have VS.NET 2005 installed. I posted "IME dll generated from VS.NET 2005 'SP1' failed to load" on MSDN forum, and later I found that "Visual C++ Libraries DLL Deployment" by Ayman Shoukry is relevant and another post on MSDN forum called "SP1 dlls on non-SP1 machine" is the exact answer. The official reference is "Redeploying an Application Containing a Visual C++ Service Pack or Hotfix" and "_USE_RTM_VERSION" on MSDN.

Today, 4 months later, why do I recall this issue? Because, again, I met a similar problem yesterday. I checked my windows update history, there's no record of VS.NET 2005 SP1 —— yes, I'm lazy and refusing to install it, to avoid the task of C++ library redistribution —— but I bet something is changed by... maybe .NET Framework 2.0 security update, automatically and silently. If so, does it sound like a kind of malware? No, my bad, it's another story, not Windows Update's fault.

Alright, it's time to ask my clients to install Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) via the installer of IME, and cross the finger to see if it really helps.
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Thursday, 26 Jul 2007 01:27
I got no time to describe details here, but after evaluating almost all softwares listed on http://www.sqlite.org/cvstrac/wiki?p=ManagementTools, the recommended SQLite management tools are:

They're both cross-platform, full-featured, and have nice-lookings.
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Thursday, 31 May 2007 17:48
做大事業,機櫃裡的電腦總是少那麼一台;縱然坐擁後宮三千... 沒有好的演算法,臨幸到死可能都輪不完。

早期 Lucene 只有一些簡單的套路,例如來個 MultiSearcher, 一綱多本,理論上能訓練出頭腦靈活的學生。更進一步,還能使用 ParallelMultiSearcher, 千手千眼,名冊拆成許多份同時翻找,想來比一頁一頁循序漸進要快。

午餐不能白吃,維護多組索引往往分身乏術;若想知道祖師爺的如來神掌怎麼使,可以參考Doug Cutting 為 Technorati 設計的索引同步方案 。後繼者 Eran Globen 則針對隔山打牛 RPC/RMI 部分提出了改良的想法:Implementing Parallel Remote Search.

唔,分散的索引不是會得到各自的分數嗎?全收回來時要怎麼合併?這是 Nutch 尚未完成的招式……

Doug Cutting 兩年前的建議現在融入了 Solr 的 Collection Distribution. 本來以 crawler 為主的 Nutch, 為了讓自己能有三頭六臂,吃下 Google 發明的 MapReduce 仙丹,後來更添加了 Google File System 成分,乾脆搖身變為 Hadoop 製藥部門了。

前陣子,Sami Siren 把 Nutch 兜在 Solr 上,頗有改裝自家用豆腐車的快意。那麼,下一個該輪到誰了呢?
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Wednesday, 30 May 2007 22:42
承蒙各路先進不棄,在 OP Café 的 Ruby Tuesday 活動上獻曝了。特別感謝 lukhnos 助拳,以 Ferret 說明基礎操作的部分,讓小的能偷雞直接講些小技。

首先必須向聽眾說聲抱歉,不才在下記憶模糊而把兩項重要的參數混淆了:當我嘴上在說 mergeFactor 的時候,心裏想的其實是 minMergeDoc 啊啊啊~ m(_ _)m

投影片已更正,並在此重申正確的重點:minMergeDoc 要大一點(在記憶體 2GB-4GB 的機器上可以試試 10,000),但是 mergeFactor 要小!(不動它也行)

另外 Qing 兄提到的 RAMDirectory, 在 minMergeDoc 夠大時,Lucene 會自動採用之,實為懶人如我之福音。

上述資訊可在 Painless Indexing 之中查到;另推薦參閱 Solr Performance Factors 一文,以收綜效。

另外,關於「電話號碼搜尋」一例,在本次已簡介的原理之餘,尚可參酌使用 Search Numerical Fields 的技巧;雖然「不直接」相關,而且私以為那樣太複雜就是了…… 鄙人仍然堅持「前處理」和「後處理」比較有彈性又沒有侵入性;畢竟,多用合成,少用繼承。:)

投影片及錄音檔案在此:http://taipedia.selfip.info/RubyTuesday20070529/

2007/5/30 投影片勘誤:
foreach(ScoreDoc scoreDoc: topDocs.scoreDocs) {
  Document doc = m_standardSearcher.doc(scoreDocs.doc);

檔案已修正。
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Sxipper   New window
Date: Wednesday, 30 May 2007 18:21
想用 OpenID 嗎?該去那裡註冊呢?如果你常用 Firefox, 那麼 Sxipper 值得一試!透過它的 Firefox extension, 幾乎所有的登入畫面都可以自動處理了:



可惜它還不支援 IE,不然便能把某些密碼長到超出我腦容量的網路銀行帳號也記住…… 這也算是網路銀行的某種安全機制吧?
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Monday, 21 May 2007 13:40
最后,感谢我国政府,她为今天的和平环境付出了巨大的努力,没有这个环境,我不可能提起这个诉讼。
——互联网管制不当,中国电信遭起诉
(English version: A practical lawsuit against China internet sensorship)
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Wednesday, 16 May 2007 21:39
Optimus Maximus
I'd like to inform you that on May 20, 2007 at 3 p.m. Moscow time we'll start accepting limited pre-orders for the Optimus Maximus Keyboard.
—— Artemy Lebedev


The countdown: http://www.artlebedev.com/everything/optimus/.

BTW, I saw a very interesting —— to Taiwanese —— sentence at http://community.livejournal.com/optimus_project/28887.html:
Please note that in Taiwan, just as in Russia, May 1st is a holiday called Labor Day (so no one works).

Well, actually I worked on May 1st...... Only a "Labor in Law" (what the hell is it?) has that holiday.
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Wednesday, 16 May 2007 03:46
蘭草葉:辛,平,無毒。
主治:利水道,殺蠱毒,避不祥。久服,益氣,輕身不老,通神明。除胸中痰痺。生血,調氣,養營。其氣清香,生津止渴,潤肌肉,治消渴膽癉。 煮水,浴風病。 消癰腫,調月經。 煎水,解中牛馬毒。 誅惡氣,香澤可作膏塗發。
附方:食牛馬毒殺人者,蘭草連根葉煎水服。 即消。
——《本草綱目》

以下摘錄自
svn_repos/trunk/Modules/OVIMExample/OVIMExample.cpp:

#include <OpenVanilla/OpenVanilla.h>
#include <OpenVanilla/OVLibrary.h>
#include <OpenVanilla/OVUtility.h>


總之你一定會需要這些。
OpenVanilla.h 定義了各種資料結構,例如記憶並顯示輸入中字串的 OVBuffer
OVLibrary.h 維護動態連結函式庫 (dynamic library) 的介面。
OVUtility.h 準備了一些工具,像是臨時輸出偵錯資訊用的 murmur()


使

OV_SINGLE_MODULE_WRAPPER(IMExample);

OpenVanilla 主要是用 C++ 寫成的,但是在製作動態連結函式庫時,我們通常比較喜歡 C 那種單純的介面,於是在 OVLibrary.h 裡設計了幾個基本操作。最低限度要有上面那個。


class IMExample : public OVInputMethod
{
public:
  virtual int initialize(OVDictionary* d, OVService*, const char* mp)
  {
    murmur("IMExample::init, modPath=%s", mp);
    murmur("setting 1=%d", d->getIntegerWithDefault("key1", 1));
    murmur("setting 2=%s", d->getStringWithDefault("key2", "test"));

    return 1;
  }
  virtual const char* identifier() { return "OVIMExample-simple"; }
  virtual OVInputMethodContext* newContext() { return new IMExampleContext; }
};


就算不是寫輸入法,「模組」的設計仍然會像這樣:要有識別方式、要有開關、要有輸入輸出

於是,identifier() 傳回不可以撞名的識別字串(請自己想辦法讓它獨一無二);
initialize() 負責初始化,包括由第三個參數 const char* 指定的模組所在位置,以及記錄在第一個參數 OVDictionary* 裡,可透過 getInteger()/getIntegerWithDefault()getString()/getStringWithDefault() 取出的設定值等等;
newContext() 則傳回專職處理輸出輸入OVInputMethodContext*


class IMExampleContext : public OVInputMethodContext
{
public:
  virtual int keyEvent(OVKeyCode* k, OVBuffer* b, OVCandidate* i, OVService* srv)
  {
    // Do your magic here!
  }
};

OVKeyCode 儲存當下的按鍵資訊OVBuffer 記錄那些正在輸入的注音、字根、漢字等,OVCandidate 放置某位置的同音或重碼字詞OVService 則提供某些編碼轉換功能。
所謂輸入,顯然就在 OVKeyCode 裡;而輸出則由 OVBuffer 維護。雖然中文輸入法往往還有一層中介的注音、拼音、或字根等輸入法符號序列,但那可以封裝於內部,也就沒有顯露在 OpenVnailla 的介面上。

至於 keyEvent() 裡通常該做些什麼,而 OVKeyCode, OVBuffer, OVCandidate 等類別又有什麼方法可用,且待下回分解。
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Date: Tuesday, 01 May 2007 02:40
我寫的某個輸入法用 SQLite 3 當儲存媒體,一直以來都用得很快樂。直到最近開始測試 Windows Vista...

不知道為什麼,有些程式裡,候選字詞列表的順序總是錯的,而且固定就是那幾支程式有問題?最糟的是,連在 SQLite 自家命令列工具SQLite Database Browser 裡下 SQL 查詢傳回的結果,都是錯的。

只好提報了:http://www.sqlite.org/cvstrac/tktview?tn=2178

2007/4/25 Update: 嫌犯
Author: "Mike Tian-Jian Jiang" Tags: "述"
Send by mail Print  Save  Delicious 
Next page
» You can also retrieve older items : Read
» © All content and copyrights belong to their respective authors.«
» © FeedShow - Online RSS Feeds Reader