顯示具有 Mac OS 標籤的文章。 顯示所有文章
顯示具有 Mac OS 標籤的文章。 顯示所有文章

2010年7月29日 星期四

2010年7月12日 星期一

MacRuby, Python, Ruby 在 OS/X 下, interactive shell 中文輸入的問題

之前不管是 Ruby 或是 Python,在 OS/X 下,interactive shell 輸入中文大部分都會出現問號。今天找了一下 MacRuby 的相關資料,發現原來是 readline 的問題。

雖然說 macirb 可以用 macirb --noreadline 跳過去,可是這樣就失去了豐富的 history 功能,也無法使用 Readline module了。

網路上有些文章建議直接去抓新版的 readline 來改,但是從 MacRuby 的這個看來,是系統內的 libedit 缺乏了 multibyte 支援導致的,所以連帶 python 也會有一樣的問題。於是直接去抓了 libedit 2.6.7 下來,configure 完 make 了以後,丟到 /usr/lib 裡面取代 libedit.2.dylib (當然,要先備份),這樣不管是 python 或是 ruby interactive shell 都可以直接打中文了。

**後記**

話說太滿果然會爆炸,放進去以後有些功能就變得怪怪的,正規的作法還是要先拉 Apple 自己的 libedit-13 下來再說。

2010年1月12日 星期二

切記切記!NSString 要弄成 NSURL 一定要有這個轉換手續

NSString *stringEscaped = [stringOrig stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

2009年10月20日 星期二

MailFollowUp (Mail Plugin for Mac OS X)

Adds "Follow Up" items to the Message and contextual menus (and optionally a toolbar button) of Apple's Mail application that allows you to compose (and then send) a quoted version of the original message to all of the original recipients, keeping the To, Cc and Bcc addresses exactly as they appeared in the original message. Specifically, in keeping with Mail's built-in Reply and Reply All functionality, the plugin adds "Follow Up" (original To: recipients only) and "Follow Up All" (all original recipients) functionality via both menus and toolbar items.

[From MailFollowup Home Page]

升級到 10.6 以後,我有個很常用的 Mail plugin 瞬間不能用了,在作者的努力之下,推出的新版本終於可以在 10.6 下使用了。作者的 homepage 裡面還提到,除了 Follow-up 的 mail title 文字可以自己改以外,還可以改 menu 和工具列裡面的 icon 文字標籤:

defaults write net.welchwold.mailfollowup FollowUpPrefix -string "Follow-up: "
defaults write net.welchwold.mailfollowup FollowUpMenuTitle -string "跟進"
defaults write net.welchwold.mailfollowup FollowUpAllMenuTitle -string "跟進所有人"
defaults write net.welchwold.mailfollowup FollowUpToolbarItemTitle -string "跟進"
defaults write net.welchwold.mailfollowup FollowUpAllToolbarItemTitle -string "跟進所有人"

這樣改完之後,畫面上的整合度看起來就很高了。

2009年9月18日 星期五

Handy dandy pop-up dictionary

In any app that uses Cocoa text widgets (Safari, for example), you can hover the mouse cursor over a word and press cmd-ctrl-d to get a tool-tip like bubble that shows the word’s definition and a button to open Dictionary.app to that word. Try it on an archaic word the comprehension of which eludes you before I get overly loquacious.

[From Finer Things in Mac, Handy dandy pop-up dictionary]

This is much better than the 金山詞霸 that my colleagues are using. "You" get to decide if you want to look up the meaning of a word, instead of letting a background process hog your CPU on every mouse-over English word, bravo!