Anything that interests me finds place here. Software dominates my interests and hence a good part of this blog as well.
Wednesday, October 21, 2009
Tuesday, October 20, 2009
Did you leave your shoes to the right or the left of the umbrella?
The umbrella
As tradition dictates, upon entering his Zen master’s house, the disciple left his shoes and umbrella outside.
“I saw through the window that you were arriving,” said the master. “Did you leave your shoes to the right or the left of the umbrella?”
“I haven’t the least idea. But what does that matter? I was thinking of the secret of Zen!”
“If you don’t pay attention in life, you will never learn anything. Communicate with life, pay each moment the attention it deserves – that is the only secret of Zen.”
Source: Warrior of the Light
Saturday, October 17, 2009
Creating text with images

Tip: To make a selection from scissors select tool, click inside the selection
Friday, October 16, 2009
Thursday, October 15, 2009
Creating callouts or speech bubbles in GIMP

Add a new layer to the image by selecting Layer -> New Layer:

Give the new layer a new name (optional)

The new layer can now be found in the layers window:
Now select the Ellipse Select Tool from the Toolbox window
Draw an ellipse on the image where the callout is required:
In my case, I wanted the border line of the call out to have the same color as the cat's face. So I had to set my foreground colour to the cat's face color. To do so, select the Color picker tool in the toolbox. In the layer's window, select the Background layer.
With the Color picker tool click on the cat's face to set that color as the foreground color.
Select the new layer that was created in the first few steps:
Now select the fill tool and make sure "FG color fill" is selected.
Now click inside the ellipse. The image looks like this now:
Now click select -> Shrink.
In the next dialog, enter the size of the callout's border. In my case I wanted a 3 pixel border.
The selection now reduces by the number of pixels entered in the previous step:
Now click edit -> clear.
Now the border of the call out is nicely formed.
Now get rid of the selection (Select -> None)
Now to extend the call out, use the Path tool. Select click on points indicated:
After clicking on the 3rd point, hold the control key, hover over the 1st point and when the mouse pointer changes a little bit, click. This will make the selection a closed one.
Now draw lines over the selection by selecting Stroke selection:
In my case the size of the call out line is 3 pixels (entered previously in the shrink selection step). The same size is entered here too:
Now the image looks like this:
Using the same steps, make another call out for the mouse:
Now the lines within the call out arrows have to be removed. To do so, zoom in:
Select the Paths tool and go about clicking on the line segment that needs to be erased. Now select "Stock path" and select "Stock path from paint tool" and select "Erase" in the drop down (before doing this select the eraser tool in the tool bar and make sure the brush size [in the eraser tool properties] is correct) and stroke. This will erase the un-necessary parts and look like this:
Use, the Text tool and enter the desired text into the call out. Have Fun/ :-)
This tutorial is based on this article with more details and certain improvements.
Spring Terminology: Weaving
1. Compile Time: Aspects woven into targets when target class is compiled. This requires a special compiler though. Aspectj's weaving compiler weaves aspect this way.
2. Classload time: Aspects woven into targets when target class is loaded into the JVM. This requires a special class loader that enhances the target class's byte code before it is introduced to the application. Aspectj 5's load time weaving (LTW) support is based on this approach.
3. Runtime: Aspects woven into targets when target class is invoked. Typically an AOP container will generate a proxy object that will deliver the aspect functionality before or after delegating to the target object. This is how Spring AOP aspects are woven.
Source: My understanding from reading "Spring In Action"
Spring Terminology: Proxy
Source: My understanding from reading "Spring In Action"
Spring Terminology: Target
Source: My understanding from reading "Spring In Action"
Spring Terminology: Introductiion
Source: My understanding from reading "Spring In Action"
Wednesday, October 14, 2009
Spring terminology: Aspect revisited
See previous post titled “What is Cross Cutting Concern? Why AOP? What is Aspect?” before reading this.
An Aspect is an amalgam/merger of advice (what and when) and pointcuts (where) [see previous posts on advice and pointcuts].
Spring Terminology: PointCut
An Aspect (see previous post on what an Aspect is) need not handle all Join points of an application. A specific Aspect can be made responsible for a subset of Join points. PointCuts are used to define the subset of join points that a given Aspect is responsible for handling. In other words PointCuts defines the join points where the aspect logic is to be applied. This “where” can be defined on specific, explicit class and method names or through regular expressions that apply to classes and method names that match the pattern.
Spring Terminology: Join Point
Points in application logic where the aspect’s (see previous posts on what an Aspect is) functionality is to be applied or plugged in. This point could be a method invocation, field write/modification or exception thrown. There are points where the aspect’s logic can be pluged in to add new behaviour.
Spring Terminology: Advice
Defines the responsibility of the Aspect (see previous posts on what an Aspect is) in terms of what (will be performed) and when (it will be performed – before/after/before and after/only on exception).
What is Cross Cutting Concern? Why AOP? What is Aspect?
There are certain aspects of the application that has to be addressed at every layer of the application and cannot be categorized to be a responsibility of any one single layer. Examples are logging, transaction management, security, Caching, Validation etc…
These aspects that span across the several layers of the application are cross cutting concerns. AOP helps decouple cross cutting concerns from the application logic that they impact.
If there was no AOP, one would have to implement common functionality in a base class and have all classes make use it. But this will make the object hierarchy brittle. Other common approach is to delegate common functionality is to utility class. But this will require calls to the utility method spread all across application logic code.
In AOP, the common functionality is implemented in a single class. But this class is invoked by declaratively defining how and where the functionality needs to be applied without having to modify the class to which the functionality is applied to.
These classes that hold common functionality are called Aspects.
Now, the application logic code or service modules contain code pertaining only to their primary responsibility or primary concern and secondary concerns move to aspects. The second advantage is that all common functionality is nicely held in a single place.
Why Dependency Injections
Dependency Injections helps decouple the various components of the application by
- Having the components reference each other through abstract interfaces and
- Delegate instantiation of concrete implementation classes to a dependency injection framework like Spring












