Monday, July 28, 2014

Oba nathuwa inna bari tharamata (Guitar Chords)

Artist : Victor Rathnayaka

[Intro] [ G - 4/4 ]
-------------------------------------------------
|  G  |  -  |  Em |  -  |
|  G  |  -  |  D  |  -  |
|  D  |  -  |Bmin |  -  |
|  D  |  -  |  G  |  -  |


[Chorus]
-------------------------------------------------
G                          Emin    
Oba nathuwa inna bari tharamata 
G                          D
oba hithata awith hemi hemihitha 
Bmin                       D
oba nodaka inna bari tharamata 
Bmin         D             G
Netha obawa soyanawa dawasema

[Intern] [ G - 4/4 ]
-------------------------------------------------
|  G  |  -  |  Em |  -  |
|  C  |  -  |  G  |  -  |
|  D  |Bmin |  D  |Bmin |
|  G  |  -  |  -  |  -  |

[Verse 1]
-------------------------------------------------
G                    Emin
Mei Sithal hima giri arane
Bmin                    G
mata hamu wu wana pasa kusume
G                         D
pethi matha sthapa regena yanna ma
Bmin      D          G
kusum nimnaye malathiye

[Chorus]
-------------------------------------------------
Oba nathuwa inna bari tharamata..

[Verse 2]
-------------------------------------------------
G                   Emin
Me jeewana awapasa ahase
Bmin                   G
oba purpasa sada ve pipune
G                      D
obe rasin ma dawalann ra
Bmin       D            G
laya matha snaha raajaniye

[Chorus]

-------------------------------------------------

Oba nathuwa inna bari tharamata..

Monday, March 10, 2014

Spring MVC Get file under WEB-INF or in any lib *.jar

Use Spring DefaultResourceLoader and Resource to read inside WEB-INF or any resources in a *.jar file.


  import org.springframework.core.io.DefaultResourceLoader;
  import org.springframework.core.io.Resource;

       public static void myFunction() throws IOException {
            final DefaultResourceLoader loader = new DefaultResourceLoader();

            LOGGER.info(loader.getResource(
                  "classpath:META-INF/resources/img/copyright.png").exists());

            Resource resource = loader.getResource( 
                  "classpath:META-INF/resources/img/copyright.png");

            BufferedImage watermarkImage = ImageIO.read(resource.getFile());


        }

Sunday, February 2, 2014

Kimada Nawe (Guitar Chords)

Artist : Clarence Wijayawardana
[Intro] [ G - 4/4 ]
-------------------------------------------------
|  D  |  -  |  -  |  -  |
|  G  |  -  |  -  |  -  |
|  D  |  -  |  D7  |  -  |
|  G  |  -  |  -  |  -  |


[Chorus]
-------------------------------------------------
G                                  D
Kimada Naa..we, ai naa..we tharaha vee
                       D7            G
Kawuda kee..we boru kee..we mage daya
                            C   Cm
Pera nuu..ye ai uu..ye ada wage
       G            D7            G
Kimada Naa..we, Eai naa..we ada oya.

[Inter]
-------------------------------------------------
|  G  |  -  |  D  |  -  |
|  -  |  -  |  G  |  -  |
|  -  |  -  |  D  |  -  |
|  -  |  -  |  G  |  -  |

[Verse 1]
-------------------------------------------------
G                 D          D7               G
Hamadama bala sitiya, mage kawluwa lagata wela //
                            D
Kawada..wath nee uu..ye mee wa..ge
 
[Verse 2]
-------------------------------------------------
G                D           D7               G
Mage palpatha ada palui, nihadai adurai aththe //
                            D
Kawada..wath nee uu..ye mee wa..ge 

Oba Dutu E mul dine (Guitar Chords)

[Intro]
--------------------------------------
F  | C  | Bb  | Eb
Bb | C  | -   |

[Verse 1]
--------------------------------------
F          C
Oba dutu e mul dine
A           Dm
Siduwuu semade
Bb             C            F       C7
Thawamath mage mathakayehi rende...
F             C      
Neth yuga maa desa yoma
A            Dm       
Mage miyulesiye
Bb         C            F  C7
Kumak kiyannatada serasune

[Inter 1/2]
--------------------------------------
F  | C  | F  | Bb
Eb | F  | C  | F

[Verse 2]
---------------------------------------
F       C              A           Dm         
Kage kauruda kothenaka sitinawada oya
Bb           C          F  C7    
Keleseda maa eya denaganne....
F         C              A          Dm   
Kawada koibadi yali hamu wewi dei kiya
Bb           C           F    C7   
Penayaki maa sitha paaranne...

[Verse 3]
----------------------------------------
F             C       
Keti kota guwanata musukota
A            Dm     
Mage rasa hengum
Bb            C         F    C7  
Oba wetha geeyakin ewannam....
F              C              A          Dm     
Mathu dinayaka mage denethata oba hamuwe nam
Bb            C          F   C7                    
Edina newetha maa hinehennam

[End]
--------------------------------------
F   | C  | F  | Bb
Eb  | F  | C  | F

Wednesday, October 9, 2013

How to create java.util.Properties bean in Spring

We can inject java.util.Properties bean in Spring  with a PropertiesFactoryBean.  Here is how I did for my mybatis setting values.

 <!-- mybatist setting properties -->

 <bean id="mybatisConfigrations" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
  <property name="properties">
   <props>
    <prop key="cacheEnabled">true</prop>
    <prop key="safeRowBoundsEnabled">true</prop>
   </props>
  </property>
 </bean>

Thursday, August 15, 2013

How to integrate Oval validation with Spring 3

The way I see it. If you are currently doing validation in a spring mvc application by implementing
interface Validator undestanding spring oval intergration is supper easy. Anyway it doesn't matter you have any experiance on that or not you will understand how spring oval intergration can do at with this tutorial.

  • Oval what is oval?


  • Oval validation
  • spring support
  • oval class API


Need of a validator interface

public interface Validator {
boolean supports(Class clazz);
void validate(Object target, Errors errors);
}


Spring API to validate





Add this to your bean configuration file. Replace the highlighted configuration files with your ones.


<bean id="validator" class="net.sf.oval.integration.spring.SpringValidator">
<constructor-arg>
<bean id="validator" class="net.sf.oval.Validator">
<constructor-arg>
<util:list>
<bean class="net.sf.oval.configuration.xml.XMLConfigurer">
<constructor-arg>
<value type="java.io.InputStream">classpath:com/test/validation/oval1-config.xml</value>
</constructor-arg>
</bean>
<bean class="net.sf.oval.configuration.xml.XMLConfigurer">
<constructor-arg>
<value type="java.io.InputStream">classpath:com/test/validation/oval2-config.xml</value>
</constructor-arg>
</bean>
</util:list>
</constructor-arg>
</bean>
</constructor-arg>
</bean>

The class net.sf.oval.integration.spring.SpringValidator provides an implementation of Spring's org.springframework.validation.Validatorinterface and thus can be used for Spring Validation.




False fear

There is a figure they said She talks to me It's a mischievous voice I can't deny that love They say she is pretty Smart and wa...