Mon 04 February, 2008

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 furl
add to del.icio.us. look up in del.icio.us.
add to furlSun 03 February, 2008

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
Find all subdirectories of a given path at a particular depth
def subdirectories_of(path, options = {}) depth = options[:at_depth_of] || 1 Dir[File.join(path, * ["*"] * depth + [""])] end >> subdirectories_of("/var") => ["/var/agentx/", "/var/amavis/", "/var/at/", "/var/audit/", "/var/backups/", "/var/db/", "/var/empty/", "/var/folders/", ...] >> subdirectories_of("/var", :at_depth_of => 2) => ["/var/amavis/db/", "/var/amavis/tmp/", "/var/at/jobs/", "/var/at/spool/", "/var/at/tabs/", "/var/at/tmp/", ...]
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 furl
add to del.icio.us. look up in del.icio.us.
add to furlSat 02 February, 2008

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 01 February, 2008

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
ActiveMerchant 1.3 has been released. The focus on this latest release was the addition of standardized support for the Address Verification System (AVS) and credit card verification value (CVV2) checks across all gateways which is the latest extraction from Shopify.
AVS information helps reduce fraud by checking the billing address of the customer with the cardholder information on file at the credit card company. CVV2 checks help ensure that the cardholder information has not been stolen from a database of credit card numbers because it is forbidden to record or store CVV2 numbers in any way.
The results of the AVS and CVV2 checks are now available in the response object. ActiveMerchant does all the work of interpreting the information returned from the payment gateways for you and makes the information available in a consistent hash format.
Sample AVS/CVV2 result:
response.avs_result['message'] #=>
"Street address and 9-digit postal code match."
response.cvv_result['message'] #=>
"Suspicious Transaction."
# Details:
response.avs_result['code'] #=> "X"
response.avs_result['street_match'] #=> "Y"
response.avs_result['postal_match'] #=> "Y"
response.cvv_result['code'] #=> "D"
Other notable improvements with the 1.3 release include:
- Improved documentation
- Common interface to AVS / CVV2 results
- New gateways, including Authorize.net Recurring Billing (ARB)
- Improved supported feature set of many existing gateways
- Automatically retry failed connections (when it’s safe)
Coinciding with the 1.3 release of ActiveMerchant is the ActiveMerchant PeepCode PDF by Cody Fauser. The PDF goes over the basics of payment processing, making purchases with ActiveMerchant, and security considerations to keep in mind when processing credit cards in your Rails application. The PDF also walks through the development of a sample Rails application that addresses topics such as order pipelines, order state management and the appropriate unit testing a financial application requires. It is definitely a great read if you are curious about payment processing or require payment processing in your application.
add to del.icio.us. look up in del.icio.us.
add to furl

- 相关链接
- 个人博客首页 http://obiefernandez.com/
- 个人博客 http://blog.obiefernandez.com/
- Obie Fernandez公司 http://www.hashrocket.com/
- 说明
- Obie Fernandez不仅仅是一位专家,而且还是Ruby社区的不多“几块宝石”之一。Mongrel开发者 如此说:
He’s one of the few gems of the Ruby world.
- Obie Fernandez不仅仅是一位专家,而且还是Ruby社区的不多“几块宝石”之一。Mongrel开发者 如此说:
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 31 January, 2008

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

- 说明
- 搜索引擎专业化不仅仅在搜索的形式上,如文件类型等,更重要是在搜索的内容上。现在的搜索引擎包括Google在内,常常会搜索到一些与自己搜索内容毫无相关的内容,而所需要的重要的内容难以获取。搜索引擎专业化将是该领域的未来重要的发展方向。
add to del.icio.us. look up in del.icio.us.
add to furl
Best monkey patch ever
class Object def to_f fail end end
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 30 January, 2008

I just had to share two spam emails I received yesterday. I usually just delete crap like this, but these made me giggle. The first was from "tunde luren <luren_tunde@yahoo.com>" with the subject of "bible order." Here it is:
HelloYeah, I'll be sure to send money for 150 "bibles" to Nigeria. I'll get right on that. Is a personal check OK, or do you prefer cash? Maybe I could just send my VISA details. Surely a "church" is trustworthy, right?
We need you to help us with the bible below for our church crusade programe:
Bounded leather bibles 150pcs
send us the actual amount enclouse with the frieght charge to nigeria.............
church ministry
God bless
The second one was from "Internal Revenue Service U.S.A <refund@usa.gov>" with the subject of "Important Message From IRS." Here's the text:
After the last annual calculations of your fiscal activity we have determined that you are eligible to receive a tax refund of $93.60. Please submit the tax refund request and allow us 6-9 days in order to process it.That "click here" was a link leading to an IP address-only website that is most certainly not part of the IRS. Here's what whois said about the address:
A refund can be delayed for a variety of reasons. For example submitting invalid records or applying after the deadline.
To access your tax refund online, please click here
Regards,
Internal Revenue Service
# whois 165.233.48.227So unless the IRS has done some serious outsourcing to Mauritius, I think it's safe to throw this email away. :-)
OrgName: African Network Information Center
OrgID: AFRINIC
Address: 03B3 - 3rd Floor - Ebene Cyber Tower
Address: Cyber City
Address: Ebene
Address: Mauritius
City: Ebene
StateProv:
PostalCode: 0001
Country: MU
What's funny in all these African scam emails is how awful the spelling and grammar always are. You'd think that these African scammers would wise up and hire someone who speaks English to write their spam emails for them. Then they might trick more people. But who knows? They may be tricking enough people as it is, and so they don't care about how stupid they look to the rest of us.
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
“ Harry thinks if you call him Harry one more time he’s gonna make you eat that cat. ”
Harry in Night Moves
add to del.icio.us. look up in del.icio.us.
add to furl
I'm a huge fan of Jeopardy, and a few weeks ago I got an email from them telling me that on January 29, there would be an online test for East Coast people who wanted to try out. I decided to have a go at it, since I usually do really well when I'm watching the show.
Watching on TV, and trying to answer the questions under pressure are two completely different things. The test was 50 questions and you had 15 seconds for each one. No going back, pausing, do-overs. It was damn hard. I don't think I got more than 10 questions correct. It was a very humbling experience, I can tell you.
add to del.icio.us. look up in del.icio.us.
add to furl
The flow of new Rails books seems unstoppable these days and it’s hard to keep up with all of the new releases. But there are two books that I’ve recently have had a chance to taste that I’d like to highlight.
The first is The Rails Way by Obie Fernandez, which I wrote the foreword for. It’s a big whooper of a book (900+ pages!), but also a very comprehensive walk-through for the Rails developer who already has his feet wet. It also includes a good dose of community commentary on the how’s and why’s, which I rather like.
The second is Mike Clark’s Advanced Rails Recipes, which is still not finished, but there’s a beta book available. It takes up from Chad Fowler’s original Rails Recipes book and gives you another 72 how-tos on more in-depth topics, such as REST, deployment, and testing. I’ve had a chance to taste a few of the recipes already and it’s good stuff.
If there’s a new Rails book that you really like, write a note in the comments and point people to it.
add to del.icio.us. look up in del.icio.us.
add to furl
Sun’s Mediacast site is now running JRuby on Rails as their production stack. As Igor Minar tells, this is definitely still early days for the JRuby/Rails pair, but none the less they have a finished site running off sun.com. Congratulations, guys!
add to del.icio.us. look up in del.icio.us.
add to furl
The registration for RailsConf ‘08 is now open. And if previous years are any indications, I’d register sooner rather than later if you intend to go. We’re returning to the same conference hall in Portland as last year, so we won’t be able to fit materially more people, despite the fact that so many new faces has joined the community this year.
The conference is happening from May 26th till June 1st. If you register before April 10th, there’s a $100 discount.
The content this year will also take a step up in terms of experience required for many sessions. Less “I’m just getting started, how does it work?” and more “I’ve been doing this for a while, how can I become better?”.
A good number of the sessions are already announced, as well as the tutorials. But the keynote names are still being pinned down. And we’re also reserving some session slots for emerging topics as we get closer to the conference.
Would you believe that this is going to be our fifth RailsConf? That’s just incredible. I can’t fathom that time has passed by so quickly. And I can’t wait to meet everyone again this year in Portland. The atmosphere at RailsConf is always radiant with enthusiasm and passion. People who love what they do are very contagious to be around.
add to del.icio.us. look up in del.icio.us.
add to furl
Announcing RailsConf '08 today, I stopped to think about that by the time this conference rolls around, I will have been working on Ruby on Rails for five years. Wow. There are so many memories from this wild ride that it's at once both hard to fathom that it's been so long and yet it feels like I've been doing it forever. Time can be funny like that.
But what pleases me the most is that I still absolutely love working on and with Ruby and Rails. It didn't pass, it wasn't just a phase, it wasn't a run for an exit event. I think that's significant because it means that I, and everyone else still involved with the project, are just as likely to keep at this for another five years or more.
When you do what you love for the sake of itself, the rewards are so much greater than if you just do it for external incentives. For lots of measures of "winning", we've long since won with Ruby on Rails. The impact on the industry, the adoption by thousands of companies and developers, the books, the conferences, and all that jazz. And yet, it doesn't really matter that much in the end. What matters is getting excited about continuing the work.
In light of this, I strongly recommend that you find a vocation in your life where you just really enjoy the act itself. Not just the results, not just the external incentives. The actual work. There's not enough time to spend it doing anything else.
add to del.icio.us. look up in del.icio.us.
add to furlTue 29 January, 2008


- 说明
- 自从Apple iPhone手机和Google Android手机平台出现以后,手机市场的竞争变得越来越激烈。无论是Apple和Google也好,软件都是这些企业的重点。现在Nokia才看到了:手机市场就是软件市场的竞争,并收购了著名开源跨平台开发工具 Qt 。其实,手机的概念将会在不远的时间内全面翻新,这是早就应该做的事情。手机通话将仅仅是它的其中的很小的一部分功能。
一个巨大的商业机会正在等待大家!!!
- 自从Apple iPhone手机和Google Android手机平台出现以后,手机市场的竞争变得越来越激烈。无论是Apple和Google也好,软件都是这些企业的重点。现在Nokia才看到了:手机市场就是软件市场的竞争,并收购了著名开源跨平台开发工具 Qt 。其实,手机的概念将会在不远的时间内全面翻新,这是早就应该做的事情。手机通话将仅仅是它的其中的很小的一部分功能。
add to del.icio.us. look up in del.icio.us.
add to furl
- Color Management workflow for flickr photos
Nice description of workflow for preserving color profiles in photos uploaded to flickr
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
It took eons, but the videos recorded at RailsConf ‘07 are finally ready. These videos include all the keynotes from the conference. A great warm-up for 2008 as we’ll soon be opening for general registering on this year’s conference.
add to del.icio.us. look up in del.icio.us.
add to furl
发现21世纪还是需要跟不同的人不停的解释UTF8,而却一再遭到很奇怪的眼神。
string s = "hello world,日后再说!";
byte[] asciiBytes = Encoding.ASCII.GetBytes(s);
Console.WriteLine(ByteHelper.ToString(asciiBytes));
// 68 65 6c 6c 6f 20 77 6f 72 6c 64 2c 3f 3f 3f 3f 21
byte[] unicodeBytes = Encoding.Unicode.GetBytes(s);
Console.WriteLine(ByteHelper.ToString(unicodeBytes));
// 68 00 65 00 6c 00 6c 00 6f 00 20 00 77 00 6f 00 72 00 6c 00 64 00 2c 00 e5 65 0e 54 8d 51 f4 8b 21 00
byte[] utf8Bytes = Encoding.UTF8.GetBytes(s);
Console.WriteLine(ByteHelper.ToString(utf8Bytes));
// 68 65 6c 6c 6f 20 77 6f 72 6c 64 2c e6 97 a5 e5 90 8e e5 86 8d e8 af b4 21
注意:3f就是'?'
很多时候看到老外的软件也经常处理不好中文,就是因为ASCII编码以至于出现'?',尤其在编辑器和网络中(字符串和byte转换过程)丢失了数据

add to del.icio.us. look up in del.icio.us.
add to furl
Mon 28 January, 2008

InfoQ评论英文版:Prefer Broad Design Skills over Platform Knowledge
InfoQ评论中文般:丰富的设计技能胜过特定于平台的知识
我对程序设计语言有着偏好,所以,我喜欢不断接触各种新语言,喜欢研究语言背后的实现。
最近一段时间,我做的项目用到的几乎都是对我而言的新语言:C#、ActionScript、PHP……,这等价于我要不停的学习自己新语言。
我很享受学习新语言的过程,因为它们会带给我一些不同的体验。每一种语言都有自己不同的适用范围,这一点在学习像ActionScript和PHP这种有很强领域色彩的语言时,体现得尤为明显。运用这些语言写程序的过程中,很容易体会到语言作者在设计时的侧重。
学习新语言,某些情况下也有一些让人难受的地方。经常是,程序出现了语法错误,却瞪眼看不出来,突然意识到错误所在,原来自己用的是熟识语言的语法,不禁莞尔。有时,语言或程序库与自己熟悉的习惯不相一致,经常会被绊住一段时间。
好吧!回到开头,Martin说,设计技能更重要。我想说,设计技能只是很重要的一方面,更多的还是自己做事的方法和习惯。跨越语言时,对此体会会更加深刻。
最近是在写一些PHP代码,我完成一个功能的过程大致如此;弄清楚自己要做的是什么,想一下大概应该如何实现,用PHPUnit编写测试,然后完成功能,运行所有测试,确保这个实现正确以及没有破坏任何已有的东西。把PHP换成其它语言,相信过程是类似的。
如果你有机会像我一样在语言之间穿梭,在度过最初的痛苦期之后,你会发现一切会回到自己熟悉的轨道上。设计、编码、查文档、测试,没有什么不同,所做的一切,都是把自己的想法落实成代码,只不过,由于语言的差别,落实成具体的代码,形式上略有差别而已。
当然,我们不是教条主义者,不只是简单粗暴的知识映射。语言和语言之间是有差别的,所以,学习语言时,我们会注意到语言为我们提供的便利,比如,动态语言的特性,比如,函数的抽象等等,这样我们可以更好更优雅的完成我们的工作。
相关文章:
收藏到:Del.icio.us
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



