Monday, August 30, 2010
Cutie pets
I have never really been a cat person. But everything changed when my roommate brought in two kitties 4 months ago. In fact, it was only one kitten in the beginning. Then, fearing that her kitten might get lonely, my roommate took in another kitten.
I was uncomfortable about having two kitties in my house. Well..I didn't know certain qualities of cats. The best thing about them is that they take care of themselves. I was amazed when the kitties used the litter box without training. I think that alone is a great plus.
Lately, I noticed the presence of other living creatures in the house and how it affects me. Our first kitten, Mie Mie is about 5 months now and our second addition, Snowball(because she was white) should be about 4 months. I noticed that I came to attach to them. Every time I come home, I know that they will be there behind the doors, waiting for me to come back. Even though I do not play with them that much(as you know cats are known to be lazy), I came to acknowledge their presence.
I would like to try to have a pet dog some time in my life.
Wednesday, August 25, 2010
The girl with the dragon tattoo
I read The Girl with the Dragon Tattoo...in one day. I did not really know the story before I started reading it. I just knew that it was solving the mystery of a missing person, and there was some financial corruption involved. So I thought it was some sort of conspiracy stories. However, I was wrong and I felt like I wasted my time staying up late till 4am to finish up the novel.
I like conspiracy stories. I liked Bourne Ultimatum series(I never read the books, just watched the movies). So, I think I held a very high expectation of the Dragon Tattoo given that it was a best seller in Europe and then in America. As I was reading it, I felt like the story was one that have been repeatedly told by many other novelists; rape, sex and missing person. Of 'coz that was not all to it. There was some corruption in the finance sector of Sweden, but to me, that part of the story wasn't intelligently plotted.
I kept in my mind that I was reading a translated version. Sometimes, a good story is dependent upon choice of words, metaphors and so on. Since this is a translation, I cannot comment on the narrative ability of the author. I can only tell that the story plot is one too familiar kind and I was totally disappointed that I even gave up the idea of reading its sequels. However, I watched the trailer of the Swedish movie adaptation and I found it to be interesting. I am not too keen on the idea of making an American version. More over, I do not like the girl who was chosen to play the main protagonist. I think Swedish actress Noomi Rapace did a very good job in the movie.
I like conspiracy stories. I liked Bourne Ultimatum series(I never read the books, just watched the movies). So, I think I held a very high expectation of the Dragon Tattoo given that it was a best seller in Europe and then in America. As I was reading it, I felt like the story was one that have been repeatedly told by many other novelists; rape, sex and missing person. Of 'coz that was not all to it. There was some corruption in the finance sector of Sweden, but to me, that part of the story wasn't intelligently plotted.
I kept in my mind that I was reading a translated version. Sometimes, a good story is dependent upon choice of words, metaphors and so on. Since this is a translation, I cannot comment on the narrative ability of the author. I can only tell that the story plot is one too familiar kind and I was totally disappointed that I even gave up the idea of reading its sequels. However, I watched the trailer of the Swedish movie adaptation and I found it to be interesting. I am not too keen on the idea of making an American version. More over, I do not like the girl who was chosen to play the main protagonist. I think Swedish actress Noomi Rapace did a very good job in the movie.
Wednesday, August 18, 2010
rich:tabPanel and selectedTab
rich:tabPanel is one of the richfaces components that we use very frequently in the project. One reason is that it allows us to do all processing on one page instead of multiple pages. It has its own drawbacks, but I think it's totally subjective to each individual and the type of applications.
Among the few properties of rich:tabPanel the 'name' and 'selectedTab' attributes are useful. Each tab can be given a name that you can references from other places and the 'name' attribute is just what you need. If you want to control which tab is active, then you will need to use 'selectedTab'. The process is simple, you can have a variable at the POJO or bean which can be an integer or string type. You can have that variable outjected by using @Out annotation. On the jsf page, all you need is selectedTab="#{varname}".
Now, I just mentioned that you can use both Integer and String type for the variable and it will work. Now there're times that an Integer type variable will cause some problems. For example, I gave each tab a dynamic names, which I did it by using object.hashCode() method. Each object is unique and therefore, the hashcode() will be unique. This will save you a lot of energy from brainstorming the names of the tabs if you have 10+ tabs. But when you use Integer variable for the selectedTab name, the page will crash everytime you try to do some processing. It is crashing at the Apply Phase because after you request an action, it'll try to restore the view and restore all the state variables and at that point, for some reasons, it cannot restore the selectedTab Integer variable. The workaround is to use String variable in this situation.
Among the few properties of rich:tabPanel the 'name' and 'selectedTab' attributes are useful. Each tab can be given a name that you can references from other places and the 'name' attribute is just what you need. If you want to control which tab is active, then you will need to use 'selectedTab'. The process is simple, you can have a variable at the POJO or bean which can be an integer or string type. You can have that variable outjected by using @Out annotation. On the jsf page, all you need is selectedTab="#{varname}".
Now, I just mentioned that you can use both Integer and String type for the variable and it will work. Now there're times that an Integer type variable will cause some problems. For example, I gave each tab a dynamic names, which I did it by using object.hashCode() method. Each object is unique and therefore, the hashcode() will be unique. This will save you a lot of energy from brainstorming the names of the tabs if you have 10+ tabs. But when you use Integer variable for the selectedTab name, the page will crash everytime you try to do some processing. It is crashing at the Apply Phase because after you request an action, it'll try to restore the view and restore all the state variables and at that point, for some reasons, it cannot restore the selectedTab Integer variable. The workaround is to use String variable in this situation.
Subscribe to:
Posts (Atom)