Monday, August 31, 2009

Installing apache on windows

Instalation:

First thing you need is to download the webserver. Now for windows users you will have to go for the .exe . The apache website is www.apache.org. You have to head to the apache binaries sections for Win32. I believe it is at http://www.apache.org/dist/httpd/binaries/win32/
There you will be able to download a version of apache.

Now before you download it you have to make a folder. This folder is one which serves as the root directory. Now if you don't want to do this it's ok. You can use the default path if you want. But usually this helps in setting up other things like php, and MySQL. Most people create a folder in the C:\ directory called WWW or somthin. You can name it whatever you want.

Ok so you have downloaded the Apache Web Server and ready to go with the setup. The version I have downloaded was apache_2.0.36-win32-x86-no_ssl.msi. This was a newer version and supposedly supposed to be more secure.
  • The first screen you get when your in the setup is the welcome screen, we don't care much about that.
  • The next screen is the terms and service. And yes you are going to agree to the terms.
  • The next screen is some documentation. I never really read it but if you want go ahead and do it.
  • Now we see a screen that says enter a network domain. Erase what's in there and type localhost.
  • Now the next box says Servername, erace what is ever in the box and put in localhost.
  • The next is Administrators e-mail address. Go ahead and fill that in. But make sure to change it.
  • Pick radio button that best suites your needs.
  • Now that we got that all filled out. Hit Next and you'll go to a screen that asks you which type of install you want to do. Then hit next.
If you wanted to server out of your one special folder. Change the file location where you were going to install apache. Or just leave it as the default path. Click install and it should be on it's way. Once it's done installing hit the finish button.

The test:
First were gonna check to see if Apache installed correctly.
This is how we do it. Open up Internet Explorer and type in " http://localhost" . If everything went smooth then you should be seeing a message that looks like this" Seeing this instead of the website you expected?" Yippee!!!
Apache is working.

* * * * *

Thursday, August 13, 2009

DB2 Certification




A few days training and a stressfull test. All gave me an IBM DB2 associate certificate. What a relief at last!!I would like to share my experiences with the software. BTW m still learning a hell lot of things in it.
DB2 is a database handling software that helps in maintaining large databases. I learned its express-c edition which is available in market free of cost but the most eye catching was the everyplace edition that works on mobile phones. I did'nt get the chance to work on it but soon I will.The installation process though was simple yet hectic. Lots of errors.Command center, configuration assistant, task center, journals, health center, sql assist were all easy to understand. It was very much comfortable to build the sql statements on sql assist with a GUI interface. Express-c edition comes with a pure XML add-on feature. The XML datatype helps in including the XML files in a database. XML files have user defined tags which is where they differ from HTML files where the tags are pre-defined. XML files mainly find their use in transportation and storage of data.Working on sql queries was not new but that on xqueries was a new experience.
Three cheers for IBM for making us, the "UPTU's ruined geniuses", understand such a software. DB2 9.7 "VIPER2" is what I m looking ahead for.

* * * * *

Friday, August 7, 2009

The problem of fu#king "Back" button..

Sorry for my indecent title but I was so irritated by this "back" button that I cud'nt stop myself.
After a user logs out himself from a web page and presses the "back" button of his browser he again gets himself logged in. The problem really makes you scratch your head sometimes. I did the same and came out with a cool solution.

The page in which you are asking user to log out just write the two statements on page load():

Response.CacheControl = "no-cache";
Response.Cache.AppendCacheExtension("no-store");

The two statements help in controlling the cache and preventing it to save the previous session.

Also make a session variable for login of a user. Make the session variable "true" whenever a user logs in and "false" when he logs out. Check on page load() of logout page, if session variable holds "false" value, direct the page to login page. Now if the user clicks back button he'll still remain in the login page or the page you wish to direct him.
My codes:

protected void Page_Load(object sender, EventArgs e)
{
Response.CacheControl = "no-cache";
Response.Cache.AppendCacheExtension("no-store");
if (Session["log"] != "true")
{
Response.Redirect("expired.aspx");
}
}

* * * * *

Thursday, August 6, 2009

Cool query 'bout pointers

While studying 'bout pointers I came about a cool phenomenon. Plzz don't laugh if its a but obvious thing for you. You might be a better coder than me for sure. I figured it out after a number of trials so I can't stop myself sharing it with everyone.

My question is.. Whats the difference between two statements..
int a=1;
int *p;
*p=a;//statement 1

AND

int a=1;
int *p;
p=&a;//statement 2

I played with number of printf's to come out with a simple answer. I again warn you if its a but obvious thing plzz do ignore it but it was a beautiful discovery for me though.

p=&a : in this statement, as we all know, the address of variable 'a' gets stored in pointer p and we say that pointer p points towards the variable a.

*p=a : (value of p is equal to a) in this statement, "as now I know", a new address is designated as value 1 and the pointer points to that address rather than pointing towards a. In simple words the address stored in p is not the address of a.

try two statements with..
printf("%u" "%u",p,&a);
In first you will find same address and different in the second.

* * * * *