Sun 12 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 furlSat 11 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 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 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
Joe O’Brien and I will be hosting the Test-Driven Developement in Rails Pragmatic Studio in Columbus.
Test Driven Developement in Rails
Mark your calendars. It is official! Joe O’Brien and I will be teaching a new Pragmatic Studio: Test Driven Development in Rails. The first offering of this studio will be in Columbus on October 17th through the 19th.
To quote from the web site:
In this Studio, you’ll learn how to do test-driven development by actually doing it. We’ll teach you how to get started with a solid foundation of testing practices, and then quickly build on those with advanced techniques and tools. You’ll experience a powerful synergy between testing and design that helps you write better software, faster!
If you ever wanted to improve your testing skills in Ruby and Rails, then this wil be the place for you. I’m really excited about this opportunity. I hope to see a lot of you there.
add to del.icio.us. look up in del.icio.us.
add to furlFri 10 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 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 furlThu 09 August, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
So I see that Reddit has a post titled, Build an Infinitely Scalable Infrastructure for $100 Using Amazon Services
I go to pay highscalability.com a visit, and here’s what I get:

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 enjoy lurking in obscure IRC channels and often have been amazed how many people I met there I already knew from some other channel. Today, this happened again, so I just had to map all language channels I could find on Freenode and make a diagram of their relationships.
I tried to find all language-specific general channels, and came up with these: #perl, ##c, #python, ##c++, #ruby-lang, #haskell, #bash, #lisp, ##java ###javascript, #perl6, #scheme, #erlang, #ruby, #latex, #lua, #d, #asm, #zsh ##tcl, #ocaml, #fpc, #io, #awk, #sed, #forth, #scala, #ada, #dylan, #sml, and #!/bin/sh.
I also added #rubyonrails, #concatenative, #esoteric, #oasis, #haskell-blah, #ruby-de, #camping, and #rack, which are not really general language channels but interesting to see.
After frustration with R (I first wanted
to make a kind-of heatmap), I decided to use
GraphViz’s fdp. Here’s the preview of the
map (click for fullsize, beware: 1833x2084px):
If you want to print it, there also is a PostScript version.
The font-sizes are logarithmic, legend for the edges:
- If 45% of the smaller channel are in the other channel, there is a bold line.
- If 25% of the smaller channel are in the other channel, there is a solid line.
- If 10% of the smaller channel are in the other channel, there is a dotted line.
Enjoy.
NP: Jeff Buckley—Lilac Wine
add to del.icio.us. look up in del.icio.us.
add to furlWed 08 August, 2007

在这个版本中,除了让更多单元测试通过之外,最大的变化是在Annotation的应用上。关于Annotation的工作,我已经在自己的blog上讨论过一些,这里再整理一下。
Ruby的方法总要有一个对应的底层语言实现。在C Ruby中,这个对应就是一个C的函数,而定义的时候,直接使用函数指针去做这个关联。而在Java中,因为没有函数指针,作为替代方案,我们可以使用一个对象。在XRuby的实现中,RubyMethod的存在就是为了这个目的。所以,在XRuby中对应到Ruby的方法都源自RubyMethod,比如下面这段代码:
public class String_to_f extends RubyNoArgMethod {
protected RubyValue run(RubyValue receiver, RubyBlock block) {
return ((RubyString)receiver).to_f();
}
}
从上面展示的代码中,我们可以看到,为了实现这段方法,最终需要访问receiver的内容,而且,在事实的开发中,我们经常发现一个两难的抉择:究竟把方法的具体实现放在RubyMethod中还是放在Java的方法中。
有了对应的实现,我们还需要将它注册到系统中:
StringClass.defineMethod(“to_f”, new String_to_f());
这段虽然不复杂,重复编写也不是一件让人愉快的事情。
通过Annotation,我们可以更好的解决这个问题,下面便是对应于上面实现的代码:
@RubyLevelClass(name="String")
public class RubyString {
@RubyLevelMethod(name="to_f")
public RubyFloat to_f() {
...
}
}
在这里,我们使用RubyLevelMethod将一个Java的方法和Ruby的方法绑定在一起,这个Annotation表示,一方面会生成一个对应于这个方法的RubyMethod实现满足调用规则,另一方面会在Ruby的类中定义出这个方法,减少了一些重复编码的工作量。使用Annotaion避免了前面提及的那种两难,所有的方法都实现在Java方法中即可,这样,便可以有效的减少设计上的迷惑。再有,这个Annotation可以让Java方法和Ruby方法的关联一目了然。
一如既往的欢迎对XRuby有兴趣的人加入到XRuby的开发中来,在这里,总是有一些有趣的问题可以解决。
add to del.icio.us. look up in del.icio.us.
add to furl
“ Perhaps this book will be understood only by someone who has himself already had the thoughts that are expressed in it. ”
From preface to Tractatus Logico-Philosophicus
add to del.icio.us. look up in del.icio.us.
add to furl
Debate
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
Someone asked me what music I listen to. For some reason, I drew a blank. I was listening to Kraftwerk earlier that day, but I knew there was some other stuff that had grabbed my interest lately.
So I thought I would write some of them down here.
- James White /James Chance / Contortions
- Hot Club of Cowtown
- Messer Chups
- Do Make Say Think
- Fly Pan Am
- Congotronics
- The Antlers
- A semi-random assortment of Neue Deutsche Welle bands whose names I cannot keep track of.
- A semi-random assortment of Gypsy Jazz , somewhat heavy with Django .
And right now I have Yo La Tengo ’s I Am Not Afraid of You and I Will Beat Your Ass playing.
add to del.icio.us. look up in del.icio.us.
add to furl
“ Taste is a microscope of judgment. ”
Jean-Jacques Rousseau
add to del.icio.us. look up in del.icio.us.
add to furl
The Czech Rails shop Skvělý.CZ has just announced the release of sMoney.EU, a free expense tracking application written in (of course) Ruby on Rails. It sports translations for several languages, too, and joins the growing ranks of Rails applications with localized interfaces. Great job, Robert and team!
add to del.icio.us. look up in del.icio.us.
add to furlTue 07 August, 2007

Test coverage & elegance
add to del.icio.us. look up in del.icio.us.
add to furl
“ I have become an aerial view of a coastal town you once knew. ”
Fionn Regan in Be Good or Be Gone
add to del.icio.us. look up in del.icio.us.
add to furl
从为XRuby写代码的经验来看,Annotation真的是一个不错的东西,应用了Annotation之后,代码变得更加干净,XRuby的代码因此就变得清爽了不少。XRuby通过Annotation做了许多代码生成的工作,如果采用手工编码的方式,这些代码没有难度,只有复杂度。重复的代码写起来,只会让人感到繁琐。
XRuby中运用Annotation的方式本质上相当于在做编译器的工作。对Annotation的解析,相当于parser解析源代码,当然,相对于parser来说,解析Annotation要简单得多。之后的过程就是类似的过程,根据前面解析的结果对应着进行代码生成。
在实现XRuby Annotation的过程中,还有一些有趣的工作。比如如何设计Annotation。最初的设计中,RubyLevelMethod有一个type属性,用以标识方法的类型,主要是为了满足XRuby一些优化手段,比如对于无参数和一个参数的方法调用,会做一些特殊处理提高性能。不过,这样的方法通常会有一些特别的签名,这样的签名完全是可以检测出的,所以,实际上这个type属性并不需要,而且,偶尔的误操作(比如无参数方法的type写成了一个参数),还会抛出异常。所以,最终type这个属性被去掉了,当然,这么做需要额外付出一些努力,不过,相对而言,这种努力是值得的。这个问题实际上类似于语言设计一样,哪些东西设计到语言里,哪些部分是隐含可以得到的。
Annotation可以给我们一些提示,通过诸如代码生成等工作,从而把一些操作从原来的硬编码的方式中转移出去,比如事务,AOP等等。我相信,这样会带来一些设计思路的转变,从而更好的进行设计上的划分。更进一步,设计中完全可以加入更多的业务特性,也就会让代码更有DSL的味道。
对比于Java中常见的XML方式,我更喜欢Annotation。首先,它和代码结合的更紧密,这样,在阅读的时候,可以更直观的去理解一些东西,而XML的方式中,秘密都在另外的地方。其次,IDE工具可以很好的联系源码,做一些查找引用某些类的情况就会简单得多。当然,有个问题,每次修改可能都需要重新编译代码,这个问题在开发XRuby Annotation的过程中经常遇到。
InfoQ的Floyd前不久在BEA User Group的活动中谈及企业级Java前景时,提到了他认为几个重要的趋势,包括POJO、IoC(DI),再有就是Annotation。在对Annotation有了更多的了解之后,我认为Annotation是个好东西,只是不知道它的出现是不是有些晚。
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
“ Whosoever knows the folds and complexities of his own mother’s body, he shall never die. ”
First line of Purple America
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
技术信息:Ruby语言和JRuby语言的构建系统AntWrap
- 构建工具AntWrap首页
http://antwrap.rubyforge.org/ - 说明
构建工具AntWrap是一款很有前途的Ruby语言和JRuby语言的构建系统。它已经纳入了JRuby语言的补充开发库。构建系统buildr就是在它基础上开发的。关于buildr的参考资料:【Java语言和(J)Ruby语言构建系统大全】。
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 furlMon 06 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
What’s now commonly called “punk rock” arguably started in New York City around 1974, when bands such as The Ramones and Television took up residence at CBGB’s. However, it was still pretty far underground, and t wasn’t until a few years later that the NYC music scene hit its stride (sparking similar eruptions of audio angst across the States and in the U.K.).
VH1 (oddly enough) is scheduled to show a documentary of those times, NY77:The Coolest Year in Hell
I’m stoked to see this, partly because I was there at the time (so I’m waxing nostalgic), but mostly because my good friend Patty has some film footage included.
This two-part, two-hour documentary tells the story of one of the most astonishing pop culture years in American history. New York City had fallen in decay and chaos. There were not enough jobs, not enough money, not enough police, not enough schools, and not enough social services. There was a city wide black out with major looting, there was a serial killer on the loose, and the Bronx was burning.
Yet out of the chaos, emerged one of the most creative times any city has ever encountered. Hip Hop was emerging from the South Bronx, punk music was emerging from the Lower Eastside, and disco was emerging from Queens and midtown Manhattan. Elaborate, finely crafted graffiti art decorated the subway cars. Break-dancers danced in the streets. There was a huge sexual liberation with sex clubs and a burgeoning porn industry. In the beginning of the year, the world was not paying attention, and most of this activity existed in its own underground bubble. Yet by the end of 1977 all of this artistic expression was about to become part of mainstream America and would remain popular for generations to come. Maybe it would never again be this independent expression, not invented for money or fame, but the need to rebel against the mayhem around them. Maybe it would go on to be commercialized and sterilized for massive consumption. Maybe it would never again be this unique.
I’m trying to be optimistic that it won’t suck too much, and hopefully it will capture the spirit of the day and get the story straight.
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 05 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 furl
I want to thank Derek Neighbors and Integrum for yesterday’s Phoenix Super Happy Dev House . It was a blast.
I also want to thank those who attended; I’m know it was a bit of a drive for many (40 miles for me. Each away. :) ) but supporting these kinds of gatherings is important in bolstering the local developer community.
The demos were outstanding, as were the ad hoc discussions and hacking sessions. I especially want to thank Brian Shaler (yes, THE Brian Shaler) for showing off his Google Gears work and helping me sort out a Gears + Greasemonkey issue I had.
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 04 August, 2007

In der Stufe haben wir ja einige recht aktive Blogger, und man kommt kaum nach mit lesen. Statt alles in mein NetNewsWire zu importieren suchte ich nach einem öffentlichen Feedaggregator und bin dann bei SuprGlu gelandet.
Sämtliche Blogs der Stufe kann man jetzt also gesammelt auf
lesen.
Wer noch andere stufenrelevante Blogs hat, bitte bei mir melden.
NP: Bob Dylan—Let Me Die in My Footsteps
add to del.icio.us. look up in del.icio.us.
add to furl
