Play@Work

Monday, March 28, 2005

Free as in Freedom





Awesome ..

A must read. It was one of those books that I just read from end to end without a stop.
Basically about why Richard Stallman is so passionate about his FSF Foundation. What I loved in this book were the brief moments when RMS speaks about his passion for writing software.

Clicking on the pic should give you a softcopy of the book.

I have the book, so interested people can pick it up from me :-)

Now looking to read "Hackers and Painters".

Thursday, March 24, 2005

Team Size while doing XP

Todays Standup was awesome. Since it was an optional holiday, there were just 2.5 dev pairs :-) and 3 BAs/QAs and the Standup got over really fast and I felt it was more meaningful. The standup was clean and crisp.

Being on a huge project, our team has around 7 dev pairs and 6 other people playing different roles. So the standups last for upto 10 mins and frankly I get damn bored and I shut off after sometime.

I feel it makes sense to break huge teams into smaller teams just to experience what I just experienced today !!

Wednesday, March 23, 2005

easy Gentoo Install

Hehe. Check this link

Tuesday, March 22, 2005

For firefox users

Check this out.
Customize Google

Monday, March 21, 2005

Move over Godzilla .. here comes PodZilla !!!

This is so awesome. I feel like picking up an iPod just for this.

Gabbar has installed PodZilla on his iPod. Its so damn cool to see the bootup info when the iPod is starting up.

               

Tux on the iPod              The kernel bootin up



I have an ARCHOS AV120. Its a pretty good player but has a totally clunky UI, so I have been searching on the net for some info on how I can build a small OS for this. So I was completely blown when I came to know about Podzilla. So looks like there is hope :-)



My Archos AV120

Object Boot Camp - Patterns ..

Object Boot Camp - Part 2 (Patterns) has started here at ThoughtWorks. Planned for 3 weeks, 9am - 11 am... yaaawn .. who gets to work at 9 in the morning ?? :-)

anyways. Im feeling damn lazy to chronicle this camp. Hoping some one else will keep his/her blog upto date with the day to day happenings/incidents at the Boot Camp. (if that happens I will update this page with a link to that kind souls page)

All I can say is its pretty interesting. We get to practise 'accelerated' Extreme Programming :-). Basically we have a problem to solve and we completely drive the solution using tests, rotate pairs every 15 mins etc etc. And at the end of it someone projects his code onto a wall and we get to criticize it Hehe (evil laugh).

Tuesday, March 15, 2005

Trekking In Wayanad

Had been on a trek to Wayand last weekend with a few ThoughtWorkers. Snaps and write up here.

Applying Verbs on Nouns !!

nice article which explains Polymorphism in a different way. (somewhere towards the middle of the article though)

The article itself is a pretty interesting read.

scary interviews !!

"So you dont know what a static inner class is ?" - tips to Technical Interviewing.

Monday, March 07, 2005

Head First Design Patterns

                    where is the Image ??

Been meaning to pick this book up for quite some time.
Must say its an interesting read.
The usual "Head First" series kinda book - Lotsa figures, lotsa arrows all over the place, handwritten notes on the sidelines and the usual PJs. These guys have a whole new approach on how people should learn stuff. My kinda book :-)

Easy and fun read, but at the same time pretty informative.

Saturday, March 05, 2005

Java development With Ant.

Was lookin thru this book - "Java development with Ant - Erik Hatcher, Steve Loughran". Pretty neat.
duh !!
Did you know what the full form of ANT is ??? - Another Neat Tool !!!

Picked up a few things from the one chapter that I read.

We can have one Build File per project. But then we can also break up the poject into sub-projects and have multiple build files for each sub-project.
(one - many mapping)
Project - multiple Targets
Target - Multiple Tasks

where Task is an actual reference to a Java class built into Ant that understands the parameters in the build file and can execute a particular task
We can extend these tasks (or reuse others tasks). One of the main reasons why ANT is so powerful. And Java makes it platform independent.

For (a task in ANT which compiles java code) task's Source Dependency checking to work, we must lay out the source in a directory tree matching the package declarations in the source.
- So basically if ant is recompiling the java files everytime then maybe the project hierarchy is not rite ! (dependency checking of is limited to comparing the dates on the 2 files. So if it does not find the source files in the specified package as mentioned, then it just assumes that we dont have an up-to-date version of the compiled file.) Definitely not an issue with the IDEs that we use I guess.

ant -projecthelp
returns the various targets in a build file with the description of what they do if entered in the build file.

There was also an section on how Cruise control uses ANT to do its stuff. Looked interesting, didnt check that out though.

Wednesday, March 02, 2005

checkin out Jakarta Commons - Collections

Functors
- one that performs an operation or a function
- an object that encapsulates some functional logic
eg - Comparator and Iterator

why ?
code reuse
cleaner design --> abstraction

Functor interfaces available in commons:
Predicate - evaluate criteria or conditions and returns a boolean
Transformer - create a new object depending upon the input object
Factory - Create objects
Closure - act on input objects.


Using Predicates
FilterIterator

Non destructive filtering. Basically you set up a filtering condition using a Predicate Object and just pass it to the FilterIterator and the iterator returns only those objects for which the predicate evalutes to a true.


public void testFilterIterator() {
ArrayList list = new ArrayList();
list.add("Hello");
list.add("Hello1");
list.add("Hello2");

FilterIterator filterIterator = new FilterIterator(list.iterator(), new FilterPredicate());

for (;filterIterator.hasNext();) {
String s = (String) filterIterator.next();
assertEquals("Hello", s); // only "Hello" is returned
assertEquals(3, list.size()); // non destructive filtering
}
}

// the Predicate object. pretty simple
public class FilterPredicate implements Predicate {
public boolean evaluate(Object o) {
return ((String) o).equals("Hello");
}
}



To update a collection with only those objects that match the predicate (destructive filtering) we can use CollectionUtils.filter()
Building on the same test as before


public void testDestructiveFilter() {
ArrayList list = setupList();
assertEquals(3, list.size());

CollectionUtils.filter(list, new FilterPredicate());
assertEquals(1, list.size()); // other objects in list are stripped off
}


Similarly if we want to do a non destructive filtering.


public void testNonDestructiveFilterWhichMatches() {
ArrayList list = setupList();

// the select() keeps only those objects that evaluate to a 'true'
Collection newCollection = CollectionUtils.select(list, new FilterPredicate());
assertEquals(3, list.size());
assertEquals(1, newCollection.size());
}

public void testNonDestructiveFilterWhichDoesNotMatches() {
ArrayList list = setupList();

// I guess U know what this means by now :)
Collection newCollection = CollectionUtils.selectRejected(list, new FilterPredicate());
assertEquals(3, list.size());
assertEquals(2, newCollection.size());
}



using a Transformer
- used to perform a tranformation on each object in a collection


public void testBasicTransformer() {
final ArrayList list = setupList();

CollectionUtils.transform(list, new StringTransformer());
assertEquals("HELLO", list.get(0)); // "HELLO" converted to upper case
}

// my transformer class which converts to Upper Case
private static class StringTransformer implements Transformer {
public Object transform(Object o) {
return StringUtils.upperCase((String) o);
}
}


We can also chain transformers to do some pretty neat stuff.

We can also use Predicates to count number of objects in a Collection if we need to count depending upon a condition


// the Predicate used here returns 'true' only for "Hello" objects in the collection
public void testCountingNumberOfHellosInCollection() {
ArrayList list = setupList();
assertEquals(1, CollectionUtils.countMatches(list, new FilterPredicate()));
}



There are tons of other juicy bits hidden away. Explore maadi.

Tuesday, March 01, 2005

People aspect of XP - Part 2

Madhu learnt it on his previous project.
Madhu told Suresh.
Suresh overheard me talking to JD about using the Visitor pattern and he popped over to tell us about the Jakarta Commons framework that he had just heard about from Madhu.

The power of doing stuff the way we do it.

ps: also check out the Jakarta Commons framework. Nice stuff. Im surprised I hadent heard of it till date. Better late than never I guess !!!