Sun 02 September, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
人一生就是一场马拉松,大多数人跑快了便喜,跑慢了就悲,迷迷糊糊跑到头,一切都没有了,居然不知道为什么要跑,我不愿意这样,我跑我该跑的路,你超过我、落下都与我无关,我是为我的路而生的。


add to del.icio.us. look up in del.icio.us.
add to furlSat 01 September, 2007

2. Spontaneous milk flow not associated with childbirth or the nursing of an infant.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlFri 31 August, 2007

这周早些时候,在办公室遇到了Sidu——我在西安办公室见过他。周五有个班加罗尔Ruby User Group的活动,叫Geek Night,Sidu是活动的组织者。之前,他知道Ola会来,于是安排Ola介绍JRuby。当他看到我的时候,才知道我也来了班加罗尔,于是邀请我也一起参加活动。我问他,我是否需要准备什么,他建议我做一个XRuby的介绍。Ola会有一个45分钟左右JRuby方面的介绍,所以,我需要做的只是一个简单的XRuby介绍。很合我意,因为要用英文讲,所以,如果讲多了,我恐怕自己不成。我很快就准备好了一个很短的介绍。
ThoughtWorks做事总是要敏捷的。今天,我发现Ola没来,后来才知道Ola病了。所以,Ola的部分就取消了。Sidu问我怎么办,我只好硬着头皮答应由我讲一个长一点的,一个比较完整的XRuby介绍。晚上六点的活动,商量好这些的时候,已经是四点多了。所幸之前讲过XRuby的介绍,我把讲稿翻出来修改了一番,更新了一些状态,准备用在活动中。XRuby介绍这个稿子居然得到了反复应用,第一次在北京Java User Group,第二次在敏捷西安,据说,XRuby的其他成员也用过。无论如何,我没想到,我个人的第三次居然是在班加罗尔,而且是英文。
其实,最让我头疼的绝对不是介绍XRuby,而是用英文。这周在班加罗尔上课,对我来说,简直就是一周的英文课。所有课程所有讨论都是英文,我的英文水平让我经常就不知道大家在说什么。不过,自我感觉,经过一些锻炼之后,还是略有提高的。
活动开始,我开始了第一次用英文在比较公开的场合讲东西。我的开场白是,这是我第一次用英文讲。起初,活动在一个小会议室进行,在我讲的过程中,进来的人越来越多,所以,我们又换到了一个比较大的会议室。因为用英文,我只能说,我尽量把我要表达的意思说出来,至于是否大家听懂了,我不好说。好在有讲稿,即便我讲得不够清楚,讲稿也会帮助大家多一些理解的。当翻到讲稿最后一页的时候,我长出了一口气。如果是用中文的话,我可以说得更多,至少我可以胡扯一些东西。对我来说,更大的挑战是Q&A。我的听力本来就不是太好,印度口音更是经常让我犯晕。开始之前,我找了几个同事,如果我听不懂的话,他们可以为我解释一下。在提问者的宽容和几位同事的帮助之下,我成功的度过了Q&A。问题倒不算太难,唯一让我不敢确认的是,我说的是否真的是我要表达的意思,希望没有大错。
不管怎样,我用英文讲了一次XRuby,一次很有趣的经历。
add to del.icio.us. look up in del.icio.us.
add to furl
You have to watch this. It's a great explanation of how our country should be working.
add to del.icio.us. look up in del.icio.us.
add to furl
“ All science is either physics or stamp collecting. ”
Ernest Rutherford
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlThu 30 August, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
A Sense of Accomplishment
ruby chad-tests.rb Loaded suite chad-tests Started .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... .................................... ............................ Finished in 0.110448 seconds. 1000 tests, 0 assertions, 0 failures, 0 errors
add to del.icio.us. look up in del.icio.us.
add to furl
“ It just zoomed. It just zoomed. ”
Melinda in her audio letter to Roger
add to del.icio.us. look up in del.icio.us.
add to furl
2. Medicine A rupture or splitting open, as of a surgical wound, or of an organ or structure to discharge its contents.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
I received conformation from UAT that BarCamp Phoenix 2007 will be held at UAT on December 8th, 2007.
Also, there have been some schedule adjustments for Desert CodeCamp so that various talks that have a natural dependency chain are placed in sequence. That means you can see David Koontz explain What’s Different About Ruby in the morning, then learn about IronRuby, JRuby, and the ever widening world of Ruby Web frameworks later that day (i’ll be lending hand there, talking about Ramaze, Nitro, Cerise, and IOWA). Then, the next day, catch up on Rails™ and RSpec.
It also looks like Sunday morning, pre-CodeCamp, will be the launch of Refactor Phoenix .
(I should probably go finish that Web site.)
add to del.icio.us. look up in del.icio.us.
add to furl
Ever since I switched to my exquisite Mac Pro, I've been using iPhoto. A few weeks ago when Apple announced the new iLife '08, I bought it. Last week while using iPhoto, I wanted to zip up a bunch of photos so I could move them to another machine. But I couldn't find anything like this in iPhoto. There's an exporter, but it doesn't support zip files. You can right-click on a photo and select "Show File", but that's clunky and wouldn't work well if you had multiple files you wanted to zip up.
So I wrote an exporter plugin to handle this. It's called Export To Archive, and it supports three archive types: Zip, GZip and BZip2, depending on which flavor you prefer. I personally like bzip2, because the compression is much better than the others, but YMMV.
Once you install the plugin, you select the photos and/or events you want to export,
then select Export... from the File menu (if using an older iPhoto, the Export... menu
item is under the Share menu). The "Export Photos" dialog opens with a new tab
labeled "Archive." Selecting this tab reveals a pane that looks like this.
The dropdown reveals the other two archive types. Select the type you want and then press the Export button. You will be presented with a "Save As" dialog where you can enter the name of the new archive file. You don't need to specify an extension as the plugin will append the correct extension based on the archive type. After you enter the name you want and press OK, you should see a progress dialog and then you are taken back to your photo library. If everything went as planned, you have a shiny new archive where you told the plugin to put one. If not, you should get an error message telling you what happened.
The plugin does not keep any directory paths that might have existed in your iPhoto library. I considered making a directory for each "event" (iPhoto 7.x only) but I believe a photo can be in multiple events, so this seemed like a bad idea. Maybe later.
Also, if you select multiple photos with the same name (but from different directories, obviously), then I handle it like Safari does when downloading the same file twice. I append an underscore with a number to the filename before the extension. So if you had two files called 100_1234.jpg, then one would be called 100_1234.jpg and the other would be 100_1234_1.jpg. If there were three files, the second would have _2 appended, etc. This seems like a reasonable solution to this issue.
I should mention one more thing about the compression methods. If you use Zip, then any resource fork info is lost. This probably isn't a problem, but I felt I should mention it. It's how the /usr/bin/zip program works. If you choose either GZip or BZip2, then the photos are first put into a tar file and then compressed. The /usr/bin/tar program that comes with OSX does preserve resource fork info into the archive. If you look in the archive, you will see that for every file, there is a similarly-named file that is vastly smaller than the original. If you expand the archive on a Mac, then you only end up with the files you asked for. But on other systems, the resource fork "phantom files" will be expanded to the disk along with the photo files. The file names start with ._ so on Unix systems they will be hidden. On Windows, you will probably see them. Either way, it's extra crud. I tried to figure out a way to get rid of these files, but there doesn't seem to be one. And maybe we don't want to get rid of them, anyway. Thus, if you are going to move your archive to another Mac, you might want to choose GZip or BZip2. If you're going to it to some other system, choose Zip.
Want it? There are a couple of ways to get it, depending on which version of iPhoto you have.
Both of these installers install the plugin for everyone on the system. PackageMaker.app that Apple provides doesn't seem to provide a way to install it for just the curent user. This means that the plugin will go to one of two places, depending again on your iPhoto version- iPhoto 7.x: /Library/Application Support/iPhoto/Plugins
- iPhoto < 7.x: /Applications/iPhoto.app/Contents/PlugIns
If you're running iPhoto 7.x and you'd rather install it just for yourself, you can download this zip file and install it by hand. You should put it in ~/Library/Application Support/iPhoto/Plugins.
This is a universal binary. I have tested this on a Mac Pro with iPhoto 7.x, and on an iBook G4, with iPhoto 5.x. If you have some other config and it doesn't work for you, let me know, providing a crash dump, if you have one. I don't know that I can make it work, but I could look into it.
If you'd like the source code, get it here. You'll need Xcode 2.4.1 to open the project.
That's about it. This is free software, released under the GNU GPL. If you like it, tell your friends. If there's a feature you want, let me know, or implement it yourself and provide me a patch to include in the source.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlWed 29 August, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
The time/room grid is up for Desert CodeCamp.
I’ve a 9:15am slot for Intro to Haskell.
Sadness.
Pondering cancellation; only ~10 people have signed up, and doing this even reasonably well is going to be trickier than I expected.
Anyways, an advantage of an early slot is that I will not spend all day tweaking my presentation while sitting through other talks; I’ll get to attend and enjoy the remaining sessions. (I’m helping out with one other talk that day, but I have less need to prepare much in advance for that one. I think.)
BTW, the event has been spread over a day and a half, which is sort of unfortunate, if it ends up dispersing attendance. The Sunday sessions start at 1pm. I’m not sure I’ll want to drive back down to Tempe for Day 1.5
However, this may be an opportunity to organize some sort of hackfest or Refactor Phoenix preview or some other communal geek gathering for that morning. I don’t know if the campus buildings will be open before 1pm that day, but this is something to think about.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlTue 28 August, 2007

- Dynamic image modification based on gradient vectors
This is a remarkable demonstration of a technique for dynamically adding / removing 'unimportant' pixels in an image. This lets you resize images, and with hinting, remove elements from an image. Remarkable.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
“ Fibers (and external iterators) are likely to remain in the final 1.9, more likely than continuations. ”
Matz
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
I recently bought the new iWork '08 suite from Apple and have started using the tools for stuff I used to use NeoOffice for. But I noticed something yesterday that is disconcerting.
Like a lot of people, I store my documents in a CVS repository that is backed up to another disk. I checked in a few documents created with Pages and Numbers, and everything seemed fine. That is, until I re-saved any of the documents.
The problem lies in the fact that a "document" for Pages or Numbers (and probably for Keynote as well) is not a monolithic file like a .doc file from Word. They are directory structures ("bundles" is the Apple term) that the Finder and the applications that use them treat specially. Any program in the /Applications folder is the same type of thing. When you check something into a CVS repository, CVS creates a hidden CVS directory in each sub-directory of the thing being checked in. After checking in one of these documents, I went into the document through Terminal and verified that the CVS directories had been created. So far, so good.
When things went awry was when I re-saved a document. Instead of just changing the necessary files inside the "document," Numbers deleted and re-created the entire directory structure. Thus, those CVS directories were toast. There's no good way to recover from this, because those files now look like non-CVS files, but the server already knows about them. To my knowledge, there's no painless way to handle this situation.
I don't believe that Subversion is in any better position. When using SVN, you get a .svn directory created in each sub-directory of the document, but those will also get whacked when the document is re-saved. I haven't tested that assumption, but it seems logical.
I tried to come up with a solution to this, but I'm stumped. I looked into cvswrappers just to see if it could help, but it doesn't look like it. I also considered a pre-commit script and a post-checkout analog (if there is one), but this didn't seem like it would really get us there.
The only solution I see is for Apple to stop whacking the directory structure and just change the files inside it that it needs to, and stop molesting the version-control special files. Maybe they can implement this behavior when they add support for OpenOffice and the OpenDocument format...
add to del.icio.us. look up in del.icio.us.
add to furl
Don't you just love a cult religion that will kill you if you decide to leave it?
According to Mr. Badry, Mr. Hegazy deserves the death sentence for leaving Islam. Souaad Kamel, the outgoing dean of Islamic Study for girls at Al-Azhar University, stated on the air that Mr. Hegazy should be beheaded to fulfill the religious requirements. [emphasis mine]
Read the rest and bask in the "peace" coming from such a wonderful religion.
add to del.icio.us. look up in del.icio.us.
add to furl
在ThoughtWorks里,交流是工作中非常重要的一个部分,在这里工作时间越长,这一点感觉得越加明显。今天,和我们团队中的一个人聊天,他教了我一些交流上的技巧,这里做一个简单的备忘。事实上,他教给我的远不止这些。
交流中,最大的障碍就是双方是否真的理解了对方的意思。造成误解的原因可能有很多:
* 双方都认为自己理解了问题,但这种理解可能并不一致。
* 因为背景不同,所以,双方对达成一致所基于的假设是不同的。
* 语言之间的障碍,这点我最近颇有体会
* 双方对问题理解的深度不一致
同事交给我的解决方案就是不断问问题,不断解释自己对问题的理解,对方接收到反馈就会判断与他的理解是否一致,然后再给出他的看法,这样几个来回下来,双方基本上就可以达成一致。有些人可能认为反复的问问题,反复澄清自己的理解似乎会让自己的看上去很傻,所以,听得差不多就不愿意问了。我们的根本目的是完成工作,如果因为前面不愿意看上去丢人,后面可能就要真正的丢人了。其实,没有人会认为把问题搞清楚是丢人的。
再有一点,交流之后要尝试总结,通过总结:
* 确定真正理解问题所在
* 确定双方对问题有一个共同的接收标准
* 确定双方能够在进度上达成一致
学到了,争取用起来!
add to del.icio.us. look up in del.icio.us.
add to furlMon 27 August, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlSun 26 August, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl