അനർഗള നിർഗള പ്രവാഹം
  • ബഹിർസ്പുരണങ്ങൾ
  • Note Book
  • Family History
  • ബഹിർസ്പുരണങ്ങൾ
  • Note Book
  • Family History
Search by typing & pressing enter

YOUR CART

7/30/2016 0 Comments

Framework bloat

Glad that I found this - still relevant. Majority of enterprise application performance issues can be solved if data access code is in its native language with out convoluted framework bloat the authoritarian "I want all cool framework names on my CV" architect throws at the project.

​https://vimeo.com/28885655
0 Comments

10/2/2013 1 Comment

How to move part of iTunes library to external drive

Copied the  answer by Chris CA from Apple Support Communities thread. 

To easily move some of your library...

  1. iTunes prefs - Advanced.
  2. Make a note of the current iTunes media folder location (default is /Music/iTunes/iTunes media/).
  3. Tick Keep iTunes media folder organized.
  4. Tick Copy files to iTunes folder when adding to library.
  5. Set the iTunes media folder location to the external drive where you want the files to be.
  6. Click OK.
  7. Select the files in iTunes you want on the external.
  8. Right click - Consolidated selected items.
This will copy everything selected to the location set above.

Now you can delete the TV shows from /Music/iTunes/iTunes media/TV Shows/.

All metadata will be retained.

After you are finished, go to iTunes prefs Advanced and reset the iTunes media folder location to the location you noted in step 2.
​
1 Comment

10/2/2013 1 Comment

How to change the Preview Image/Artwork of an iTunes Video

The artwork or poster frame or default image (whatever you call it) of an iTunes video (especially if its made and published from iMovie) can be changed by the following steps

1. Double click and play the video in new window
2. Pause/Stop and drag the time scale to the frame you want to set as poster frame
3. Right click on the video and select "Set Poster Frame"
1 Comment

7/22/2013 1 Comment

SQL RANK() function Example

   SELECT p.version, p.launch_date
   RANK() OVER (PARTITION BY p.version
   ORDER BY p.launch_date DESC) "Rank"
   FROM product p WHERE p.id = '1234'
Picture
1 Comment

7/22/2013 0 Comments

SQL: Select the minimum and maximum values of a column grouped by another column for a given where clause.

select   p.version, min (p.launch_date) as first, max(v.launch_date) as last
from product p
where p.id = '1234'
group by p.version, p.id
order by  p.version

The above query selects the first and last launch dates for every version (major version number assumed) of a given product with id 1234
Picture
0 Comments

7/12/2013 1 Comment

How to stop JiBX from marshalling empty nodes for null fields on structure mapping

Use a test-method on the structure to return false if the field value is null.
Note: This can be applied only when the usage attribute is set to optional (ie. usage="optional")

E.g.

<structure name="CreditCard" field="creditCard"  usage="optional" test-method="hasValidCredtiCard">
    <value name="CardNumber" field="number" usage="optional"/>
    <value name="ValidThru" get-method="getValidThru" set-method="setValidThru" usage="optional"/>
    <value name="NameOnCard" field="name" usage="optional"/>
    ....
</structure>
1 Comment

6/14/2013 0 Comments

Supporting multiple Databases in Hibernate

Data Source definition

<bean id="oracleDataSource" >
    <property name="jndiName" value="jdbc/oracleDSName"/>
</bean>

<bean id="mySqlDataSource" >
    <property name="jndiName" value="jdbc/mySqlDSName"/>
</bean>
    
        
Session Factory Configuration

<bean id="oracleSessionFactory" >
    <property name="dataSource" ref="oracleDataSource" />
    <property name="packagesToScan">
        <list>
            <value>com.feature.entities.db</value>
        </list>
    </property>        
 
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
            <prop key="hibernate.show_sql">false</prop>
        </props>
    </property>
 </bean>    
    
<bean id="mySQLSessionFactory" >
    <property name="dataSource" ref="mySqlDataSource" />
    <property name="annotatedClasses">
        <list>
            <value>com.feature.entities.db.ClassA</value>
            <value>com.feature.entities.db.ClassB</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
            <prop key="hibernate.show_sql">false</prop>
        </props>
    </property>
</bean>    
    

Configure the DAOs. 

<bean id="oracleBaseDAO" >
    <property name="sessionFactory" ref="oracleSessionFactory"/>
</bean>
<bean id="mySqlBaseDAO" >
    <property name="sessionFactory" ref="mySQLSessionFactory"/>    
</bean>   ​
0 Comments

6/14/2013 1 Comment

Spring AOP and Transaction Management

Step 1: declarations in applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">


     <!-- SessionFactory is assumed to be defined -->
    <bean id="documentsDAO" class="com.feature.dao.DocumentsDAOImpl"  lazy-init="true">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean> 

    <bean id="documentsService" class="com.feature.service.DocumentsServiceImpl" lazy-init="true">
           <property name="dao" ref="documentsDAO"/>
    </bean>  
  

    <bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager" />    
  
    <aop:config>

        <aop:pointcut id="documentsServiceMethods" 
                                    expression="execution(* com.feature.service.DocumentsService.*(..))" />
        <aop:advisor advice-ref="txAdvice" pointcut-ref="documentsServiceMethods"/>

    </aop:config>

    <tx:advice id="txAdvice" transaction-manager="txManager">
        <tx:attributes>
        
    <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>
 </beans>

Step 2: Annotate the Class

package com.feature.service
import org.springframework.transaction.annotation.Transactional;
import com.feature.dao.DocumentsDAO;
import com.feature.entity.Document;
import com.feature.entity.Category ;

public class DocumentsServiceImpl implements DocumentsService {
    @Transactional
    private List<Document> getDocuments(Category category){
        DocumentsDAO dao = getDocumentsDAO();
        return dao.getDocuments(category);  
    }
}

NOTE: The @Transactional annotation can be applied to methods in any class - not necessarily a DAO
1 Comment

    Archives

    July 2016
    October 2013
    July 2013
    June 2013

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.