2007年5月26日星期六

Mac OS X 和 windows 的比较(一)

1. 面向开发人员

macwindows的设计理念有很多不同点。对开发人员来讲mac的底层是unix(march)的核心,上层提供了cocoacarbonjavaPOSIX接口,并提供了Core FoundationCore ImageCore VideoQuickTime,Apple为程序开发人员提供了免费的xcode(相当于visual studio),方便应用程序的开发。

Mac OS X提供的框架类库看,多媒体方面占很重的分量,而在广告、影视、设计领域使用苹果系统的非常多,这也归功于OS X的这些领域软件多和高性能(PowerPC时代浮点运算的领先)。

比如《穿普拉达的女王》这个影片中看到时尚杂志员工用的都是苹果系统,iMacpowerbook/mbp,这也说明对于使用软件完成工作的人来说,软件比操作系统要重要的多(前提是对最终用户操作系统相对差距不大)。而苹果的工业设计以及给人的感觉,它的设计功力更强。

在界面领域windowsmac都在互相学习,当然我们视线中windows抄袭mac的要多一些,但是两个操作系统学习、借鉴、创新得意的是最终用户。

Windows API对微软来说是很大的一笔财富,世界上有无数的开发人员使用这些api开发各种个样的程序。这个api本身的好坏很难评价,它是数千工程师的心血之作,经历了超过十年的演进。

Mac OS同样提供了丰富的API,而OS X提供的API是从OS 8/9NextStepUnix成长起来,从Mach(Unix)内核起点来看应该在80年代,OS 8/9也开始与80年代。虽然OS X2000年才推出,它的内核以及上层界面都经过了将近20年的历程(到2000年)。

Mac OS借鉴了更多前人的经验,把核心的底层交给了最稳定的Unix内核,而把它的长项界面功力更大程度的做了发挥。《apple human interface guideline》专门为界面开发程序人员的指导方针,在interface Builder(界面开发工具)中也内置了根据《guideline》指定的各种提示,比如在拖动按钮时会出现指导线,根据整个界面布局指导开发人员放置位置。

2. 系统易用性

mac还是windows主要是常用的软件在系统上是否易用、好用,比如windows上没有了office软件,mac上有office软件,那么一定是用mac的多。

对最终用户来讲,操作系统启动后,用户会打开最常用的软件,根据职业不同,有图形图像处理、影像处理、文字处理等程序,而这些程序的使用占据了用户80%以上的时间。

这些占用80%以上时间的程序如果在两个平台上都有,那么对最终用户的差别就不会很大,比如Adobedreamweaverphotoshop在两个系统下差别很小,因此网页、美术设计人员可以在着两个平台下随意切换。就是说操作系统处于底层,如果上层能够不变化、而底层变化,那么对用户的影响非常小。当然这些小的影响有些可能是致命的,比如假设在mac os X下始终没有很好的中文输入法,那么必然会极大程度上影响用户的使用。

2007年5月9日星期三

Firefox 常用插件

1.Web debeloper

https://addons.mozilla.org/en-US/firefox/addon/60

开发人员常用工具。

2.ScribeFire

https://addons.mozilla.org/en-US/firefox/addon/1730

firefox里撰写blog

(发现问题:撰写的文章会出现 符号,可能是格式问题。发布的文章底部会出现ScribeFire的标志)

3.del.icio.us

https://addons.mozilla.org/en-US/firefox/addons/policy/0/3615/14890

整合del.icio.us书签。

本地安装,可以把xpi插件文件下载到本地,然后使用firefox打开,就能够在本地安装插件。

2007年5月5日星期六

给苹果系统提速

(翻译 http://www.thedvshow.com/cgi-bin/dvtips/newsscript.pl?record=53)

1.首先,磁盘碎片整理并不增加磁盘空间。唯一增加磁盘空间的方法是删除文件。磁盘碎片整理只是把不连续的磁盘空间整理为连续空间。

2.如果你在运行OS X Tiger或者Pather的话不需要进行磁盘整理。OS X在运行时实时整理所有文件大小小于20MB的文件。除非你有许多大文件经常修改,否则不许要进行磁盘整理。

(译注:在你需要经常修改大文件或者很多大文件变动时,操作系统可能不能分配到连续的完整空间,因此会使用不连续空间,这样再读取这些文件时会需要稍多的磁盘操作从而降低速度。)

你不需要进行磁盘整理,HFS+文件系统不像FAT和NTFS那样碎片化,它存放数据采用了更“聪明”的方式,不像FAT设计的那样贪婪的使用更多的字节。

如果你真的感觉需要进行碎片整理,那么可以使用第三方工具iDefrag。

关于碎片整理更多的建议可以参考Apple网站文档

3.在系统属性里面,去掉”put the hard disks to sleep whenever possible”选项。使用这个选项会导致磁盘唤醒时的延迟。

其它影响因素还有运行耗费cpu性能的进程,过低的磁盘空间,没有编码的资源等等。

4.使用AppZapper移除没有使用的程序,AppZapper不仅在Application文件夹移除文件,它会同时移除关联的.plist,甚至.dmg等关联文件。

5.检查/etc/hostconfig文件,关闭不需要的服务。如果需要更深入的优化,可以在控制台使用’ps -ax | more’查看后台进程。对于大多数后台进程可以使用’man NameOfDaemon’查看资料判断是否需要。

6.删除不需要的第三方程序。

删除Application中不需要的程序。有卸载功能的程序使用卸载功能,没有的直接把它放到垃圾箱。

属性文件包含有对应用系统的各种设置,如果删除了应用程序,那么也要把属性设置删除,可以直接拖动到垃圾箱或者Control-Click选择删除。

7.使用Disk First Aid

8.Onyx是众多系统工具软件中的一款,可以使用它来调优系统隐藏属性,进行清理工作提高系统性能。



Powered by ScribeFire.

The Zen of Python

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

给sallingClicker添加realplayer的控制功能

Salling Clicker 是一款远端控制软件,类似苹果自带remote control的frontrow服务端,
支持使用蓝牙协议的手机﹑palm等来控制mac OS X。
安装完后带有dvd player,iPhoto,iTunes,VLC等的控制脚本,但是没有带realplayer控制
脚本。它的脚本使用的是applescript,可以自己编写realplayer控制脚本。
使用它提供的脚本模板keypad widget可以很快自己编写一个realplayer的控制脚本。
下面列出需要响应控制事件的部分脚本:
if the_key is "#" then
show keypad help keymap keymap_info title "Sample Help"
else
-- show screen message "'" & the_key & "' was pressed"
if the_key is ">" then
show screen message "play"
tell application "RealPlayer"
activate
play
end tell
else if the_key is "<" then
show screen message "pause"
tell application "RealPlayer"
activate
pause
end tell
else if the_key is "^" then
show screen message "up volume"
tell application "SEC Helper"
set system sound volume to system sound volume + 0.1
end tell
show screen message (system sound volume as string)
else if the_key is "v" then
show screen message "down volume "
tell application "SEC Helper"
set system sound volume to system sound volume - 0.1
end tell
show screen message (system sound volume as string)
else if the_key is "6" then
show screen message "un mute"

tell application "RealPlayer"
--activate
tell player 1
set is muted to false
end tell
end tell
else if the_key is "5" then
show screen message "mute"
tell application "RealPlayer"
-- activate
tell player 1
set is muted to true
end tell
end tell
else if the_key is "1" then
show screen message "full"
tell application "RealPlayer"
-- activate
tell player 1
set is full screen to true
end tell
end tell
else if the_key is "2" then
show screen message "un full"
tell application "RealPlayer"
-- activate
tell player 1
set is full screen to false
end tell
end tell
else
show screen message the_key
end if

全屏幕代码还没有调好。
手机按键说明:
上 提高系统音量
下 降低系统音量
左 暂停realplayer
右 播放
5 静音
6 停止静音
在nokia 6600 + MacBookPro上面测试通过。

2007年5月4日星期五