123
 123

Thu 11 December, 2008

Click here to bookmark this link.Channel Image13:57 Windows世界:系统优化工具CCleaner下载超过二亿次!» 天天红玉世界
系统优化工具CCleaner下载超过二亿次!
  • 英文说明
    • CCleaner is a freeware system optimization, privacy and cleaning tool.
  • 中文说明
    • 一款免费的系统优化工具;
    • 清除系统的不使用和临时文件;
    • 使得系统运行更快;

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

Wed 10 December, 2008

Click here to bookmark this link.Channel Image21:44 卷起袖子做咨询» 梦想风暴
在你印象中,咨询师是什么样子呢?

曾经,在我脑海中,咨询师是一群西装革履的家伙,在众人面前侃侃而谈。一群受苦受难的劳苦大众像企盼救星一样,等待从咨询师那里获得宇宙的终极奥义。

后来,接触过几个“咨询师”,他们在我心目中的形象是,一群衣冠楚楚的家伙,用满嘴的大词,为人们描绘了一幅理想家园的蓝图。当一切回归真实,梦幻只是梦幻,问题依然如故,而咨询师们早已不知踪影。

再后来,我成了咨询师。

这个项目是我真正做咨询的第一个项目,挂了咨询师的头衔有一段时间了,终于有机会行使咨询师的职责了。说到ThoughtWorks的咨询,闪现在我脑子里面第一个词就是敏捷,没错,现在这个项目也是一个关于敏捷的项目。加入ThoughtWorks之前,我以为,所谓的敏捷咨询就是像那些咨询师一样,就是到到其它的公司,有如传教士一般,把公司的敏捷理念宣扬一遍就万事大吉了。进到ThoughtWorks,我才发现,嘴上功夫原来只是很小的一部份,ThoughtWorks的咨询是要卷起袖子干活的。

在客户现场,我们和客户的程序员一起结对编程,分享自己对于开发和敏捷的理解;我们需要和客户一起攻关技术难点,展示我们解决问题的过程;我们需要帮助客户发现一些他们习以为常的问题,灌输高效开发的理念……我才进入到现场一个星期,但我可以深深体会到我的同事们之前所做的一些工作已经逐渐开始体现价值。和我们一起工作过的一些客户工程师已经开始能够自己按照敏捷的方式进行开发,甚至可以为一些到这个团队进行考察的其它项目人员讲解一些基本的理念,而这一切都是来自于他们和我们一点一滴在一起工作的积累。

我们这个客户不断在探寻着更加有效的做事方法,所以,咨询请的也不只我们一家。就在我们在客户现场努力工作的时候,另外的一家,据说还是名人,跑到这边给他们的这些项目负责人一级做了一个培训。当我问起他们对这次培训的看法,和我聊天的那个负责人直言不讳,那些人讲得很好,但是很难落到实处。原来大家对这种靠嘴吃饭的咨询师认识竟然惊人的一致。完美世界都好办,但是一旦来到现实世界,种种问题就会浮出水面。问题总是要解决的,谁来解决问题呢?那些花钱请咨询师的人如果能够有效解决所有问题,那么他们多半也不必请咨询师了。而这个时候,咨询师在哪里?

曾经有人这么评价过ThoughtWorks咨询,花钱请了这么多人做咨询,ThoughtWorks是唯一一个卷起袖子和我们一起干活的。




add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image11:37 网站推荐:澳大利亚社区网站» 天天红玉世界

Tue 09 December, 2008

Click here to bookmark this link.Channel Image19:21 Apple世界:设置环境变量实例» 天天红玉世界
设置TextMate的环境变量方法
cd ~
 
mkdir bin
 
ln -s /Applications/TextMate.app/Contents/Resources/mate ~/bin/mate
 
vim .bash_profile
export PATH="$HOME/bin:$PATH"
 
source .bash_profile
 
mate .

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

Mon 08 December, 2008

Click here to bookmark this link.Channel Image14:26 Monkeybars with inline-Ruby Swing code and Gee Whiz! generator» James Britt - Code, Content, Caffiene

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&#38;color1=0xb1b1b1&#38;color2=0xcfcfcf&#38;hl=en&#38;feature=player_embedded&#38;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 add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image09:05 Rails Templates» LetRails
刚刚在译言上看到相关的介绍,但是感觉讲的不是很清楚,Rails Templates是Edge Rails中的一个新特性,它的作用实际上就是允许你自定义Rails(这里指的是命令行的那个可执行脚本)的行为,比如...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:15 Automatic Mahjong Table» Projectionist
Click here to bookmark this link.Channel Image04:15 There is no win and no fail...» Projectionist
There is no win and no fail. There is only make.

Sister Corita Kent


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:14 披露宴» Matzにっき
教会の後、午後から会社の後輩の披露宴。 なかなか良いものであった。まあ、結婚はスタートであってゴールではないので、 末長くお幸せであってほしい。 以下、気づいたほぼどうでも良いこと。 プロの運営は安心できる。最近出席した知人の披露宴は、どれも身内の手作り感あふれるもので、 それはそれでよいのだけど。 でも、主役はそれなりに大変そう 夫が稼ぎ、妻が家事、という従来型モデルがわりと暗黙に仮定されていた。 個人的には双方が納得してれば(ここ重要)結構幸せなモデルだとは思うけど、 共働き夫婦である彼らはどう思うん..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:14 出張» Matzにっき
今週は出張が多い。今年最後の忙しさ。 東京、RA運営委員会ミーティング 東京、楽天技術研究所ミーティング 技研忘年会 Ruby開発合宿 札幌、パソナテックイベント おかげで松江のOSS協議会のイベントには欠席しなくてはならない。 ところで、札幌で私と一緒に金曜の晩ご飯を食べたい人はいますか? いなけりゃ多分ファーストフードで済ませちゃうけど。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:14 SD Card» Matzにっき
手持ちの2GのSDカードにRubyConfのビデオデータを書き込んでたら、 read/write errorが発生して、その後書き込めなくなった。 マウントもできない。 パーティションテーブルから壊れているらしい。 fdiskしてもbroken partition tableというエラーが出て書き込めない。 もしやハード的に壊してしまったんだろうか。 そんなに酷使した覚えはないのだ。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sun 07 December, 2008

Click here to bookmark this link.Channel Image23:29 复制:杀伤力?生产力?» 梦想风暴
复制粘贴在很多人眼睛里面是洪水猛兽,唯恐逼之不及。作为一个有职业道德的程序员,我也痛恨把一段代码复制粘贴,凡是经过我手的代码,我通常会在力所能及的范围之内消除一些重复。不过,这里要说的是另外的复制。

最近在外面做项目,和客户的一个程序员在结对编程。

这个项目从最开始到现在,已经快有两个月了,而我是这周才加入到这个项目里面的。作为一个“后进”程序员,我前期的工作就是老老实实坐在一边看着我的pair在那写程序,力争不给人添麻烦,偶尔在力所能及的范围之内,给出一些修改建议。看得出,前期同事们的努力很有成效,现在这些客户程序员已经深谙TDD之道了。几乎很严格的遵守着先写测试,后写代码的纪律,而且结果也还不错,至少经过了这种思路写出的代码看上去已经比较干净了,至少对比他们之前的代码,整洁许多了。

从过程上来看,客户的程序员已经可以很成功的“复制”了我们的过程,甚至在某些情况下,遵守得比我们还要严格。但是,我之所以在这个过程中还不是完全无用的,主要是因为我的pair写出的代码看上去还不那么地道,比如说,一些测试方法里面用到了相同的内容,没有提取出来,很多测试类有相同的部份,没有提取基类等等。所以,借着写新测试的机会,我几乎把原有的测试重构了,该提取变量提变量,该提取基类的提基类。由于之前已经写了很多的代码,虽然这个重构本身说起来不大,但修改起来影响还真是不算小。

随后,在写新的测试时,我的pair就开始大量的运用这些新东西,减少重复代码。实际上,不仅仅是测试,在和我结对的过程中,我给他讲了一些写程序的方法,可以很明显的看到,他会有意识的运用这些刚刚学到的方法。所以,他成功的“复制”了我的想法。

榜样的力量是无穷的。很多人写代码,实现一个功能,通常所做的第一件事就是在现有系统中寻找类似的部份,然后根据这些东西去写新的部份。也许这里的代码并不是简单复制粘贴,但是,我们会遵循原有代码的结构去写新的部份。所以,无论代码好坏,只要有先例,就会有人复制,因为在写的人看来,那就是“模式”,是前人的经验。模仿的结果是类似的结构膨胀会非常快,如果团队规模很大的话,那么膨胀的速度是超乎想像的。

但是,显然不是所有“模式”都是好模式,至少我曾经见识过的一些成百上千行的函数就不是什么好“模式”。遗憾的是,我们中的大多数人也许太过于相信“前人”了,也许没有“能力”或是没有”想法“去修正前人留下的”模式“,我们知道这种复制的结果是什么,它可以把变化变成末日,有太多的团队就是这样一步步把自己推向深渊。

很多人之所以那么做是因为他们没有见识过不一样的。前不久,和几个朋友聚会,一个人说,他们公司新来了一个架构师,写代码很简洁,一个方法最长也就是三五十行,我说自己写代码的习惯是Java尽可能控制在10行以内,Ruby尽可能控制在5行以内。我在他的眼神里看到了一丝吃惊。

我经常开玩笑说,一个项目之所以要在前期多花些功夫,目的是为了后期有更大的空间来糟蹋。最近见识到的这些更加坚定了我的这个想法,一个项目“先行者”必须做一个足够好的榜样,以便“后来者”进行复制,这样,项目才能够有生命力,否则,陷入恶性循环,等待我们的只能是无休止的痛苦。

复制,到底是生产力,还是杀伤力,要看我们选择怎样的路了。




add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image18:21 Zum zweiten Advent» chris blogs

Erst mal paar Nachträge zur Adventskalenderliste letzte Woche:

Wer noch Geschenke sucht:

I remember Leslie Harpold.

NP: Brazilian Girls—Internacional


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

Sat 06 December, 2008

Click here to bookmark this link.Channel Image08:57 New REE with OS X, 64-bit, Solaris support and GC patches» Riding Rails - home

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 add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image08:57 Three Days With the Roku Netflix Player» Joey Gibson's Blog
My Netflix Player arrived on Wednesday. It was supposed to be a family Christmas present, but you know how those things go. When something this cool arrives this early, there’s no way it’s going to stay boxed up for three more weeks. The box is very small, maybe 4.5 inches on a side, and about 2 [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Fri 05 December, 2008

Click here to bookmark this link.Channel Image23:34 This Week in Edge Rails» Riding Rails - home

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")

commit commit

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 add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image23:34 Phusion Passenger 2.0.5 now compatible with Edge Rails» Riding Rails - home

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 add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image17:48 Cucumber实例世界:Cucumber on Rails深化实例(四)» 天天红玉世界
Cucumber on Rails深化实例(四)
 

警告:在复制本博客代码时,空行存在中文空格,需要删除!!!

Cucumber on Rails深化实例
rails 04_demo_cucumber && cd 04_demo_cucumber
 
ruby script/generate cucumber
 
vi features/support/env.rb
require 'cucumber/rails/rspec'
require 'webrat' if !defined?(Webrat)
 
vi lib/tasks/cucumber.rake
# 在format和language之前是两个“-”,其它地方也是如此。
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "—format pretty —language zh-CN"
 
rake db:migrate
 
rake features
 
ruby script/generate rspec_scaffold post title:string body:text
 
ruby script/generate feature post title:string body:text
 
vi features/step_definitions/webrat_steps.rb
#require 'webrat' if !defined?(Webrat) # Because ...
 
rake db:migrate
 
vi features/manage_posts.feature
功能:管理帖子
为了能够控制“帖子MVC”
作为软件普通用户
我要完成“帖子MCV”创建和删除帖子的功能
 
场景: 创建一个新的帖子
假如 我已经在创建新帖子页面
当 我在输入框<post_title>中输入内容<lycom.de是什么网站>
而且 我在输入框<post_body>中输入内容<lycom.de是一个Ruby/Rails技术新闻博客>
而且 我点击按钮<Create>
那么 我应该看到<lycom.de是什么网站>
而且 我应该看到<lycom.de是一个Ruby/Rails技术新闻博客>
 
场景: 删除第一个帖子
假如 存在<4>个帖子
当 我删除第一个帖子
那么 还应该有<3>个帖子
 
vi features/step_definitions/post_steps.rb
require 'spec'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
 
Given /我已经在创建新帖子页面/ do
visits "/posts/new"
end
 
When /我点击按钮<(.*)>/ do |btn_name|
clicks_button btn_name
end
 
Given /存在<(\d+)>个帖子/ do |n|
Post.transaction do
Post.destroy_all
n.to_i.times do |n|
Post.create! :title => "Post #{n}"
end
end
end
 
When /我在输入框<(.*)>中输入内容<(.*)>/ do |id,text|
fills_in(id, :with => text)
end
 
When /我删除第一个帖子/ do
# @post = Post.find(:first)
# visits "/posts/#{@post.id}"
visits posts_url
clicks_link "Destroy"
end
 
Then /^我应该看到<(.*)>/ do |text|
#response.body.should =~ /#{text}/
response.body.should =~ Regexp.new(text)
end
 
Then /还应该有<(\d+)>个帖子/ do |n|
Post.count.should == n.to_i
response.should have_tag("table tr", n.to_i + 1) # There is a header row too
end
 
# 这个命令输出结果就是上面图
rake features 
或者
ruby script/cucumber -a zh-CN features/manage_posts.feature

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

Thu 04 December, 2008

Click here to bookmark this link.Channel Image11:51 Apple世界:通用即时通讯工具Adiumx» 天天红玉世界
通用即时通讯工具

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

Wed 03 December, 2008

Click here to bookmark this link.Channel Image23:57 图书世界:免费的RJS教程» 天天红玉世界
免费的RJS教程
  • 说明
    • RJS教程是使用早期的Rails版本为基础的
    • RJS中文教程不是完整的翻译版本
    • 谁来着手以Rails 2.2版本重新写该教程的命令?

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