Thursday, August 25, 2005

Google Sidebar Hotkey Activation

I like the new Google Desktop with the sidebar. It shares similarities with Konfabulator, recently bought by yahoo. They both allow easy access to some custom little widgets that I would call "active". They are active because they are refreshed periodically with new information (processor usage, news, scratch pad, emails, etc). But while Konfabulator choose to emphasize on visual effects, Google prefers a more standard information presentation. This shows as well in their choice of technologies:
  • Google Sidebar plug-ins are just Windows appz that can take advantage of Google Interfaces. That makes them quite powerful in theory, but programming them is less accessible.
  • Konfabulator plug-ins are Javascript+XML, the Javascript is not just regular client-side javascript, it can use Konfabulator API (containing many effect and rudimentary network access), and COM objects . That makes them very focused on presentation, and the Internet.
In the long run, Google choice makes sense, the forthcoming Avalon will make visual effects very accessible to windows developers.

Now back to the subject, I missed the 'activation on hotkey' feature from Konfabulator for the Google Sidebar. Fortunately, I a have found a powerful little open-source program, Autohotkey, that allowed me to do that very quickly. Here is the script I use (it's a hack since it relies on toolbar size (but not position), but I like the default position and it works (only using floating deskbar, i let you figure out for the non floating version)):
F12::
MouseGetPos, X, Y
if WinExist("ahk_class _GD_Sidebar")
{
WinActivate
BlockInput,On
MouseClick, left, 160, 16
MouseMove, X,Y
BlockInput,Off
return
}
else if WinExist("ahk_class ATL:0044A4C8")
{
WinActivate
BlockInput,On
MouseClick, left, 158, 16
MouseMove, X,Y
BlockInput,Off
return
}


Categories: , , , , ,

Google Sidebar Hotkey Activation

I like the new Google Desktop with the sidebar. It shares similarities with Konfabulator, recently bought by yahoo. They both allow easy access to some custom little widgets that I would call "active". They are active because they are refreshed periodically with new information (processor usage, news, scratch pad, emails, etc). But while Konfabulator choose to emphasize on visual effects, Google prefers a more standard information presentation. This shows as well in their choice of technologies:
  • Google Sidebar plug-ins are just Windows appz that can take advantage of Google Interfaces. That makes them quite powerful in theory, but programming them is less accessible.
  • Konfabulator plug-ins are Javascript+XML, the Javascript is not just regular client-side javascript, it can use Konfabulator API (containing many effect and rudimentary network access), and COM objects . That makes them very focused on presentation, and the Internet.
In the long run, Google choice makes sense, the forthcoming Avalon will make visual effects very accessible to windows developers.

Now back to the subject, I missed the 'activation on hotkey' feature from Konfabulator for the Google Sidebar. Fortunately, I a have found a powerful little open-source program, Autohotkey, that allowed me to do that very quickly. Here is the script I use (it's a hack since it relies on toolbar size (but not position), but I like the default position and it works (only using floating deskbar, i let you figure out for the non floating version)):
F12::
MouseGetPos, X, Y
if WinExist("ahk_class _GD_Sidebar")
{
WinActivate
BlockInput,On
MouseClick, left, 160, 16
MouseMove, X,Y
BlockInput,Off
return
}
else if WinExist("ahk_class ATL:0044A4C8")
{
WinActivate
BlockInput,On
MouseClick, left, 158, 16
MouseMove, X,Y
BlockInput,Off
return
}


Categories: , , , , ,

Tuesday, August 23, 2005

I Need Another DB Framework!

I am currently facing a problem that neither Hibernate nor iBatis solves nicely. I also looked at other ORM or just DB framework, without success.

What I would need is a framework that generates PreparedStatements with a query by Criteria like API. I have many queries that are similar but varying according to different input parameters. iBatis can handle this, but for complex queries and scenarios, the XML becomes completely unreadable, and you therefore loose any advantage that iBatis was bringing with the externalization of SQL statements in XML. The other issue I have with using iBatis is that for another part of my project, the automatic generation of SQL statements a-la Hibernate is useful.

Hibernate has a very nice Query by Criteria API, but it lacks just a tiny bit of flexibility in customizing queries. For example, I could not find a way to specify a "USE INDEX(index_name)" in the generated SQL, after the SELECT FROM xxx and before the rest of the query. I did not find either a way to specify the use of a "STRAIGHT_JOIN" instead of an INNER JOIN. These are all MySQL specific issues, but those little things are extremely useful at improving some of my queries performances. Writing N sql queries hard coded is not a good option, since this N can be quite big, which is why I am using Query by Criteria in the first place.

So is there a need for yet another DB framework?

I Need Another DB Framework!

I am currently facing a problem that neither Hibernate nor iBatis solves nicely. I also looked at other ORM or just DB framework, without success.

What I would need is a framework that generates PreparedStatements with a query by Criteria like API. I have many queries that are similar but varying according to different input parameters. iBatis can handle this, but for complex queries and scenarios, the XML becomes completely unreadable, and you therefore loose any advantage that iBatis was bringing with the externalization of SQL statements in XML. The other issue I have with using iBatis is that for another part of my project, the automatic generation of SQL statements a-la Hibernate is useful.

Hibernate has a very nice Query by Criteria API, but it lacks just a tiny bit of flexibility in customizing queries. For example, I could not find a way to specify a "USE INDEX(index_name)" in the generated SQL, after the SELECT FROM xxx and before the rest of the query. I did not find either a way to specify the use of a "STRAIGHT_JOIN" instead of an INNER JOIN. These are all MySQL specific issues, but those little things are extremely useful at improving some of my queries performances. Writing N sql queries hard coded is not a good option, since this N can be quite big, which is why I am using Query by Criteria in the first place.

So is there a need for yet another DB framework?

Sunday, August 21, 2005

del.icio.us toolbar customized

When I bookmark articles with delicious, I like to keep the content on my hard drive, because pages sometimes change, or are removed, or I want to do local searches. I believe this is one reason some people like furl (furl keeps a copy on their server that only yourself can read, but does not allow search).

A combination of slogger and delicious could solve partially the problem. But it is not integrated, I can't get my local version from delicious, so I loose the tagging, listing and all other plus from delicious.

I added my own feature to the delicious toolbar, which I like very much. This new toolbar saves automatically the file you bookmark (on the + button), and will add a link in your delicious home to the local version (if it exists).

I have it publicly accessible at http://perso.wanadoo.fr/logos01/deltoolbar.html

It is not meant to be used by everybody as it is not official. But the page will give you an idea of what it does. If you think it is useful, I will improve it, otherwise it will stay the way it is because it fits my use.

Categories: , ,

del.icio.us toolbar customized

When I bookmark articles with delicious, I like to keep the content on my hard drive, because pages sometimes change, or are removed, or I want to do local searches. I believe this is one reason some people like furl (furl keeps a copy on their server that only yourself can read, but does not allow search).

A combination of slogger and delicious could solve partially the problem. But it is not integrated, I can't get my local version from delicious, so I loose the tagging, listing and all other plus from delicious.

I added my own feature to the delicious toolbar, which I like very much. This new toolbar saves automatically the file you bookmark (on the + button), and will add a link in your delicious home to the local version (if it exists).

I have it publicly accessible at http://perso.wanadoo.fr/logos01/deltoolbar.html

It is not meant to be used by everybody as it is not official. But the page will give you an idea of what it does. If you think it is useful, I will improve it, otherwise it will stay the way it is because it fits my use.

Categories: , ,

Thursday, August 18, 2005

Inside the Java Virtual Machine

I am reading an old book, Inside the Java Virtual Machine. Some old books don't age, and this is one of them. The chapter on the Java Virtual Machine is just excellent and should be read by every Java developer. It explains each step a JVM does when you run a Java program, very clearly.

You could get plenty of stupid interview questions from it like: How is the Java stack used? Between method area, heap, pc register, stack which one are shared among threads?

Also they saw the full potential of Java quite early on (1997). They explain how the JVM specs allow for very different implementations, ones that can run in different environments, for example, simplifying a bit: low memory, embedded world, or lots of memory, mainframe world. It is not an accident if Microsoft chosed a very similar design for the CLI of .NET, they have been looking for getting into the embedded area for quite some time, and apparently, they are making good progress.

Tags:

Inside the Java Virtual Machine

I am reading an old book, Inside the Java Virtual Machine. Some old books don't age, and this is one of them. The chapter on the Java Virtual Machine is just excellent and should be read by every Java developer. It explains each step a JVM does when you run a Java program, very clearly.

You could get plenty of stupid interview questions from it like: How is the Java stack used? Between method area, heap, pc register, stack which one are shared among threads?

Also they saw the full potential of Java quite early on (1997). They explain how the JVM specs allow for very different implementations, ones that can run in different environments, for example, simplifying a bit: low memory, embedded world, or lots of memory, mainframe world. It is not an accident if Microsoft chosed a very similar design for the CLI of .NET, they have been looking for getting into the embedded area for quite some time, and apparently, they are making good progress.

Tags:

Tuesday, August 16, 2005

Firefox Shortcut URL as Command Line for the Web

I have been doing some work on Firefox extensions. Mozilla/Firefox is a really interesting world, it is extremely flexible, you can make it transform the web the way you want.

Recently, someone started YubNub, the "command line for the web", a very simple idea, but useful. This is a bit similar to the Firefox Search Bar, except more powerful, and quicker to use. Mozilla developers actually had that idea a long time ago (around 2000), it is called shortcut url. Basically to any bookmark, you can add a shortcut, you then just have to type that shortcut (let say g for google.com) in the address bar to go to the address pointed by the shortcut. This shortcut accepts 1 parameter (represented by %s in the URL), so you can do "g chasethedevil" to search google for "chasethedevil" if you set up your shortcut properly. Firefox can build this dynamic URL automatically for you if in an input box, you right click and choose "Add a keyword for this search".

Now we have seen the Firefox address bar can be used to quickly perform a search on a selected website. But this can be much more powerful. As this page suggests, you can associate a bookmarklet with a shortcut, you can execute whatever javascript you wish. One very simple example is:
javascript:void(location.href=
'http://web.archive.org/web/*dc_/'+location.href)
. This shows how you can use the address bar in a very flexible manner. It would be easy to support a multiple parameters search using a bookmarklet. There is a whole list of commands very similar to yubnub ones in addition to those on the previously mentioned link.

I first thought about writing a simple extension to have my command line in Firefox (for example by extending the getShortcutOnURI function), but after some information gathering, I discovered it was already possible. Firefox is truly amazing. It is a bit of a shame that this functionality is not a bit better exposed to the user.

tags:

Firefox Shortcut URL as Command Line for the Web

I have been doing some work on Firefox extensions. Mozilla/Firefox is a really interesting world, it is extremely flexible, you can make it transform the web the way you want.

Recently, someone started YubNub, the "command line for the web", a very simple idea, but useful. This is a bit similar to the Firefox Search Bar, except more powerful, and quicker to use. Mozilla developers actually had that idea a long time ago (around 2000), it is called shortcut url. Basically to any bookmark, you can add a shortcut, you then just have to type that shortcut (let say g for google.com) in the address bar to go to the address pointed by the shortcut. This shortcut accepts 1 parameter (represented by %s in the URL), so you can do "g chasethedevil" to search google for "chasethedevil" if you set up your shortcut properly. Firefox can build this dynamic URL automatically for you if in an input box, you right click and choose "Add a keyword for this search".

Now we have seen the Firefox address bar can be used to quickly perform a search on a selected website. But this can be much more powerful. As this page suggests, you can associate a bookmarklet with a shortcut, you can execute whatever javascript you wish. One very simple example is:
javascript:void(location.href=
'http://web.archive.org/web/*dc_/'+location.href)
. This shows how you can use the address bar in a very flexible manner. It would be easy to support a multiple parameters search using a bookmarklet. There is a whole list of commands very similar to yubnub ones in addition to those on the previously mentioned link.

I first thought about writing a simple extension to have my command line in Firefox (for example by extending the getShortcutOnURI function), but after some information gathering, I discovered it was already possible. Firefox is truly amazing. It is a bit of a shame that this functionality is not a bit better exposed to the user.

tags:

Wednesday, August 10, 2005

Hibernate Criteria API vs HQL Overhead

I was wondering what was the framework weight in the performance of my application, and I wanted to check at several frameworks performance. I used JMeter to benchmark a stripped application (database access through tomcat) under various loads.

My very modest test shows no significant difference between Hibernate Criteria API and HQL access for queries. Criteria might be a few milliseconds slower, but my query time will take 10x more time, even for a relatively simple query (my query is has 3 inner joins, is grouped, with a count and takes only 4ms when performed once in mysql under no load).

It seems much more important for the Framework of choice to provide good scalability, easy development and maintenance, rather than saving a few cycles, unless the Framework becomes a bottleneck.

Tags:

Hibernate Criteria API vs HQL Overhead

I was wondering what was the framework weight in the performance of my application, and I wanted to check at several frameworks performance. I used JMeter to benchmark a stripped application (database access through tomcat) under various loads.

My very modest test shows no significant difference between Hibernate Criteria API and HQL access for queries. Criteria might be a few milliseconds slower, but my query time will take 10x more time, even for a relatively simple query (my query is has 3 inner joins, is grouped, with a count and takes only 4ms when performed once in mysql under no load).

It seems much more important for the Framework of choice to provide good scalability, easy development and maintenance, rather than saving a few cycles, unless the Framework becomes a bottleneck.

Tags:

Friday, August 05, 2005

How to become a JavaRSS member on blogger.com

The trick is to create a post with the javarss image and to use the link generated by blogger.com to display the image. Then you can follow the rules from http://www.javarss.com/pages/?page=suggest

How to become a JavaRSS member on blogger.com

The trick is to create a post with the javarss image and to use the link generated by blogger.com to display the image. Then you can follow the rules from http://www.javarss.com/pages/?page=suggest