Posts

Green Cleaning: Its impacts on Health & Environment

Image
Green cleaning refers to the use of cleaning methods and products that are environmental friendly in nature as it contains ingredients and products that are designed to preserve and create no harm to the human health and environment quality. These green cleaning products and techniques avoid the use of materials which contain toxic or harsh chemicals some of which emit volatile organic compounds which cause respiratory, dermatological and other dreaded conditions. Products are environmental friendly and biodegradable. Little that we verify, what it is in that container of Your favorite Cleaning Product? Experts say that most of the cleaning products are made up of enormous amount of chemicals which can impact the health of users. As people are being more aware of the impacts and zooming in the market, people begin rethinking what they will be bringing into their homes. Famous water pollutant is phosphates, water-softening mineral additives that were once widely used in laun...

So, What is E-commerce?

The Internet has created a new economic ecosystem, the e-commerce marketplace, and it has become the virtual main street of the world. Providing a quick and convenient way of exchanging goods and services both regionally and globally, e-commerce has boomed. Today, e-commerce has grown into a huge industry with US online retail generating $179 billion in revenues in 2010, with consumer-driven (B2C) online transactions impacting industries from travel services to consumer electronics, from books and media distribution to sports & fitness. So Lets see what is E-commerce: E-commerce: E-commerce (electronic commerce or EC) is the buying and selling of goods and services on the Internet. In practice, this term and e-business are often used interchangeably. For online retail selling, the term e-tailing is sometimes used. It has lot of benefits too: 1. Global Presence : The penetration of your business is Global. Means your business can go from India to US, Australia to South Africa. 2. L...

Capturing a Screenshot in Java (Using AWT)

Image
Taking a screen shot in Java, sounds interesting right. Suddenly, While Searching to internet I came across this. Here is the piece of code with which you can do this task: import java.awt.AWTException; import java.awt.Rectangle; import java.awt.Robot; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class ScreenCapture { public static void main(String[] args) { try { Robot robot = new Robot(); //The Size of Rectangle is Similar to Screen Resolution. BufferedImage bi=robot.createScreenCapture(new Rectangle(1280,1024)); //This will write the image to this particular location ImageIO.write(bi, "jpg", new File("C:/Ashish Docs/ScreenShot.jpg")); } catch (AWTExcepti...

Bridging Java and Adobe Air - Merapi

Image
How Exiciting it will be if you can call Java directly from an AIR Application? I got excited when i read first time. And I feel you will also be. So why to wait, here is the solution for it........ Merapi Merapi: A Bridge between Adobe AIR and Java Merapi is a bridge between applications written in Java and those running in and created for Adobe AIR™ (Adobe Integrated Runtime™). Merapi has been designed to run on a user's machine, along with an Adobe AIR™application and providea direct bridge between the Adobe AIR™ framework and Java, exposing the power and overall calabilities of the user's operating system, including 3rd party hardware devices. With a light weight and straightforward API, developers can leverage the OS by writing Java companion applications for their AIR™ applications. Java programs treat Merapi as a bridge to the running Adobe AIR™ application and vice-versa. How to achieve this is given below: Sending a message from ActionScript: var message : Message = ne...

Finding Postions of HTML Element in a Scrollable Div

Hi Friends, Have you ever find it difficult to find the x, y coordinates value for a HTML element in side a scrollable div. Just few days back, i got this problem. where i wanted to show tool tip on a link, but since the HTML element was in a scrollable div, the positioning to tooltip was not correct. Here is the code earlier i used to find the X and Y positions: function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } This function works well when your HTML element is not within a scrollable div. B...

Removing null or specific values from list in Java

Have you tried to remove null values from a List (may a ArrayList). Yesterday I was trying it out, when I had to remove null values from a List before processing it. Initially, I was trying with the simple for loop and out I was getting Still NullPointerException while processing. I tried with couple of ways, before I came to a efficient one. Lets see this with an example: Lets see what are the flaws, when u try to remove null values from a List with a for loop: List li = new ArrayList(); FileListItem fLI = new FileListItem(); fLI.setFormFileName("123"); FileListItem fLI2 = new FileListItem(); FileListItem fLI3 = new FileListItem(); FileListItem fLI4 = new FileListItem(); fLI4.setFormFileName("456"); li.add(fLI); li.add(fLI2); li.add(fLI3); li.add(fLI4); System.out.println("====this.fileList() =====" + li); for(int i = 0;i System.out.println("li Size ====" + li.size() + " & Va...

Holi 2008 - Better than Expected

Image
Hi Friends, This time I celebrated holi in Pune. This year it was special. Check out the photos, which will tell you about it. Thanks My frens, who were there with Me. I hope Everybody had a great fun on that day.

Its nothing but All about me.

Hi Friends, I am Ashish Kumar Mishra. I am an Indian. I born an brought up in Hisar, a district of Haryana. I did my schooling from Hisar. But Schools keep changing after every year or 2. I did my Matriculation, From Leading High School. And Intermediate from New Yashoda Public School. Then I joined degree program from Maharshi Dayanand University in Computer Applications. In my school days (Before Matriculation), I decided that i am going for a Degree in Computers and I thought a Degree in Computer Applications was a better option. After my graduation, I went to Delhi, started preparing for the Entrance of Post Graduation in Computer Application. I joined a Company in Delhi as Trainee Programmer. But my father wanted me to go for Higher Educations. Even I wanted to go for it. And I took admission in my Post Graduation Programme in Computer Application offered by Amravati University. I passed my Post Graduation in 2007. But in 5th Semester, I joined a Company called Vision System G...

Sun To acquire MySQL

Image
Sun Microsystems is going to jump in the database market with the purchase of most successful open source database developer MySQL for $1 billion. This is the main center of attraction on both the websites: & With the move, announced Wednesday, Sun takes a big leap into the $15 billion database market and pits it against the likes of Microsoft, IBM and Oracle. MySQL have clients Facebook, Google, Nokia and Baidu as customers. What makes MySQL interesting to Sun. About 20 percent of MySQL deployments run on Solaris, according to Sun estimates outlined on a conference call. Seventy five percent of MySQL deployments are not on Sun hardware. That gives Sun an opportunity to bundle hardware software and services. While Sun can also distribute MySQL through its channel and OEM partnerships and create various bundles. The overarching goal is to give MySQL more “commercial appeal” and boost adoption of open source software in the enterprise. One big question is what Sun does next to build...

Three Rules for Effective Exception Handling

Image
Exceptions in Java provide a consistent mechanism for identifying and responding to error conditions. Effective exception handling will make your programs more robust and easier to debug. Exceptions are a tremendous debugging aid because they help answer these three questions: • What went wrong? • Where did it go wrong? • Why did it go wrong? When exceptions are used effectively, what is answered by the type of exception thrown, where is answered by the exception stack trace, and why is answered by the exception message. If you find your exceptions aren't answering all three questions, chances are they aren't being used effectively. Three rules will help you make the best use of exceptions when debugging your programs. These rules are: be specific, throw early, and catch late. To illustrate these rules of effective exception handling, this article discusses a fictional personal finance manager called JCheckbook. JCheckbook can be used to record and track bank account activity...

Waoo - Netbeans 6 is Available

Image
The much awaited IDE NetBeans 6 is out today. In morning when i saw the email from net beans stating: [nbannounce] NetBeans IDE 6.0 Available . I couldn't stop myself from digging its features. It supports almost all current technologies and standard of Java/J2EE/Web Services/SOA. Even, I ordered for a Free starter kit DVD. So why Don't you order or download the NetBeans 6 Today. NetBeans is easy to use IDE. Here is link to order a Starter Kit: Get My Own NetBeans 6 Starter Kit . or Click the Image to get It: NetBeans 6 DVD includes: NetBeans IDE 6.0 with all packs Java(TM) Platform Standard Edition Development Kit (JDK) 6.0 Update 3, Java Tutorials, NetBeans tutorials and screencasts. Following Operating Systems are Supported: Windows, Linux, Solaris x86, Solaris SPARC Mac OS X. Currently, The NetBeans starter kit is available in English language, but very soon it will be available in other languages also. So what are you waiting for. Just register and Get it.

Google Desktop Search - Awesome Tool

Image
Hi Friends, I found something very interesting something about google desktop search. I think, it is really useful to share with you people. Google Desktop Search acts as your own personal Google Server and indexes the contents your system by file name, or in the case of select file formats, by the contents of the file. It runs on Windows XP and Windows 2000 (with Service Pack 3). The free download indexes the full text of email created in Outlook or Outlook Express, Word documents, Excel spreadsheets, PowerPoint presentations, AOL Instant Messages, and caches the pages you view in Internet Explorer so you can revisit the page later "even if its live content has changed or you're offline." The install is really simple and after you install it starts indexing. If you are working on your system then it will take a while to index. As soon as it realizes the machine is idle it starts churning away. After it indexes the data you are presented with a browser based interface muc...

Manipulating String intelligently

Image
Performance and Optimizations are the key features desired in Java Programming. So here are some examples, how to make improvement in your String manipulation.. String is the most encountered Objects in Java Programming. Till Tiger, we have 3 Classes to manipulate Strings. These are String, StringBuilder, StringBuffer. String is immutable whereas StringBuffer and StringBuilder can change their values. StringBuilder was introduced in J2SE5 or Tiger.The only difference between StringBuffer and StringBuilder is that StringBuilder is unsynchronized whereas StringBuffer is synchronized. So when the application needs to be run only in a single thread then it is better to use StringBuilder. StringBuilder is more efficient than StringBuffer. Here are some examples given by Mr. Heinz Kabutz about how to perform String Manipulation intelligently. We start with a basic concatenation based on +=: public static String concat1(String s1, String s2, String s3, String ...

Calendar class - Better Way to Manipulate Dates.

Java’s Calendar class offers a set of methods for converting and manipulating temporal information. In addition to retrieving the current date and time, the Calendar class also provides an API for date arithmetic. Calendar’s built-in date/time arithmetic API is extremely useful. This tutorial examines the Calendar class API and presents examples of how you can use Calendar objects to add and subtract time spans to and from dates and times, as well as how to evaluate whether one date precedes or follows another. Adding time spans Let’s say you want to add a time span to a starting date and print the result. Consider the following example, which initializes a Calendar to 16 July 2007 and then adds two months and three days to it to obtain a new value: import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; public class CalenderDemo{ public static void main(String[] args) { CalenderDemo tdt = new CalenderDemo(); tdt.calculateDa...

Reflection APIs - A way to inspect classes at runtime

Java Reflection is a technology that looks inside a Java object at runtime and sees basically everything about the object that you would know at compile time. Java Reflection is a technology that looks inside a Java object at runtime and sees what variables it contains, what methods it supports, what interfaces it implements, what classes it extends—basically everything about the object that you would know at compile time. The Reflection API is located in the java.lang.reflect package and is included in any J2SE installation. Primarily it is intended for very generic programs such as database browsers or visual code editors, but it can be used in any other applications. Reflection is for Basic techniques There are two basic techniques involved in Reflection: discovery and use by name. Here are descriptions of both: Discovery involves taking an object or class and discovering the members, superclasses, implemented interfaces, and then possibly using the discovered e...

Java Singleton Pattern : Potential Problems and Solutions

The Java Singleton pattern belongs to the family of design patterns that governs the instantiation process. This design pattern suggests that at any time there can only be one instance of a Singleton (object) created by the JVM. You implement the pattern by creating a class with a method that creates a new instance of the class if one does not exist. If an instance of the class exists, it simply returns a reference to that object. How the Singleton pattern works: Here’s a typical example of Singleton: public class Singleton { private final static Singleton INSTANCE = new Singleton(); // Private constructor suppresses generation of // a (public) default constructor private Singleton() {} public static Singleton getInstance() { return INSTANCE; } } The classic Singleton does not use direct instantiation of a static variable with declaration — it instantiates a static instance variable in the constructor without checking to see if it already ex...

Struts Are the Really Very Beautiful..................

Three Days Before Struts started in Training program. I Heard that Struts are very difficult to understand. But After three days, I found how beautifully they are designed by the Craig R. McClanahan. I also learned Here in current company that learning the concepts is very neccessary rather than just gulping the APIS. I really thank our instructor for this. Hey I m not going to write about the struts, since web is just full of such kind of material. The spirit is to force urself to learn the basics of anything. Technology may change not the basic concepts. Time to Take a Break.

Exams Season of Tension, Isn't It?

Exams are going on, Tension is also there. But Exams should be there to test us, otherwise we''l become Lazy..... Isn't IT?

Hey Proud to be an Indian.

Hi day before yesterday, it was 59th Independance Day. We seen the as usual 15th august parade & just enjoyed another holiday. But we r forgetting the meaning of the day. On this day, i remembered what our President said in 'Ignited Minds'. His mission of transforming India into a developed country. Youth like us need to think abt it seriously. We can do this simply by performing our duties like not paying bribes, oppose the curruption, just switching the electric equipments, by keeping our environment clean, etc. By making people aware abt their fundamental duties & rights. Everyone need to do his share of work in transforming India into a developed. Lets make a commitment to ourself that we'll do these small things & help our country. In this way only, we'll find true meaning of these days like 15th August, 26 Janauary, etc. Ok bye for now, i m coming back soon... Ashish