Viral Patel

Lazy Load Image & WordPress Gravatar using JavaScript / JQuery

Lazy Load Image & Wordpress Gravatar using JavaScript / JQuery
A webpage load time plays a very crucial role in SEO and impacts your website ranking significantly. Google has already incorporated site speed as one of the several signals that it uses to determine search ranking. The faster your website loads the better it will perform in google ranking.There are several things one can do ...

21 JavaScript Tips and Tricks for JavaScript Developers

21 JavaScript Tips and Tricks for JavaScript Developers
If you are doing lot of JavaScript programming, you might find below list of code snippets very useful. Keep it handy (bookmark it) and save it for future reference.Here are 20 very useful JavaScript tips and tricks for you.Disclaimer: Not all these snippet are written by me. Some of them are collected from other sources ...

CSS Styling Radio Button and Checkboxes

CSS Styling Radio Button and Checkboxes
The idea is simple. We want to change the look and feel of existing radio buttons into more of a push button. The above image pretty much tells what we want to achieve.Now we want to do this without using Javascript or JQuery. Just plain HTML and CSS. Nothing fancy.Lets dive into code. 1. The HTML The ...
Tags:

Java XPath Tutorial: How to Parse XML File using XPath in Java

XPath is a language for finding information in an XML file. You can say that XPath is (sort of) SQL for XML files. XPath is used to navigate through elements and attributes in an XML document. You can also use XPath to traverse through an XML file in Java.XPath comes with powerful expressions that can be used to parse an xml document and retrieve ...

Android Internet Connection Status & Network Change Receiver example

Android Internet Connection Status & Network Change Receiver example
If you are developing an Android app you may already fetching information from internet. While doing so there is a chance that internet connection is not available on users handset. Hence its always a good idea to check the network state before performing any task that requires internet connection.You might also want to check what kind of internet connection is available in handset. For example ...

Android: Activity name must be specified error

Android: Activity name must be specified error
If you are an avid Android developer there is a chance that you might have encountered this error.Activity name must be specifiedThe error popups up when we create a new Android project in Eclipse.You have no idea how to solve this!! You try giving all the values but still the error doesn't go away.Here ...

Spring MVC Flash Attribute tutorial with example

Spring MVC Flash Attribute tutorial with example
Spring MVC 3.1 version has added a very useful feature Flash attribute which it lacked and is now solving a long time problem of POST/Redirect/GET pattern.In a normal Web based MVC application each form submitted POST the data to the server. A normal spring controller (tagged with annotation @Controller) fetches the data from request and process it further (save or update in database). Once ...

Dynamic Property Loader using Java Dynamic Proxy pattern

While reading through Stackoverflow, I came up to this interesting question: Java Properties File binding to Java Interface. The idea is simple but quite helpful.Basically we create an interface like:interface LoginConstants extends Constants { @DefaultStringValue("Welcome to my super app") @Key("appDescription") String appDescription();@DefaultStringValue("Ok") @Key("okButtonLabel") String okButtonLabel(); }And whenever we want to use ...

Android Install/Uninstall Shortcut example

Android Install/Uninstall Shortcut example
Nowadays many android apps installs a shortcut on home screen when you install the app and run it for the first time. This is a nice strategy to engage user by compiling them to use your app. Most of times when a user install an app, the app is deep buried in list of apps making it almost difficult to discover. So its always a ...

Struts 2 Action Chaining example

In Struts 2, sometimes you may want to process another action when one action completes. For example on successfully submitting a form you want to render output from other action.This is called Action chaining in Struts 2. One action leads to another one and so on.Request > Action 1 > Action 2 > ResponseIn Struts ...
Page 1 of 3212345...102030...Last »