Programmer Love Letter


Sweetheart, I've seen you yesterday while surfing on local train platform and realised that you are the only site I was browsing for.
For long time, I've been lonely,this has been the bug in my life and you can be a real debugger for me now. My life is just uncompiled program without you which never produces an executable code and hence is useless.

You are not only beautiful by face but all your ActiveX controls are attractive as well. Your smile is so delightful which encourages me and gives power to me equal to thousands of mainframes processing power
When you looked at me last evening, I felt like all my program modules are running smoothly and giving expected results. /* which I never experienced before */.

With this letter, I just want to convey you that, if we are linked together, I'll provide you all objects & libraries necessary for human being to live a error free life. Also don't bother about the firewall which may be created by our parents as I've strong hacking capabilities by which I'll ultimately break their security passwords and make them agree for our marriage.
I anticipate that nobody has already logged in to your database so that my connect script will fail. And its all certain that if this happened to me, my system will crash beyond recovery.

Kindly interpret this letter properly and grant me all privileges of your inbox.

- A Software Professional :D

Bad SEOs or Bad SEOs Client?


You hear all the time about bad SEOs. Bad SEOs are offering worthless services, failing to deliver on their internet marketing promises, polluting the search engine results?well, a lot of bad things. But how much ever gets said about bad SEOs' spiritual counterparts: bad SEO clients?

As an SEO, I can see things from the other side of the table. You see, despite trying hard to make it clear I'm a good, ethical, results-oriented, smarter marketing, white-hat SEO, I have gotten no end of inquiries from bad prospective SEO clients. Sure, no one who gets cheated is ever entirely to blame, and some cheated businesses are entirely blameless. But the bad SEOs would have too small a market to stay in business if it weren't for almost-as-bad clients.

Shades of Bad SEO Clients

First, let me make clear what I mean by "bad" SEOs. Bad SEOs are bad because they either do unethical things to get e-marketing results, or because they consistently fail to deliver results. A good SEO delivers results and does it without trampling over other people's rights (like submitting automated comments to their websites or trying to get good sites de-indexed).

A bad SEO client, in turn, is someone who will only be satisfied (albeit temporarily) with a bad SEO. Because they refuse to consider ethical web consultants or smarter marketing strategies, they are creating markets for the e-marketing charlatans and black-hats. There are two basic types of bad SEO clients: crooks and fool--oops, I mean, ethically challenged and judgmentally-challenged.

Ethically-Challenged SEO Clients

I haven't gotten so many inquiries asking for out-and-out unethical services. Still, I've been asked about blog-sp@mming software and other shady internet marketing tactics a couple times. A colleague shared this gem with me: "Have you thought about just scanning a book from the library and using it for web content? Or is that too high-risk?" (Seriously, someone asked him this.)

Of course, judging from the amount of comment sp@m and SEO-motivated hacking on the web, there is plenty of demand for this stuff.

Judgmentally-Challenged SEO Clients

A much larger group of bad SEO clients are simply those who insist on putting themselves in the way of fraud. Yes, that's right: I'm blaming the victim. Someone who goes looking for a $5 gold watch can't cry too long if the watch turns out to be fake or hot. With SEO, there are a few more nuances, but it's the same essential idea.

The overwhelming majority of these judgmentally challenged souls are private individuals whose only business is the business-in-a-kit variety. Yet they are also sometimes representatives of actual successful companies. The real businesspeople tend to be quicker to let their misconceptions go (after all, they can afford the real SEO alternatives), but not always. Let's look at some representative types of this group, straight out of my own inbox (note: these are inquiries from prospects, not actual clients).

1. Something-for-(Little More than)-Nothing Clients

Really, I tend to think these people should be in the ethically challenged group, but maybe that's just the remnant of my work ethic making me be mean There are actually two kinds of these clients:

- The ambitious but cheap client: "I'd like to get to the top of Google for the keyword, 'mortgage' so I can turn over $100,000/month in revenue. I can spend up to $1,000."

-The Adsense-is-my-business-plan client: you wouldn't believe the numbers of inquiries I get from people who only plan to make money off Adsense or other on-site advertising?they don't even have a plan for getting repeat traffic, nor do they have content to synergize with the SEO effort. By buying promotional services, they would essentially be buying advertising in order to make money off advertising?you see where that could be a problem?

Another way of looking at it: why wouldn't I just create a site myself and keep all the profit from my efforts? In fact, most SEOs do have their own project sites, which are often monetized by Adsense. The money we could otherwise get from Adsense is one very low baseline for pricing our services. Legitimate SEO clients are typically selling goods or services at a profit rate that works out to ten or more times what they could get from Adsense.

In addition to the greedy, I also see a few other kinds of less common, but still problematic prospective SEO clients:

2.SEO-Starry-Eyed Clients: "Search engine traffic is definitely the best way for me to get pet-sitting clients in my tiny Himalayan village."

3.The Little-Knowledge-Is-a-Dangerous-Thing Client: "Don't tell me about keyword research, content, anchor text, or natural linking strategy, just get me the PageRank (or links, keyword density, or whatever the fad is)."

4.Gullible-and-Not-Letting-Go Client: "I know of at least two services that will submit my site to thousands of search engines for $29.95. If you can't do that, I'll take my business elsewhere."

5.I-Will-Never-Trust-SEO-But-I'll-Consider-It-Anyway Client: "No one can guarantee a good search engine ranking so this is all pointless?I'll just go with that $29.95 search engine submission package someone just emailed me about. At least it's cheap."

In short, if you are going to find good SEO web consultants, you need: 1) realistic expectations; 2) a realistic budget; 3) solid information. Don't expect something for nothing, do a little reading, and it's much less likely you'll fall victim to bad SEOs.

10 Ways to Build Self Confidence


Self confidence is the difference between feeling unstoppable and feeling scared out of your wits. Your perception of yourself has an enormous impact on how others perceive you. Perception is reality — the more self confidence you have, the more likely it is you’ll succeed.
Although many of the factors affecting self confidence are beyond your control, there are a number of things you can consciously do to build self confidence. By using these 10 strategies you can get the mental edge you need to reach your potential.


Build Self Confidence

1. Dress Sharp
Although clothes don’t make the man, they certainly affect the way he feels about himself. No one is more conscious of your physical appearance than you are. When you don’t look good, it changes the way you carry yourself and interact with other people. Use this to your advantage by taking care of your personal appearance. In most cases, significant improvements can be made by bathing and shaving frequently, wearing clean clothes, and being cognizant of the latest styles.
This doesn’t mean you need to spend a lot on clothes. One great rule to follow is “spend twice as much, buy half as much”. Rather than buying a bunch of cheap clothes, buy half as many select, high quality items. In long run this decreases spending because expensive clothes wear out less easily and stay in style longer than cheap clothes. Buying less also helps reduce the clutter in your closet.

2. Walk Faster
One of the easiest ways to tell how a person feels about herself is to examine her walk. Is it slow? tired? painful? Or is it energetic and purposeful? People with confidence walk quickly. They have places to go, people to see, and important work to do. Even if you aren’t in a hurry, you can increase your self confidence by putting some pep in your step. Walking 25% faster will make to you look and feel more important.

3. Good Posture
Similarly, the way a person carries herself tells a story. People with slumped shoulders and lethargic movements display a lack of self confidence. They aren’t enthusiastic about what they’re doing and they don’t consider themselves important. By practicing good posture, you’ll automatically feel more confident. Stand up straight, keep your head up, and make eye contact. You’ll make a positive impression on others and instantly feel more alert and empowered.

4. Personal Commercial
One of the best ways to build confidence is listening to a motivational speech. Unfortunately, opportunities to listen to a great speaker are few and far between. You can fill this need by creating a personal commercial. Write a 30-60 second speech that highlights your strengths and goals. Then recite it in front of the mirror aloud (or inside your head if you prefer) whenever you need a confidence boost.

5. Gratitude
When you focus too much on what you want, the mind creates reasons why you can’t have it. This leads you to dwell on your weaknesses. The best way to avoid this is consciously focusing on gratitude. Set aside time each day to mentally list everything you have to be grateful for. Recall your past successes, unique skills, loving relationships, and positive momentum. You’ll be amazed how much you have going for you and motivated to take that next step towards success.

6. Compliment other people
When we think negatively about ourselves, we often project that feeling on to others in the form of insults and gossip. To break this cycle of negativity, get in the habit of praising other people. Refuse to engage in backstabbing gossip and make an effort to compliment those around you. In the process, you’ll become well liked and build self confidence. By looking for the best in others, you indirectly bring out the best in yourself.

7. Sit in the front row
In schools, offices, and public assemblies around the world, people constantly strive to sit at the back of the room. Most people prefer the back because they’re afraid of being noticed. This reflects a lack of self confidence. By deciding to sit in the front row, you can get over this irrational fear and build your self confidence. You’ll also be more visible to the important people talking from the front of the room.

8. Speak up
During group discussions many people never speak up because they’re afraid that people will judge them for saying something stupid. This fear isn’t really justified. Generally, people are much more accepting than we imagine. In fact most people are dealing with the exact same fears. By making an effort to speak up at least once in every group discussion, you’ll become a better public speaker, more confident in your own thoughts, and recognized as a leader by your peers.

9. Work out
Along the same lines as personal appearance, physical fitness has a huge effect on self confidence. If you’re out of shape, you’ll feel insecure, unattractive, and less energetic. By working out, you improve your physcial appearance, energize yourself, and accomplish something positive. Having the discipline to work out not only makes you feel better, it creates positive momentum that you can build on the rest of the day.

10. Focus on contribution
Too often we get caught up in our own desires. We focus too much on ourselves and not enough on the needs of other people. If you stop thinking about yourself and concentrate on the contribution you’re making to the rest of the world, you won’t worry as much about you own flaws. This will increase self confidence and allow you to contribute with maximum efficiency. The more you contribute to the world the more you’ll be rewarded with personal success and recognition.

Introvert & Extrovert Motivating

Generally we blame motivation or a lack of willpower for failing to keep our Resolutions. But this is too simplistic a view. If you want to create an endless source of motivation you have to understand what motivation is and how it works. Everything in life has many, many layers and levels to it. And motivation is no different.

No one has ever lacked motivation. Probably the most common area where people talk about motivation is losing weight and exercising.

Now why is someone overweight? Because they have too much motivation for the foods that make them put on weight.

Why don’t people exercise? Because they are more motivated to do anything rather than exercise.

The problem is not motivation. You are always motivated, but you are motivated for the things that you feel will bring the greatest rewards or the least pain.

Your motivation depends to a great extent on your personality. Introverts are more interested in avoiding pain, whereas Extraverts are more concerned with possible rewards. Some people have a longer-term view of life, others care more about now.

So an Introvert with a longer-term perspective is far more likely to choose the fat-free option because he or she wants to avoid the pain of being overweight.

Whereas a more impulsive Extravert will probably go for the chocolate cake because the reward now is far more exciting than the possible pain in the future.

Everything we do is based on an economic mindset. By economic I don’t mean financial, but we do attribute everything with a value. And we continually look to maximize our pleasure and reduce our pain.

So if your Resolutions aren’t working out. Look for what you are valuing more. The pay-off may not be obvious or even now, but on some layer or level there must be a pay-off.

This brings us to another aspect of motivation. Different Resolutions work on different levels and as a result access different sources of motivation. The source of motivation you are using will determine how long you stay motivated for.

What does this mean?

Well, there are five levels of Resolution that I can think of. And each one has a slightly longer life span than the last. I think of them like this:

The five levels are;

The Resolution you make because it’s expected of you.

This type of Resolution has no real emotional pay-off to you. It’s just something you are doing because doing something else may cause you the pain of disapproval or the risk of standing out and appearing abnormal.

Doing what’s expected is easy. It saves anyone nagging you and the effort of thinking for yourself.

But once you are out of that situation its hard to maintain, because it loses it’s reward and you have to suffer the pain of carrying it out.


The Resolution you make because you feel bad at the moment.

This type of Resolution is made as a knee jerk reaction in the moment to get rid of a pain. So it has an emotional pay-off, but as soon as the pain has gone there is no reason to continue.

For example, if you really analyze why people exercise – I used to own a Health Club, so I did – you’ll find that they tend to do it because they’re fed up being overweight or unfit or whatever. But this isn’t a sudden decision. Most have been considering exercising for months or even years. What really gets them to start is a more intense emotional pain.

Either a Doctor scares them into exercising or more often it’s a time when they feel insecure. Perhaps they have just got divorced… or their relationship is hitting a rocky patch and they are thinking of either competing for their Partner or being back on the dating market. Whatever the specifics they feel so bad when they worry that they have to do something to ease the pain. ‘Yes, they say I’m determined to stay on the program this time. I know its not a quick fix’. And they mean it when they say it.

Two or three months later though, the situation that was causing the pain has resolved itself one way or another. So the incentive for exercising has gone. Yet still the grind of going through the boring routine is still there. Sooner or later the pain of exercising outweighs the pain relief it used to bring. And then the Resolution ends.
 
The Resolution you make because you want something.

Sometimes this level comes from wanting something to get rid of a pain. And sometimes it just a natural ambition to grow. It lasts until you outgrow the desire or something better comes along.

Often people will go through the other levels of Resolution. And with each stage of evolution they find that life in general starts to feel better after overcoming a problem.

Then somewhere something just clicks and they realize that they feel better because each problem caused them to grow, in order to resolve it. The idea pops into their head that if they were to just grow for the sake of it… life might get more and more enjoyable.

Because this resolution is based on a far more permanent feeling it lasts for far longer than the previous motivations, which were just passing wants. However what you want and do to feel good will change as you grow.

One time you may want X, but three months or three years (depending on how quickly you are evolving) later you change your mind about what will make you feel good. Then your Resolution will change possibly before your motivation goes.

The Resolution you make because it’s you.

There are some things that you just feel so strongly about that you absolutely must do them or you would never do them. This is because they just aren’t you. So the motivation for this type of resolution will last for as long as your identity remains constant.

You can have different Resolutions in different areas of your life at different levels. Each level of resolution represents the overcoming of a problem or an urge to grow.

Overcoming these problems or achieving these desires causes us to grow and evolve. Once we grow there is no going back. Try not being able to ride a bike or do up your shoelaces. So problems and desires are the carrot and the stick forcing us to evolve.

Eventually we can reach a stage where we realize that… all along it was us that created the problems. And if we just accept ourselves as we are… we can enjoy all of life – and life will enjoy us.

PHP Security and Sessions

Learn how to secure your PHP pages swiftly using a simple include file that should be included at the top of every page. Read more ...This article demonstrates an easy way to maintain sessions and security (or authorization) in PHP. It does NOT use the PHP built in session support.

The following method will allow you to easily secure any PHP page by simply including a file at the top of every page. In this tutorial you will:

a) Create your database structure
b) Create a login page
c) Create your security check include file
d) Secure your site

There are many different ways you can modify this technique to suit your own needs. Some of these ideas will be listed at the end of this article.

Step 1: Store your data

In order to authenticate your users, you must store their information somewhere. That location can be a flat text file or a database server. In this tutorial, we will use a MySql database. Given that you probably already have a database you wish to use, this article will focus just on one table: tblUsers.

This table will store all of your user information but we will only focus on the fields necessary to this article. The following fields are required:

iUser - This will be a unique ID used in the table.
sEmail - We will use the email address as the login
sPassword - We will need this to authenticate the user
sGUID - This is the field to store the users current session ID
sData - This is where you can store various session information about the user.

To create this table in MySql, execute the following DDL:

CREATE TABLE tblUsers (
iUser int(10) unsigned NOT NULL auto_increment,
sEmail varchar(255) NOT NULL,
sPassword varchar(255) NOT NULL,
sGUID varchar(32),
sData text,
PRIMARY KEY (iUser)
) TYPE=MyISAM;

In the interest of space and time, this article will assume you can build your own "Add User" form and we will use the following DML to add a user for demonstration purposes:

INSERT INTO tblUsers Values
(
Null,
'test@user.com',
password('testpass'),
Null,
Null
)

Note the use of MySql's Password() function. This is a one-way function so you will not be able to "retrieve" the user's password. There are other options you can use besides the Password() function such as a md5 hash or your own cipher. The Null value for the iUser field triggers the auto_number function and will generate a unique ID for us. The user we just created has an email/username of test@user.com and a password of testpass.

Step 2: Create a login page

You will need a way to authenticate your users as they enter the system. You will create a login page in such a manner that it can intercept a user going to any secured page in your system. Once the user has logged in they will be redirected back to the page they were attempting to access.

First, we need a simple HTML form so save the following HTML as Login.php:

<html>
<head><title>Login</title></head>
<body>
<form action="LoginAction.php" method="Post">
Email Address:<br />
<input type="Text" name="psEmail" />
<br />
Password:<br />
<input type="password" name="psPassword" />
<br />
<input type="submit" value="Login" />
<input type="hidden" name="psRefer" value="<? echo($refer) ?>"
</form>
</body>
</html>

The obvious parts of this login page are the email and password. The hidden field psRefer will be a query string variable that is passed to this page, which represents from where the user entered the web site.

Next, we need a page that will actually authenticate the user against the data in the database. If the user is successfully authenticated a GUID will be generated and they will be on their way. If they are NOT authenticated they will be sent back to the login page. The following code should be saved as LoginAction.php:

<?php
// Check if the information has been filled in
if($psEmail == '' || $psPassword == '') {
// No login information
header('Location: Login.php?refer='.urlencode($psRefer));
} else {
// Authenticate user
$hDB = mysql_connect('server', 'user', 'pass');
mysql_select_db('database', $hDB);
$sQuery = "
Select iUser, MD5(UNIX_TIMESTAMP() + iUser + RAND(UNIX_TIMESTAMP())) sGUID
From tblUsers
Where sEmail = '$psEmail'
And sPassword = password('$psPassword')";
$hResult = mysql_query($sQuery, $hDB);
if(mysql_affected_rows($hDB)) {
$aResult = mysql_fetch_row($hResult);
// Update the user record
$sQuery = "
Update tblUsers
Set sGUID = '$aResult[1]'
Where iUser = $aResult[0]";
mysql_query($sQuery, $hDB);
// Set the cookie and redirect
setcookie("session_id", $aResult[1]);
if(!$psRefer) $psRefer = 'index.php';
header('Location: '.$psRefer);
} else {
// Not authenticated
header('Location: Login.php?refer='.urlencode($psRefer));
}
}
?>

The first objective of this code is to verify that a username and password were sent and otherwise return to the login page. This is just some rudimentary protection against some hacking. Next, the code connects to a database and tries to retrieve the user data matching the credentials sent from the Login.php page. If there is no match in the database the user is returned to the login page.

If there is a match the user record is updated with a GUID and a cookie is set on the user's computer. You do not have to use cookies here but this prevents you from having to put the session id on the URL of every page. After the cookie is set, the user is either sent to the referring page or to a default page (in this example: index.php).

To generate the GUID or session ID, you need to generate a unique number and hash it to protect would-be hackers from brute-forcing their way into your application. This article used MySql's built in MD5 function with a formula to help generate a random seed. You can use PHP's hashing functions or any other method of generating random hashes here.

Step 3: Create an include file

Now that you have a login mechanism, you need to create a page that will easily protect any page in your web site by simply including it. To make this "smart" page you just need to check the user's session ID that is stored in their cookie against the database. If there is a match then the user has logged in otherwise they should be redirected to the Login.php page. Here is the PHP code to perform that (call it incSession.php):

<?php
// Check for a cookie, if none got to login page
if(!isset($HTTP_COOKIE_VARS['session_id'])) {
header('Location: Login.php?refer='.urlencode($PHP_SELF.'?'.$HTTP_SERVER_VARS['QUERY_STRING']));
}
// Try to find a match in the database
$sGUID = $HTTP_COOKIE_VARS['session_id'];
$hDB = mysql_connect('server', 'username', 'password');
mysql_select_db('database', $hDB);
$sQuery = "
Select iUser
From tblUsers
Where sGUID = '$sGUID'";
$hResult = mysql_query($sQuery, $hDB);
if(!mysql_affected_rows($hDB)) {
// No match for guid
header('Location: Login.php?refer='.urlencode($PHP_SELF.'?'.$HTTP_SERVER_VARS['QUERY_STRING']));
}
?>

The first part of the code checks to see if there is a cookie set with the session ID otherwise it will redirect the user to the Login.php page. If there is a valid session ID the script will try and match it against the database. If there is not a match the user is redirected to a Login.php page. Otherwise, the user is allowed to continue onto the page they were trying to access. To add this security to a page in your application, simply add the following code to the top of the page:

<?PHP require('incSession.php'); ?>

Now you have secured your application! Once you get over the initial creation of the Login and actions pages you only need to add the one line of code above to secure any page in your web. Here is a list of modifications you can make to the above implementation to make the script even better:

Expiration - You can have the login expire by adding a logged-in date field to tblUsers. You would need to check that date against your "timeout" in incSession.php.

Security Levels - You can add a field to tblUsers to specify the user's security clearence. Then you can compare that value against a variable that you have defined on each secured page. For example you could put the following at the top of your secured page:

<?PHP
$giSecurityLevel = 3;
require('incSession.php');
?>

After that, the script could return the user's security level in incSession.php and compare it against $giSecurityLevel. If the user's level is below the required level the script can redirect them to a "no access" page.

Store/Retrieve Session Data - You can use the sData field to store the user's session information (like a shopping cart, for example) as a formatted string or even XML data. The choice is entirely yours since it is a large text field.

Conclusion

Using the script above will assure that you have a simple and foolproof method of securing your web site. There are many other methods available (PHP sessions, .htaccess, etc.) and each has their strengths and weaknesses. I believe this method to be one of the most portable and easily customized methods available.

Detecting AJAX Request with PHP

Here, I will show you how can detect if a HTTP request was an Ajax request. Ajax requests are performed in JavaScript using the XMLHttpRequest component.

When such a request is made, a HTTP header called X-Requested-With is sent. The corresponding value for this header is XMLHttpRequest. You can access these headers from the PHP superglobal $_SERVER.

PHP renames HTTP request headers so dashes become underscores and all letters are made upper-case. Therefore we can check $_SERVER['X_REQUESTED_WITH'].

Therefore you can use the following code to check if a request is from an Ajax request.

Listing 1 Checking if a request is an Ajax request (listing-1.php)
<?php
$isXmlHttpRequest = array_key_exists('X_REQUESTED_WITH', $_SERVER) &&
$_SERVER['X_REQUESTED_WITH'] == 'XMLHttpRequest';

if ($isXmlHttpRequest) {
// is an Ajax request
}
else {
// is not an Ajax request
}
?>
If you're using Zend_Controller_Front, you can call the the isXmlHttpRequest() method on the request object.

Being able to check if a request is useful to determine what kind of content to send back. For example, if the request is an Ajax request you may want to send back some JSON data, whereas if it's not you may just want to return normal HTML.

In the following listing I demonstrate this. If the request is an Ajax request we sent some JSON data back, otherwise we fall through and output normal HTML.

Listing 2 Outputting JSON data for Ajax requests only (listing-2.php)
<?php
$isXmlHttpRequest = array_key_exists('X_REQUESTED_WITH', $_SERVER) &&
$_SERVER['X_REQUESTED_WITH'] == 'XMLHttpRequest';

if ($isXmlHttpRequest) {
$data = array(
'foo' => 'bar'
);

header('Content-type: application/json');
echo json_encode($data);
exit;
}
?>
<html>
<head><title>Normal page content</title></head>
<body>
<!-- normal page content -->
</body>
</html>

Using Return Codes in PHP


I will show you how to execute a command on your server using system(). I will show you how to check if the command was successful using its return value.

To demonstrate this functionality we'll write a short script restarts your web server. Before restarting the server it will verify the configuration file is valid.

To execute a command we use the system() function. This function accepts as its first argument the command to execute, while the second argument is a variable you pass by reference that the return value is written to.
Note: You can also use functions such as exec() or passthru() if you need to access output from the program, but to keep things simple we'll ignore these functions.

The following listing shows how you to call system().
Listing 1 Accessing and outputting the return value from system() (listing-1.php)

<?php
system('/path/to/someCommand', $retval);
echo "Return value: " . $retval;
?>

If a command-line program has been written correctly, it will exit with a status code of 0 when the program executes correctly, or it will exit with a non-zero value when something does not work correctly.

The following listing shows a basic check of the return value. The specific error that has occurred will depend on the command being run.
Listing 2 Checking the return value and acting accordingly (listing-2.php)

<?php
system('/path/to/someCommand', $retval);

if ($retval == 0) {
echo "Executed correctly\n";
}
else {
echo "Some error occurred: " . $retval;
}
?>

To demonstrate this, we'll write a short script that calls makes use of the apachectl program. This is used to control an Apache installation (start / stop / restart the server). If you run this command with an argument of configtest it will tell you if the configuration is valid. If you run it with an argument of graceful it will restart the server (gracefully - that is, it will complete any active requests).

When you run apachectl configtest it will tell you if an error occurs, but additionally, it will exit with a code of 8 (you can see this documented inside the apachectl script).

Therefore, you can run this command and check if the configuration file is valid. If it is, we'll restart the server, if not, we won't. The following listing demonstrates this.
Listing 3 Restarting your Apache server if the configuration is valid (listing-3.php)

<?php
$ctl = '/usr/local/apache/bin/apachectl';

system($ctl . ' configtest', $retval);

if ($retval == 0) {
system($ctl . ' graceful');
}
else {
echo "Configuration error, unable to restart\n";
exit($retval);
}
?>

In this script we chained the return value. That is, when an error occurred we also exited with that return code. That way, if yet another script uses our PHP script they can also check the error code if required.

That's all there is to it! You could extend this script by checking the return value of the second command also, since this call can also fail.

Improving Web Performance from Page Components

On a web page images, flash, style sheets and scripts are some of the components that take time to load. For increasing the site load time, we might have to keep the site simple and reduce the number of web components on a page. The Http request/replies have to be kept at a minimum for optimum web performance.

The web page design needs to be simple by reducing the number of page components that take time to load. CSS sprites are one of the most preferred methods that reduce the number of image requests.

Response times are often impacted by user's proximity on web servers. When looked upon content for a solution, deploying content to server across multiple geographies will make the pages load faster. This can also be made unique to geography, looking upon the local market for the product or service, as this would definitely boost online businesses locally for their geographies.
Changing the architecture of the site can be a daunting task, synchronizing session state and replicating the database transactions across al the server locations. On an average, 80 to 90% of the time is spent on loading the components of the page. Its always a god idea to disperse static content rather then redesigning your site applications architecture. The front end engineers that care about web performance want a page to load progressively as soon as possible. This is very essential for the users who are looking out for a lot of content are on very low internet speeds.

Monitoring website applications in terms of performance should be focused in order to have optimum performing site. Web application monitoring solutions should be used to have comprehensive monitoring of web applications. Web performance is directly dependent on monitoring the website with different aspects in mind regarding all the components used on the website.

How to make 'her' fall in love with you

Searching for ways to make a woman fall in love with you can easily drive you up the wall. For a lot of men, just like you, women can be a little bit of a mystery. One moment you think that you are doing okay with a woman, and then the next moment, you are wondering if she is really into you at all. Is there a way that you can make sure that you can make her fall for you?
Here are some ways to make a woman fall in love that should get you going:

1. Be the kind of guy that she can feel secure with.
The only way to really make a woman feel this way is for her to see that YOU are a secure man. When a woman can sense that you are nervous or insecure around her, you are doing nothing to make HER feel security when she is with you. Don't assume that you have to act super macho to make a woman feel protected by you. You just have to leave her with the impression that she is with a confident alpha male that has no insecurities at all.

2. You have to be spontaneous with a woman.
To be honest, most guys ARE pretty boring. When they want to take a woman out on a date, they will do the tried and true dinner and a movie thing. You want to get used to being a little more spontaneous and think outside of the box once in a while when you are with a woman. You don't want her to be able to read your every move even before you make it. You want to be able to catch a woman by surprise and make her wonder what is going to happen next when she is with you.

3. You have to be able to go beyond the friend zone with a woman.
Being polite and being friendly is all well and good, but if you want to make a woman fall for you, if you want her to want you, then you have to go beyond that friend zone with her. If you hesitate to do this, or if you never really get beyond this stage with her, then you are only going to end up disappointed when you find out that she does not feel the same way about you that you do about her. Most men have been in this situation before, and you have to realize that it's a trap.

Resolving Error 8906 in MS SQL


In MS SQL Server database, a PFS (Page Free Space) page has one byte for each of the pages existing in the file interval it maps. This byte contains a bit that indicates that the associated page is a mixed page. An IAM page includes a mixed page array, which is an array of eight page IDs, to keep the mixed pages that have been allocated to the index. In some cases, when the database goes corrupted, the page containing 'mixed page' bit is not recognized correctly. Thus, you can detect such specific cases of database corruption and, take corrective measures for MS SQL Repair.

Most of the SQL database corruption problems can be analyzed and detected by running DBCC CHECKDB command. Let's consider the below error message, which typically appears when the discussed problem occurs. When you run DBCC CHECKDB command to check the integrity of database, following error might pop up:


Server: Msg 8906, Level 16, State 1, Line 0
Page P_ID in database ID DB_ID is allocated in the SGAM SGAM_P_ID and PFS PFS_P_ID, but was not allocated in any IAM. PFS flags 'PFS_FLAGS'.

Cause

Error 8906 is most likely to occur when a page with 'mixed page' bit set up in PFS byte has not been detected as an IAM page or in a mixed page array of an IAM page, which indicates database corruption.

Solution

If you encounter error 8906 after running DBCC CHECKDB on your SQL Server database, apply the below measures to solve it:

Run hardware diagnostics to isolate hardware-related problems. Corrupted hardware components are known to cause these issues if database corruption persists.
Restore the database from last good backup available.

If no clean backup is available, run DBCC CHECKDB without any repair clause to know the extent of damage and required SQL Repair clause. Again run DBCC CHECKDB command with the recommended repair clause. Make sure to backup your database before executing the repair command, in order to avoid post-crash results.
Use a third-party SQL Repair utility, in case DBCC CHECKDB doesn't work.


For best results, it is recommended to use Stellar Phoenix SQL Recovery software. Designed to run powerful and safe scanning algorithms, this SQL Repair utility can restore all database objects in a simple way. The application supports MS SQL Server 2008, 2005, and 2000.

WiMax for student



If you're currently enrolled in college, you're probably beginning to realize just how much technology is going to play a factor in your learning experience. While it used to be that the most high-tech piece of equipment you had to send a child off to school with might be a typewriter, these days it's not even enough to simply have a desktop or laptop computer--you must have the kind with the right amount of memory, the right capacity for handling a workload, and even particular software. And for befuddled parents, it's not the demands of one's children--it's the requirements of the particular departments of study.

Whether you're attending Central Texas College in Killeen or Greensboro College in Greensboro, technology has never been so important when it comes to getting a good education. But how can you possibly stay connected if you don't have a powerful wireless internet connection outside of the common spaces on campus? There are a couple of different ways to try and solve that sort of problem. You could split the cost of getting broadband with roommates and then invest in a router so that you also have wireless internet at home, but that would only result in a signal that ends up lagging because everyone is online at once. Or you could resolve to always study on campus, but that can quickly lead to trouble and frustration, as sometimes there are loud groups in the library, and the stress of getting to off-campus housing late at night is enough to be a deterrent to many students, especially young women.

So what's the best way to stay connected to everything from the latest discussion you're participating in via Blackboard to your friends back at home? A solid and reliable connection to the internet, for sure. But Wi-Fi signals are often limited or unreliable, and there's no way that you can tote a broadband connection around with you. So what's a smart college student to do?

Turn towards the future of technology, of course. Because so many college students are not weirded out by the prospect of getting online and updating their Facebook via their smartphone or even checking out a website on someone's iPad, the notion of using a lot of equipment in nontraditional ways seems like the norm. So something like WiMax, which is wireless signal for your web surfing that relies on towers like a cell phone company rather than using the typical old paradigm of getting online, makes a lot more sense. In fact, if you really look at things, it makes a lot more sense than dealing with the unreliable nature of using the on-campus network, where there are so many different students all connected that it is a wonder that the entire thing doesn't crash on a regular basis.

But there's something more about WiMax. If you're living in a dorm and don't want your roommate eavesdropping when you have sensitive conversations about being homesick, you can tote your laptop elsewhere and still manage to Skype without interruption. And if you are trying to find deals on textbooks, it's a lot more pleasant to scour the internet from the privacy of your own room rather than in the one spot in the common area where you can actually pick up the wireless signal. In short, it just makes considerably more sense if you want to be a part of a bright future to get on board with the technology that's going to get everyone there, sooner rather than later.

How to Optimize Your Dell Inspiron 1525 Battery


After used for a time, we can obviously feel that our computer getting more and more slow. The start time extend from 30 seconds to 1 minutes or more. When we use the computer to play game or wacthing video, the computer suddenly freeze. Then we should restart the laptop. Let me introduce some simple maintenance once or twice a month can make a difference in performance on all of his team.
  • Spyware, adware and viruses must be detected and cleaned frequently to maximize the efficiency of your computer.
  • Your Dell inspiron 1545 battery hard drive and personal files will be stored and managed properly to ensure that they are not damaged in the course.
  • Valuable information must be supported by a separate storage source such as a CD or DVD.
Use the following steps to clean the PC and then examine the steps in the Protect your PC against the most common problems to defend the security.

Step 1 - to undo harmful changes to the Windows System Restore

Undo harmful changes to the Dell Inspiron 1501 Battery using Windows System Restore. This tool is located in front of your computer to a date that unwanted software is installed or started receiving the annoying pop-ups

Step 2 - Malicious Software Removal

Install anti-virus software and keep virus definition files current is the best way to preserve the health of your computer. Test your Dell Inspiron 1525 Battery computer's exposure to online security threats and learn more about the HP recommends anti-virus solution on the connection from Symantec Security.

Step 3 - Manage efficiently drive

Manage your hard disk more efficiently using Microsoft Windows built-in system tools. Disk Cleanup deletes temporary files and other data that make the computer slower. Defragmentation program takes all the scattered data and grouped them together in the front of the unit and helps your hard drive work faster and more data.
In the end we advice you backup your computer and reinstall your OS once a year.