Thu 11 December, 2008


- 英文说明
- CCleaner is a freeware system optimization, privacy and cleaning tool.
- 中文说明
- 一款免费的系统优化工具;
- 清除系统的不使用和临时文件;
- 使得系统运行更快;
add to del.icio.us. look up in del.icio.us.
add to furlWed 10 December, 2008

曾经,在我脑海中,咨询师是一群西装革履的家伙,在众人面前侃侃而谈。一群受苦受难的劳苦大众像企盼救星一样,等待从咨询师那里获得宇宙的终极奥义。
后来,接触过几个“咨询师”,他们在我心目中的形象是,一群衣冠楚楚的家伙,用满嘴的大词,为人们描绘了一幅理想家园的蓝图。当一切回归真实,梦幻只是梦幻,问题依然如故,而咨询师们早已不知踪影。
再后来,我成了咨询师。
这个项目是我真正做咨询的第一个项目,挂了咨询师的头衔有一段时间了,终于有机会行使咨询师的职责了。说到ThoughtWorks的咨询,闪现在我脑子里面第一个词就是敏捷,没错,现在这个项目也是一个关于敏捷的项目。加入ThoughtWorks之前,我以为,所谓的敏捷咨询就是像那些咨询师一样,就是到到其它的公司,有如传教士一般,把公司的敏捷理念宣扬一遍就万事大吉了。进到ThoughtWorks,我才发现,嘴上功夫原来只是很小的一部份,ThoughtWorks的咨询是要卷起袖子干活的。
在客户现场,我们和客户的程序员一起结对编程,分享自己对于开发和敏捷的理解;我们需要和客户一起攻关技术难点,展示我们解决问题的过程;我们需要帮助客户发现一些他们习以为常的问题,灌输高效开发的理念……我才进入到现场一个星期,但我可以深深体会到我的同事们之前所做的一些工作已经逐渐开始体现价值。和我们一起工作过的一些客户工程师已经开始能够自己按照敏捷的方式进行开发,甚至可以为一些到这个团队进行考察的其它项目人员讲解一些基本的理念,而这一切都是来自于他们和我们一点一滴在一起工作的积累。
我们这个客户不断在探寻着更加有效的做事方法,所以,咨询请的也不只我们一家。就在我们在客户现场努力工作的时候,另外的一家,据说还是名人,跑到这边给他们的这些项目负责人一级做了一个培训。当我问起他们对这次培训的看法,和我聊天的那个负责人直言不讳,那些人讲得很好,但是很难落到实处。原来大家对这种靠嘴吃饭的咨询师认识竟然惊人的一致。完美世界都好办,但是一旦来到现实世界,种种问题就会浮出水面。问题总是要解决的,谁来解决问题呢?那些花钱请咨询师的人如果能够有效解决所有问题,那么他们多半也不必请咨询师了。而这个时候,咨询师在哪里?
曾经有人这么评价过ThoughtWorks咨询,花钱请了这么多人做咨询,ThoughtWorks是唯一一个卷起袖子和我们一起干活的。
add to del.icio.us. look up in del.icio.us.
add to furlTue 09 December, 2008
Mon 08 December, 2008

I forked the Monkeybars repo so I could safely experiment with some things. My repo is monkeybars-with-inline-ruby-swing and that’s pretty much it in a nutshell.
Often, when people talk about Monkeybars, they compare it to some other similar tool that uses inline code (often using a “builder”-style syntax) to define the UI. The typical Monkeybars demo, in contrast, shows the use of WYSIWYG UI editor to create a binary Java Swing class; this file is then used in the Monkeybars app.
Not surprisingly, showing how this is done can take some time, even for a basic Hello, World! demo app. The sad truth of conference talks and demos is that you can get screwed from both ends in trying to properly explain anything non-trivial. You want to point out the details (because your tool is powerful), but that eats up the limited time available. You also want to actually show something, ideally something complete, so you end up with something simplistic.
If done well, then everyone gets the point: robust, sophisticated tool presented in overly-simplistic app for demonstration purposes. However, you can often end up with people seeing it the other way: lots of detailed steps needed to get to skimpy results. What’s then not grasped (or not well explained) is that the details are there to convey the breadth of possibilities; the skimpy app is there to simply demonstrate that this is something real. You still have to apply some imagination to understand the implications for larger, far more complex applications by extrapolation.
Demos using hand-written code to define a GUI have a real edge here because the speaker never has to leave the code editor, never has to switch views or tools, never has to explain much more than “here’s some more Ruby.” What’s often not mentioned, though, is that the inline-style of GUI definition does not scale well beyond the typical demo program. What you see really is what your get. (Trust me; I would not want to have to work on JotBot hand-coding the UI.)
Of course, maybe you don’t want much more than a handful of buttons and some text fields. Maybe all you want is the desktop equivalent of HTML 3.2.
Sometimes that’s all I need for given screen in some larger app, and having Monkeybars provide this would make it that much sweeter. Best would be that it would not alter how one uses the full power of the library.
So here’s what my fork of Monkeybars adds:
- Some code to the base View class to aid in detecting when the Swing UI class is in fact created via Ruby, so that the appropriate reflection/meta-programming can be done
- An additional app generator that gives you an MVC tuple, with a basic view UI class, written in Ruby, in place.
Because I’m interested in getting people to play with this, I renamed the key files from monkeybars to jimpanzee. Now if you install the code as a gem you won’t stomp on any existing Monkeybars installation. (The code should be completely compatible with the current actual Monkeybars API, but the renaming is cleaner.)
With jimpanzee, you can do this:
james@james06:~/tmp$ jimpanzee MyCoolApp :demo
Creating directory MyCoolApp
Copying jimpanzee project structure
Creating default code for MyCoolApp ...
Final steps:
1. Place a copy of jruby-complete.jar in the MyCoolApp/lib/java directory
2. cd into the MyCoolApp/src directory
3. Run the code using jruby:
jruby main.rb
Happy hacking!
and if you follow those final instructions you’ll have a simple cross-platform GUI app running. Toss in rawr and you’re three steps away from having redistributable executables ready.
You can see it here (except for the Rawr part):
<object height='344' width='425'><param></param><param></param><embed src='http://www.youtube.com/v/u_g245nW_vg&color1=0xb1b1b1&color2=0xcfcfcf&hl=en&feature=player_embedded&fs=1' height='344' width='425'></embed></object>There’s more to be done, not the least of which is ensuring that my approach is robust. The generator needs improvement; it’s pretty brain-dead. (For example, :demo is a hard-coded flag for the generator code, and you can’t tell it what to name the generated tuple. But these are not difficult things to change. The real issue is what to change them to.)
There’s a certain “gee whiz” factor in this, because there’s a low limit on what such generators can buy you, and how much inline UI code you’ll want, but the flip side is that it does lower the barrier to entry, and it is of practical value when coupled with Monkeybars’ other killer features. The best part is that it is in addition to, not in place of, all the power the best GUI toolkit offers for creating robust GUI apps of all shapes and sizes.
Please keep in mind when you see any demo that looks a bit too good or too easy that maybe the cool comes with a cost. The most common is that what makes some things easy ends up making other things hard. Always try to ask the presenter what the limits are, if a tool will grow with you if the size your application expands, or if will you find yourself stuck once the gee whiz has worn off.
Whatever tools you pick, consider the long view.
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
“ There is no win and no fail. There is only make. ”
Sister Corita Kent
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 07 December, 2008

最近在外面做项目,和客户的一个程序员在结对编程。
这个项目从最开始到现在,已经快有两个月了,而我是这周才加入到这个项目里面的。作为一个“后进”程序员,我前期的工作就是老老实实坐在一边看着我的pair在那写程序,力争不给人添麻烦,偶尔在力所能及的范围之内,给出一些修改建议。看得出,前期同事们的努力很有成效,现在这些客户程序员已经深谙TDD之道了。几乎很严格的遵守着先写测试,后写代码的纪律,而且结果也还不错,至少经过了这种思路写出的代码看上去已经比较干净了,至少对比他们之前的代码,整洁许多了。
从过程上来看,客户的程序员已经可以很成功的“复制”了我们的过程,甚至在某些情况下,遵守得比我们还要严格。但是,我之所以在这个过程中还不是完全无用的,主要是因为我的pair写出的代码看上去还不那么地道,比如说,一些测试方法里面用到了相同的内容,没有提取出来,很多测试类有相同的部份,没有提取基类等等。所以,借着写新测试的机会,我几乎把原有的测试重构了,该提取变量提变量,该提取基类的提基类。由于之前已经写了很多的代码,虽然这个重构本身说起来不大,但修改起来影响还真是不算小。
随后,在写新的测试时,我的pair就开始大量的运用这些新东西,减少重复代码。实际上,不仅仅是测试,在和我结对的过程中,我给他讲了一些写程序的方法,可以很明显的看到,他会有意识的运用这些刚刚学到的方法。所以,他成功的“复制”了我的想法。
榜样的力量是无穷的。很多人写代码,实现一个功能,通常所做的第一件事就是在现有系统中寻找类似的部份,然后根据这些东西去写新的部份。也许这里的代码并不是简单复制粘贴,但是,我们会遵循原有代码的结构去写新的部份。所以,无论代码好坏,只要有先例,就会有人复制,因为在写的人看来,那就是“模式”,是前人的经验。模仿的结果是类似的结构膨胀会非常快,如果团队规模很大的话,那么膨胀的速度是超乎想像的。
但是,显然不是所有“模式”都是好模式,至少我曾经见识过的一些成百上千行的函数就不是什么好“模式”。遗憾的是,我们中的大多数人也许太过于相信“前人”了,也许没有“能力”或是没有”想法“去修正前人留下的”模式“,我们知道这种复制的结果是什么,它可以把变化变成末日,有太多的团队就是这样一步步把自己推向深渊。
很多人之所以那么做是因为他们没有见识过不一样的。前不久,和几个朋友聚会,一个人说,他们公司新来了一个架构师,写代码很简洁,一个方法最长也就是三五十行,我说自己写代码的习惯是Java尽可能控制在10行以内,Ruby尽可能控制在5行以内。我在他的眼神里看到了一丝吃惊。
我经常开玩笑说,一个项目之所以要在前期多花些功夫,目的是为了后期有更大的空间来糟蹋。最近见识到的这些更加坚定了我的这个想法,一个项目“先行者”必须做一个足够好的榜样,以便“后来者”进行复制,这样,项目才能够有生命力,否则,陷入恶性循环,等待我们的只能是无休止的痛苦。
复制,到底是生产力,还是杀伤力,要看我们选择怎样的路了。
add to del.icio.us. look up in del.icio.us.
add to furl
Erst mal paar Nachträge zur Adventskalenderliste letzte Woche:
Ruby Advent 2008 hat “Ruby Cool-aid for Holiday Season”.
Advent Beer Calendar 2008, ein Blog über alkoholhaltige Biermischgetränke.
Wer noch Geschenke sucht:
Bad Gift Emporium, “We have lots of BAD gifts. Really BAD gifts.”
NP: Brazilian Girls—Internacional
add to del.icio.us. look up in del.icio.us.
add to furlSat 06 December, 2008

Phusion is on a roll today. Not only did we just get a new Passenger, they’ve also just dropped a new REE (the Ruby patches for copy-on-write) that includes 64-bit support as well as compatibility with OS X and Solaris. They’ve also fitted the excellent RailsBench patches from Stefan Kaes that allows you to tweak the GC settings in Ruby if you need to.
This edition was sponsored by 37signals, Curve21, Dr Dispatch Transportation Software, InfoEther, Martian Interactive, New York Times, Shopify, Trevor Turk, and Utah Imaging.
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 05 December, 2008

November 29-December 5, 2008 Edition
Rails 2.3 development is still continuing at a healthy clip. Here’s an overview of what’s happened this week.
Application Templates
Rails now incorporates Jeremy McAnally’s rg application generator. What this means is that we now have template-based application generation built right into Rails; if you have a set of plugins you include in every application (among many other use cases), you can just set up a template once and use it over and over again when you run the rails command. Pratik Naik provided a thorough writeup of this feature over on his blog. commit
Find Improvements
Even the venerable code used by Active Record to talk to databases can be improved, and we had a couple of improvements checked in this week. First, the SQL generated for preloading records in has_and_belongs_to_many associations has had an extra “AS” excised, which makes it work better with some databases. Also, we now have a :having option on find (as well as on has_many and has_and_belongs_to_many associations) for filtering records in grouped finds. As those with heavy SQL backgrounds know, this allows filtering based on grouped results:
developers = Developer.find(:all, :group => "salary",
:having => "sum(salary) > 10000", :select => "salary")
Rack Integration
The tighter integration of Rails with Rack continues. This week saw the death of the venerable CGI processor within Rails, as well as the use of Rack to handle FCGI. There was also some refactoring down in the Rails tests to make them play nicer with Rack. commit commit
Configuration File Cleanup
Over the years, the default environment.rb file had gotten a bit cluttered with comments, random documentation, and settings that mot people don’t need. DHH took a few minutes to clean up the mess, and the current state of this file is much leaner. As part of the cleanup, session store configuration has been moved out to its own file. commit
No More Process Scripts
If you’re one of the (fairly rare) Rails developers who deploys in a fashion that depends on the inspector, reaper, and spawner scripts, you’ll need to know that those scripts are no longer included in core Rails. For Rails applications that are reployed with current alternatives like Passenger, these are just unnecessary baggage. But if you need them, you’ll be able to pick up copies via the irs_process_scripts plugin. commit
Odds and Ends
The fact that Rails checks for IP spoofing can be a nuisance for sites that do heavy traffic with cell phones, because their proxies don’t generally set things up right. If that’s you, you can now set ActionController::Base.ip_spoofing_check = false to disable the check entirely. commit
Rails.root now returns a Pathname object, which means you can use it directly with the join method to clean up existing code that uses File.join. commit
ActionController::Dispatcher now implements its own middleware stack, which you can see by running rake middleware. commit
Gem loading is smarter about missing dependencies. commit
auto_link now properly applies options (such as :target and :class) to generated e-mail links. commit
add to del.icio.us. look up in del.icio.us.
add to furl
The Phusion team keeps blazing ahead with Passenger and improving it rapidly. They’ve just released version 2.0.5, which includes a few fixes and introduces compatibility with the Rack-based Edge Rails.
At 37signals, we’ve already switched over Ta-da List and are busy working on getting the rest of our suite running on Passenger. It’s just so much easier to deal with and the memory savings you get through REE are a nice cherry on top.
I keep getting a steady stream of success reports from all over the world as well. I’ve even read of a few people getting back into Rails development because Passenger finally took out the inconvenience of deploying.
It’s hard to argue with the usability. I’ve personally been setting up a new server running Ubuntu 8.10 and using Apache 2 with Passenger. The time it took me to go from a fresh install to a complete production setup was ridiculously low. There’s just so much less to worry about.
If you haven’t given Passenger a chance yet, now is definitely the time.
add to del.icio.us. look up in del.icio.us.
add to furlThu 04 December, 2008


- 说明
- 通用即时通讯工具Adiumx解决了MSN账号在Apple上的即时通讯问题。
- 另一款通用即时通讯工具Pidgin
add to del.icio.us. look up in del.icio.us.
add to furlWed 03 December, 2008


- 说明
- RJS教程是使用早期的Rails版本为基础的
- RJS中文教程不是完整的翻译版本
- 谁来着手以Rails 2.2版本重新写该教程的命令?
add to del.icio.us. look up in del.icio.us.
add to furl

