Skip to main content

Posts

Showing posts from April, 2012

jQuery : Stop Jsnow Animation

How to stop Jsnow animation? Hi, Jsnow is one of the light-weight jQuery plug-ins which is producing snow effect. Here, I want snow effect no longer after few seconds of initate and Jsnow is working in background continuously to make snow effect perfect. Obviously, this is affect event handling speed of other javascripts. And In my case, I have to stop Jsnow completely. So I have added an option variable "stopSnow" and by default it is holding value "0" which is mean run snow forever and then made some changes plugin itself. By changing this value (in milliseconds), I can stop the snow completely. Plugin Code:  // jSnow, a jQuery Plugin v1.1.mod2    // Licensed under GPL licenses.    // Copyright (C) 2009 Nikos "DuMmWiaM" Kontis, dummwiam@gmail.com    // http://www.DuMmWiaM.com/jSnow    // Modified 2009~   // Updated in 2009 by Shadowmint (http://shadowmint.blogspot.com/)   // Updated in 2010 by Serban Boanca (http://www.dj50.ro/

Spring - The purpose of parent attribute.

 The "parent" element of <bean> tag is used for reusing configuration parameters. This "parent" attribute accepts a reference to an another bean of same type. All the parameters that are configured in parent bean are also available in child bean. See the below example.  In this example I have configured two beans in beans.xml file namely bean1 and bean2. The bean2 have an parent attribute value as "bean1", In this situation the bean2 inherits the all the properties and values of the bean1 (name1, name2, name3, name4 - properties and values).   If you want to override the some of the property of bean1 then you have to redefine the same properties into child bean. Here the properties name3 and name4 are  override-ed by child bean (bean2). 

Spring - Map configuration using xml bean configuration file

 This is very simple example for configuring Map in spring application using XML bean configuration file and this is my bean class. package com.mapconfig; import java.util.Map; public class MapConfig {       Map<String,String> demoMap ;       public Map<String, String> getDemoMap() {             return demoMap ;       }       public void setDemoMap(Map<String, String> demoMap) {             this . demoMap = demoMap;       }       } The corresponding beans.xml file is here. <? xml version = "1.0" encoding = "UTF-8" ?> < beans xmlns = "http://www.springframework.org/schema/beans"       xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"       xsi:schemaLocation = "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" >       <!-- Map configuration -->       < bean id = &