Friday, July 18, 2008
Love Marriage
The negative force that binds a jealous person is relatively difficult to deal with. In most cases, these “green-eyed” persons tend to shun away from the truth. In reality, to be jealous is normal. However, the point wherein the spouse will no longer listen to the truth and will only hold on to what he or she believes in even if those facts were not true is not acceptable. And if the spouse can no longer control his or her jealousy, the future of their marriage will be ruined. With jealousy, it is not surprising why the ratio of marriages to divorce nowadays is 2 to 1. It is no longer shocking why two million couples are getting a divorce every year.
The Solution:
Love in marriage should never be selfish and insecure. Married couples should never strive for their individual satisfaction. They should always make each other feel the love that binds them together. There are instances that a person cannot simply dismiss his or her jealousy. It is extremely important that they learn to keep the communications line open and tell their partners about the problem. It is not enough that jealous people try to stop assuming negative ideas. It is best that they tell their partners about them so that they can both work out some solutions to the problem. The difficulty with most married couples is that they are afraid to tell their partners the reason they are jealous, hence, miscommunication happens.
Researches show that married couples who do not have at least 80% open communication can expect the worst from their marriage. The bottom line is that jealousy should be resolved through proper communication. Let the other person know what you are jealous about. Make him or her understand how you feel about the past so that you can both create a good solution for the present. Best of all, try to make each other feel special and loved. Keep in mind that jealousy is basically rooted in insecurity. If a person who feels 100% assured that he or she is greatly loved by his or her partner, then, there is no room for jealousy, and their marriage will definitely grow old with them.
Note: If you are interested in further reading regarding this topic, we suggest that you visit the Marriage Book section of our web site. You may want to take advantage of our special introductory offer regarding our guide "15 Steps Towards Improving Your Marriage" as this offer is quantity limited .
Monday, June 23, 2008
JAVA Reflection API
Mirror, mirror, on the wall...
No, this is not about me looking at myself, or even my own code. Rather, it's my nomination for the Beautiful Code API. There is plenty of beautiful stuff in the Java SE API, but to my mind one of the most sublime pieces is Sun's Reflection API. While some dynamic languages let you do what Reflection does, I'm not aware of any other compiled, strongly-typed language (other than, perhaps, Java knock-offs like C#) that have anything like it.
So what is Reflection? Also known as Introspection, the Reflection API allows you to operate on classes and objects in ways such as the following:
* Load a class file into memory at run time, knowing only its name;
* Given a class, examine its methods, fields, constructors, annotations, and so on;
* Given a class, invoke constructors and methods;
* Given a class and an instance, access fields;
* Given an interface, create proxies for it dynamically.
A class named Class
It might seem strange to have "a class named Class" (maybe no more so than creating an object of class Object, I guess). But java.lang.Class has been around since the earliest days of Java; at least JDK 1.0, so I guess most of these uses were planned even then.
Time for a code example. Suppose you've invented a new API called a Showlet, sort of a cross between an Applet and a Servlet. You think lots of people will want to write their own Showlets. Create an interface for it:
package showoff;
public interface Showlet {
public void show();
}
Publicize it (this step omitted from this article; you're on your own). Now whenever somebody wants to write a showlet, they just implement your public interface. Say I write one called IanShow:
package com.darwinssys.jellybeans;
import showoff.Showlet;
public class IanShow implements Showlet {
public void show() {
System.out.println("OK, here's what I show: A234JQ");
}
}
Nothing very elaborate, but enough to show (so to speak) the operation. Your code will need to load this class, even though my class was written after your class, so you can't have a compile-time dependency on my class. However, to use it is no problem:
public class MyBigApp {
public static void main(String[] args) throws Exception {
String className;
// stub getting name of user-defined class from config file
className = "com.darwinsys.jellybeans.IanShow";
// Create this user's ShowLet
Class c = Class.forName(className);
Showlet s = (Showlet)c.newInstance();
// Now we have a showlet, make it do its thing:
s.show();
}
}
The whole magic part is the two lines of code below the comment "Create this user's Showlet". The first line uses the Class class' static forName() method to dynamically load the IanShow.class file from your classpath into the JVM. At this time the class file will be found, inspected, verified, and loaded into memory; after this it is treated pretty much like any other class in your application. The second line creates an instance of this class. The main requirement for this to succeed is that there must be a public, no-argument constructor in your class. Since this is the default constructor in Java, it's a safe bet. But in case the user messes up, one of a variety of Exceptions is just waiting to be thrown. See the JavaDoc, or compile this code in an IDE with the throws clause commented out. In a real "extensible application" model, you'd want to catch some of these and give better warnings.
One of the most annoying problems is ClassCastException, which would happen if the user provided a class that doesn't implement the Showlet interface. This would occur after the newInstance() call but before the assignment to variable "s". To prevent this exception, you'd normally use the built-in instanceof operator, but that requires the class be known at compile time. There is an isInstance method in the Class class; a more cautious version of the Showlet creation is thus:
Class c = Class.forName(className);
Object o = c.newInstance();
if (o instanceof Showlet) {
Showlet s = (Showlet)c.newInstance();
...
} else {
System.err.printf("Sorry, class %s is not a Showlet%n",
className);
}
What does all this give you? An extension or plug-in mechanism that is completely independent of user-defined classes. As long as they correctly implement your published interface, they will load and run.
Plan B
If for some reason you prefer inheritance, make Showlet be an abstract class with show() an abstract method. The instance classes then extend this rather than implement it. Everything else is pretty much the same.
Getting to Class
Class.forName() is one way of getting a Class descriptor, and it's familiar to anybody who's written a "JDBC 101" program (even though it's not how you get your database driver in real life). There are two other ways of getting a Class descriptor.
If the class whose descriptor you want is known at compile time, just say typeName.class. The "class" keyword in Java, if it appears after a "." with a type name before that, generates an expression of type "Class" for the given type. So String.class returns the same as Class.forName("java.lang.String"), for example.
Finally, if the class is not known but you have an object of the class, you can ask it for its class.
Class c = someRandomObject.getClass();
println("Object is of class " + c.getName());
What does this give you? One way or another, you should now be able to get a Class descriptor for any class in a Java program.
MyJavaP
The standard JDK has always included a program called javap, the Java printer. Javap has two main functions: it provides a quick view of a class' external structure, and it provides a detailed dump of a class' internal byte code. The latter is beyond the scope of the Reflection API; you would have to use a byte code library such as the Apache Byte Code Engineering Library (BCEL). The former, however, can easily be implemented using Reflection. When run against java.lang.Object, the Java SE implementation produces this output:
Compiled from "Object.java"
public class java.lang.Object{
public java.lang.Object();
public final native java.lang.Class getClass();
public native int hashCode();
public boolean equals(java.lang.Object);
protected native java.lang.Object clone() throws java.lang.CloneNotSupportedException;
public java.lang.String toString();
public final native void notify();
public final native void notifyAll();
public final native void wait(long) throws java.lang.InterruptedException;
public final void wait(long, int) throws java.lang.InterruptedException;
public final void wait() throws java.lang.InterruptedException;
protected void finalize() throws java.lang.Throwable;
static {};
}
I wrote a simple clone of javap, called MyJavaP. An earlier version of this was contributed to the Kaffe project. The output is as follows:
class java.lang.Object {
public java.lang.Object()
public native int java.lang.Object.hashCode()
public final native java.lang.Class java.lang.Object.getClass()
protected void java.lang.Object.finalize() throws java.lang.Throwable
protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException
public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
public final void java.lang.Object.wait() throws java.lang.InterruptedException
public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
public boolean java.lang.Object.equals(java.lang.Object)
public java.lang.String java.lang.Object.toString()
public final native void java.lang.Object.notify()
public final native void java.lang.Object.notifyAll()
}
As you can see, it misses some details, and the static code block. But, for a simple implementation (about sixty lines), it does not badly. The core of the implementation is shown in these twenty lines of code:
Class c = Class.forName(className);
System.out.println(c + " {");
int mods;
Field fields[] = c.getDeclaredFields();
for (Field f : fields) {
if (!Modifier.isPrivate(f.getModifiers())
&& !Modifier.isProtected(f.getModifiers()))
System.out.println("\t" + f);
}
Constructor[] constructors = c.getConstructors();
for (Constructor con : constructors) {
System.out.println("\t" + con);
}
Method methods[] = c.getDeclaredMethods();
for (Method m : methods) {
if (!Modifier.isPrivate(m.getModifiers())) {
System.out.println("\t" + m);
}
}
System.out.println("}");
Membership Lists
Suppose you want to become a famous Java author by creating a big fat book full of API cross-reference. Knowing there are new releases of Java SE every 12-18 months, do you:
* a) Read the javadoc, and type up a huge document with all the information for each class, or
* b) Write a program that extracts all this information mechanically, and sends it direct to your typesetting program?
If you answered "a", give yourself zero points, and thanks for playing! The correct answer is of course "b". In fact, using classes from java.util.zip along with Reflection makes this whole thing pretty easy. Once you have a Class object, there are methods in it with names like getConstructors(), getFields(), getMethods(), and so on. Each returns an array of descriptor objects, e.g. Constructor, Field, Method. These classes in java.lang.reflect (and their parent class Member) provide detailed information about one member in the given class. For example, a Method object contains the corresponding method's name, visibility, argument list, and so on. If a method is overloaded, each overload will return one Method.
The basic idea for the cross reference program, then, expressed as pseudo-code, is:
for (ZipEntry entry : new ZipFile(name).entries()) {
if (entry represents a Class) {
Class c = Class.forName(entry.getName());
for (Field f : c.getMethods()) {
print a field;
}
for (Method m : c.getMethods() {
print a method;
}
}
}
Of course, the real code is a bit more complex. And, in fact, I wrote it with the view that I might want to re-use parts of the code, so the outer loop and the "if entry represents a class" logic are in the abstract class APIFormatter; the logic of what to do with a given class is deferred to the template method doClass() in a subclass. The standard example is CrossRef, but there is another usage example in the JUnit test case APIFormatterTest. Finally, CrossRefXML extends CrossRef and overrides some of the output methods to output an XML document instead of a text document.
JavaBean Introspector
Several APIs use classes from the Reflection API. The JavaBeans API (java.beans) was both designed as a simplification layer to make it easier to use reflection for the less-ambitious task of getting an object's list of "properties" - fields that have setter/getter method pairs- and hence to make it easy for GUI builder tools to discover information about "Java Beans". The spec included the now-well-known setter/getter accessor pattern, requirement of a no-argument constructor, and the optional BeanInfo configuration file. Sun hoped and expected that tool building companies would produce GUI builders (based on JavaBeans) that would compete with Visual Basic. Arguably they have done so, in tools like Eclipse and NetBeans with their respective visual builders.
The Introspector is the main class you need to know. Its getBeanInfo() method takes a class name and returns a general-purpose BeanInfo object. This represents the list of properties either exposed by the bean or specified in the eponymous configuration file.
A new methodology - Dynamic Method Invocation
If you have a Method descriptor, you can invoke that method on any object of a class that contains it. Just call the Method's invoke() method passing the object (you can pass null if you're invoking a static method), and the argument list packed as an array of Object. Assume you are given class X containing this method:
public void work(int i, String s) {
System.out.printf("Called: i=%d, s=%s%n", i, s);
}
To find and invoke this method dynamically, given an instance of it called "x", all you need to do is:
Class clX = x.getClass();
// To find a method, need array of matching Class types.
Class[] argTypes = { int.class, String.class };
// Find a Method object for the given method.
Method worker = clX.getMethod("work", argTypes);
// To invoke the method, need the invocation
// arguments, as an Object array.
Object[] theData = { 42, "Chocolate Chips" };
// The last step: invoke the method.
worker.invoke(x, theData);
By itself this is a bit tedious to code, but it is background for the next few sections.
Dynamic Proxy and AOP
The Proxy pattern is well known: one object stands in for another. A Proxy can be created in Java using an interface and two classes, the "real" implementation and a surrogate or wrapper which implements the same interface and ultimately forwards each method call through to the "real" implementation. For example, if I want to create a Proxy for the Showlet example above, say, to verify the user's credentials before passing control to the provided Showlet, a do-nothing proxy impementation can be as simple as this:
public class ShowletProxy implements Showlet {
Showlet realObject; // set in constructor
public void show() {
realObject.show();
}
}
In real life the Proxy can do all sorts of other things, such as testing security, logging method calls and their parameters, network calls (used in RMI and EJB), and so on.
A more complete hand-written Proxy might look like this:
public class ShowletProxy implements Showlet {
Showlet realObject; // set in constructor
public void show() {
final String className = realObject.getClass().getName();
if (securityOK()) {
log("About to call " + className);
realObject.show();
log("Completed " + className);
} else {
log("Security - rejected " + className);
}
}
}
The downside of this is that it is tied to a particular interface, namely Showlet. What if you want to proxy ten, a hundred, or a thousand classes? It just doesn't scale. You need a way to write the proxies dynamically. That is, of course, the dynamic proxy mechanism. Introduced to Java in Java SE 1.3, the dynamic proxy mechanism in class java.lang.reflect.Proxy allows you to create a proxy to any interface dynamically, given only the interface and a general-purpose InvocationHandler. The InvocationHandler is where you specify what to do before and after the method invocation. An InvocationHandler allows you full control over the actual invocation of methods in the "real" object that is being proxied. There is only one method in the Invocation handler interface; a typical implementation might look something like this:
class MyInvocationHandler implements InvocationHandler {
private Object realObject; // set in Constructor
/**
* Method that is called for every call into the proxy;
* this has to invoke the method on the real object.
*/
public Object invoke(Object proxyObject, Method method, Object[] argList)
throws Throwable {
log("About to call " + className + "." + method.getName());
Object ret = method.invoke(realObject, argList);
System.out.println(" Completed.");
return ret;
}
}
The InvocationHandler's invoke() method is where the dynamic proxy calls your code; the "method.invoke()" is where your proxy calls the real object's method. The names are the same, but they are different steps along the chain, and the argument lists differ. Although the InvocationHandler's invoke() method is passed a reference to the dynamic proxy, it is not passed an reference to the "real" object, so this has to be provided in the class, either by a Constructor or (for greater flexibility) in a set method.
To create the dynamic proxy, use the Proxy class' newProxyInstance() method, which requires a ClassLoader (see below), one or more interfaces that are to be handled (as an array of Class objects), and a reference to the InvocationHandler:
Showlet generatedProxy = (Showlet) Proxy.newProxyInstance(
Showlet.class.getClassLoader(),
new Class[] { Showlet.class }, handler);
Because it's a nuisance to create the InvocationHandler and the Dynamic Proxy, this is normally delegated to a Factory method. Factory is another well-known design pattern used throughout Java: a class makes up objects for you (see for example Locale.getInstance() and Calendar.getInstance()).
In the code download you will find a class called DynamicProxyFactoryDemo which implements a Factory for the proxies; note that the main program now has no idea that proxying is going on; it deals only in the interface (and the factory).
public static void main(String[] args) {
Showlet showlet = ShowletFactory.getInstance();
System.out.println("Showlet Proxy object is " +
showlet.getClass().getName());
System.out.println("All done");
}
What does this give you? With Dynamic Proxy, you can create one proxy that will proxy all (or selected) requests for a huge number of methods on a large number of objects. However, the proxying has some setup complexity, so it's best if you can abstract object creation into the factory.
Aspects of change
A more generic way of handling this notion of proxying is to use programming language constructs to help automate it. This has lead to the rise of "Aspect Oriented Programming", or AOP. AOP uses some interesting vocabulary, but an "Aspect" is some function (such as logging or validation) that needs to applied automatically to a range of classes. Two important AOP implementations are Aspect/J (original site at PARC; current site at Eclipse.org) and the Spring Framework AOP. Spring provides a very general-purpose Bean Factory that is configured entirely by a configuration file, and a large array of pre-written beans. Useful in this context is their AutoProxyFactoryBean, which will automatically apply proxying to an arbitrary number of methods based on several seclection mechanisms, including one that uses Regular Expressions.
Since I'm sure there will be a BC article on Spring, I won't steal this article's thunder, but if you want a peek meantime, check out the Spring Framework site.
ClassLoaders and SecurityManagers and more, oh my
One topic I've not covered here is the notion of security. Java provides a SecurityManager class that can be used to limit what classes can do. A ClassLoader is, of course, the object that is responsible for loading classes. Java provides a default ClassLoader, but you can write your own. The topics of ClassLoaders and SecurityManagers are important, but this article is already at its maximum length. I urge you to learn about these topics, especially if you are going to be using dynamic classloading of classes provided by other, possibly untrusted, entities. These topics are discussed in my Java Cookbook (O'Reilly, 2e 2004) as well as in the Sun-provided documentation.
Conclusion
The Reflection API is truly sublime, because it allows your code to reach down into the JVM and do some of the same things that the Java runtime does: discover and load class files, instantiate classes, discover and invoke constructors and methods, discover and set/get fields, and more. In this Beautiful Code, I've shown some real-world code that uses this beautiful API.
Sunday, June 22, 2008
Community Goal for the Year 2010
ECONOMY
By the year 2010, the annual Median Family Income will increase by a higher percentage then the Bay Area Consumer Price Index.
By the year 2010, housing will be available and affordable to meet the needs of the local work force.
By the year 2010, county performance in key economic sectors such as agriculture, tourism and retail will meet or exceed the state average.
EDUCATION
By the year 2010, more students will be working at grade level with a curriculum that spirals in rigor throughout the K-14 system.
By the year 2010, more students will be ready for college and transfer ready from the community college into four-year colleges and universities.
By the year 2010, more schools will have a pre-kindergarten program available for all children.
HEALTH
By the year 2010, Santa Cruz County residents will have improved access to primary, specialty and emergency medical services. Appropriate planning and training will have been accomplished for medical response to disasters.
By the year 2010, 80% of healthcare providers will use Health Information Technology to improve patient safety, enhance healthcare systems efficiency, and provide community-wide secure health data to improve population health for Santa Cruz County residents.
By the year 2010, 75% of Santa Cruz County residents over the age of 60 will receive education and information regarding end of life choices and opportunities; thus empowering them to make self-determined decisions regarding health care.
By the year 2010, the prevalence of childhood obesity in Santa Cruz County will be reduced by 5%.
NATURAL ENVIRONMENT
By the year 2010, the health of rivers and the ocean is improved by reducing erosion, reducing pollution and increasing summer stream flows.
By the year 2010, more high density, “green” and affordable housing units will be developed near transit and job centers while open space is preserved and increased.
By the year 2010, single passenger auto use will be reduced by improving cyclist safety, increasing miles of bike lanes and increasing use of public transportation.
SOCIAL ENVIRONMENT
By the year 2010, more people will be educated and engaged in activities that strengthen our community and civic life.
By the year 2010, families and children will have access to the information, resources and support they need to succeed.
By the year 2010, all people in Santa Cruz will have a way to meet their basic needs for food, housing, healthcare, childcare and transportation.
By the year 2010, Santa Cruz County residents with physical, psychiatric and development disabilities will have access to community services needed to ensure integration and inclusion in all facets of community life.
PUBLIC SAFETY
By the year 2010, crime within Santa Cruz County will continue to decrease and residents will have increased confidence in their personal safety at home and in the community.
By the year 2010, children in Santa Cruz County will live in safer families and communities.
Year 2010
There is a debate as to how specific years of the 21st century should be pronounced in English. Although the majority of English-speakers say "two thousand (and) X" for any specific year post–1999, it is often suggested that the continuation of this type of pronunciation for the entire 21st century would be inappropriate or unnatural, given the alternative "twenty X" option.
Academics suggest that since former years such as 1805 and 1905 were commonly pronounced as "eighteen oh" or "nineteen oh" five, the year 2005 should naturally have been pronounced as "twenty oh-five".[1] Many experts agree that majority usage of "two thousand (and) X" is a result of influences from the Y2K hype, as well as the way "2001" was pronounced in the influential 1968 film, 2001: A Space Odyssey.
Many people, including linguistic and academic experts, predict that the "twenty X" pronunciation method will eventually prevail, but a time frame as to when this change will occur often differs. The year 2010 is suggested by many[2][3], while 2011[1] and 2013 are popular as well. The latest time frames for change are usually placed at 2020[1] or 2100.
According to a recent press release, David Crystal, author of the Cambridge Encyclopedia of the English Language, has predicted that the change of pronunciation to "twenty X" will occur in 2011, as "twenty eleven", explaining that the way people pronounce years depends on rhythm, rather than logic. Crystal claims that the rhythm or "flow" of "two thousand (and) ten", beats out that of "twenty ten", but the flow of "twenty eleven" beats out "two thousand (and) eleven".[1] Alternatively, Ian Brookes, editor-in-chief of Chambers Dictionary, suggests the change will occur in 2013. And finally, the UK Times has suggested 2020 as a final time frame for the change, saying "If people can have “twenty-twenty” vision, then surely they should also live in the year “twenty twenty”.[1] The team which organized the successful bid to host the Olympic Games of 2012 in London, styled the year they will hold the games as "twenty twelve". This appears to have been accepted with the British public.
In addition, some notable organizations are already switching to the "twenty" system. The favoured description for the 2010 Vancouver, Canada, Winter Olympic Games is stated as the "twenty ten" Winter Olympic Games, the 2010 FIFA World Cup is stated as the "twenty ten" FIFA World Cup, South Africa & the 2010 Commonwealth Games, India prefers the description of this Event as the "twenty-ten" Delhi Commonwealth Games, India.
Some suggest that after the "twenty X" pronunciation for current and future 21st century years has taken hold, future references to early 21st century years will change accordingly from the previous "two thousand (and) X" method; thus, they say, future generations will refer to the date of the 9/11 attacks in the United States as September 11, "twenty oh-one", just as 1911 was referred to as "nineteen hundred and eleven" at the time, but is now called "nineteen eleven".
Saturday, June 7, 2008
Get Paid
Get Paid Every Time Someone Visits Your Website
Is this the next big thing since Adsense ?
You actually get paid every time someone visits your website
This network site has been receiving some major press in the last couple of weeks.
HOW IT ALL WORKS:
When a visitor arrives at your website a short 5 second audio advertisement plays.
And you get paid for every audio message played.
What does that mean in passive income for you?
Here are some examples:
Your website receives 10,000 visitors per month … you make 25% of $280 additional passive income
Your website receives 50,000 visitors per month … you make 25% of $1400 additional passive income
Your website receives 100,000 visitors per month … you make 25% of $2800 additional passive income
Your website receives 1,000,000 visitors per month ... you make 25% of $28,000 additional passive income
... that's $7,000 per month
PLUS ANOTHER 5% ON ALL YOUR CONTACTS THAT YOU REFER !
This means if you refer someone who has a website that receives 1,000,000 visitors per month ... you make 5% of the $28,000
... or $1,400 per month just for the referral
Benefits:
1. The visitor does not have to click on an ad for you to earn revenue.
2. You keep your visitors on your site.
3. The ‘Pay Per Play' scheme is transparent so you know how much you will earn.
4. There is no cost to join.
Thursday, May 29, 2008
Sites using AdSense
Sites using AdSense include large information sites, affiliate-driven sites, forums and blogs.
"Chat" sites are considered not suitable. Some blogs are being rejected, but information-rich blogs are being accepted.
GoogleGuy explains AdSense
GoogleGuy, an anonymous Google employee who contributes to discussions on the WebMasterWorld.com forums, explains how AdSense will help information sites:
"...sites that provide solid content, especially niche sites that don't want to hunt down their own advertisers, should really benefit ... there's a whole universe of people who ... mostly produce informational sites, and the chance to recoup their costs without much effort is nice. I hope AdSense does encourage more diversity and voices on the web, because now smaller sites can work on what they're interested in - the content of their sites - without worrying very much about the costs of self-publishing information."
How to choose sites to block
You'll probably want to block some of the AdSense ads from appearing on your site. As well as blocking rubbishy sites, you may want to block tough competitors.
The ability to block sites is especially important for sites that are not purely affiliate-income driven. For example, if you're selling a service or a product you won't want competitors' ads on your site.
You can find such competitors by doing some searches on Google for key phrases that are important on your site and looking at the AdWords ads that appear.
Wednesday, May 21, 2008
Forget about Adsense
If you want to significantly increase your current Adsense earnings the first thing you need to do is forget about Adsense. Sounds strange doesn’t it, but if there is such a thing as a secret to making money with Adsense, it is that it has nothing to do with Adsense.
All Adsense is is a way of monetizing your website traffic. Therefore to make more money from Adsense you need a website and you need more traffic. No traffic, no Adsense clicks. Lots of traffic, lots of Adsense clicks. That’s the bottom line. You can get more traffic in two ways:
1. By bringing more to your existing website(s), or
2. By building a new website and bringing traffic to that.
Almost every forum post, blog entry and article that discusses Adsense and how to make money with it wrongly focuses on optimizing your website for your Adsense ads. Where should I place them, what colours should I use, how many units should I include on a page, should I use Adlinks, what format produces the highest click through rate – all of these questions belong to trying to increase responsiveness from your traffic to your Adsense ads. The prerequisite is traffic - if you’ve only got a few visitors coming to your website a day, even a 100% click through rate will only generate a dollar.
Now at this point I’d like to defend myself - the point of this lesson is not to devalue the importance of optimization. I’ve taken sites in the past from $5 to $50 a day without increasing their traffic, through things like re-structuring and correct format and color choices, but the trick with optimization is to know its place and to focus on it at the right time. Don’t get caught optimizing a website that has not been fully developed. The forums are full of these people puzzling over how they can reach $100 a day with Adsense when they’ve not broken down what is actually necessary to generate that amount of money.
From my experiences with Adsense, you’ll make good money with it by integrating it into “successful websites”. My example above was already receiving close to 1,000 visitors every day. A couple of weeks spent optimizing and monitoring resulted in a 10 fold increase in income but that site was already “successful” so to speak. It had good placements in the search engines, a strong supporting link structure and a growing repeat user rate – it was the right time to optimize.
But a successful website isn’t necessarily one that gets thousands of visitors a day, it’s one that fulfils the purpose it was originally established for. For example, if you’ve built a website about choosing a baby stroller you want people who are coming online to find out about baby strollers to find it and use it, if you’ve built one about making money with Adsense you’re looking for those people who want to make more money with Adsense ;)
A site is successful when it’s connecting with a significant proportion of its’ intended market or users. Once you’ve made this connection, monetizing your traffic with Adsense is very easy and improving your visitors interactivity with your ads (which is the same as saying your click through rate) becomes a legitimate focus. There are hundreds of different things you can do to increase your CTR and I’ll cover many of them in future lessons. Just make sure you’ve done the groundwork and have got targeted traffic coming to your website first.
