2013/04/18

Adding Chinese Dictionaries to the built-in Dictionary Application & TranslateIt!

很久以前,在 Mac 系統中,
可翻譯中文的 TranslateIt! 可是完敗內建字典。
所以我也趁特價時購入它的 License :D
(複數是因為買了兩次...
第一次特價時只給兩年使用權,第二次用五鎂買了終生權~)

但是,經過了這些歲月,
TranslateIt! 的游標翻譯功能卻還是原地踏步~
到現在還是無法支援在 Chrome 進行翻譯,
而內建的字典卻在與時俱進,
現在甚至可以匯入中文字典並在更多程式中使用。
剩下來個人覺得比不上 TranslateIt! 的~
只剩下有發音「按鈕」的功能~哈!
(得反白後右鍵選擇 Speech 才行 :P)

以下是匯入中文字典到內建字典程式的步驟:
  • 首先請連線到 StarDict 的中文字典頁面,下載你想要的字典檔
  • 下載並安裝 Mac Dictionary Kit 免費轉字典檔工具 DicUnifier
  • 將下載的字典檔丟到執行中的 DicUnifier 中,然後等待~
    • 會花不少時間轉檔,請多點耐心唷!
  • 轉換完成之後,新字典檔會自動被丟進系統字典檔目錄中
  • 打開內建字典程式,你可以進入偏好設定裡面去進行調整

又,其實現在 TranslateIt! 官網提供的字典檔沒有中文字典了,暈倒!
但 StarDict 的字典檔是可以直接給 TranslateIt! 使用的~
  • 下載回來的是 *.tar.bz2,解開後進入該資料夾
  • 裡面會有同名稱的 *.dict.dz & *.idx
    • 再將 *.dict.dz 解壓縮成 *.dict
  • 執行 TranslateIt! 並雙擊 *.dict 便會自動被加入它的資料庫
進入偏好設定中,利用拖曳方式排出你要顯示的翻譯順序即可。


P.S: 網友提供的給內建字典程式用的雅虎字典:
https://www.box.com/s/ykdnqqi7krgrc6oyhbq4
下載後解壓縮到 /Library/Dictionaries
而其實它也可以匯入 TranslateIt!  唷!方法相同!




2013/04/15

TextMate2

TextMate 1.5.x 一直是我的主力軟體,真的很好用,所以當初也是很豪爽的敗了它,那時還沒有教育價(後來有才了15% off)~

這是去年八月的消息,其實我一直忘記post xD
http://hdj-berkeley.blogspot.tw/2012/08/textmate-2.html
剛剛因為不小心用 TextMate1 讀到中文檔,感覺不舒服,
決定升到 TextMate2 才又想起來~

現在如果你有使用 MacPorts 你可以很方便的裝好它!
中研院有人把步驟寫出來了,請參考:
https://ascc.sinica.edu.tw/iascc/articals.php?_section=2.4&_op=%3FarticalID%3A4266

TextMate2 在中文字的讀取與輸入都已經支援,
不像第一代必須要另外安裝外掛跟字型才行,而且還是會很醜,
所以有需要的人,例如某吉娜某易翰等等,可以去試試!
記得安裝後進去 TextMate2's Preference > Terminal 啟動 cmd 程式唷~!
這樣便可以從終端機直接叫出 TextMate2 編輯檔案。




2013/04/11

AstroPy

This morning I found this Python package form a post on the iObserve FB wall.

http://www.astrobetter.com/first-public-release-of-astropy/

NewImage

The current release already contains the following functionality:

Astropy also includes a lot of infrastructure code that makes it very easy for users to develop their own Astronomy packages, using Astropy as a core dependency.

Then I tried to download and install in on my mac. 

The size of the installing file is just about 5Mb only.

After installing it, I did some tests by following its examples from the document.

It's really helpful, and now I do not have to convert all my shell scripts to Python codes.

It saves my lots of time :P

Happy!

 

You should give it a try!

2013/04/04

QLFits - QuickLook generator for FITS files

Its official website:
http://www.softtenebraslux.com/qlfits/

The author of QLFits is the same one writing the 'iObserver', an useful app for astronomers.
The author is an astronomer also :D

QLFits was a commercial app before, but now it is FREE.
I have it installed in my previous SL Mac and it was working quite good.

Now since I am using the ML, I wanna have it in my Mac too.
But the problem is that, the latest version of QLFits was released about three years ago,
I am not sure if it will be compatible with the ML.

I just ran the installer, and there was no error messages poped.
But when I tried to have a quick look on a MIOSOTYS reduced FITS file,
the poped QL window is totally blank...><...

Then after reading its offical webpage, I just realized that:

Make sure to open the QLFits PrefPane once 
in the System Preferences before using QLFits.

and after doing this, it works perfectly :P

 
[NOTE]
I just visited the author's FB (actually, it is iObserve's FB),
and found he just updated the source code of QLFits two days ago.
Now the source code of QLFits is putting on GITHUB.
https://github.com/SoftTenebrasLux/QLFits
 
If you are using ML, and have Xcode & its command line tools installed,
you will have the 'git' command in your system.
Then try to following these steps:
 
1. (in your terminal)
$> git clone git://github.com/SoftTenebrasLux/QLFits.git
You will find the resulting folder after successfully running.
 
2. enter the folder and you will find 'QLFits.xcodeproj',
just click twice on it then wait for the window of Xcode popping up.
Then 'Run' the project, the products should be produced.
 
3. copy "~/Library/Developer/Xcode/DerivedData/QLFits-'ooxxooxx'/Build/Products/Release/QLFits.qlgenerator" to "/Library/QuickLook",
 
4. open the "System Prefrence", you should see its PrefsPane :D
 
5. Now the version is 2.4.0~
 
6. If needed, reset the 'quicklookd'
$> sudo qlmanage -r
 

The error of missing Font Arial for Gnuplot 4.6.2 in ML

Lupin asked me about this error about two months ago.
Then he downloaded some font to replace the AIRAL and solved this error.

Two days ago, Yi-Han asked me the same question.
I jus realize that this error will just happen if your Gnuplot is installed in a ML via MacPorts.



Since I will upgrade to ML very soon, I try to find my own solution.
And here is my way:

insert the lines below to your startup file (.profile or .bashrc):

export GDFONTPATH='/Library/Fonts/Microsoft'
export GNUPLOT_DEFAULT_GDFONT=Arial

To have it work, you will need to have the MS Office for Mac installed in your Mac first,
then you will not need to download any fonts, just use the fonts coming with MS Office.


Actually you will not need to use font Airal alway, just change the setting to the font you'd like.