Showing posts with label Consolidation. Show all posts
Showing posts with label Consolidation. Show all posts

Monday, May 10, 2010

Simple C# Page Hit Counter


Image : http://www.flickr.com


If you have or are interested in developing your own website, there probably will come a time when you want to get a general idea of how many times your website is being visited. There are more elaborate ways to do this of course, some developers refer you to reading the server logs, others will suggest using a third party product and implementing it's code within your own website.

For the rest of you who would rather just get a general idea if your personal website is getting roughly 10 hits per day or 1000, this little code snippet will help get you on your way. I have developed elaborate site analysis applications that provide statistics on what pages are being viewed, how long the visitor remains at that specific page, what browser they are using, who referred them to the website to begin with as well as what their I.P address is and the list goes on. For the sake of this article though, we'll be using the k.i.s.s method.

The level of this code requires only a minimal amount of knowledge of the .NET environment, and of course your website should be hosted on a windows server with the .NET environment.

This code can be copied and pasted in the footer area of any .aspx file in your website. Generally, you would put it in the footer of the home page, or at least that's a good place to start.

The first thing you'll want to do is create an empty text file, call it counter.txt and save it to your root directory. The next step is even easier, copy and paste the code below into your .aspx file and save it. Be sure to import the system.IO class into your page something like this


public string counter()
{

StreamReader re = File.OpenText(Server.MapPath("counter.txt"));
string input = null;
string mycounter = "";

while ((input = re.ReadLine()) != null)
{
mycounter = mycounter + input;
}

re.Close();

int myInt = int.Parse(mycounter);
myInt = myInt + 1;

TextWriter tw = new StreamWriter(Server.MapPath("counter.txt"));

tw.WriteLine(Convert.ToString(myInt));

tw.Close();


re = File.OpenText(Server.MapPath("counter.txt"));
input = null;
mycounter = "";

while ((input = re.ReadLine()) != null)
{
mycounter = mycounter + input;
}
re.Close();


return mycounter;

}




'copy this code to the bottom of your .aspx page.







A brief description of what is going on in this code goes as follows:



a. create a method called counter

b. Call the StreamReader class from the system.IO library and read your text file

c. Store the value of the text file in a variable

d. Close the StreamReader

e. Open the StreamWriter

f. Add 1 to the variable holding the value from the text file

g. Write the new incremented by 1 value to the text file

h. Close the StreamWriter


This last line

is the line that calls the method when someone visits your homepage for instance. You can put all of the code at the bottom of the page, or if you are a little more experienced with c# you could place it in a "code-behind" file or an "include" of class methods to keep the code a bit more clean.

Nothing fancy, but gives me an idea of how active the site has been recently.
Hope this helps you in the same way that it has helped me.

Happy Coding!

Sunday, April 4, 2010

Clear Signs to Tell You That the Marriage is Over


Image : http://www.flickr.com


All of the things that you hoped for during the few years of your marriage are gone. However, you are still hoping that the sparks will eventually come back again for the sake of your children. If you want to be sure before you hit the divorce arena, here are some signs on how to tell if your marriage is over.

If you feel uncomfortable about sharing your thoughts with your partner, it is a clear sign that everything is getting quite shaky for you. It is only natural for you to share your deepest concerns to your spouse. You have promised to be faithful to each other and get through life's perils together, and not feeling so is one of the signs on how to tell if your marriage is over.

Another sign is when you feel that you are working hard to get the love and attention of your partner. Naturally, you would want to receive some love from the person that you are going to spend your life with. But if this does not work, and you think that your spouse has other interests besides being in a marriage, then let it be.

Although these things about how to tell if your marriage is over are stated here, nothing compares to letting your husband or wife know about your concerns if these problems arise. It is very important to have an open communication with your spouse. Who knows, you may just give your marriage a second try.

Wednesday, March 31, 2010

How to Stop Comfort Eating - Hypnotherapy Cure For Eating Problems


Image : http://www.flickr.com


If you suffer from the familiar problem of needing to stop comfort eating, you are definitely not alone. While it may have begun with an apple women, and some men, have been engaging in comfort eating activities for thousands of years. So, what is it? Comfort eating is eating at times when you feel stressed, depressed, unnerved, anxious, excited, sad, and the list could go on and on. The problem lies in the fact that most people have far too many comfort eating crises for the sakes of their waist lines.

Why the Huge Rush to Stop Comfort Eating?

Comfort eating by itself is no big deal when enjoyed in moderation. The problem is that most people eat the wrong foods and have far too many times when they need these comfort foods that are usually high in sugar, fat, and/or calories. Unfortunately, comfort foods are quite often high in all three of these things. While they may bring about the temporary and all too brief high or feelings of relief that you are looking for, they also leave behind jeans that are far too tight and other problems related to a growing waistline.

More Problems With Comfort Eating

Other problems that go along with the need to eat for the sake of relief is that you generally tend to eat too much of the wrong foods and then you have the problem of guilt on top of the depression that drove you to turn to comfort eating to begin with. If you stop comfort eating all together you can break the cycle of eating for depression, overeating, feeling guilt, and beginning again.

Overeating Help Through Hypnotherapy

Though hypnotherapy in one form or another has been around for centuries it is only recently getting the credit it deserves as an effective form of treatment for all manner of emotional, medical, and physical maladies. NLP and hypnotherapy alone are powerful tools to help you stop comfort eating. When you combine them they will have a profound impact and give overeating help that even you might not have dared to dream possible.

But, how does it work? NLP, or neuro-linguistic programming works by training your mind to place less importance on those foods that you generally turn to when you need comfort. By robbing them of their importance and/or power over you, the mind leaves you free to pursue healthier choices or not to eat for the sake of depression at all.

Hypnotherapy can be used in conjunction with NLP in order to imitate the feelings of relief and/or elation that are often accompanied by consuming the various foods you eat for comfort. It doesn't matter why, how long, when it first happened, or how often if happens; if you need help to stop comfort eating or overeating help in general there are many excellent sources for help. Some of the best though, are through NLP, hypnosis, and hypnotherapy.

Monday, March 29, 2010

Getting In Shape For A Body Building Competition


Image : http://www.flickr.com


Body building competitions are a dime a dozen these days. A lot of people are interested in body building and it has become one of the most favorite interests of both men and women in the recent times. People love to build their muscles just of the sake of it and also for the sake of entering many a competition that take place all over the world.

A body building competition is the right place to show your body and get appreciated by tons of fans all over the world. In fact, it brings out the best out of you and makes you popular. It is the most rewarding experience a body builder can have and it is the ultimate dream for any body builder to enter a competition and win it hands down.

If you are an amateur or a professional body builder, you can participate in such events in your area and slowly work your way up to the top events that take place in various parts of the world. You can start off with your place where local competitions are conducted and go on to become even 'Mr. Universe', the ultimate acclaim you can get in this field.

Such contests allow you to compete with other contemporaries who are looking forward for their turn to fame and recognition. In fact, the competition is a fierce one and it often motivates you to work out well, eat well, and get better results from your body to perform well in the competition. A few days before the competition, they will be extra special to make sure they present their body in the best possible manner. For this, they cut down the fat content from their food completely and work out for several hours a day in order to get that ultimate muscle tone and definition.

Also, the spirit of a body building competition is almost infectious and you can find it out the minute you step into the stage. The kind of recognition you get and the kind of support you get makes you forget all the toil you went through building all those muscles and makes you long for even more of that. You need to register yourself officially in order to enter most of these events and once you do well at the initial stage, you can always go places by entering bigger contests that are held all over the world.

How To Block Unknown and Anonymous Numbers


Image : http://www.flickr.com


Some people and companies can use pretty devious tactics to get you to pick up the phone, even when they know there is a good chance you have no desire to talk with them. One thing many do is make their number come up on your caller ID as 'unknown' or 'anonymous'. What that happens, you take your chances when answering. This is something that debt collectors do in many cases, and is also done by survey firms, and even telemarketers. If you don't want these types of calls to come through, there are a few ways that you can try to block them.

These calls can come in any time of the day. Some of them are marked as unknown or anonymous, but there are also some that are marked as private. Private numbers might be people you know who have blocked their number by being seen by those they call. Most do that in an effort to stay off of calling lists. Those people have the option of unblocking their number on a call-by-call basis, so they can call you with their number displayed if you have it set up so their call cannot come through otherwise.

Most companies offer you a way to block these calls, and it can usually happen by just dialing a code on your phone. If you have Time Warner Cable digital phone service, just as an example, you can dial (*77) on your phone and wait to hear confirmation that your unknown and anonymous calls are now being blocked. There is also a code (*87) that you can use to turn this type of service off. If you have service through Vonage, you can use the very same codes.

You may find that most all phone companies use the same codes for the sake of simplicity, but if you try it and nothing happens, you may have to contact your particular company to see what the code is. Some may not offer this, and it is not available in some parts of some states. You can look through your local phone book for this information (usually in the very front sections) to see if something is listed there.

This code and service usually work very well. It forces someone to identify themselves before they can ring through to your line, or they can't get through at all. What you should remember, however, is that you may still get some 'out of area' or 'unknown' calls that do come through. This is not because your phone code is not working, but rather, because their phone provider failed to send through the proper data to display the number. In these cases, it is simply a matter of technology not working correctly.

Saturday, March 27, 2010

Steps to Getting Along With Difficult Family Members


Image : http://www.flickr.com


My pregnant daughter just called me to complain (again) about her paternal grandmother. This has become a daily phone call. My son called me from work "Mom, can't we see Aunt Ila and Lucas and they could just once leave HER home?" Our nephew doesn't make a habit of phoning me, however he did tell his mom he wasn't coming down to visit this time if they had to stay with HER. My sister-in-law popped for a hotel room.

Every family has a member that rubs the rest of the clan the wrong way. I'm pretty sure it's some sort of biblical rule, if not, then it must be in the bylaws passed by the federal government of every country.

Now I'm not a psychologist or a family counselor-but due to my two now wonderful adult children, I have been through enough therapy to give advice on the subject of getting along with difficult people. Especially those that we love (or have to for the sake of a loved one).

1. PICK YOUR BATTLES CAREFULLY. Decide what you can ignore and what you can't. For example: I hate when people aren't honest. I don't mind if you disagree with me. I don't care if you don't like me. But I won't put up with duplicity. Just tell me the truth. Some people it's laundry, money or a personal dress code. Whatever you do, don't chose every little nitpicky event and yell about it. Oh, and when you go to war-do it quietly. I've found my low voice or even silence is a very powerful tool in fixing a problem area.

2. STAY AWAY AS MUCH AS POSSIBLE. That's right. There is always another room, someone else you can talk too or just bow out of the event if you have to lower yourself to the main offender's behavior.

3. USE THESE TWO PHRASES AND THEY WILL END MANY A PROBLEM. My husband an I learned these words from a family therapy seminar and they turned into our favorite rebuttals during the teenage years: Regardless of.../Nevertheless...
Now I know these sound simplistic but picture this: teen doesn't want to do homework and starts to yell at you.
You respond: Regardless of how you hate English, you have to do the assignment.
Or your mother-in-law hates that you won't take her on vacation. You respond: Nevertheless, our plans have been finalized and you are not going.

4. IF YOU HAVE NOTHING NEW TO ADD. This is our third favorite for the "comeback" on #3. When the challenger rebuts you simply say: I have heard what you had to say, if you have nothing new to add, we are done here.

Then simply walk away, read a book/newspaper, make a phone call or retire to the bathroom. The key to making these steps work is reacting by NOT reacting.

Oh, I used these phrases on my pregnant daughter just now.

Sarah, I know your grandmother is extremely trying, nevertheless, for your father's and aunt's sake, you'll have to put up with her for a visit. I have heard how much you dislike her, if you have nothing new to add to your long list of complaints-we're done.

I added-this is really good practice, pretend you have to take care of your two year old who is just about to throw a tantrum. Stay calm, quiet and ignore the bad behavior. It goes away, eventually.