如何让Tiger的终端上输入和显示中文 — (334)

默认情况下,OsX的终端是不能正确显示和输入中文的。需要作如下设置:
在~/.bash_profile或者~/.bashrc中添加:

bind ’set convert-meta off’
bind ’set meta-flag on’
bind ’set output-meta on’
export LC_ALL=zh_CN.UTF-8

打开一个终端,在窗口预设中选择仿真,去掉“忽略非ASCII字符”的选项。
选择显示,确认“字符集编码”是Unicode(UTF-8)。
点击“将设置用作预设”

Cmd+Q,退出终端。重新打开终端,现在在终端下可以正确输入和显示中文了。

Can’t convert string from ‘UTF-8′ to native encoding:

今天在update原来的subversion库的时候出现这个错误。开始以为是从windows直接copy过来的svn workingcopy有问题,就重新checkout了一下,结果还是这个错误。很快在subvesion的book上找到这个问题的原因,说是因为我本地的locale和提交者的locale不同。原来在windows上用的可能utf8,我的terminal的locale没有设置。测试一下,set locale 为zh_CN,不行,直接用UTF8呢?export LOCALE_ALL=zh_CN.UTF-8,ok了。

好像昨天在设置vim的时候,也说是要支持vim的中文,需要utf8,这次直接改好了。把上面的locale的设置放到~/.bashrc里面就ok了.

Best of Vim Tips — (543)

[http://www.rayninfo.co.uk/vimtips.html](http://www.rayninfo.co.uk/vimtips.html)

太棒了!

从Apple的字体到Vista引发的网页设计的思考 — (691)

从用mac book pro到现在这2天,最不适应的是网页的显示效果:
原来在T41上,由于是用宋体点阵,字体小的可怜,但是显示效果基本上和当初看的效果是一致的。
但是到了apple上,情况大不一样了。Mac由于使用了AA(字体反锯齿),因此,在大分辨率上的LCD上可以将字体显示的非常平滑,英文字的效果是特别的舒服。而中文,则默认的使用华文黑体。
问题来了,在Windows上,我们在作网页的时候,默认的认为用户的字体是宋体,这样,往往作效果图的时候,我们使用宋体字作为显示效果来作的。在Vista以下的系统中,系统默认使用的是simsun.ttc,这是一种内嵌了若干小尺寸的点阵字库的字体,因此,当小字体时显示效果还不错,如果字体大了,则字体边缘会立刻显得毛糙了。以前,大家都相安无事,因为,大家用的都是CRT,LCD属于少数,而且分辨率普遍都低。现在不同了,LCD越来越普及,而分辨率也越来越高,Windows下面当你分辨率调高后,字体会显得非常小,这对于你的眼睛简直是强奸。虽然你可以用大字体方案,但是效果并不好。Mac这方面则要强很多,分辨率高了,但是字体也随之增大,当起用了AA后,显示效果会非常平滑。说到这,想起了ClearType,这是MS针对LCD推出的技术,用于解决大分辨率的LCD的显示效果的问题。我当初用T41的时候,也曾经启用过,但是效果。。。简直糟透了!由于缺乏有效的矢量字体,内置的simsun在字体的边缘都花了。也许你会说,那么我的用户都是Windows,何必需要考虑Mac用户的感受呢,我继续好了。错,Vista的推出是一个重大的改变。Vista将采用矢量黑体(微软的雅黑)作为默认的显示字体,原来的simsun则被丢弃了。这样,在Vista的IE7上,用户所看到的效果就不再是原来的宋体了。由于有了好的黑体字,ClearType就有了用武之地了。用户的字体大小会根据分辨率来进行调整。

随着Vista的普及,我们设计网页的时候,会面临几个问题:

- 用户的最终视觉感受是否和我一样?
- 我要强迫用户接受我的设计字体?还是我自己去体验不同的感受?(尤其是你的用户分Vista/Mac和WindowsXP 2派用户的时候)
- 我要强迫用户选择我设计的字体大小?
- 是尊重我设计师的视觉感官重要还是尊重用户的自己的选择?

此外,随之而来的是制作网页的问题:

- 如何有效选择一个字体尺寸的度量标准?px?pt?还是em?
(em是W3C推荐,pt是印刷推荐,px很难完全精确实际大小,因为mac和windows本身对px的定义就不同)
- 行距和边际的尺寸度量标准是什么?
(我个人感觉,尽量不用px作为标准,使用em相对值更好)
- 在LCD和CRT下,我的页面的layout是否能否基本协调一致?

###最后,各位亲爱的网页设计师们,你们准备好了么?###

btw:我现在已经习惯了Mac的显示方式,虽然和原来的宋体字的感受不同,但是我的眼睛。。真的是舒服很多啊)

关于Vista和雅黑,参考一下这篇文章,虽然有点夸大其实:
[雅黑:即将到来的中文字体革命](http://www.windstudio.net/html/200611/20061114102849.htm)

网上也有不少雅黑字体的下载,据说可以用在XP上。大家可以gogole一下。

ClearType是MS的称呼,但并不新鲜,对应的,Linux/Unix上的XFT很早支持了AA,Mac的字体引擎应该和XFT差不多吧,很多人认为
M$的ClearType比Mac、Unix的AA要差一些,我没有验证过。

配置firefox将rss直接订阅到google reader — (86)

在firefox2中,如果将rss阅读订阅改成google reader,当点击浏览器的RSS标记时,总是让你选择一下是订阅到google的个性主页还是reader,我是从来不用那个home的,因此每次都要点击一下太烦,还好firefox是可以修改的:
1.在地址栏输入:about:config
2.将下面的key替换成相应的value

key:
browser.contentHandlers.auto.application/vnd.mozilla.maybe.feed
value:

http://www.google.com/reader/view/feed/%s

key:
browser.contentHandlers.types.2.uri
value:

http://www.google.com/reader/view/feed/%s

关于使用Performancing在视觉Blog发文的说明 — (361)

我现在一般用Performancing来发表blog。要想使用这个firefox的插件,需要的配置信息:

1、在Blogs的tab里,点击Add,增加一个blog

2、在向导的Intruction点击Manully Configure

3、选择BlogService时选择Custom Blog

4、在Blog System下拉框选择Wordpress,在ServerAPI Url输入:

http://blog.chinavisual.com/nightsailer/xmlrpc.php

注意:将nightsailer换成你的用户名或者blog名。

5、在用户名和密码填写你的用户名密码。

ok,现在你可以使用Performancing来发表文章了。

你可以随时点开Performancing的面板,输入内容。在编辑器界面,你可以Save as note,或者从右边的blogs侧栏中选择一个blog,
在Categs中勾选你需要发表的类别,最后点击Publiash as xxxxx.
不过几秒钟,你的blog的文章就发表好了。

Mac迁移指南-针对Windows用户 — (609)

这里有一篇关于从window转到mac上的入门指南,原文在这里:

http://www.lifehacker.com/software/mac/hack-attack-a-guide-for-switching-to-a-mac-224674.php

简单说一下:

Mac OS X的键盘符号:

⌘ Command键,最常用的,和Windows的window键不一样,相当于window的ctrl键
⌃ Control键,不常用,正好相反,这个Control和Windows的可不一样,一般是配合鼠标,相当于鼠标右键

⌥ Options/Alt键,常用,相当于Alt键,比如用于光标移动(跳过词)或者和Shift配合,选择加亮

还有,比如,Power键,Shift键。

常用的键盘方式(对照于Windows):

强制退出(Windows:Ctrl+Alt+Del):Cmd-Alt-Escape

窗口切换(Windows:Ctrl+Tab):
Cmd+Tab/Cmd+Shift+Tab:切换当前运行的程序
Cmd+~/Cmd+`:切换当前运行程序的不同窗口(比如你同时打开了多个safari窗口或者Word窗口)

隐藏/最小化:
Cmd+M: 最小化当前窗口
Cmd+H:隐藏当前应用程序。
隐藏和最小化的区别,隐藏不会push到dock。最小化则push一个图标到dock上。
隐藏比最小化的好处是,当你用Cmd-Tab切换到这个程序时,隐藏的程序会立刻恢复窗口到屏幕上,
但是最小化则仍保持在dock上,你需要再点一下,才能恢复窗口。当然,你可以方便的用鼠标直接点dock上的最小化图标。

打开、运行选定的文件:
这是最容易的迷糊的,windows上用Enter来运行,但是Mac上,Enter则是对其改名!正确的快捷键是:Cmd+O。

Backspace /Delete:
Mac上,Backspace相当于windows上的delete,而delete则相当于backspace。而且,像我的笔记本上,是没有backspace键的。
你需要使用Function+Delete。

删除文件:
Cmd+Delete,或者直接仍到废纸篓。

关闭窗口和应用程序:
这也是最常犯的错误。一般windows上,关闭了最后一个窗口,也就相当于关闭了应用程序,而mac上并非如此,你需要使用Cmd+Q来退出应用程序,否则它一直在后台运行。
Cmd+W:可以关闭当前的窗口,这个和大部分window程序的Ctrl+W类似。

自动运行:
在Windows中,放到启动文件夹的程序会自动运行。而Mac上,则需要在帐户的登录项目中设置。

安装应用程序:
Mac安装程序的过程和Windows极其不一样,实际上Mac是不需要独立的安装程序。一般提供下载的dmg实际上是一个压缩包,系统一旦下载后会自动mount到桌面上,所以,你在finder里面会找到刚才这个dmg的文件夹,并且旁边有一个弹出的按钮。后来我明白,这实际上和linux的mount loop是一样的。你可以简单的把里面的目录或者图标,拖放到应用程序里面。然后,在应用程序里面Cmd+O运行就成了。卸载也很简单,实际上你只要拖到废纸篓就可以了。当然,如果不放心,也可以使用类似AppZapper这个工具,你只需要把应用程序拖放到它的窗口,它也会自动删除相关的所有文件。

磁盘分区:
Windows是分区的,每个分区一个盘符,当然,NTFS也可以装载到一个现有的目录下,不过估计大多数人不用。
Mac对此称为Volume,卷宗(这名字有点别扭)和Unix一样,每个分区对应/dev/下面的一个设备,mac会自动mount到/Volumes下面的一个目录。
启动分区就是root分区啦,在/Volumes

用户目录:
所有的用户数据都放在/Users/
里面包括桌面,共享等等。和Linux一样,只是/home变成/Users而已。

其他的就和Unix一样了,/etc是系统配置,/var运行信息,/usr系统文件,/usr/local本地的设置。
还有ssh,apache,php4,bash,perl以及常用的Unix的程序都有了。

Mac的启动速度要比Windows快的太多,我以前的T41启动一次,需要泡茶才能完全正常。
我现在已经再也不想碰windows啦,呵呵。

powered by performancing firefox

MacOsx快捷键 — (263)

Startup

C start from CD
D start from 1st partition
N start from network server
T put computer in FireWire Target Disk mode
X start in OS X
⌥ show all startup disks
⌥⇧⌘⌫ start from external drive or CD
⌥⌘OF open firmware
⌥⌘PR zap PRAM (hold until 2nd chime)
⌘S single user mode
⌘V verbose
mouse button eject CD
⇧ after power-up: turn off kernel extensions
after login: prevent startup items from opening

Power
⌃⌘-power restart
⌃⌥⌘-power shut down
⌥⌘-power sleep

Application Management

⌘-tab cycle forward through applications
⇧⌘-tab cycle back through applications
⌘~ cycle forward through application windows
⇧⌘~ cycle back through application windows
⌥⌘-esc Force Quit dialog
⌘-toolbar
lozenge cycle forward through toolbar displays
⇧⌘-toolbar
lozenge cycle backward through toolbar displays
⇧⌘3 screen dump (entire screen)
⇧⌘4 screen dump (drag a rectangle)
⇧⌘4,space,click screen dump (highlighted window)
⌘-space cycle forward through keyboard layouts
⇧⌘-space cycle back through keyboard layouts
⌘-drag window
title bar adjust window in background
⌥-click Dock icon
or window switch to new program, hide previous one
⌥⌘-click Dock icon switch to new program, hide all others
⌘-drag rearrange or remove menulets or toolbar icons
⌘-click
window title expose path in popup
⌥-zoom button maximise window
⇧-minimise button minimise window slowly
⇧-click minimised
window in Dock open window slowly
⇧-close button close window slowly
⌥⌘W close all application windows
⌥-close button close all application windows
⌥⌘M minimise all application windows
⌥-double-click
title bar minimise all application windows
⌥-click Dock icon restore all application windows
⌥-minimise button minimise all application windows
⌥⌘D toggle appearance of Dock
⌘-drag onto
Dock icon prevent Dock icons from moving
⌥⌘-drag
onto Dock force program to open dragged item

Outline View
⌘← Collapse
⌥⌘← Collapse All
⌥-click
disclosure triangle Collapse All
⌘→ Expand
⌥⌘→ Expand All
⌥-click
disclosure triangle Expand All

Safari
⌫ Back
⇧⌫ Forward
⌘/ Page Load Test Window
⌘[ Back
⌘\ Status Bar
⌘] Forward
⌘| Address Bar
⇧⌘A Autofill Form
⌥⌘A Activity
⌥⌘B Bookmarks Bar
⌥⌘E Empty Cache
⌥⌘F Google Search
⇧⌘G Find Previous
⇧⌘H Home
⌘K Block Popups
⌘L Open Location
⌥⌘L Downloads
⇧⌘N Add Bookmark Folder
⌥⌘P Snapback
⌥⌘S Search Results Snapback
⌥⌘U View Source
⇧⌘→ Next Tab
⇧⌘← Previous Tab
⌘↑ Page Upper Left
⌘↓ Page Bottom Left

Text
⌃A move to beginning of paragraph
⌃B move one character back
⌃D delete character to right
⌃E move to end of paragraph
⌃F move one character forward
⌃K delete text to end of paragraph
⌃N move to next line
⌃O insert newline
⌃P move to previous line
⌃T transpose characters
⌥⌫ delete word to left
⌥⌦ delete word to right

Text Field
⌥← move one word left
⌥→ move one word right
⌘← move to beginning of line
⌘→ move to end of line

Text View
⌥↑ move up one page
⌥↓ move down one page
⌘← move to beginning of line
⌘→ move to end of line
⌘↑ move to beginning of view
⌘↓ move to end of view

Terminal
⌃A move to beginning of line
⌃E move to end of line
⌃T transpose characters
⌃U erase line
esc,B move one word back
esc,C capitalise next word
esc,D erase next word
esc,F move one word forward
esc,L make next word lowercase
esc,U make next word uppercase
esc,⌫ erase previous word

Menu
⌘+ Make Bigger
⌘, Preferences
⌘- Make Smaller
⌘. Stop
⌘: Spelling
⌘; Check Spelling
⌘? Application Help
⌘A Select All
⌘B Bold
⌘B Toggle Toolbar
⌘C Copy
⇧⌘C Show Colors
⌘D Add Bookmark
⌘D Don’t Save
⌘D Find Previous
⌘E Eject
⌘E Use Selection for Find
⇧⌘E Export
⌘F Find
⌘G Find Next
⇧⌘G Go to Folder
⌘H Hide Application
⌥⌘H Hide Others
⌘I Get Info
⌘I Italic
⇧⌘I Import
⌘J Scroll to Selection
⌘K Connect to Server
⌘K Erase Deleted Messages
⌘L Link
⇧⌘L Lower Case
⌘M Minimize
⌥⌘M Minimize All
⌘N New (Window)
⌘O Open
⌘P Print
⇧⌘P Page Setup
⌘Q Quit Application
⇧⌘Q Log Out
⌥⇧⌘Q Log Out Without Confirmation
⌃⌥⇧⌘Q Force Log Out Without Confirmation
⌘R Refresh
⌘S Save
⇧⌘S Save As
⌘T New Tab
⌘T Show Fonts
⌘U Underline
⇧⌘U Upper Case
⌥⌘U Capitals
⌘V Paste
⌘W Close Tab
⌘W Close Window
⇧⌘W Close Window
⌥⌘W Close All Windows
⌘X Cut
⌘Z Undo
⇧⌘Z Redo

Numeric Pad
fn0 Button Hold
fn1 Mouse NW
fn2 Mouse NN
fn3 Mouse NE
fn4 Mouse WW
fn5 Button Click
fn6 Mouse EE
fn7 Mouse SW
fn8 Mouse WW
fn9 Mouse SE
fn. Button Release

Universal Access
⌥⌘* Toggle Zoom
⌥⌘+ Zoom In
⌥⌘- Zoom Out
⌥⌘\ Toggle Zoom Antialiasing
⌃⌥⌘* Toggle Monochrome
⌃F1 Toggle Full Keyboard Access
⌃F2 Highlight Menu
⌃F3 Highlight Dock
⌃F4 Highlight Active Window
⌃F5 Highlight Toolbar
⌃F6 Highlight Utility Window

VoiceOver
⌘F5 Toggle VoiceOver
⌃F7 Toggle ‘⌃⌥’ Lock
⌃⌥F7 Show VoiceOver Menu
⌃⌥F8 Open VoiceOver Utility

powered by performancing firefox

Mac新用戶最常犯的30個錯誤 — (217)

1. Closing an application window, thinking it has quit.

2. Downloading an app and running it from the disk image.

3. Creating endless untitled folders

4. Using Safari’s Google search to get to a website

5. Confusing the concept of wallpaper with screensaver

6. Double-clicking a window thinking it will maximise it, but instead sending it to the dock

7. Not understanding the usefulness of column view and leaving everything in icon view

8. Not using any keyboard shortcuts

9. Thinking that now they’ve got rid of Windows they won’t have problems of _any_ sort on their Mac

10. Renaming desktop icons to random characters because they don’t understand the difference between the enter and the return key on Mac. (Enter puts an icon into rename mode).

11. People trying to find the menus on a window, not realising they’re always at the top of the screen

12. Trying to resize windows from the edge rather than the drag area on the corner

13. Trying to use the CTRL key rather than CMD key for shortcuts.

14. Thinking it’ll be easy to get a stuck CD out.

15. Installing a program every time they want to run it because they think the installer _is_ the program.

16. Where’s “the internet”? (looking for the Windows Internet Explorer “e” icon)

17. Repeatedly hitting the Apple key expecting the Apple menu to pop up (confused with Windows Key and Start Menu concept)

18. Thinking the green “+” button maximises a window to full screen (not realising that Apple’s maximise philosophy is to only make a window as big as it needs to be to comfortably fit the width of content currently being displayed)

19. Looking in vain for an uninstaller app, because they don’t realise that uninstalling an application on Mac is as easy as dragging the program icon into the trash.

20. Minimising windows all the time rather than using “hide”, leaving the document section of the doc littered with forgotten minimised windows (that are quietly occupying system resources).

21. Double-clicking dock icons.

22. Inadvertant click-drags and removing programs from the dock in the process.

23. Saving everything to the desktop or somewhere on the hard drive other than their home folder

24. Trying to load documents or programs multiple times because they don’t recognise the progress indicators (sound of hard drive grinding, CD spinning, Mac spinning beachball, browser status bar)

25. Not understanding that the dock is used to both launch and return to a program …

26. Inability to work with multiple documents on-screen at the same time, because they have only ever learned to use Windows’ maximise mode which always makes everything full-screen

27. Confusing “delete” with “backspace” (because Apple has two keys named “delete” on the keyboard, one of which does forward delete and the other backward delete. Way to go, usability geniuses).

28. Expecting “home” and “end” keys to go the beginning and end of a line, rather than beginning and end of a document.

29. Not realising that when you copy a folder over an existing one, OS X -replaces- the destination folder rather than merging the contents, which is what Windows does.

30. Looking for the “complicated” way of doing everything. For example, trying to go into system preferences and right-clicking on the networking icon in order to find available wireless networks, rather than just clicking on the Airport icon in the menu bar and selecting the relevant wireless network.

嘿嘿,這2天我還真犯了好多上面的錯誤呢

powered by performancing firefox

庆祝我的mpb — (500)

盼望着,盼望着,我的mac pro book终于来了,从今天开始,我的T41要成为历史了,实在是腻味了windows臃肿和缓慢的运行速度,还有那些该死的病毒、蠕虫什么的。

我发现,国内用apple的多数是设计人员,开发人员似乎并不多,但是在国外,相当多开发人员使用osx, 尤其很多的web开发人员,你可以从他们的演示中看到。我觉得osx作为开发用,有不少得天独厚的优势,首先osx本身就是unix内核,其本质还是unix,可以使用和多数unix,linux类似的环境,比如bash,ssh,ftp这些都是内置了。此外,编译环境autoconf,make,gcc等都是内置的,因此大多数可以和服务端部署同样的环境。相比,我在windows下面必须要安装cygwin,像编译php,apache都是可望不可及的事情。

我的mbp配置算是很高的,2.33 duo2core, 2g memory,120g 5400rpm. 我比较担心的是IO,因为被windows吓坏了,说起来我的t41虽然是3年前的机器,但是配置现在看来还是相当的不错,60g的7200rpm的硬盘,2g的内存,1.8的p4m。不过,当我在xp上装了apache,php,zend之后,速度就不尽人意。还有那该死的杀毒,装了杀毒的,消耗资源,关键时刻机器都动不了,不装吧,形同自杀。换osx我最大放心的是不用在用杀毒了,什么kaspersky,kav,统统抛弃。

不过,xp还是偶尔得用的,首先是网上银行,尤其是招行,只能用windows的ie,国内的就只考虑window,其他的连网上银行都无法使用,没办法。

这是用safari发表的,safari显示的速度真是超快啊,比ie,firefox都要快那么多,有点不适应。
另外,没想到苹果内置的中文输入法这么好用,赞一个。

« Previous PageNext Page »