Syndicate

OPML
RSS
Atom

ThoughtWorks Studios

ThoughtWorks' Agile Project Management application

I had a painful experience installing these two packages on my Mac. I finally found one forum where someone had posted the same error I was getting and had got an answer for it. It was only then that I headed in the right direction. Hope this helps others who are trying to install these two packages.



First, it's important to check the version of Tcl installed on the system. I don't think the snack available in Active state's Tcl works off the shelf. Active state's versions of Tcl were installed in the /Library/Frameworks/Tcl.framework/... directory on my machine.



I initially tried to debug by checking the auto_path value in tclsh. It was showing the older one of the two Tcl versions installed in the Tcl.framework directory first. That made me think that it must was a problem with the version and therefore, in order to make it point at the newer installation, I set the environment variable TCLLIBPATH to the newer distribution's Resources/Scripts directory. I also copied the latest version of snack into the Scripts directory there. This didn't work. It would say that the file was found but architecture was wrong - meaning something wasn't meant to run on my version of mac os. I'm running Leopard - 10.5.7 BTW.



After several attempts of trying to invoke snack in different ways and in different places, I stumbled upon this link: http://www.nabble.com/tkSnack-td17870514.html. The author of the solution says that the version of Tcl found in /Library/Tcl is the right one. I looked into that and found a copy of snack in /Library/Tcl. Thinking this may be the right way out, I placed this path before the other versions. It still didn't work, although it was certainly looking in the correct place. I was quite frustrated and deleted the other two packages as I would then be sure that it is this copy being invoked and not any other one. No improvement again, I was still getting the same error message:



_tkinter.TclError: couldn't load file "/Library/Tcl/snack2.2/

libsnack.dylib": dlopen(/Library/Tcl/snack2.2/libsnack.dylib, 10): no

suitable image found. Did find:

/Library/Tcl/snack2.2/libsnack.dylib: mach-o, but wrong architecture



It finally worked when I moved the snack directory to /Library/Tcl/teapot/package/macosx-universal/lib. I order to check, I opened wish and typed "package require snack". It returned 2.2; brought me a brief moment of joy and I did my victory dance in the chair itself :). A simple script then played a song to match the moves.



package require snack

snack::sound s

s read victory_song.mp3

s play



I also discovered that snack does not play audio if invoked from tclsh. It needs to be run using wish, irrespective of whether you want a UI or not.



Soon after, I also copied the wsurf1.8 directory from the source distribution of wavesurfer into the above mentioned directory. To check if it was working correctly, I commented out the line:

set auto_path [concat [file join [file dirname [info script]] ..] $auto_path]

in wsapp1.tcl in the demo directory and ran it. It worked!
We are happy to announce the release of CruiseControl.rb 1.4.0. This release adds support for three distributed version control systems - Git, Mercurial and Bazaar - in addition to Subversion.



CC.rb remains easy to install, pleasant to use and simple to hack. Since the source has now moved to a git repository, it is easier than ever to fork and contribute. We're looking forward to your pull requests!



Downloads are available from both Rubyforge and Github.
Some words are more popular than others and using them in spoken language will seem ordinary, however using a rarely used synonym of such words might make others around you raise their eyebrows, run for the nearest dictionary, or in the worst case may project you as show-off who has just recently picked up that word from a dictionary or scrabble game.



While pondering about the effects of such words, in some free time today, I also began to wonder how specific words become more popular than others. It's fairly obvious that such localisation, if I may call it so, happens within groups. The group could be based on geography, profession or any other congregation where its members communicate with each other. What follows are some of my thoughts on the possible sources of popularity of such words and some mildly amusing effects of their usage.



There must be a way in which these words are induced into spoken language. In fact, what qualifies as a general word and what doesn't itself is arbitrary and might depend on the people involved in the conversation. For now let us assume that the group does not involve linguists or people from the literature or arts background and general words as in those which you would use while talking to normal people (excluding the previously mentioned group again). I'm not trying to find out how general words are introduced, since there are incredibly many ways in which people can pick them up. I'm just thinking about those which increase in popularity over a short period of time or restricted to a small group, since it's those which might give an insight into how the "word infection" spreads.



The infection, in the sense that I have attributed to it, may differ in speed and size of population which it affects. I've seen a lot of people, especially of the younger generation, pick up words from movies or TV shows. One such instance I still remember was the word "gob", which most of the students in my class picked up after we saw it being used in movie screening at school. All of a sudden "shut up" had transmogrified to "shut your gob". It faded away in a short span, probably because "shut up" is simpler and shorter of the two. Had it been shorter and simpler, I presume it would have sustained. Students also have a tendency to use words, which their parents or teachers use. I think such propaganda creates a bunch of students, feeling empowered by the addition to their vocabulary and ready to slap those words at others in regular conversation. Whether that group is successful at propagating that word or not is a far more deeper question, which I don't have the capacity to answer at the moment. Therefore, if you are a teacher, actor, parent, or script writer you could contribute to that growth and check if you are capable of injecting a word or two into the larger population.



I also feel that the media, such as TV, radio and online or print newspapers have the potential to reach a large population. For instance, I didn't know what "ombudsman" meant until it was used everywhere in the Indian news a couple of weeks ago. I'm sure if I now manage to somehow use "ombudsman" while speaking to people in India, they will know what I'm talking about and won't think of it as some spiritual word (the "Om" connection). This however, restricts such knowledge to people with access to such news. The induction phenomena can also be observed within groups of people of the same profession. There were dozens of terms we used when I worked as a consultant. So much, that it seemed like we had almost developed our own subset of a dictionary. Terms such as default have become more common thanks to computers and computer professionals. There may be other methods, probably which some social scientist or linguist has studied already, but my tired brain couldn't think of more in a short span.



Coming to the comic consequences of such usage; for me it creates a trigger calling out "what in hell (sometimes wtf) is that". My brain tries to find all possible similar sounding, ending, starting and middle sequences trying to figure out what that meant. When it finally gives up, which is when the speaker has generally finished the sentence, I'll ask what they meant. In some cases, it's been some silly phrase that the person would have picked up from a children's TV program broadcast in the 80's in Australia, which I would have no idea about; Or it would be something which I would really not know. I also recently heard from a native English speaking friend of mine that she got a mail with the term "sagacious" used in it. It was written by a non native English speaker, while she was volunteering in X country. She thought that they must have used a thesaurus to find and somehow introduce a complex word in the mail. However, I know that "sagacious" is used fairly often in India, and might be in common use in country X as well. I'm not sure if the usage was correct semantically, because there's a subtle difference between sagacious and related words such as sensible, rational or sane, for instance, but it definitely shows that it can make you look stupid even if you aren't, well maybe not that much. In some cases, if you use such words, you might just miss the point totally. In one instance, a classmate shouted out - "shut your gob" at another fellow from a different class and ended up explaining what it meant.
Software Development - Art OR Science?



A seemingly clichéd question. Never passed my mind all these years. But let me tell you how I got thinking about this and maybe it'll interest you a bit.



Like I said earlier, I have been following a lot of Lean-Kanban discussions, articles, etc lately. Some such material is Little's Law & WIP limits. Now the moment I saw an equation, I couldn't resist the temptation of trying out some math to see if the size and composition of my current team is optimal. Furthermore, I thought, given a few specifications of the project like domain complexity and technology, could I find the optimum team size and composition?



I hit two forums with this idea and most of the feedback was that there are too many things to consider and difficult things as well like the skills and experience of the people on the team. And I agree that people make most if not all the difference. But that's the problem isn't it?



What's so special about our people? Skills. Experience. Talent even. It's a sign. It's a sign of our industry being immature. I think its in around the occupation stage on this scale.







Enough demand can trigger the Art - Occupation - Industry - Science transitions for any activity. Note that the transition is never 100%. There's Art and Science in everything. The question is whether something is "more of" art OR science.



People keep arguing that Software Development is different. We are not like construction, we are not like assembly line manufacturing, we are not like Product Development either. I used to believe it till a few days back. But the more I think about it the more I feel that these are arguments of a losing population of craftsmen who are finding it increasingly difficult to meet the demand for their craft (which has BTW risen at unusual rates).



Think about the guy somewhere around current Pakistan who created the first piece of leather clothing many hundred years ago. Think about the leather industry right now. Think about the transition. At some point he must be saying "This is different. This needs skills. This needs experience". It took centuries for the transition but it happened. I am sure it can be co-related to the rise in demand for leather products.



The funny thing is, if you look at the list of general characteristics of the Art and Science sides, the first three points on each side don't really fit in with the IT occupation do they? We have loads of unskilled people sitting around producing amazing amounts of useless code all over the world.



So I think the revolution is inevitable. At some point the people who pays us boatloads of money for bad software are going to revolt. We either have to change OR die.



Here's another article roughly talking about similar things. The author anticipated a code market to emerge where reusable components would be bought and sold (which didn't happen OR hasn't happened yet). But the rest of the content is around the same theme as this post.

My English isn't perfect, but if my sole work was writing, I'm sure I would have worked on improving it. While reading today's edition of The Times of India, among the daily list of suicides, murders and accidents, I noticed a column with the title: "Couple ends life". It's sad that they ended their lives, but what I thought about was whether the heading was grammatical. I'm not insensitive, surely there should be more support for people in trouble. I'm not getting into that, I'm just highlighting my view on the grammar.



The word 'couple' is a collective noun and in UK English which has been India's default English, collective nouns are usually referred to as plurals[1]. In contrast, US English has a greater tendency to classify collective nouns as singular. In general they treated as singular or plural depending on whether the action the being performed is individual or collective in nature. In the newspaper article they are referring to the couple in a singular form, since it's followed by the singular verb 'ends'. It could be said that they are performing the same action of killing, but I feel that since 2 lives are lost it should be considered as plural. If they are following the US English grammar, they are wrong again since their spellings are in accordance with UK English.



Another observation, thanks to a quick google search, was that such headings are popular only in Indian or Pakistani news. I'm not sure if that means couples don't kill themselves elsewhere or if there is a more commonly accepted phrase for it in other nations.



[1] http://www.britishcouncil.org/learnenglish-central-grammar-collective-nouns.htm
Once you have your wall in place, it’s time to start monitoring your progress through the project. Best done on a daily basis and best done with a “Finger Chart”. Here’s an example.



A finger chart is basically your wall turned sideways so that your swim lanes are horizontal rather than vertical. Now what you track is the number of stories in each state (finger).



This chart may not make sense to you immediately but there’s a lot of useful data hidden in here. Here are the different inferences you can make by looking at a finger chart.







1) Bottlenecks

The first thing that you monitor on a finger chart is bottlenecks. This is easy. Just check for a band thickening consistently. A band thickening means that there is either a capacity problem or a capability problem in the next band. For example, the BA/QA band consistently thickens a suddenly rises at specific intervals. This is because the Client is signing off the stories only at the end of each week. This may be due to various reasons which need to be investigated to see if something is wrong OR can be made better. The ultimate goal is to achieve a smooth graph.







2) Work in progress

At any given point if you measure the total across all bands vertically, it will give you the total work in progress. This is a total of everything that needs attention from someone or the other on the team. Always try to keep this as low as possible. You should ignore the Celebration State for this calculation.



3) Average Turnaround Time

If you measure the time across all bands horizontally, you get the turn around time for a story. This is a good measure of your entire process. How lean your processes are, how good the team is, how involved and keen the client is, etc. This is what tells you how much time your team needs on an average to turn an idea into working software.



Remember that the finger chart is a cumulative of all stories. Therefore the top line of the graph should never dip down unless you have really reduced scope.



Now whether to track Number of Stories OR Story Points on a finger chart is an interesting debate. I will try to present my ideas on that in another post.



UPDATE : As David pointed out these are called Cumulative Flow Diagrams in the Lean world. Finger Charts is/was more of a ThoughtWorks term.

http://www.kaixin001.com 开心网是中国所有SNS到目前为止最成功的一个。当然其成功的原因有很多,从设计角度,其中一个原因就是“Engaging”,就是说这个产品可以很好的吸引用户并且可以比较好的持续的吸引客户使用她。



自从有了Facebook之后,中国的软件开发者就再一次开始了可悲的模仿。一个个类似Facebook的SNS如雨后春笋一样窜出来,例如海内,校内等。但是他们都没有开心网成功。那么开心网使用了什么办法将自己于区分于其同行呢?



开心网成功的利用了中国人的弱点和欲望将中国用户吸引。看看以下几个例子:





组件 解释
奴隶买卖 利用了中国人2000多年的封建传统的后遗症,梦想统治大众。有强烈的控制和拥有的欲望。
争车位 利用了中国人梦想拥有一部自己喜欢的车的强烈愿望;还有中国人喜欢占小便宜的特点。
买房子

中国人尤其是生活在大城市的“外来人口”多么渴望拥有自己的房子和自己喜欢的装修。现实中不能实现只能在虚拟中实现了
种菜

利用了中国人一间房子,一亩地,两只母鸡,一头猪的小农思想;这里再次利用了中国人爱占小便宜的爱好。很多出生在城市的孩子从来就没干过农活,当然就更不知道如何种菜,养芦花母猪,养鸡等农村常见活动了。这刚好迎合了这些孩子这种喜欢尝试的心理。


当然还有很多组件也很人性化。由于其他SNS之前也使用过其类似的设计,这里就不列举了。可见这种利用中国人性弱点和欲望的设计在娱乐产品中还是成功的一个原因。



June 4th或者说天安门事件一直是西方津津乐道的话题。这是我好多在英国工作的同事说中国没有人权的有力证据。我们先不来讨论事实的真相是什么。姑且听一下这些人是如何得出如此结论的。英国的媒体向来以报道事实,客观而出名。尤其是对本国的事件,由于英国人非常容易理解本国人的文化,思维方式,做事的方式,因此报道往往根据其固有逻辑有理有据。相反在其报道东方的某些新闻或者事件的时候,其西方的这种逻辑生搬硬套到中国的现实当中往往会得出非常片面甚至失实的结论。



自从我03年开始在英国生活以来,收集了大量的来自于西方媒体的关于6.4的真是图像,图片,和一些无法判断真伪的采访报道等等。我的确看到了一些血腥的镜头,看到了肢体接触。但是我没有看到哪怕一秒的中国军队射杀无辜平民或者学生的镜头。更没有看到所谓的解放军开着坦克压过示威者的镜头。我相信西方媒体为了证明其论点会把这种镜头,哪怕只有一秒也会极力广播。很失望,西方媒体并不能拿出任何有力的证据证明6.4是一个政权镇压民主的事件。



这个月4号,BBC播放了纪念6.4二十周年的节目,期间采访了几个在大陆生活的中国人。这些人是这个事件的“受害者”或者其家属。还是很遗憾,关于这些人对当时情况的描述根本无法让我根据常人的逻辑推论出解放军射杀学生的结论。其中一个“受害者”并不是一个学生,更不是参加示威的人,但是他说在那次事件中他失去了半条腿,他用中文陈述了一些前后自相矛盾的“事实描述”,最终他说他最生气的是,政府一直没有让他享受残疾人应该享受的特殊补贴。因此他非常痛恨政府。



同样是观看这个节目的英国人,他们的第一印象都是“中国是一个没有民主和自由的国家”。我们先不来讨论这个论点的真实性,但从这种完全失实的论据就推断出其论点的逻辑也实在是太不靠谱了。



同样是一件事情,一个来中国一个星期的英国人回去告诉他的朋友中国是什么样子。另外一个在中国生活了20几年的中国人告诉他的朋友中国是什么样子。很不幸的是这个朋友往往会相信这个英国人,即使其所说的是带有很多感情色彩的“事实”或者是完全没有论据的论点,他都非常容易被他的朋友相信。相反那个知道事实真相的中国人缺会被认为是一个说谎者。多么不幸。这种现象就是信任歧视。



信任歧视有几种表象:



  • 人类往往更容易相信和自己关系密切的人;而歧视和自己疏远的人。
  • 人类往往更容易相信和自己有着同样或者近似文化,宗教,地域背景的人;而歧视异族,异类。
  • 人类往往更容易相信简单的论点或者简短的论据;而歧视复杂的论点或者有上下文的内容丰富的论据。
  • 人类往往更容易相信约定俗成或者常识;而歧视冷静合理的逻辑分析。


到底是什么原因让很多非常聪明的,或者是受到过良好教育的人错误了相信了不该相信的人或者事呢?原因有以下几个:



  • 感性大于理性:即使是再聪明的人有时候也会头脑过热,不能冷静的思考。
  • 没有完整的逻辑思维的方式和常识:还是有一些人会搞出黑马非马的笑话。
  • 由于涉及个人或者阶级利益而故意忽视论据的上下文。


如何才能避免信任歧视,正确冷静逻辑的判断呢?我想如果你是一个足够聪明的人,你应该已经得到答案了。





… and move to newer dope…

I just realized that I had about 58 eclipse SDKs downloaded on my hard drive and 22 instances of different versions of eclipse. That was a whooping 9GB for the sdk downloads and 6.5GB for the extracted versions. Time to move to newer dope :)

Similar was the case on the cruise based build grid that tested SWTBot from all versions starting from eclipse 3.2 upwards to the latest RC build on all platforms — linux-gtk/linux-gtk-64/win32/macosx-carbon.

Eclipsetasy

Eclipsetasy

I have been reading Stewart Brand's much celebrated book over some time now. Took some inspiration from it for a local KM-community talk on innovation. In particular, I was tickled by his characterization of how ideas spread:

Perhaps culture is driven by just such flea-market ideas in a vast network of uncredited influence.

Replace culture by 'innovation in software' and it still makes perfect sense. Our aggregated blog page is a good example of a flea-market of ideas.



Stewart argues for evolutionary design over visionary design - now where have I heard that before? It seems he once suggested to an architect that he go back to his building to see how the users were finding it. The architect said, "Oh no. You never go back. It's too discouraging." Just reinforces that we need to be on our guard when we choose technologies to build applications. Will the eventual maintainers of the application be comfortable with them? Is the app designed for change? Does the roof (read abstractions) leak?



It's true that construction industry (or any other industry for that matter) isn't a good analogy for software development. In particular, coding is not analogous to construction (compilation probably is). But the life of a building seems to have striking similarities with that of an application. Though buildings are expected to have much longer lives than applications, the total churn that they are subjected to is probably comparable. Buildings are subjected to form-over-function pressures of the marketplace - software apps are less so. Both suffer every now and then from architect hubris.



Wired covered the book long ago. The BBC documentaries based on the book are still available.



Part 1: Flow

Part 2: The Low Road

Part 3: Built for change

Part 4: Unreal estate

Part 5: The romance of maintenance

Part 6: Shearing Layers



There is also a good summary up at: http://www.gyford.com/phil/writing/2004/10/24/how_buildings_le.php


Background: Was just back from uni and still thinking about the best way to include negation and other filter criteria in my modified version of lucene tree search. Was quite sure I had to get back to work soon and chose my fastest recipe for dinner: Mie Goreng with boiled eggs. Mie Goreng is really delicious(yes they really are! :)), fast to cook and cheap as well; can't ask for more :P. Had the radio on and was glancing through a Sunday magazine as I sat sucking up the noodles. There are two soft lamps at the ends of a bookshelf facing which I was seated. By about midway through my meal, the lights had lit up to their full intensity and I noticed the vase on top of the book shelf. The lighting had such an astounding effect on the vase that I suddenly felt like it had just been placed there. Those flowers were more than a week old, so they didn't look that fresh, but it was still good enough and worth capturing. I finished my fast food even faster and ran upstairs to pick up my camera, almost as if the flowers would wilt away any moment. A few tens of minutes of clicking followed and here's one of my unedited shots.




ThoughtWorks' CTO, Rebecca Parsons and Martin Fowler presented (with usual panache) this overview of ThoughtWorks' findings on Google App Engine (and the cloud in general) at Google I/O. Being part of the enterprise track, their talk focussed on enterprise readiness/applicability.



A summary for the busy technologist:



Google App Engine

  1. A reasonable option for a number of applications.
  2. Sets the bar in terms of low barrier to entry
  3. Technical things to consider before taking the plunge:
    1. Testing - development environment not (yet) quite the same as production.
    2. Persistence - Different idioms needed than when persisting to relational databases.
    3. Concurrency - The deployment sandbox is effectively single threaded. A whole bunch of Java libraries that spawn their own threads will need to be ported over before they can be used on the app engine. Moving away from shared memory concurrency is probably good anyway.

Advice for the enterprise

  1. There is a spectrum from infrastructure (Amazon) to applications (Salesforce) with platform (app engine) being in the middle but closer to infrastructure. Domain specific play (statistical analysis cloud) is possible in the space between platform and applications. Of course, considering the venue, the speakers did not emit competing names like Amazon or Microsoft.
  2. Standard potential advantages - dynamic scaling, low entry barrier (therefore low downside risk), pay as you go (op-ex over cap-ex)
  3. Economies of scale (in terms of skilled people and infrastructure) mean that it is much harder to do-it-yourself (private clouds).
  4. Security, privacy and IP - SLAs are ok but not nearly as good as the ability to fire your CIO when things go horribly wrong.
  5. Is it really cheaper? - Unambiguous yes only if you move everything and close down your own data center.
  6. Need new IT org? - probably yes - hopefully one that has better relations with the business.
  7. Vendor lock-in? - probably not much worse than Oracle lock-in.
  8. Other use cases - experiments, spiky one-time computational needs.
  9. This is another of those things that lets you focus on core competencies.
  10. Has the potential to solve the last-mile problem in agile software development - frequent and incremental deployment to production.

A reminder to those following Planet Eclipse that there’s a Galileo DemoCamp in Pune on Saturday, 13th June 2009. Sign up on the wiki page so that the ThoughtWorks Pune office is stuffed with enough food to feed you :P

An Eclipse DemoCamp is a congregation of Eclipse enthusiasts to meet up and demo what they are doing with Eclipse. The demos can be of research projects, Eclipse open source projects, applications based on Eclipse, commercial products using Eclipse or whatever you think might be of interest to the attendees. The only stipulation is that it must be Eclipse related.

Hurray! It rained in Melbourne again today. The Bureau of Meteorology, in one of their reports, have mentioned that the likelihood of rainfall in most parts of Victoria, exceeding the median, is between 40 and 55%, this winter. That said, I know how predictable Melbourne's weather is. For now, I only know that it will rain tomorrow as well, and our rain water tank will collect a few more centimetres of water, which is great. The picture on the left was taken in my backyard, when I ventured to smell the rain drenched mud.
Went biking today morning after almost a month's break. The weather has been bad particularly on weekends for quite a while, and today was no better, but we had decided to go in advance and stuck to it. It was extremely cold when we left at 8 am., making it seem like it was earlier. My toes and fingers had frozen by the time we finished the ride. The ride itself was great otherwise. With my housemate as the navigator, I was quite certain our group wouldn't get lost. A portion of our ride around the Yarra Bend Park is shown in the map. Although I have been on the Yarra Trail several times, today's ride was different because we passed through Fairfield and Alphington. The quiet and narrow roads, lined with old houses there, make it a great place to ride.
Gmail is interestingly smart. I always hated when gmail pops up the question "Send this message without text in the body?". But recently I discovered that the question can be suppressed by adding the end of mail slang <eom> to the subject line.



A time saver.

There’s a joke about maven downloading half the internet. Apparently p2 talks to the other half maven does not download.

Earlier you’d go get a coffee every time you clicked the eclipse update manager. With the eclipse servers taking a beating and download speeds really going slow you better grab lunch.

But wait there’s another nifty “hack”: Don’t talk to the eclipse servers.

To make the p2 update manager faster (assuming you aren’t downloading from the eclipse mirror sites):

  • Edit your hosts file (/etc/hosts or c:\windows\system32\drivers\etc\hosts)
  • Add a fake alias for the download server:
    127.0.0.10 download.eclipse.org
    

Open the update manager again, enjoy the amazing speeds, remember to remove the line if you indeed want to talk to the eclipse servers.

It's been years since I blogged. I'm off to a fresh start now and have cleansed my previous posts. Starting afresh is the way to go when previous posts seem irrelevant. However, I do acknowledge that relevance is subjective and might vary over time. The blogs I write now may seem odd if I read them a few years later. That said, I didn't have the same realisation when I wrote my previous posts and hence feel justified to delete the old ones.
Some time ago I'd written about how Twitter's descriptions of their own codebase made my hackles rise.



I wasn't alone in this, and one discussion thread on the internal ThoughtWorks dev list later we had some hard numbers extracted from all the Ruby work we've done or are doing.



Martin's put them up on his bliki - take a look. There are the numbers to back the talk - you don't need type checks all over your codebase in Ruby (or any other dynamic language), Alex Payne's opinion notwithstanding.

You can download the latest and greatest from the SWTBot download page.

A listing of some of the new features available:

Bug 263036 – SWTBot finally has an icon that was missing since two years!

Bug 269919 – Added support for toggle buttons

Bug 271246 – Better support for handling editors. This should serve as a good start towards providing support for multipage, forms based editors

Bug 271132 – Using Display#post() to support sending native click events instead of fake events. This is still work in progress and not all widgets support native events yet.

Bug 273624 – Use native keyboard events for typing. SWTBot currently defaults to using AWT robot. SWT’s Dispay#post() is available as well — it is however buggy across platforms and swt versions. Since SWTBot uses native keyboard events, it needs to understand various Keyboard Layouts.

Bug 267189 – Support capturing screenshots of widgets.

Bug 277093 – Support for Link widgets.

There are also a lot of minor bugs that were fixed in this release.

Monday morning excitement. JUnit tests that pass in the IDE fail in ant and cruise servers running on all platforms.

java.lang.AssertionError:
Expected: a string containing "... text=Ç..."
     got: "... text=Å..."

My immediate reaction was the encoding used by the JVM. Setting the “file.encoding” system property to UTF-8 did not help. Running the ant based tests in remote debugging mode also confirmed that the two strings were indeed different.

Since the tests used Cobertura for code coverage, the next step was to disable cobertura. Cobertura manipulates the generated byte code to add logging statements for code coverage. Still the same error.

The hidden gem seemed to be the -encoding java compiler flag. Setting it to UTF-8 fixed the problem.

So the next time you have something fail because of an encoding issue, it could just be the compiler encoding and not just the encoding used in the runtime!

On Friday night at work, some of us were discussing our plans for the weekend. I mentioned that I'd visit I2IT - a college in Pune - and give a presentation on OpenSolaris and ZFS to the students. Ever on the watch for a chance to showcase ZFS, I gave my colleagues a quick demo on ZFS.



We had a look at creating a snapshot, deleting files, and then recovering files from the .zfs folder as well as by rolling back to the snapshot. I also cited some disk performance numbers (5 mins for a full SVN checkout of a particular project on my laptop, vs 30+ mins for others who use Windows on the same laptop model). I also mentioned the notion of pools, of how one can transparently add storage, etc.



I will be showcasing ZFS sometime this week to the entire office.



While we were leaving, my colleague remarked "ZFS is the most amazing technology I've seen in recent times".



Reflecting on it a bit, I couldn't agree more !
Here is a useful link that helps explain Cloud Computing : http://industry.bnet.com/technology/10001746/fog-is-lifting-on-cloud-computing/



The Open Cloud Consortium has as list of software related to Cloud Computing. There may be others too.



According to the statements on Sector listed at that page, Sector is supposed to be twice as fast as Hadoop .



Though I consider myself too old to understand the medium, I'm intrigued by the effort needed to keep Facebook running. Facebook's cloud computing related software, called Thrift , is available for download too.



Matt Asay asks Cloud computing: A natural conclusion of opensource ? . This is an informative read, because Matt provides perspectives on how users are no longer interested in the underlying technology, but in how they access that technology, and how inter-operable the data is.
My roommate is excited about opensolaris. Being a .NET developer, he wished to help create a mono package for Belenix. While I walked him through an exercise on building mono from source, I realized that we had a "broadband" line which gives us just 20KBps. While trying to get mono to build (we've not done this yet due to a corlib.dll version mismatch with mcs), we had to wait a while for mono and for monolite to get downloaded.



Yesterday, I'd presented on Belenix and ZFS at a local college I2IT, and had fallen short on DTrace and Zones demos. My custom Belenix installation has a broken zones config, and I've not made time to learn to write DTrace scripts.



I also learned that it is impossible for the students of I2IT to download the Belenix ISO, or any of the tools and software that one could run on. Though they have a Sun Campus Ambassador who is doing a good job, he can only distribute what he receives as part of the ambassador program. Anything more, and the students have to fend for themselves.



All opensolaris evangelists should have a good collection of demos for various topics, familiarity with the various topics that they are going to demo, CDs/DVDs to give away, and learning material (or at least a printout of URLs that people should visit - in case you run out of CDs/DVDs).



Expecting people to download content is unrealistic - they may not have the bandwidth, and the sheer chore of having to download something could be a deterrent. This is a reality in India, and when we evangelize, we need to have various tools ready and available on distribution media.



It may be worth having a demo CD all by itself, in case the basic Belenix CD does not have space. An alternative to consider would be having DVDs.



Here are some demos that I think we should have, along with the requisite software where possible.

- Entertainment, Games, Graphics tools, OpenOffice

- Communication Tools (IRC, Browsers, streaming-content servers and clients, file download tools, Skype in a Linux Zone, Jabber, etc). See note below on Skype.

- Web app stacks

- Wine for running Windows apps, along with some free Windows apps

- Development Tools

- Using opensolaris tools to solve college assignments, and to understand subjects better.

We could have sample code that illustrates a topic, and DTrace scripts that helps the programmer see how the code behaves on a running system. This would be a very useful demo, imo.



A lot of the above is already available thanks to the efforts of the opensolaris community, the various blogs, and the documentation team. The next round of work would be to collate all this together, improve where necessary, and to create DVDs. There'd be a lot of testing too.



The creators/communities of the various tools would be a good group to source demos from.



Along with all this, we should also have instructions on setting up a local mirror, a DVD of the Belenix repository which could be used as the seed for the local mirror.



Note on Skype redistribution: We're allowed to re-distribute Skype, provided we send them an email, and comply with various conditions there ( a bit of a task, but can be achieved).

http://www.skype.com/intl/en/legal/promote/distribute/

http://www.skype.com/intl/en/legal/promote/materials/

Would it be legal to setup Skype in a zone and distribute that ? We should find out.



Note on Sun Studio Redistribution:

We need to have an answer once and for all - Can the excellent Sun Studio Compilers be redistributed by non-Sun distros ? We've initiated conversations by have not followed up on them.
Amey and I presented on opensolaris at Pune yesterday. Amey has put up a report here



Here's my own analysic.



What went well:

- Rapport with the audience



- ZFS demos

In my experience with showcasing opensolaris, ZFS alone sometimes convinces people that opensolaris should be considered seriously.

To Sun's ZFS team: I hope to do you proud with even better ZFS demos !



What didn't go well:

- Some students "forgot" that I'd mentioned that Belenix was a first class KDE 3.5.x environment.

They wanted to know at the end how Belenix compared to a KDE environment. I blame myself for such questions, since I should have established beyond doubt that Belenix has just about everything that a KDE environment has to offer.



- I forgot to prepare and take along Belenix CDs :(

I was simply flooded with work, and am anyway guilty of not managing my time well.

Now that I'm used to a 10 Mbps line at work where ISOs are downloaded within an hour or so, and because I know that I2IT is a premier institution, I assumed that the students would be able to download the Belenix ISO themselves. They told me that this was not possible given that they had limited bandwidth at college and that they had to go through a committee for anything over 30 MB in size. This excludes even GParted, btw, which is over 30 MB in size.

This made me realize that if I get used to having high-speed bandwith despite being an Indian staying in India, it is unrealistic to expect the IPS team to understand that the world cannot download lots of content all the time.



Future Directions:

- Emphasize how Belenix is a first class KDE environment.

Talk to the KDE evangelizing team for ideas here.

Mention how the next version of Belenix could set the gound for opensolaris being _the_ KDE platform of choice.



- Different presentation styles for students vs working professionals.



- Demos, demos, demos

This needs a separate blog post by itself.



- Have CDs and the opensolaris Learning Guides ready for use.



Bottom line: Be prepared.

All merchants online know pricing is absolutely critical to their bottom line. Plain discounting of products seasonal or in general is a merchandizing skill that is learned by all merchants when they’re trying to push sales online. Given the ease with which prices can be compared from one store to another and the popularity of price comparison engines. It is imperitive for all merchants (big and small) to understand how to price their products effectively to ensure that consumers purchase and “stick”.

The way you set prices doesn’t just influence demand it also effects consumption: ie. the extent to which your users actually use your service or you products that they’ve paid for and if they come back for more.

Let’s take this example: 2 friends: Jill and Jane get a membership to a local gym. Jill gets a monthly membership at 100USD/month and Jane pays a 1000 USD for the yearly membership upfront. Now, fast forward 6 months later: who is more likely to remain committed to their exercise schedules? Given the motivations of both J’s is the same, there is a higher likelihood that Jane (yearly membership) drops off her regimen first. Psychology tests have shown that Jane in an attempt to extract the most value from her higher one time payment will peak at a certain time and stop exercising as frequently at the gym. Jill on the other hand continues to use the gym and is happy with the value that she is gaining from her purchase. Jill eventually sticks on with her monthly plan for another 2 years at the same gym.

The lesson learned above is that not only is it critical to price correctly so that you target the Jill’s of the world to purchase today, but, it is also critical to make these one time buyers “stick”. Whether it is a one time purchase of a chair online or a discounted golf club bought online it is important to price correctly for “that” consumer and personalize the visit to an extent that the consumer has subliminally been affected positively.

The first and foremost step in this process is to “price correctly“. To effect the behaviour of the user positively a simple dumb discount that treats all visitors alike is just not going to cut it. This is the precise problem we’re tackling at Runa: understanding how to enable merchants to make better discounting decisions in real time for individual consumers that visit their sites and to increase lifetime value of these customers while at the same time maximizing their profit margins.

I’ll be writing about some basic techniques on how simple dumb discounting can help your bottom line and then provide some measurement of how you can further optimize this $ value by using Runa’s SaaS campaigns (I’m talking about a 200% increase in profit by using Runa in some cases :) ).



This post summarizes my series on fallacies of knowledge management.

  1. Well begun is half done, so let's begin by collecting content
  2. Repositories ensure that knowledge lasts longer than employees
  3. Good organization is key
  4. Access Control is Key
  5. Make it easy to import and attach documents
  6. Put usable tools in place, adoption will follow

Plug: If you think your organization could use some help on KM, feel free to reach out to us.
Made in China是价格便宜的代名词。很多科技含量低,低附加值的东西都是中国或者亚洲小国制造的。如果人们谈论日本制造,德国制造,美国制造或者英国制造,就不会有人和价格便宜联系起来。价廉固然重要,但是物美才是核心竞争力。LV的包包不便宜,但是还是有很多人买。



其实用“制造”来形容一个国家的产品并不完整。制造只是将一个设计利用一种或者几种工艺制作成实际产品。“设计”才是一个国家或者民族的精髓。日本制造给予消费者的第一印象是高科技,人性化,精妙,质量好并且价格合理;英国制造则是以高贵,奢华,经久耐用,出色的工程制造为名片;德国制造不必多说了,自然是严谨,质量性能极高,可靠;美国制造倒是比较多元化,高科技,简洁,有气势,强劲。



每个国家的设计制造其实代表了其民族的个性,并且及其鲜明。这让我及其困惑的是中国制造的特点是什么呢?中国的民族特点是什么呢?我google了一下"Chinese car design",找到了这样一个链接[http://www.carkeys.co.uk/news/2008/january/17/14506.asp],如果这是世界看到的中国设计,那实在是太可怕了!!!这完全是精神病院里边跑出来了几个搞了这么几个脑袋撞了大树之后出来的东东。看看刚刚上海车展的北京制造,也实在看不出什么民族特点来。



我来伦敦生活后就去了所有我感兴趣的博物馆,尤其是和设计相关的博物馆。直到有一天我看到了一个叫做龙马奔腾的玉雕被其的精巧深深的震撼了。想起在博物馆展出的大多数中国展品大多数都是以精巧和匪夷所思使其与众不同。或许这就是中国制造应该有的精髓吧。当然质量是任何制造都不可或缺的。希望不久的将来能看到中国的产品能真正代表中华民族的特点而畅销全世界。



首先要做的事情就是“停止模仿”。你可以借鉴甚至是高价购买别人的先进技术,别人的制造和管理方法,但是完全没有必要抄袭别人的设计啊。如果你是一个有思想,有文化,有创造性的民族为什么不创造呢?很期待中国的70年以后出生的人能改变这个非常羞耻的现实。

The effort of running a typical KM initiative almost makes us want to believe that mass adoption will follow. Unfortunately, Ms.Adoption is not easily wooed. The launch of these initiatives are usually broadcast via company wide email. An increasing percentage of employees seem to be immune to such broadcasts (for good reason?). The early adopters, a smail percentage, use it for a few days and then their activity begins to dwindle. Adoption proceeds at an uneven pace and sometimes fails to reach critical mass needed for positive network effects. A year later, it's time for yet another initiative.



There are often genuine reasons why adoption doesn't take off. For example, the applications may not be easily accessible outside the company intranet. Or the applications may be slow to access from remote offices. Maybe people are just overworked. I am begining to wonder if there is another factor at play. I have observed it on the web and I suspect similar forces are at play within the enterprise: poor citizenship. Too many of us prefer to be passive consumers of public content on the internet. We don't produce or perhaps more importantly, curate existing content. Granted, there are some prolific producers of mediocre content via blogs, comments, tweets, and posts to public mailing lists or discussion groups (and a few prolific producers of really good content via the same channels) but they are more the exception than the rule.



Some examples of poor citizenship with respect to curating content:

  1. Not clicking "I found this review helpful/unhelpful" on a website that carries reviews (e.g. Amazon) or "This documentation was/was not useful to me" on a website that actively solicits feedback on documentation (e.g. many of Google's help pages)
  2. Not adding appropriate tags to images found on Flickr

  3. Not posting answers to unanswered questions that you ask in a public forum and later figure out the answer/workaround for.
  4. There are times when programmers struggle with a cryptic stacktrace at work and a web search points them to the exact cause. All because someone took the effort to blog about that issue. You often see a number of grateful comments at the bottom of such posts. Yet, when I overcome such a problem by myself, I seldom try to write a post about it.

It's not like we don't do it because we are against digital sharecropping. It might be that trying to be a good cyber citizen leads to yak shaving. I suspect that at least some it just boils down to a I-can't-be-bothered attitude. This attitude has tragic consequences for commons like public forums and wikis. Not many people seem to want to take the effort to contribute. But a system that fully relies on user generated content cannot succeed in the face of indifferent users. To some extent, cultural legacies determine our ability to effectively participate in a system that more resembles a gift economy. Incentive systems may help with adoption but they need to be tailored to the specific dynamics of the user community. All in all, adoption is a tough nut to crack.
世界上最受欢迎的classic music super star是谁?当英国的媒体大肆宣传这个只有26岁的钢琴家的时候,你可能会想郎朗为什么会如此受欢迎。4月14号到19号这一周郎朗在伦敦举行的4场音乐会和一场专访。我有幸到现场倾听了三场音乐会并且参加了LSO对他的专访。



感染了,郎朗的音乐,郎朗的表演实在是无与伦比。往往是每段演奏结束后几秒中之后才是满场的掌声,因为大家都还都沉浸在乐曲之中。我的语言能力是无法描述其音乐的动人和精彩。这让我想起初中语文课本《绝唱》(节选自《老残游记》)中一段对艺人王小玉的表演。英国女王和Philip亲王曾经问郎朗,你手那么快没有把钢琴弹碎啊?郎朗在弹奏黑白相间的琴键如同一双手在一个二八少女的侗体上不断的游走;悠扬的琴声好像是少女的呻吟;其中的美妙实在是无法形容。



人人都说郎朗的双手多么“昂贵”,其实真正昂贵的是郎朗的智慧;一个26岁的男孩英语非常流利,并且很擅长用其有限的英语能力给予很多提问非常精彩的解释。



郎朗是一个非常典型的80后,个性鲜明。当大家要求与其合影的时候,他不断的做着鬼脸;摆各种pose,多动的性格都非常有趣,完全是一个没有长大的男孩。



郎朗的成功是一个优秀商业团队的包装。郎朗改变了人类对严肃音乐的印象。不再严肃,而是充满激情!郎朗的每场音乐会都是富有个性的表演,而不是单一的钢琴演奏。















Although I am not in the thick of things right now (because I am onsite, alone, so far away from my team) I follow the very active kanbandev yahoo group. It's a great resource for thoughts and questions on lean and kanban software engineering.



David Joyce, a group member, posted about a presentation he gave and I found it really good. So here's the presentation for anyone else interested.



It's definitely a long one but take some time to go through it.



Good stuff David.
I came across this discussion on the lack of really private methods in Python. Time and again, some of us feel violated that a method that is supposed to be private is somehow accessible to callers (via permissive reflection or otherwise). However, this reaction misses the point of encapsulation.



Encapsulating an object is not about protecting (or securing) the said object. If you must think in terms of protection, then it is about protecting the consumers (callers) of the object. Encapsulation is about freeing your consumers from the knowledge of your implementation details. By doing so, you insulate your consumers from any ripple effect of changes to your implementation.



The term 'access qualifier' for describing public, protected, private doesn't help. Something like 'visibility indicator' might help avoid the notion of access protection.
One of the many things I enjoy taking care of as a sysadmin are the SVN repositories at our Bangalore office. These are large repositories, and have three known mirrors, one NFS share where each commit is incrementally dumped, as well as a secret mirror that no one else knows about ;)



Here are the steps that I follow when setting up an SVN mirror. I'll later post information on problems that one faces when setting up and maintaining SVN mirrors.



Very, Very, Important: When committing to an SVN mirror, you need to use TortoiseSVN 1.5.0 and no later. Any later revision may work, but may break during certain tasks. There is no such problem when committing to the main SVN server.



How SVN mirroring works (in a nutshell):

Users connect to mirror servers. mod_dav_svn serves content from the local system, and sends commits to the main server. The main server's post-commit scripts use svnsync to push commits to the mirrors via a protected URL that is writable only from the main server.  



My instructions include integrating with LDAP on an Active Directory server.



Install CentOS 5.2 (I've tried FC8 and Ubuntu, and they have some wierd issue or the other with SVN mirroring. Nothing that I can definitely point out).

Uninstall all SVN the comes with the OS

Install Collabnet SVN client binaries

Install Collabnet SVN server binaries

symlink /opt/CollabNet_Subversion/bin/ into /usr/bin



Include the following httpd fragment on the main server's httpd.conf file. You could Include another file containing the following, too. This is what I do.



LoadModule dav_svn_module /etc/httpd/modules/mod_dav_svn.so

LoadModule authz_svn_module /etc/httpd/modules/mod_authz_svn.so

<Location /someproject>

                DAV svn

                SVNPath /repos/svn/repos/someproject

                AuthzSVNAccessFile /repos/svn/access/someproject/svn_access.conf

                AuthType Basic

                 AuthName "Active Directory LDAP Authentication"

                AuthBasicProvider ldap

                AuthzLDAPAuthoritative off

                AuthLDAPBindDN user@adserver.thoughtworks.com

                AuthLDAPBindPassword somePassword

 AuthLDAPURL "ldap://adserver.thoughtworks.com:389/ou=Principal,dc=Corp                                                                            orate,dc=thoughtworks,dc=com?sAMAccountName?sub?(&(objectClass=user))"

                require vaild-user

SVNPathAuthz off

        </location>





/repos/svn/access/someproject/svn_access.conf

-------------------------------------------------------------

can_write_group=aduserA, aduserB,aduserC

read_only_group=aduserD,aduserE,aduserF

no_access_group=aduserG,aduserH,aduserJ

[repository:/]

@can_write_group=rw

@read_only_group=r

@no_access_group=



Create a repository as follows:

svnadmin create /repos/svn/repos/someproject

change permissions as follows

chmod -R g+w /repos/svn/repos/someproject

chown -R apache.apache /repos/svn/repos/someproject



symlink the collablnet svn modules



ln -s /opt/CollabNet_Subversion/modules/mod_dav_svn.so /etc/httpd/modules/mod_dav_svn.so

ln -s /opt/CollabNet_Subversion/modules/mod_authz_svn.so authz_svn_module /etc/httpd/modules/mod_authz_svn.so



reload httpd

    service httpd reload



On the mirror server:

Follow instructions as above.

Modify the httpd Location to become

                DAV svn

                SVNPath /repos/svn/repos/someproject

               SVNMasterURI http://svnserver.thoughtworks.com/someproject

                AuthzSVNAccessFile /repos/svn/access/someproject/svn_access.conf



Also include the following snippet:

<location /someproject-sync>

   DAV svn

   SVNPath /repos/svn/repos/someproject

   Order Deny,Allow

   Deny from all

   Allow from svnserver.thoughtworks.com

</location>



cat > /repos/svn/repos/someproject/hooks/pre-revprop-change << EOF

#!/bin/bash

exit 0

EOF



chmod +x /repos/s



Reload the httpd server

    service httpd reload



Now, back on the main svn server



- initialize the SVN mirror on the mirror server



svnsync init http://svnmirror.thoughtworks.com/someproject-sync http://svnserver.thoughtworks.com/someproject



Edit the post-commit hook to contain the following:

svnsync sync http://svnmirror.thoughtworks.com/someproject-sync --source-username read_only_user --source-password valid_password



You can now either let the next post-commit update the mirror at one shot, or transport the data yourself and then update the mirror's metadata.



To populate the mirror automatically, simply commit to the main server once.



Populating the SVN mirror manually to seed it with data is the preferred approach, especially when the mirror is at a remote location.

Note down the properties of the mirror server

svn pl --revprop -r 0 http://svnmirror.thoughtworks.com/someproject-sync

Unversioned properties on revision 0:

  svn:sync-from-uuid

  svn:sync-last-merged-rev

  svn:date

  svn:sync-from-url



Get each property:

svn pg svn:sync-from-uuid --revprop -r 0 http://svnmirror.thoughtworks.com/someproject-sync

svn pg svn:sync-last-merged-rev --revprop -r 0 http://svnmirror.thoughtworks.com/someproject-sync

svn pg svn:date --revprop -r 0 http://svnmirror.thoughtworks.com/someproject-sync

svn pg svn:sync-from-url --revprop -r 0 http://svnmirror.thoughtworks.com/someproject-sync



1. Export the svn data

Assuming the latest revision is revision 32478 (an excellent case for populating data manually)

svnadmin dump /repos/svn/repos/someproject -r 1:32478 --incremental | gzip -9 > someproject_1_32748.gz



2. Transfer the file to the mirror server

scp someproject_1_32748.gz user@svnmirror.thoughtworks.com:



On the remote server:

3. Extract the archive file

gunzip someproject_1_32748.gz



4. Import the data into the repository

svnadmin load /repos/svn/repos/someproject < someproject_1_32748



Back on the main server

5. update the mirror repository's sync-last-merged-rev property

svn ps svn:sync-last-merged-rev  32748 --revprop -r 0 http://svnmirror.thoughtworks.com/someproject-sync



6. Ensure that everything's fine

svnsync sync http://svnmirror.thoughtworks.com/someproject-sync



If you face any problems, reply to this post and I'll see how I can help with my own experiences on solving those problems :)



Once I get SVN 1.5 based mirroring to work on Solaris 10, I'll post about that too. In my opinion, Solaris 10 + ZFS should be the best bet for SVN servers and mirrors, because there are some problems that even having a mirror will not help you solve quickly.

Some such problems are:

- what if the ext3 file system goes corrupt (I just dealt with a corrupted ext3 file system on an RHEL 5 box this weekend).

- what if someone makes a dangerous commit and you need to remove that commit before anyone else checks it out ?

  one example would be checking in a massive delete/folder structure by mistake

  another example would be checking in an infected file

  yet another example would be checking in installers into the repository.

If you need to roll back quickly, you can do so if you have ZFS snapshots per post-commit, but not with other filesystems. With other file systems, you'd need to go through the painful steps of dumping all the commits, importing in data upto (but not including) the poison commit, and then pointing users to that repository.



A alternative would be to have another repository which is updated once every twenty commits or so. You would then have the opportunity to selectively push in commits and to then drop the most recent bad commit.



The best would of course be to use Mercurial and to ditch SVN altogether.  This is not always feasible, though.

I'm told that there aren't adequate tooling to support Mercurial in Windows as much as there are for SVN. Next, our customers may be averse to moving to (and asking their other vendors to move to) a new tool (we should ask, though).
One blog post that I read just now is "Complexities of APIs" where Ketan observes how a service locator gets in his way.

Jruby-in a jar already bundles rspec and rake, so the goal was to find out where it gets packaged.

Download the jruby source zip, extract it and open the build.xml file, search for “rspec” (there’s two occurences) and you’ll find that it’s passed in as an argument to the gem installer, add in another line with “cucumber”:

<target name="install-gems">
  <property name="jruby.home" value="${basedir}"/>
  <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
    <classpath refid="build.classpath"/>
    <classpath path="${jruby.classes.dir}"/>
    <sysproperty key="jruby.home" value="${jruby.home}"/>
    <arg value="--command"/>
    <arg value="maybe_install_gems"/>
    <arg value="rspec"/>
    <arg value="rake"/>
    <arg value="cucumber"/> <!-- add cucumber -->
    <arg value="--env-shebang"/>
  </java>
</target>

Then run ant:

$ ant jar-complete

To verify that everything is fine:

$ java -jar lib/jruby-complete.jar -S gem list

*** LOCAL GEMS ***

builder (2.1.2)
cucumber (0.2.3)
diff-lcs (1.1.2)
polyglot (0.2.5)
rake (0.8.4)
rspec (1.2.2)
sources (0.0.1)
term-ansicolor (1.0.3)
treetop (1.2.5)

Great we’ve now managed to package jruby-in-a-jar with some additional gems. Now to run cucumber on jruby in eclipse.

Fredrick recently asked on the swtbot newsgroup:

My goal is to be able to write some user acceptance tests (using Cucumber) to be able to tests some of my Eclipse plug-ins.

Cucumber is a BDD framework written in (J)ruby. It executes plain text files as functional tests. As a first step, the goal was to be able to print a simple ‘hello world’:

This required being able to bundle jruby with the necessary gems, the jruby jar is already OSGi-fied, so creating a manifest was not required.

First drop in the jruby-complete.jar that we just created inside the target eclipse’s plugins directory.

Then create an eclipse application with the following in it:

public class CucumberRunner implements IApplication {

    public Object start(IApplicationContext context) throws Exception {
        Bundle bundle = Platform.getBundle("org.jruby.jruby");

        URL jrubyHome = FileLocator.toFileURL(bundle.getEntry("/META-INF/jruby.home"));

        RubyInstanceConfig config = new RubyInstanceConfig();
        config.setJRubyHome(jrubyHome.toString());
        Ruby runtime = JavaEmbedUtils.initialize(new ArrayList(), config);
        RubyRuntimeAdapter evaler = JavaEmbedUtils.newRuntimeAdapter();
        evaler.eval(runtime, "p 'Hello, Eclipse World'");
        JavaEmbedUtils.terminate(runtime);

        return EXIT_OK;
    }

    public void stop() {
        // do nothing
    }
}
Hello, Eclipse World

Hello, Eclipse World

Now all we needed was to be able to execute the cucumber executable instead of printing hello world :)

Import the cucumber plugin with a sample calculator to execute it:

Cucumber Output

Cucumber Output

One lesson that I have realized the value of is "Try to learn from others' mistakes".



One such mistake that I hope to not make myself is that of not delivering when I have the best at my disposal - A great management, hard working colleagues, a positive environment, a patient boss, and the opportunity to take us to the next level.



I really hope that I never have to write a mail like Jonathan did, when the entire Sun board had amazing engineers in the world, but could not make it's marketing team deliver - A marketing team which comprises of people who will waste your time criticizing the Linux kernel instead of focussing on Solaris' advantages. (The two persons I've communicated with in India were different, though).



I read a discussion thread recently where an ill-informed person commented that Sun has dumped code on the world and that it's not really an open source leader. We who know and love Sun know better. I didn't argue with him, because here too, one needs to blame the absence of marketing and brand imaging building.



It takes courage to call a spade a spade, and Ben did a good job of this.
A large number of OSX users will be able to demonstrate to you that OSX improves their productivity a lot. Though I don't know a great many of my customers whose productivity has actually improved, there are a limited number of OSX power users I know, and when I see them at work, I am convinced that OSX is good for them.



However, what most people do not know is the horrible hell that sysadmins have to go through when it comes to supporting the Apple hardware platform.



Our problems are with the warranty, the absence of any insurance policy, and the high price of Apple hardware.



Unlike with Dell hardware, you don't get comprehensive warranty with Apple hardware. You need to prove that the defect that you are facing on Apple hardware is a manufacturing defect, else you need to pay money from your pocket. If you were to accidentally drop your laptop and the case were to get cracked, or if the security fellows at the airport mis-handled your lugguage and the display were to crack, your further experiences would be different depending upon whether you had a Dell laptop or a Mac. With a Dell, you can get a same or next business day replacement if you paid for such a plan (At Thoughtworks, we pay for such a plan).



With a Mac, however, there is no such plan to pay for.



At least in India, no Insurance company is willing to insure Mac hardware, though they have no problems with Dell hardware.



For the price of Apple's hardware, you can get far, far more if you were to opt for a Dell unit, or at least get the same features at a lower cost if you were to opt for Dell.



Note: I'm mentioning Dell here because that's the only hardware that I support and can compare with. My colleagues tell me that other brands are comparable or better than Dell (notably, Toshiba, HP and Lenovo).



Note to all OSX fans: this is a post by a sysadmin about the warranty and replacement problems with Mac hardware, and not about OSX the Operating System which is well engineered, and which I have some amount of respect for.
An educational read -> http://www.jroller.com/habuma/entry/a_dozen_osgi_myths_and
Ever since I become a sysadmin at Thoughtworks, I've helped the Studios marketing ensure that the product launch happens successfully.



For those who don't know, Marketing created the demand, while Sales turns the leads generated from Marketing into concrete sales.



Each product launch or release has been educational and adventurous. It fun to get a new set of web pages live, and to then watch the httpd logs and find out who's navigating the site at a particular moment.



The Studios Marketing team are like a company by themselves - they decide the targets, then go aim for those targets. There is tremenduous positiveness, a "we can achive" spirit, and the motivation to do a lot of hard work. I intend to complete my present marathon bout of work to go help our Marketing folks with more stuff.
http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a00807dac5f.shtml



That was a highly visited link at cisco.com during the past few months.



I've been really busy creating failovers for just about everything (we have three active SVN mirrors + an S10 based NFS store that gets incremental revision dumps.. Yay!), and now my attention has moved toward the Cisco devices.



Being sysadmin is a fiduciary responsibility - your company, colleagues and customers trust you to do the right thing.



There's so much that we've accomplished, but I've nearly zero time to blog about it all. I intend to complete putting systems in place and setting up failovers for just about everything, and will then hopefully have time blog.
In order to migrate legacy content, one might resort to importing or attaching old documents into a newly fangled KM repository. This is a slippery slope. Importing/attaching becomes a crutch for users who are just too lazy to get used to authoring content in-line (using rich text editors). They continue to author all documents off-line. So what? Is there is a problem?



As Google has so successfully demonstrated, it is often the hyperlinks between documents that are more valuable than the documents themselves. Imported/attached content almost always lacks relevant hyperlinks to other documents in the repository. They hang about like dead limbs of a tree. What is worse, the offline versions often aren't discarded after import. They continue to evolve offline, unbeknownst to other users. They get attached to emails and soon no one cares about the orphaned version in the repository. The Google docs video captures this sitution well.







But of course, we love the power of our offline office tools and will continue to have powerful spreadsheets and presentations created using them. Sure, just don't tack them on as appendages to the one big repository. There is another repository better suited for offline content. It is called a file server. Better yet, use a web-enabled version control system backed by a file server. This gives us permalinks to the latest version of every document. Get them indexed by an enterprise search product. Oh, but our users aren't version control savvy. Come on. It takes fifteen minutes of training to understand update, add/edit, commit. After all, we all claim to be organisations of savvy knowledge workers, don't we?
Ever heard a code-smell in a conversation? Like this guy is giving you gyan about how he's doing x in language y and it's such a pain in the ass, and you're thinking to yourself "x is such a darn stupid idea in the first place," know what I mean?



The reason I bring this up is because this interview with some of the Twitter hackers came up on the ThoughtWorks software dev mailing list today, and it smelt faintly of cowpats so I thought it worth a mention.



Most of the interview is fairly quiet, sensible stuff; you're ambling along going 'Ho, hum, mildly interesting...' and then something fearsomely ignorant bumbles out and gores you someplace delicate. Here's an example that got pointed out:
Alex Payne: I’d definitely want to hammer home what Steve said about typing. As our system has grown, a lot of the logic in our Ruby system sort of replicates a type system, either in our unit tests or as validations on models. I think it may just be a property of large systems in dynamic languages, that eventually you end up rewriting your own type system, and you sort of do it badly. You’re checking for null values all over the place. There’s lots of calls to Ruby’s kind_of? method, which asks, “Is this a kind of User object? Because that’s what we’re expecting. If we don’t get that, this is going to explode.” It is a shame to have to write all that when there is a solution that has existed in the world of programming languages for decades now.
Aargh. Aargh, I say. I would freakin' bust someone who wrote object-oriented code with is_a? or kind_of? in it, and here's this laddie out on the world wide internetworks proudly admitting that his people write that kind of code. nil checks everywhere? The solution to that has been around for ten years now, for crying out loud. Hasn't anyone told them this kind of code is a people problem, not a language problem?



Here's another bit that seemed suspicious:
Alex Payne: I think programmers who’ve never worked with a language with pattern matching before should be prepared to have that change their perceptions about programming. I was talking to a group of mostly Mac programmers, largely Objective-C developers. I was trying to convey to them that once you start working with pattern matching, you’ll never want to use a language without it again. It’s such a common thing that a programmer does every day. I have a collection of stuff. Let me pick certain needles out of this haystack, whether its based on a class or their contents, it’s such a powerful tool. It’s so great.
Needle in a haystack, eh? In my limited fp experience, pattern matching is used in functional languages for both terseness and for polymorphism. What they seem to be describing - using pattern matching as a glorified regexp and an accessory to the violation of encapsulation - seems pretty unnecessary, given that they're using an OO language that supports polymorphism through objects anyways. This kind of stuff was why I put my Scala studies on hold until I learned how to think correctly in functional terms; Scala makes it easy for a novice to write code that is neither good FP nor good OO.



I have this feeling that Twitter is always 'discovering' something which the rest of the world already knows and has used for a long time. What's worse, they won't go look at the tons of work that's out there and learn from that; no, they'll make the same naive mistakes all over again, like they did a couple of years ago with message queues, a story I've heard from a lot of people.



Don't get me wrong here, I'm not dissing everything they've said; they're good chaps and have a fantastic service deserving of respect. I've also written a little Scala myself and have been lurking on the /Lift/ lists for over a year and I agree with them when they say Scala is a nice language. But frankly, a little engineering and attention to code quality might help them solve more problems than switching languages.
So DevCamp is tomorrow; I haven't got my talk(s?) anywhere close to ready, so today is going to be a hard grind. Perhaps, I'll just do the Ruby talk and skip the js one?



Anyways, if you live in Bangalore or happen be in town on Saturday, 11th April, do consider dropping in (directions to ThoughtWorks office can be found on the wiki, map and all); there are 18 sessions up on the wiki and a bunch of interesting people participating, so it should be an entertaining gig.



Oh, and do remember to tell any of your friends who might be interested.
I have been trying to build an application using GWT and JDO on the Java App Engine. This post captures some things I discovered along the way.



GWT-JDO compatibility

The JDO interface is provided by implementing extensions to DataNucleus. It provides a (not so seamless) wrapper around low level DataStore (BigTable) API. Before running the application, JDO annotated classes need to be bytecode-enhanced by the DataNucleus enhancer. (The appengine Eclipse plugin does this automatically). If you are writing a GWT app, then typically, these very JDO classes are also your GWT domain classes (myapp.client.DomainClass). So these classes need to be compatible with respect to gwt-compiler (e.g. Serializable) and data nucleus enhancer. An example of where this isn't obvious is in the choice of datatype for primary key. We can't simply use com.google.appengine.api.datastore.Key because the gwt-compiler cannot serialize Key (seems this is now possible) and we don't have the source for Key. Instead, we use an encoded String form of Key.



@PersistenceCapable(identityType = IdentityType.APPLICATION)

public class SomeDomainClass implements Serializable {

@PrimaryKey

@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)

@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")

String id;



User API integration with GWT

The appengine user API lets us authenticate Google users. However com.google.appengine.api.users.User cannot be used as a GWT domain object. gwt-compiler would need its source code. I ended up creating another class myapp.client.User for this purpose. This is probably good anyway because it lets me add app specific behavior to my User.



Development environment

GWT hosted mode gets going the quickest. Custom build file can be written to run local server mode. But neither of these are quite the same as deploying to the real appengine servers at appspot (or your domain). The local environment don't mimic all the characteristics of actual deployment. Post deployment testing is highly recommended for real apps. For purposes of unit testing, the datastore calls can be routed to an in-memory proxy. Also, Fred Sauer's gwt-log is quite handy.



JDO Quirks

Obviously there is no concept of joins. Mappings are also constrained. Pure one-to-one associations aren't supported. Instead, we have a form of composition that the appengine docs refer to as owned one-to-one relationship (e.g. Employee's ContactInfo). I am begining to wonder if the JDO interface is actually a hinderance to thinking non-relationally. It might be better to use the low level datastore API directly.



Overall, it has been fun. Java appengine seems quite promising. ThoughtWorks plug: Yes, we offer app dev and consulting services for all things cloudy.



Update: Coverage by fellow ThoughtWorkers:

Ola Bini

Paul Hammant

John Hume

Philip Calcado

The series on fallacies of knowledge management will continue after this post.



I attended the first CloudCamp in India at IIMB today. It was well organised and well attended. I had only planned to network and attend the talks but ended up onstage in true unconference style. Dr. Srinivas P was kind enough to invite me to a panel discussion on certain aspects of cloud computing. While the panel discussions were mostly illuminating, I noticed some mixing of terminology around SaaS. This post is meant to highlight that SaaS is a distribution model for software and is independent of the hosting model (severs under a table, private data center, Google AppEngine, Amazon etc).



Yeah, one could argue that the appengine is more than a pure hosting model but that is not material to this post. It was agreed during the course of the sessions that Amazon's offerings could be described as infrastructure-as-a-service (IaaS) and that of the Google App Engine as PaaS: platform-as-a-service (for lack of a better term).



Now let's take the example of a business that sells tax-return filing software. If it chooses to sell the software by shipping CDs or offering installable downloads, then its distribution model may be termed as software-as-a-shrink-wrapped-product. On the other hand, if it chooses to host the software somewhere and let users connect to it for filling out their returns, then the distribution model is termed as software-as-a-service. Note that we haven't said anything so far about where the software is hosted in the second case. All we know is that the customer is not required to install it in her premises. So, from the POV of a citizen filing returns, it is either shrink wrapped software or software-as-a-service. The end user doesn't care about whether the hosting is IaaS, PaaS or a private data center.



If you really want to complete the circle, you could view IaaS and PaaS as an exteme form of SaaS, viz: system-software-as-a-service - since the cloud service providers basically offer the use of (dynamically scalable) virtual machines as a service to the application developer.
It appears that Undernet is blocked across a whole bunch of networks in India for reasons unknown. Here's my traceroute to us.undernet.org:



~$ traceroute us.undernet.org

traceroute: Warning: us.undernet.org has multiple addresses; using 66.186.59.50

traceroute to us.undernet.org (66.186.59.50), 64 hops max, 40 byte packets

1 192.168.1.1 (192.168.1.1) 1.227 ms 0.858 ms 0.875 ms

2 ABTS-KK-Dynamic-001.64.167.122.airtelbroadband.in (122.167.64.1) 39.120 ms 26.279 ms *

3 ABTS-KK-Static-041.32.166.122.airtelbroadband.in (122.166.32.41) 47.611 ms 25.424 ms 25.164 ms

4 ABTS-KK-Static-009.32.166.122.airtelbroadband.in (122.166.32.9) 25.713 ms 25.913 ms 24.841 ms

5 122.175.255.29 (122.175.255.29) 26.253 ms 25.515 ms 25.598 ms

6 * * *

7 * * *





There is just one server accessible, and that's montreal.qc.ca.undernet.org. Hopefully, this should save you a half hour's googling.



Don't let this stop you from filing a complaint with your ISP though (I just logged one with Airtel - ticket #18088886 - and they've promised to have this sorted by 1:30 pm tomorrow) - this is still a free country and they have no business blocking anything on the internetworks.



Update 2009-03-24:

Oslo.NO.EU.Undernet.Org also seems to work. Still no response from Airtel, however. That's quite atypical - it's the first time in about three years that Airtel has failed their "we'll fix it in four business hours" promise.



Update 2009-03-27:


Date: 25/3/09 1:24 AM

Hi,



I was to be informed about the status issue 18088886 regarding blocking of Undernet IRC servers by Airtel latest by 13:30 on 24th March, but have not been contacted. Please get back to me with an update.



Thanks,

Sidu.



Date: 25/3/09 1:32 PM



Dear Mr.Sidu,



Thank you for writing to us at Airtel Telemedia Services.



We acknowledge the receipt of your mail dated March 25th, 2009.



With regards to reference number 18088886, we regret to inform you that IRC

port 66602 cannot be opened as the same has

been blocked by Department of Telecommunications (DoT).



For further assistance, please.

• Call us at 080-44444121

• E-Mail us at - care.karnataka@airtel.in

• Fax us at 080-41112346



Assuring you of our best of services at all times.

Yours sincerely,



Thrapthi

Customer Relations

Airtel Telemedia Services



Date: 25/3/09 3:08 PM

Hi,



The highest port possible is 65535. Port number 66602 does not exist. Please confirm your response.



Please keep in mind that I am able to connect to other IRC networks (like Freenode) on the standard IRC ports, which would not be possible if the ports themselves were blocked by the DoT.



Best,

Sidu.



Date: 26/3/09 9:15 AM



Dear Mr. Sidu,



Thank you for writing to us at Airtel Telemedia Services.



We acknowledge the receipt of your mail dated March 25th, 2009.



Your request for broadband related has already been registered with the

reference number

18088886 and we have forwarded your mail to our technical team for further

clarifications.



We would get back to you as per the updates.



For further assistance, please.

• Call us at 080-44444121

• E-Mail us at - care.karnataka@airtel.in

• Fax us at 080-41112346



Assuring you of our best of services at all times.

Yours sincerely,



Mohsin.

Customer Relations

Airtel Telemedia Services

Organizations that are straitlaced about providing employees with unrestricted access to information cannot expect them to have a different attitude towards sharing knowledge with each other. A number of organizations share information with employees only on a need-to-know basis. For any given employee, very little (relatively) information falls in the need-to-know category. She is cut off from information that she might just be curious about. But wait, isn't this a good thing? Why distract employees with useless information? Fair enough, don't push unnecessary information to everyone. But don't hide it behind access control either. Someone might just find a serendipitous use for the information. A better approach might be to just hide the information that absolutely needs to be hidden and free everything else up. Rather than share on a need-to-know basis, protect on a need-to-hide basis.





Wikis are a great example of a technology that turns access control on its head. In a typical wiki, not only can everyone read everything by default, they can even edit anything. This feature used to invite ridicule in traditional departments. But the adopters mostly thrived. Hell did not break loose. Wikis have a robust cure for mischief. It is called "revert to earlier version". Authentication is essential. Authorization is less so. Author traceability discourages frivolous edits.



There is also the issue of scale. Preventive access control doesn't scale. What scales instead are mechanisms that offer cheap cures in case of problems. This is commonly accepted when we build applications for the web. Client server applications used to rely on a mechanism called pessimistic concurrency that tries to prevent problems while web scale applications rely on optimistic concurrency, i.e. taking corrective action in case of problems.



In a fast paced world you can't wait to ask for permission at every turn. We have an unwritten code that helps move things along at ThoughtWorks: Ask for forgiveness, not for permission. A friendly access control regime lowers barriers to participation. And participation is absolutely key to the success of any knowledge management effort.
Even though keyword based search doesn't yield satisfactory results all the time, it often delivers better than manual organization.



Search trumps Navigation



Sophisticated Users

Others

Use application launchers like Launchy, GnomeDo or Quicksilver

Use hierarchical navigation from start menu or equivalent

(Coders) Use Ctrl-N (IntelliJ) or Ctrl-Shift-T (Eclipse) to open a class

Use hierarchical navigation of the Package/Project explorer

Use search engines to find information on the internet

Might prefer using something like Yahoo Directory to get to the information they seek

Use desktop search to find files on their hard disk

Always use the hierarchical file system explorer



Traditional hierarchical organization requires users to navigate through the hierarchy to get to whatever they are looking for. Such navigation is unnecessary in cyberspace and is painful for seasoned knowledge workers. Reliance on taxonomies is a relic of physical world thinking. Their importance is overrated in a digital medium.



Folksonomies don't replace search either. Being multidimensional, they are useful for finding 'similar content' after you have found the first one. Even then, it requires very good participation by the user community to be relevant.



Comprehensive organization is expensive and time consuming


It takes humans to put things in their place. :-) Correct classification requires some understanding of the subject. At a time when the quantity of content is growing rapidly, it is expensive to hire people with understanding of the subject to maintain a organization hierarchy. Relying on users to do this themselves doesn't work out well in my experience.



Lightweight, deferred organization is easy

One of the problems with upfront organization is that you have to come up with a scheme that is acceptable to most (if not all) users. Instead, it is easy to slap on a starting page or a table of contents later if you are using something like a wiki. When my project wiki began to get unweildy, someone just added a page called "Day one reading material" with links to several other informative pages (thus bypassing all notions of hierarchical navigation). New joiners to the project were simply directed to this page.



Just Ask Around

Asking people for information has never been easier. Corporate microblogging (micro-messaging) tools like Yammer (or just a company wide always-on chatroom) make it very effective and non-intrusive to ask questions like: "Can sometime point me to existing collateral for xyz service offering?"
As I mentioned in this post, I am pretty annoyed with myself because of the way I structured stories in the first release of my current project. Here are a few things that I learnt.



First of all when we say that Story A is dependent on Story B, it means that Story B development cannot start until Story A development is complete



There are different situations where one story is dependent on another. Each situation needs to be dealt with in a different manner.



Types and Approaches



Situation 1 - The wrong split

This is the classic vertical split. Many have advised against it but many more fall into the same trap again and again. Myself included :)



Look out for the vertical split problem.

Remember,

If your body is horizontally split in half as in you have no legs, you can still do something with yourself.



If your body is vertically split in half as in your left is separate from your right...



The first place to look for the vertical split is Admin Functionality / User side of the application. If you see your stories divided like Admin Stories and User Stories make as big a noise as you can quickly.



Situation 2 - The application flow

This is where we just plainly don't think.



Example:

When you get a message on Yammer, Yammer sends you an email. You can click on the email to look at the message you have got. BUT you can obviously keep your Yammer client open and see the message instantaneously and thats the way it's supposed to be used.



Email notification is a nicety. Showing the message on Yammer client DOES NOT depend on sending an email notification to the user.



Such errors are much easier to spot. Beware of the Business Process Workflows that you refer to. The business process workflow DOES NOT represent development flow. Mark the niceties and essentials apart in your workflow.



Situation 3 - Data dependence

This is a little more tricky. But I have seen this a lot of times as well. This is closer to David's comment on my earlier post.



Surely to sell an item, you need to set the item up in the system. Doesn't this mean that you have to build the Item CRUD features into the system before you can sell it.

NO!!

Theoretically the items could be setup directly in the database. If the goal of the system is to sell an item, then that's what should be done first.



Practically you should be doing the absolute minimum "item setup" before you build the functionality to sell it.



The first thing is to concentrate on the crux of the system. Selling Stuff, Lending Books, Renting out DVDs, Playing Music, these are the things to achieve as early as possible in respective projects. Therefore you need to do whatever is needed to get to these areas as soon as possible.



Musings-at-the-end

I was mostly plagued by the admin V/s user situation throughout this release. We split stories that way because there was a tough deadline to meet and we thought it's better to split the work so that more pairs can work on the project. It worked out alright and we are in the last iteration and even able to provide a few more story points than promised. But we did face a lot of problems in scheduling because we split the stories in a wrong way. So that's definitely something to avoid.



Another thought that keeps popping in my head is the idea of Programming by Convention. Like RoR.



If you have a team of fairly experienced, "like minded" developers... can they agree upon a few conventions to follow so that two pairs can work on "Setting up the Item" (Admin part) and "Using the Item" (User part) simultaneously? I am still talking about evolutionary design (code as well as database). I seem to think that with good build processes, this should be possible.



What do you think?





We're happy to announce the second edition of DevCamp Bangalore, DevCamp Bangalore 2; it's happening on Saturday, 11th April 2009.



DevCamp is an un-conference by the hackers, for the hackers and of the hackers.

It's a species of BarCamp where anything a lover of computers and technology would consider important or entertaining goes.



The first DevCamp happened a little over a year ago and was a lot of fun; we're hoping hoping to keep that trend going with DCB2.



If you're planning to do a session at DCB2, do keep in mind the fact that everyone at DevCamp is a hacker, a pro. Please assume a high level of exposure and knowledge on the part of your audience and tailor your sessions to suit. Avoid 'Hello World' and how-to sessions which can be trivially found on the net. First hand war stories, in-depth analyses of topics and live demos are best.
http://www.opensolaris.org/os/community/observability/



There's a wealth of observability tools listed there !
If you're developing using ActiveResource, you should to add this line to your environment.rb:
ActiveResource::Base.logger = ActiveRecord::Base.logger
That will write all your resource requests to the log as well, a useful thing.
Someone on #ruby-lang wanted to know how to define a method on a class when the method is first called. Here's a quick example.
require 'rubygems'

require 'spec'



module DynamicGetter

def method_missing(name, *args)

if(@attributes.has_key? name)

self.class.class_eval do

define_method(name){ @attributes[name] }

end

self.send(name, *args)

else

super

end

end

end



describe DynamicGetter do

before(:each) do

# Reference the class used in the specs

# as an ordinary variable rather than a

# named constant (@ooga instead of Ooga)

# so that it can be created afresh for

# each spec.

# If we did class Ooga, the second spec

# would fail because the first spec already

# created the method #woot.



@ooga_klass = Class.new(Object)

@ooga_klass.class_eval do

include DynamicGetter



def initialize(attributes = {})

@attributes = attributes

end

end

end



it "should know how to add a method to a class on first call" do

o = @ooga_klass.new(:woot => 5)

o.should_not respond_to(:woot)

o.woot.should == 5

o.should respond_to(:woot)

end



it "should raise a method not found exception if the attribute isn't present" do

lambda{ @ooga_klass.new.woot }.should raise_error(NoMethodError)

end

end

Another example is the Rails find_by_* methods, which are defined the first time you call them.

If, for some reason, you want to apply the example I've given on a per-instance basis, look at this post.



Related posts:
The next bangalore-fp meetup is scheduled to take place on the 14'th of March at ThoughtWorks.



Presentations:.

1. Functional Programming 101 by Varoun

2. Dojo Zen aka Web 3D by Tom Elam



Date/Time: 14-Mar-2009, 2:30 PM - 4:30 PM



Location: ThoughtWorks Technologies (India) Pvt Ltd.

2nd Floor, Tower C, Corporate Block, Diamond District

Airport Road, Bangalore - 560 008, India.



Directions + map here.
My employer aims to be a home for the best knowledge workers. Several companies operating in the knowledge economy have similar aspirations. Yet, some of them fall shy of calling themselves a people dependent company. They would rather be process dependent (and people independent). Why? Because a process won't tender resignation and leave. Valuable knowledge may be lost when an employee leaves. Knowledge that is codified into a process is safe from attrition. However, this doesn't work in practice.



Knowledge keeps evolving. Codifying it into a process merely takes a (context-free) snapshot of evolution. Knowledge evolution can only happen in people's heads. The only way to preserve knowledge when someone leaves is to make sure that someone else knows the stuff well enough. However this knowledge transfer will fail if only attempted as a handover activity. Why? Because context is severely restricted during a planned knowledge transfer session. Knowledge sharing and collaboration has to be part of the work ethic of an organization. People need to buy into the fact that knowledge multiplies by sharing. In such a collaborative environment, knowledge silos are minimized if not eliminated.



'People dependence' is much more robust than 'person dependence'. A sharing-friendly culture helps move the dependency from person to people. A process and documentation driven culture moves the dependency from person to repository and knowledge atrophies in due course.



Sharing is effective via conversations, not so much via artifacts. This is because of the lossy nature of communication. Signal to noise ratio decreases as bandwidth decreases from face-to-face to phone conversation to instant messaging to email to finally an artifact in a repository.
This is the start of a series of posts on what I consider to be fallacies of knowledge management.



Some ten years ago, I used to be in the habit of printing good articles I came across on the internet. Sometimes, fifty pages at one go. But I wasn't able to keep up with reading all that I was printing. Yet, the act of printing and possessing the content seemed to offer some kind of reassurance. After all, I could read it anytime I wanted to. I realized the folly of my ways when I had to relocate for my next job. I had fifteen kilos of mostly unread, somewhat dusty, printed material. I was faced with the choice of dumping them (with all the associated guilt of wasted resources) or paying to transport them in the hope of catching up some day.



Then I grew a little wise. I started merely saving stuff to my hard disk instead of printing. I created a folder '2bRead' (still have it) and started growing my repository of wisdom there (or so I thought) - whitepapers, presentations, podcasts, videos, you name it. As the folder grew in size, I began to forget what was in there. I used to search on the internet for stuff I already had. Desktop search only partially solved the problem. The indexes began to grow huge and it didn't keep track of deletes well - I used to get false results. It also didn't help that I used to switch between operating systems.



Then came del.icio.us and I thought an end to my woes. Several bookmarks and tags later, I realized that I was spending more time bookmarking and tagging than actually reading and assimilating. It wasn't because I was an obsessive compulsive organiser (far from it). It was just that I often didn't have the time to study something when I came across it - it was much easier (and reassuring) to just bookmark and tag it.



Now I use a much harsher approach - read it then and there or forget it. You might be more disciplined than I am and might find this absurd but I suspect I am not alone. Individuals and organisations are struggling to keep up with the assimilation of information. So they tend to resort to what seems to be the next best thing - the collecting of information. However, this tends to be mostly a futile exercise. It might be more useful to focus on assimilation of information whenever 'information events' happen - talks, presentations, meetings. Focussing on recording and distributing (or storing centrally) in the hope of future assimilation is going to be increasingly ineffective.



Favour individuals and interactions over artifacts and repositories.

Favour context rich conversations over mostly context free collateral.



After all, we don't manage knowledge within digital repositories. We can only hope to curate information within them. Knowledge can only reside in people's heads. Efforts to improve knowledge should therefore focus on assimilation via collaboration rather than on curating information.
Every so often I come across a bit of code which looks something like this:
def upcase_collection(collection)

array = []

collection.each{|item| array << item.upcase}

array

end



Yeah, I know you language punters are looking at this and going 'yech'; but folks new to blocks and used to for loops aren't likely see the problem.



Here's the deal: when using blocks with collections in Ruby, always respect the sanctity of a block passed to a collection. Never misuse the closure created with the block to manipulate objects outside the scope of the block - in this example using array as an accumulator. There are always better ways to do this without violating encapsulation, the other collection methods available in Enumerable being a case in point.



There are a couple of smells you always come across in such situations:

  • The presence of objects whose states are changed from within a block in a different scope
  • The fact that you need a temporary variable at all in the first place
  • The availability of methods like collect, partition or inject which do exactly what you need - for free.


The (trivial) example I've given would be better solved using collect.
The Bangalore Ruby User Group will be meeting up this Saturday at 4pm. There is no set agenda; the meeting is divided into two halves, with members talking about something they've worked on recently in the first half and an open Q & A session in the second where folks can pick each others brains about all things Ruby.



The first half will be quick, ten minute sessions. If you're planning to participate, please remember that a full-fledged presentation with slides is nice, but not necessary.



I'm planning to talk about some of the smells and pitfalls someone new to Ruby should watch out for when contributing to a codebase.



If you're interested in attending, please let us know by sending a mail to the list so that we have a rough idea of how many folks will be participating.



Details

Date: Saturday, 20th December

Time: 4:00pm to 5:30pm

Venue:

ThoughtWorks,

2nd Floor, Tower C,

Corporate Block, Diamond District,

Airport Road, Bangalore.

Directions, Map and Parking.
If you plan on building running JRuby from source, then here are a few useful symlinks to get things set up. Remember to change the paths to suit.
ln -s ~/Work/ruby/jruby/bin/jruby /usr/bin/jruby

ln -s ~/Work/ruby/jruby/bin/jirb /usr/bin/jirb

ln -s ~/Work/ruby/jruby/bin/jgem /usr/bin/jgem

ln -s ~/Work/ruby/jruby/bin/jirb_swing /usr/bin/jirb_swing
Why run JRuby from source? Because it's developed very actively and there is enough happening that I like to do an svn up every other week, followed by and ant clean and an ant. Yes, that is all it takes :). The svn url is http://svn.codehaus.org/jruby/trunk/jruby
Disclaimer: ThoughtWorks embraces the individuality of the people in the organization and hence the opinions expressed in the blogs may contradict each other and also may not represent the opinions of ThoughtWorks.