Monday, May 31, 2010

Customizing h:selectOneRadio

So, the other day, one of the users request to make changes to the way a particular dropdown is displayed. I used h:selectOneRadio for the radio buttons and for the dropdown options, I used the s:selectItem that has an arrayList of enums for values. The requested change was to customize those dropdown options so that some options are bolded whereas the rest are displayed normally.

It sounded as a decent request and didn't seem hard. However, I'm finding that it's hard to customize a dropdown choices that uses h:selectOneRadio. I can't just randomly customize s:selectItem, and f:selectItems is also very similar to s:selectItem. The only thing that is left to try is f:selectItem. I thought I could use f:selectItem because it doesn't take an arraylist like others. However, f:selectItem doesn't have 'style' option.

Therefore, I couldn't customize the dropdown list as I wanted. I'm wondering if there's a way out there that will make this customization feasible at all.

Wednesday, May 26, 2010

Platform Vs. Framework

It seemed to me that I'm not the only one who has confusion about differences between framework and platform. Based on my past experience, I understand what platform is in general. We run Operation Systems on Windows platform, Linux platform and so on. By definition, a platform creates an environment that software codes can run. Based on that definition, J2EE is a platform.

On the other hand, framework is a collection of APIs and libraries that guide how software should be run. Programmers can modify the established framework to enhance and modify. However, the underlying architecture of those application will essentially be the same. Seam is a framework, which is run on a J2EE platform.

Monday, May 24, 2010

Web applications and browsers

As a developer of web-based application, I sometimes wish that there were a new type of browser out there. One that will be a hybrid between a standalone application and the true browser type. Not that I don't like what we have right now. I think the development of browsers have come very far(considering the fact that it started out in 1980s and the first browser came out in 1991) and what we have nowadays is very fitting to our needs. But there're some areas where the idea of a browser is not suitable to use. This is coming from my first hand experience of developing web applications.

The idea of a browser is to share and retrieve information in a big network. Most web pages in 1990s were passive in data representations. As we entered into the new century, the idea of internet was changed and browsers became more sophisticated. They supported a variety of functions, plug-ins and multimedia. As we are on the end of two decades since our first browser, we've reached the dawn of cloud-computing, in which browsers play a significant roles.

Now, the question is if current browsers capable of supporting cloud-computing? Granted, there're a lot of web applications out there such as our online banking systems and social networking site that requires the use of browsers. But the idea of browsers as applications is somewhat inconsistent and inappropriate. Therefore, developing of web applications is somewhat different and sometimes complicated.

I don't have a specific list in my mind of what the new application browser should be. But I like the idea of one of Mozilla's add-ons called Prism. It completely removed the annoying buttons such as the back button and therefore, made the web applications more like standalone applications. However, Prism is not very popular and people are still scared to replace Firefox, IE and Chrome with something like Prism. Hopefully, there'll be something out there that will be sophisticated enough to start browser revolution.

Friday, May 21, 2010

Pac-Man turned 30th!

I'm not really a Pac-Man fan. I like Tetris more than Pac-Man, probably because the highest level I ever achieved on Pac-Man is the second level. And I didn't have enough interest to push my effort further.

Anyway, yesterday, Pac-Man turned 30th. Normally I should neither be happy or sad. However, Pac-Man meant something else to me these days. The professor from my algorithm class uses Pac-Man as an analogy to solve the dynamic solution problem. It is not directly applicable, but Pac-Man was an illustrative likeness. So, when someone mentioned Pac-Man, instead of remembering it as a game, I remember it as the starting point to solve dynamic programming problems. ("Chopped the big solution one by one to obtain the smaller piece and find the best one"). Happy Birthday, Pac-Man!

Tuesday, May 4, 2010

Facebook : What went wrong?

Facebook is in decline. Everyday, I hear more people are talking about closing and deleting their accounts. What started out as a project by some college students that targeted to bring students from U.S. institutions together had expanded globally. There are reportedly about 400 million Facebook users worldwide.

Facebook teaches us that to do something that will gain attention, you should target the right audience. Young people are more technology oriented, and especially, college students are the best group to be aimed at because of their intellectual level, social structure and networking ability. Facebook was a success with college students. When Facebook started, there were other social networking sites such as Friendsters and MySpace. However, Facebook quickly surpassed the popularity of those other networking sites because of the environment and perspective that it created at that time. If you wanted to create a Facebook account, you needed to have a valid college/university email address. That gave users a sense of privilege that they are belonging to a limited group of people who share more or less same background. On top of limiting the users who could use Facebook, it also added one more restriction by allowing different privacy settings. During that time, Friendster did not allow users to have control over the display of the information. A lot of Friendster’s users are starting to get tired of their information being display openly. Facebook seemed to jump in the game at the right time. There are other features that contributed to the success of Facebook such as tagging. Facebook API allows the development of applications which can be played in groups by you and people in your friends list, and that also created the sense of belonging and community.

It is a very good social networking platform until a year or so ago. I think the main problem with the decline in the popularity of Facebook is the surge in users; as a consequence the privacy settings are less efficient. And also the role of the business comes to play in the picture. When you develop something because you want to, it is a totally different perspective from doing something to create monetary value. I cannot say that Mark Zuckerberg held no intention of making profit out of this whole venture. But at least, his initial effort seemed to be selfless.

Information is a very valuable asset in today’s world. People are willing to pay for information, and I think Facebook has an advantage of in the possession of the information of the users around the world. If you think current privacy setting in Facebook is good enough, you are wrong. If you want to totally limit the access of your information, there are so many steps involved. Some people will be smart enough to realize the shortcomings of Facebook, and I’m waiting for the day when Facebook will become obsolete.

Sunday, May 2, 2010

Easy way to rename files in Java is not that easy!

I know there's a method called renameTo() in File class. I tried using it. All the posts I found online suggested that all I need is a File object to the new file and call renameTo() method.

I tried all the possible combination and it didn't rename my file. I saw the all my file objects are given the right paths by printing out the file names. The only possible thing I can think of is the permission issues. So I even tried copying the files over to the Shared folder and still failed.

So, I ended up writing a method that copied over the content of the original file into the new file which has the new file name. After that, the old file gets deleted. And it worked and that was a prove that the permission wasn't the issue. I know it's a not-so-sophisticated approach. But it worked and I needed something that will work. Hopefully I will be able to use renameTo() without any problems one day.