Posts Tagged ‘How-To’

Page 1 of 41234

JavaScript Array Remove an Element

JavaScript Array Remove an Element
Following is an example of JavaScript where we will remove elements from an array with Index and Value. There are different methods in JavaScript that we can use to remove elements. We will use splice() method. Remove Array element by Index First we will see an example were we will remove array element by its index. For this we can define a generic function removeByIndex(). function removeByIndex(arr, ... Full story

jQuery Resizable and Draggable Tutorial with Example

Have you ever tried doing some animation using plain Javascript or moving DIVs here and there or resizing them?! Well, you know then how much pain it is as not only you have to tackle the difficult part of animation but also making it cross browser compatible. Well you probably know why I am stretching up so ... Full story

Run Multiple Instance of Apache Tomcat in Single Server

Run Multiple Instance of Apache Tomcat in Single Server
A lot of time we want to run multiple instances of Apache Tomcat server on a single machine. Generally this is done for creating a separate load balancer server for an application or install a different application independently. This can be achieved easy by some configuration in Tomcat Server. We need to install a second instance ... Full story

Display Twitter User Image on your Blog/Website in 2 Minutes

Display Twitter User Image on your Blog/Website in 2 Minutes
Twitter API has became a powerful way of getting information about a twitter user and her activities. In my previous tutorial we saw how to create a simple twitter reader in 5 minutes. Let us see how to get the User Image (or Avatar) from Twitter and display it anywhere you want. So how ... Full story

Blocking Obscene/Unwanted Ads in Google Adsense

Blocking Obscene/Unwanted Ads in Google Adsense
Since few days we were noticing some really obscene ads of a Gaming website on our blog. After quick search we found that these Ads were from a website called evony.com. We received lot of concerns/comments from our website visitors who were restraining to visit us from their work area just because of these ads. Evony ads are like a virus for a lot of people's ... Full story

Static Import in Java: New way to Import things in Java!

Static Import is a new feature added in Java 5 specification. Java 5 has been around the corner for some time now, still lot of people who are new in Java world doesn't know about this feature. Although I have not used this feature in my work, still it is interesting to know about. What is ... Full story

Convert ArrayList to Arrays in Java

A lot of time I have to convert ArrayList to Arrays in my Java program. Although this is a simple task, many people don't know how to do this and end up in iterating the java.util.ArrayList to convert it into arrays. I saw such code in one of my friends work and I thought to share this so that people don't end up writing easy ... Full story

Creating a dynamic menu-planning page and shopping list

Creating a dynamic menu-planning page and shopping list
I have a page on my site that allows users to create a shopping list from seven dinner recipes and one dessert, Users can deselect ingredients that are already onhand so that these items are not included on the shopping list.  You can see the page as it currently functions here:... Full story

WebSphere Application Server: Implement different Logout technique

WebSphere Application Server: Implement different Logout technique
Implementing Logout functionality in a form based authentication in J2EE website is straight forward. The session needs to be invalidated by calling request.getSession().invalidate() method. Thus in a simple servlet following code will be the code for logout: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getSession().invalidate(); response.sendRedirect("/sampleapplication/index.jsp"); } This is simple way for implementing logout. There is also another, ... Full story

How to execute a command prompt command & view output in Java

How to execute a command prompt command & view output in Java
The basic part is very easy. To do this, we will use the Runtime’s exec method. The code would be like: Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("ping localhost"); The command (I’ve used “ping localhost” ) can be anything that your command prompt recognizes. It will vary on UNIX and Windows environment. Now comes the bit where you would ... Full story
Page 1 of 41234
Copyright © 2010 ViralPatel.net. All rights reserved.