Thursday, July 9, 2009

Bing vs. Google

Came across this interesting Bing vs. Google tool. Must say, I was pleasantly surprised by the consistency of results and opinions.


Friday, February 1, 2008

GWT RemoteServiceServlet + Guice = GuiceRemoteServiceServlet

If you use Guice and GWT you'll probably find this handy:
GuiceRemoteServiceServlet is a wrapper servlet for GWT RPC utilizing Guice for managing RemoteService implementation object's lifecycle.


<servlet>
<servlet-name>GWT-RPCServlet</servlet-name>
<servlet-class>com.gc.gwt.server.GuiceRemoteServiceServlet</servlet-class>
<init-param>
<param-name>guice.module</param-name>
<param-value>com.test.guice.MyGuiceModule</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>GWT-RPCServlet</servlet-name>
<url-pattern>/GWT.rpc</url-pattern>
</servlet-mapping>


  1. map all you remote service implementations in Guice Module
  2. define and map GuiceRemoteServiceServlet as shown above
  3. point ALL services to the same /GWT.rpc


The source for the GuiceRemoteServiceServlet can be found here.

Good luck.

PS: GuiceRemoteServiceServlet depends on Guice and apache-commons beanutils.

PS2: The source of GuiceRemoteServiceServlet is distributed under Apache 2.0 License.

Monday, December 10, 2007

MS Volta is doomed I tell you... doooooo-o-o-o-oomed!!!

Not that I care about any of the MS technology, but the simple reason for such dramatic subject is this screenshot (I took it myself):

This is the simplest sample application: http://labs.live.com/volta/samples/Quickstart.html
135 requests, 2.29MB download (only 56KB from cache), it took 31.67 seconds, FF said "Not Responding" while it was loading and I've been loading it for the third time.

They're not going to get out the sandbox with that attitude.

Monday, November 26, 2007

The Eclipse Integration for Apache Maven (IAM)

The biggest obstacle for using Maven full time at work or my open-source projects was the absence of reasonable IDE support. There is an eclipse Maven plugin available, but it has some significant issues (I won't go into details):
http://maven.apache.org/eclipse-plugin.html

And finally, Eclipse will have "native" maven support!!!
http://www.eclipse.org/proposals/iam/

Eclipse IAM - The Eclipse Integration for Apache Maven proposal was approved. So, this time next year (according to the tentative time line) we'll be able to, hopefully, efficiently use maven from within eclipse.

1 day down, 364 to go...

Tuesday, October 30, 2007

What's up with Firefox?

Just take a look at that memory usage:

And the Firefox window in question is this:

Yes, I did work with some resource intensive pages, but I've closed them all. So, what's up with Firefox?

Monday, October 15, 2007

Nice GWT Tree: Part 2

This is my second attempt to introduce lines in GWT Tree. This a very rough version: download patch (for the 1.4.60 tag).

Basic usage:

// Create a tree with a few items in it.
TreeItem root1 = new TreeItem("root 1");
root1.addItem("item0");
root1.addItem("item1");
root1.addItem("item2");

TreeItem subItem1 = new TreeItem("sub item 1");
subItem1.addItem("item0");
subItem1.addItem("item1");
subItem1.addItem("item2");

root1.addItem(subItem1);
root1.addItem("item3");
TreeItem subItem2 = new TreeItem("sub item 1");
subItem2.addItem("item0");
subItem2.addItem("item1");
subItem2.addItem("item2");


// Add a CheckBox to the tree
TreeItem item = new TreeItem(new CheckBox("item3"));
root1.addItem(item);

root1.addItem(subItem2);


TreeItem root2 = new TreeItem("root 2");
root2.addItem("item0");
root2.addItem("item1");
root2.addItem("item2");

Tree t = new Tree((TreeImages) GWT.create(TreeLinedImages.class));
t.addItem(root1);
t.addItem(root2);

// Add it to the root panel.
RootPanel.get().add(t);

interface TreeLinedImages extends TreeImages {

/**
* @gwt.resource treeOpenLined.gif
*/
AbstractImagePrototype treeOpen();

/**
* @gwt.resource treeClosedLined.gif
*/
AbstractImagePrototype treeClosed();

/**
* @gwt.resource treeLeafLined.gif
*/
AbstractImagePrototype treeLeaf();
}



CSS:

.gwt-TreeItem {
}

.gwt-TreeItem-selected {
background-color: #3169C6;
}

.gwt-TreeItemTable {
padding: 0px;
margin: 0px;
border-collapse: collapse;
}

.gwt-TreeItemTable tbody, .gwt-TreeItemTable td, .gwt-TreeItemTable tr, .gwt-TreeItemTable th {
padding: 0px;
margin: 0px;
}

.gwt-TreeItem-Nested {
margin: 0px;
padding: 0px;
}

.gwt-TreeItemTdImg {
border: 0px;
padding: 0px;
margin: 0px;
background: transparent url("tree_connect_tb.gif") repeat-y 7px top;
}

.gwt-TreeItemTdImgLast {
border: 0px;
padding: 0px;
margin: 0px;
}

.gwt-TreeItemChildSpan {
margin: 0px;
background: transparent url("tree_connect_tb.gif") repeat-y 7px top;
}

.gwt-TreeItemChildSpanLast {
}



And you should see something like this:


You'll also need to include tree.css and the images from the zip file.

Good luck.

Tuesday, October 9, 2007

GWT-Ext (GWT wrapper for ExtJS) - the bug fixing adventure

Recently I started playing around with ExtJS — it is agruably (vs. Dojo) the best integrated JavaScript widget library. I was also pleased to learn that there is a GWT wrapper library out in the wild, i.e. GWT-Ext. But (there is always a "but") I quickly learned that it's not all flowers — none of the key Drag&Drop features were implemented in gwtext-0.9.1. So I had to go back to writing all that nasty JavaScript by hand.

Shortly after, gwtext-0.9.2 was released and I was pleased to learn that tree Drag&Drop support was added, but (obviously) some key events were missing, like "move" and "nodedaragover" wasn't returning the crucial boolean (to indicate wheather to allow drop on the target node). And then I decided that instead of filing a bug report and waiting for it to be considered from a pile of other bugs and enhancement requests I'd rather fix it myself and just share a patch. And that's what I did. It took me a couple of hours to figure out a fix and 30 seconds to send a patch... and to my surprise it took only a couple of days for my fix to be included in the trunk. It saved me a lot of grieve of trying to maintain my own fixed version.

Here is a link to the discussion on the GWT-Ext developers forum.

I guess the moral of this story is that if you find a bug, don't rush to file that bug report... try to spend a few minutes to figure it out yourself. It will:
  • give you an opportunity to learn the product/library/framework,
  • allow you to narrow down the scope of the problem,
  • give you better understanding of the circumstances that lead to the failure,
  • give you valuable knowledge that will allow you to write a bug report that will include more of the much needed details.
Ultimately it will directly reflect on the time spent to fix the problem.