Okay I have been working on a GWT application for awhile now. The other day I came across the need to have some effects in the application. Knowing about the JQuery effects and how great the JQuery library was I decided to see if the GWTQuery library (98% rewrite of JQuery in GWT) had what I needed. After about an hour I realized that the project was not being updated that frequent, the documentation was out of date and I found a post stating they thought the project may be dead.
I first heard of the project last year watching the Google I/O session videos. I have emailed Ray and not recieved a response on the status of this project. For my own sanity I decided to use JSNI and JQuery. After all, the few things I wanted to do was not going to be that slow and I can easily keep the JQuery dependency isolated.
Summary:
I hope we hear more about the GWTQuery project and I hope that Ray keeps contributing to it. For now though I am going be using JQuery and JSNI.
Wednesday, April 21, 2010
Building a Twitter style TextArea using GWT

When using twitter the client can only place a 140 characters in the box. There is a nice big GREY label above the box that shows the user how many characters are left. I have been playing with GWT for awhile now and decided that building that control wouldn't be too hard. Turns out it isn't but I hit a few bumps along the way.
The main gist of it is that you have to be careful how you calculate it. I was trying to keep a running count of how many times a key was pressed. The only problem is there are a lot of key codes to recongnize and the character codes can differ, it seems, across browsers. Just when I was in despair about the struggles creating this control it hit me that there is a much easier way. The only thing that needs to be taken into consideration is when the event on the control gets fired.
The solution is to take the length of the text in the TextArea and subtract it from the desired limit.
counter =140 - length
For this to work though the event needs to occur after the TextArea is updated. So keep track and update the counter using the KeyUpEvent in GWT.
int counter = 240
TextArea post = new TextArea();
post.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
int postLength = post.getText().length();
counter = 140 - postLength;
submit.setEnabled( (counter<140) );
if( submit.isEnabled() ){
submit.removeStyleDependentName("disabled");
}else{
submit.addStyleDependentName("disabled");
}
count.setText( counter + "" );
}
});
One additional problem is how to keep the counter from going negative by allowing the user to type in too many characters. The solution is to create a KeyDownEvent handler that will check the current counter and make sure it is not less then 1 before allowing the Key event to propagate. Once the text content length reaches 140 then the event will need to be prevented.
post.addKeyDownHandler(new KeyDownHandler() {
public void onKeyDown(KeyDownEvent event) {
if( counter<1 ){
event.preventDefault();
event.stopPropagation();
}
}
});
Wednesday, April 7, 2010
Agile Project Documentation
Recently I had to summarize several weeks worth of work and hand sketches into something that is presentable to the client. The first thought is to throw together some screen shots of the application and put that in a document and send it off. The problem with that approach is that there has been a lot of thought on much more then screen shots. Thought has been given to the platform that this could be deployed to, the method for scaling the product, the ability to test the product, day to day management of the product, as well as over all coding.Thought has been given to how the system should be extendable by using interfaces in key points so alternative implementations can be created in the future. The interaction of the software components and the packaging of the software has also been under consideration.
I always have trouble writing this type of document. It takes me longer then I would like and I never feel like the flow and content are up to parr. This time I have spent sometime reflecting on the paper. The paper itself turned out to be around 30 pages long and contained the screen shot section, an architecture section, and a very small sample of what a "Getting Started" page might look like.
I think the problem with my approach is although I preach Agile for software development I never really think of anything else in bite size chunks. For example there has been several times over the last month that I had a clear picture in my mind of how to explain a part of the system. Instead of sitting down and creating a content snippet right then I let the thought evaporate. Unfortunately when I sit down to document the system and all the design the thoughts do not come back into mind so easily. In fact while some of the content comes to mind quickly most of it I am grasping for. That makes one tired.
I am looking into creating Agile documents. Documents with low amount of ceremony so I can keep the personal attachment down. I don't want to create a classic piece of literature i just want to explain the technical merits of a system. I realize to do that I need to improve on my writing abilities.
I have a though about using Google Wave as a snippet holder for both pictures and text. As thoughts come to mind I can create a new entry on the wave. By using a Wave BOT maybe I can have the snippets published to a WIKI or just as a PDF or something... Don't know yet. That is where my thought on this stops.
So why not just use a text editor or any other tool for recording snippets and then use some shell script to publish. That might be a solution tool. Currently I like using Wave because several people can collaborate on the content and it is simple to edit content on a Wave. To me the Wave environment makes since for creating Agile documentation.
The one area that I also need to think about is structure of the content. I would like to have a simple straight forward structure that I use over and over. I know there are thousands of design documents out there but I haven't seen a lot of standardization.
I am looking at a book with the title Agile Software Documentation
I always have trouble writing this type of document. It takes me longer then I would like and I never feel like the flow and content are up to parr. This time I have spent sometime reflecting on the paper. The paper itself turned out to be around 30 pages long and contained the screen shot section, an architecture section, and a very small sample of what a "Getting Started" page might look like.
I think the problem with my approach is although I preach Agile for software development I never really think of anything else in bite size chunks. For example there has been several times over the last month that I had a clear picture in my mind of how to explain a part of the system. Instead of sitting down and creating a content snippet right then I let the thought evaporate. Unfortunately when I sit down to document the system and all the design the thoughts do not come back into mind so easily. In fact while some of the content comes to mind quickly most of it I am grasping for. That makes one tired.
I am looking into creating Agile documents. Documents with low amount of ceremony so I can keep the personal attachment down. I don't want to create a classic piece of literature i just want to explain the technical merits of a system. I realize to do that I need to improve on my writing abilities.
I have a though about using Google Wave as a snippet holder for both pictures and text. As thoughts come to mind I can create a new entry on the wave. By using a Wave BOT maybe I can have the snippets published to a WIKI or just as a PDF or something... Don't know yet. That is where my thought on this stops.
So why not just use a text editor or any other tool for recording snippets and then use some shell script to publish. That might be a solution tool. Currently I like using Wave because several people can collaborate on the content and it is simple to edit content on a Wave. To me the Wave environment makes since for creating Agile documentation.
The one area that I also need to think about is structure of the content. I would like to have a simple straight forward structure that I use over and over. I know there are thousands of design documents out there but I haven't seen a lot of standardization.
I am looking at a book with the title Agile Software Documentation
Monday, April 5, 2010
At the Library
Okay, I am at the library with my nephew working on finishing up some documentation. Today is the first day of blogging with an accountability partner. A colleague at work gave me the idea of being accountable to get each other into a pattern of blogging. New habits can be hard to form but repetition will create a habit. So here is first day of accountability blogging.
Marc are you blogging? Marc's blog link will go here when I find out what it is. No more time for now.
I have it now: Marc Johson
We are keeping an eye Marc's blog for his first post. Very excited!!
By the way we hope to be doing a podcast with Marc at the end of May. We will be interviewing him on the creation of his company Today Forward.
Marc are you blogging? Marc's blog link will go here when I find out what it is. No more time for now.
I have it now: Marc Johson
We are keeping an eye Marc's blog for his first post. Very excited!!
By the way we hope to be doing a podcast with Marc at the end of May. We will be interviewing him on the creation of his company Today Forward.
Sunday, April 4, 2010
Trip to Jackson
So this weekend I had to run with my father-in-law to Jackson TN, just about 2 hours south west of Nashville, to pick up the kids. My father-in-law drove so I spent the time reading and looking through my Kata pile of stickies formerly hanging on the wall. I have categorized my Kata's into piles dealing with basic operations, build operations, and general maitenance operations.
The one Kata that I think I have perfected is "Take a Note". I was also working on make a blog entry and I got mired down in TextMate, Apple Script, and Quicksilver. I think I may take a break from working directly on Kata's and just spend some time researching Quicksilver plugins.
The one Kata that I think I have perfected is "Take a Note". I was also working on make a blog entry and I got mired down in TextMate, Apple Script, and Quicksilver. I think I may take a break from working directly on Kata's and just spend some time researching Quicksilver plugins.
Saturday, March 27, 2010
Kata
"is a Japanese word describing detailed choreographed patterns of movements practiced either solo or in pairs. Kata are used in many traditional Japanese arts such as theater forms like kabuki and schools of tea ceremony (chadÅ), but are most commonly known for the presence in the martial arts. ..."
I am going to start blogging regularly whether I have anything to say or not. Sometimes it feels like I may not be ready to put my thoughts down in a complete well formed manner; however, because of a desire to form some new professional habits I am going to try to blog daily. To form a discipline habit.
Today's topic is the Software Kata.
The idea of the Software Kata is not my own but this idea resonates with me. Here is a link to Dave Thomas's Kata page.
I have not been thinking about computer science algorithms or even programming task in particular. I have been thinking about the routine stuff I do on my laptop everyday. I don't want the routine stuff to get in the way of the more important task of the day. If you watch a musician, painter, gymnast, or martial artist when they are performing it is a exhilarating. After watching a good musician I become inspired to pick up my bass and immediately start working on my routines.
Now with another favorite thing of mine. Developing software I want to develop those kind of abilities as well. I want the operation of me and this machine to be similar to that of a musician and their instrument.
I was at work and I asked a colleague a question and he proceeded to perform several operations on his machine. I noticed how quickly and gracefully he navigated the file system, files, and applications. In fact from that moment on I kept that experience in mind and mentioned it to several other developers in the group and they had noticed this persons grace as well. All of a sudden I felt like a kid holding his first guitar, strumming the strings and really not knowing what else to do.
My plan is to use software Kata's developed for everthing from the simplest to the more complex things in my profession. I will practice these Kata's dajavascript:void(0)ily, weekly, and monthly. I know with continued focus in this area I can bring my level up to a much higher level of grace and elegance. After all this stuff is fun why let the machine and my clunky interactions get in the way!
I am going to start blogging regularly whether I have anything to say or not. Sometimes it feels like I may not be ready to put my thoughts down in a complete well formed manner; however, because of a desire to form some new professional habits I am going to try to blog daily. To form a discipline habit.
Today's topic is the Software Kata.
The idea of the Software Kata is not my own but this idea resonates with me. Here is a link to Dave Thomas's Kata page.
I have not been thinking about computer science algorithms or even programming task in particular. I have been thinking about the routine stuff I do on my laptop everyday. I don't want the routine stuff to get in the way of the more important task of the day. If you watch a musician, painter, gymnast, or martial artist when they are performing it is a exhilarating. After watching a good musician I become inspired to pick up my bass and immediately start working on my routines.
Now with another favorite thing of mine. Developing software I want to develop those kind of abilities as well. I want the operation of me and this machine to be similar to that of a musician and their instrument.
I was at work and I asked a colleague a question and he proceeded to perform several operations on his machine. I noticed how quickly and gracefully he navigated the file system, files, and applications. In fact from that moment on I kept that experience in mind and mentioned it to several other developers in the group and they had noticed this persons grace as well. All of a sudden I felt like a kid holding his first guitar, strumming the strings and really not knowing what else to do.
My plan is to use software Kata's developed for everthing from the simplest to the more complex things in my profession. I will practice these Kata's dajavascript:void(0)ily, weekly, and monthly. I know with continued focus in this area I can bring my level up to a much higher level of grace and elegance. After all this stuff is fun why let the machine and my clunky interactions get in the way!
Tuesday, July 28, 2009
Subscribe to:
Posts (Atom)