Mon 11 February, 2008
Sun 10 February, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
- 搜索引擎与中国
- 中国互联网上的搜索引擎点击量排名:百度,QQ,新浪,谷歌。
- 全球范围内,雅虎/Google第一位交替出现,百度第18位。
- 百度在中国的成功一个原因是它提供的歌曲搜索和下载。
- 中国谷歌提供免费音乐在几周内将会启动。合作者: Top100.cn 。
add to del.icio.us. look up in del.icio.us.
add to furlSat 09 February, 2008

Here’s what’s planned for February Refactor Phoenix Meeting
Agenda Change: Refacotr Presents Wicked Cool JavaScript
Date: Wednesday, February 27, 2008
Time:Social stuff: 6:15pmWe’re now at Boulders on B’way!
Presentation stuff: 7:00pm (We’ll be bringing our video projector)
Place:
Boulders on Broadway 530 W Broadway Road Tempe, AZ 85282
Google map: http://rubyurl.com/SKAU
—-—-—-——NOTE —-—-—-——
New location!
Refactor has moved to Boulders on Broadway!
—-—-—-—— —-—-—-——
See http://www.refactorphoenix.com for details
For this Refactor Phoenix meeting: Brain Shaler and James Britt will explode your head with killer presos about Javascript
Refactor Phoenix is a monthly non-denominational gathering of desert geeks, dedicated to the open exchange of information in a casual environment.
We meet on the 4th Wednesday of each month.
If you’re a (coder|programmer|software engineer|hacker|developer), Refactor Phoenix is for you.
For more information, please see
http://www.refactorphoenix.com
or contact
James Britt
Rising Tide Software
james@risingtidesoftare.com
(602) 714-1147
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
“ When we start excessively pontificating and trying to add value, we are often not really focused on the quality of the idea at all. We are just trying to prove to the world how smart we really are. ”
Marshall Goldsmith
add to del.icio.us. look up in del.icio.us.
add to furl
Rails core
add to del.icio.us. look up in del.icio.us.
add to furlFri 08 February, 2008

While cooking my breakfast this morning I turned on the NASA channel on TV to see what was going on with the Atlantis mission. There was a beautiful video shot of the open cargo bay with the Earth below; quite stunning. Then the chatter between Atlantis and Mission Control. I didn't write it down, but one of Atlantis' crew was saying something about mail not moving from the outgoing mail folder to the sent mail folder and just needing to wait for the next mail sync. Mission Control then said something about Atlantis having Outlook problems. Gack! They're using Windows on the Shuttle?!? They're doomed!!!
Seriously, based on all of my many years experience with Windows, I would really be uncomfortable knowing that Windows was on the shuttle doing anything other than letting the astronauts play games.
add to del.icio.us. look up in del.icio.us.
add to furl
Last night we went to my favorite Chinese restaurant and on the way out I noticed that some punk had 'altered' the specials board. It shouldn't have made me laugh, but it did. Thomas told me that I should be ashamed of myself for laughing at that. I choked out an agreement between peals of laughter.
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
Heroku is a rails platform with a twist: it all runs in your browser.
The entire platform is build around a web based IDE which allows full rails development and deployment. Your apps are deployed to Amazon’s Elastic Cloud by the push of a button.
add to del.icio.us. look up in del.icio.us.
add to furl
“ You are entitled to your own opinion but not your own facts. ”
Patrick Moynihan
add to del.icio.us. look up in del.icio.us.
add to furlThu 07 February, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
Paul Graham issues the Arc Challenge … who could resist?
Paul Graham’s Arc Challenge
You can read about the Arc Challenge here: The Arc Challenge. Go ahead a read it now, but I will summarize the challenge.
Write a web program such that:
- The first page of the program displays nothing but a text box and a submit button. You enter some arbitrary text and press the submit button, which takes you to …
- The second page is nothing but a single link labeled “click here”. The URL linked to must not contain the text entered in the first step (i.e. you are not supposed to pass the text as a parameter on the link). Clicking the link takes you to …
- The third page which contains “You said: XXX” (where XXX is the text you entered in the first step).
Here’s a screen cast demoing my solution to the Arc Challenge. (We will show the code shortly).
Paul’s Solution
Paul has been working on designing Arc, his ideal programming language for the future. Given Paul’s language preferences, it is no surprise that Arc is very Lisp-like. Here is Paul’s solution written in Arc:
(defop said req
(aform [w/link (pr "you said: " (arg _ "foo"))
(pr "click here")]
(input "foo")
(submit)))
Paul points out that the solution is very short and elegant, only 23 nodes in the codetree. I’m sure I don’t quite understand exactly what it is doing (I’d love to see a step by step explanation of the code). He wonders what it would look like in other languages.
Several people have responded with solutions in their own languages. I’ve seen a Smalltalk Solution as well as a Ruby solution (which pretty closely mimics the Arc code from Paul) on the Arc Language Forum page that was setup for responses.
Continuation Web Servers
The Arc challenge is a perfect candidate for a continuation based server solution. And I recalled that Chad Fowler and I had written a demo continuation based server for the Continuations Demystified talk we did at RubyConf 2005. (Look for the “Poor Man’s Seaside Demo in that presentation.) I wondered how easy it be to code up an Arc challenge solution using that code base.
The key to a continuation based server is that it allows the programmer to code in a linear fashion. All the request/response nature of web interaction is completely hidden from you as a programmer.
For example, let’s pretend we wanted to solve the Arc challenge using a terminal and command line rather than a web based solution. How would you write it? Probably something like this:
text = gets
puts "click here"
gets
puts "You said: #{text}"
Simple, linear programming. (OK, printing “click here” is silly in a text program, but you get the idea). You ask a question and read a response. You pause for a click. You then tell the user what the result is.
Ask. Pause. Tell.
Those are our basic abstract operations for this problem. Lets rewrite our text based solution using these abstractions. We’ll put this in a file called “arc_challenge.rb”.
Conversation.interact do |io|
text = io.ask
io.pause("click here")
io.tell("You said: #{text}")
end
I’ve introduced three operations (methods) that are provided by an I/O object (let’s ignore the interact line for now). “ask” will ask the user for input, returning the string. “pause” will pause until the user indicates he/she is ready to continue (e.g. pressing return in our command line version). “tell” sends the given string to the user.
So, what does “Conversation.interact” do? It creates the environment where the user have a conversation with the program. The interation is controlled through our ask/pause/tell functions provided by the I/O object passed to the interact block.
Here is an implementation of a text based conversation.
class TextBased
def interact
yield(self)
end
def ask(prompt=nil)
print prompt, " " if prompt
gets.chomp
end
def pause(prompt="")
print prompt, " " if prompt
gets
end
def tell(message)
puts message
end
end
Conversation = TextBased.new
To run the text based conversation, just require the text. Here’s a demo:
Arc on the Web
Well, anybody can solve the challenge in text mode. How much work do we have to do to get it on the web.
The answer: Zero!
The code Chad and I wrote for Continuations Demystified includes a web-based version of the conversation object that is ready to go. All we have to do is plug it in and run it. No changes are required to our basic Arc challenge solution.
Again, a screen demo:
Yes, we know that although we now have our Arc Challenge on the web, we haven’t quite conformed to the exact requirements of the challenge. We will handle that next.
The Final Arc Solution
The problem is that the current Web based conversation object makes all kinds of assumptions that are not appropriate for the final Arc solution.
In particular, we need to change:
- Get rid the head line, restart link and other extraneous HTML elements.
- Don’t keep a running log of the conversation. When you move to a new page, you start from scratch.
- The “click here” should be a real link, not just a text box where you can press enter.
To get to here, we will have to make some modifications to the conversation web library. It turns out the changes are pretty straight forward. The whole interaction framework is controlled by the Conversation object that implements ask/pause/tell methods. You can see the changes made for the Arc challenge in the “noecho_web_based.rb” file (see the end of this post for the availability of the source code).
The Final Conversation Based Solution
In cased you missed it, here is the Arc Challenge Solution:
Conversation.interact do |io|
text = io.ask
io.pause("click here")
io.tell("You said: #{text}")
end
Yep, it’s the exact same file we used for the text based solution. I don’t know if it is as elegant as Paul’s version, but I certainly find it easy to read and understand. (Rerun the very first screen cast in this posting if you want to see it in action again).
If you want to look at the code, there is a tarball available that contains all the continuation server demo code from Continuations Demystified talk, as well as the two new files I added for the Arc challenge. “arc_challenge.rb” is the actually solution and “noecho_web_based.rb” is the conversation library that renders the solution in the style set forth by the challenge.
Enjoy.
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

- 说明Waves
- Waves是一款创建基于Ruby语言的网络应用软件框架。
- Waves是一个开源项目。
- Waves是功能丰富的,紧凑的,和可扩展的。
- Waves是线程安全的,可实时补丁和容易集群支持。
- Waves是依赖于最好Ruby语言软件包:Rack, Mongrel, Sequel, Markaby, and Erubis。
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 06 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
All I've ever heard about the Tet Offensive was that it was a massive failure for the Allies and that it signaled the beginning of the end for Allied forces in Vietnam. Over the past couple of years I've read several stories contradicting the conventional wisdom about Tet. From these readings, it seems that far from a defeat for Allied forces, it was actually a stunning, massive defeat for the Communists. Here's the latest story from the Wall Street Journal explaining exactly that. Essentially, the media mis-reported what happened during Tet, and the American people swallowed it. Most still believe it. I believe the same thing is happening with media reporting in Iraq. Objective figures show the troop surge is working, but most Americans think we're "in a quagmire." Will it take 40 years before we see that the reporting on Iraq was wrong?
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
“ We are the ones we’ve been waiting for. ”
Barack Obama
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 05 February, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
Hello from the new server!
I managed to glom things together just enough to get the bit-rot that is this site's code running on the new server. All the usual caveats about brokenness apply.
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
“ That ends a 7hr nap. Pertussis vs. narcotic cough syrup? Too soon to tell. Dreams of bulimic care bears and carpets made of ape faces? Nice. ”
Michael Buffington
add to del.icio.us. look up in del.icio.us.
add to furlMon 04 February, 2008

The major showstopper before I was seriously considering going to Git was the lack of an darcsum-like interface for Git.
Yesterday night I finally decided to write it.
git-status (included as git.el in the Git distribution) is usually
good enough to use, but I often like to do partial commits, that is,
commit only parts of a file. Git can do that now for some time, using
git add --interactive or frontends like
git-hunk-commit
or git-wt-add. Still, there
was no way to do it conveniently in Emacs.
Let me introduce gitsum:

You can freely delete hunks you don’t want to commit, split big changes, or even edit the patch directly if you feel adventurous. It also integrates into git-status so you can easily switch between these frontends.
Gitsum is hosted at http://github.com/chneukirchen/gitsum (which I highly recommend) and is mirrored at http://git.vuxu.org/, patches and additions are welcome! It’s still very fresh and has some rough corners, but I already notice my increase in productivity.
NP: Twelve Tone Failure—As I Hit the Floor
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



