STACK implementation using ARRAY in C


/* stack implementation through array */

#include<stdio.h>

#define MAXSIZE 5

int stack[MAXSIZE];
int top=0; // index pointing to top of stack

void main()
{
void push();
void pop();
void display();
int will=1, i;

while(1)
{
printf(“\n\n\n MAIN MENU:\n\n\n 1. PUSH \n 2. POP \n 3. EXIT \n\n ENTER YOUR CHOICE:”);
scanf(“%d”, &will);
switch(will)
{
case 1:
push();
display();
break;
case 2:
pop();
display();
break;
case 3:
exit(0);
break;
default:
printf(“Invalid Choice”);
}
}  //end of outer while
} //end of main

void push()
{
int num;
if(top>=MAXSIZE)
{
printf(“\n STACK FULL”);
return;
}
else
{

printf(“\n\n ENTER THE STACK ELEMENT:”);
scanf(“%d”, &num);
stack[top++]=num;
}
}

void pop()
{
if(top>0)
top–;
}

void display()
{
int i;
if(top<=0)
printf(“\n\n STACK EMPTY”);

else
for(i=top-1;i>=0;i–)
{
printf(“\n\n %d”, stack[i]);
if(i==(top-1))
printf(“—>TOP”);

}
}

Robots, Spiders and Crawlers


A robot, spider, or crawler is a piece of software that is programmed to “crawl” from one web page to another based on the links on those pages. As this
crawler makes it way around the Internet, it collects content (such as text and links) from web sites and saves those in a database that is indexed and ranked according to the search engine algorithm.

When a crawler is first released on the Web, it’s usually seeded with a few web sites and it begins on one of those sites. The first thing it does on that first site is to take note of the links on the page. Then it “reads” the text and begins to follow the links that it collected previously. This network of links is
called the crawl frontier; it’s the territory that the crawler is exploring in a very systematic way.

The crawler sends a request to the web server where the web site resides, requesting pages to be delivered to it in the same manner that your web browser
requests pages that you review. The difference between what your browser sees and what the crawler sees is that the crawler is viewing the pages in a completely text interface. No graphics or other types of media files are displayed. It’s all text, and it’s encoded in HTML. So to you it might look like gibberish.

Here’s a quick list of some of the crawler names that you’re likely to see in that web server log:

  • Google: Googlebot
  • MSN: MSNbot
  • Yahoo! Web Search: Yahoo SLURP or just SLURP
  • Ask: Teoma
  • AltaVista: Scooter
  • LookSmart: MantraAgent
  • WebCrawler: WebCrawler
  • SearchHippo: Fluffy the Spider

“nofollow” tag-SEO


The tag <rel=”nofollow”> is an attribute that tells a search engine crawler not to follow a certain link on your website.

For example, if you want to include an example of a bad site (like a hacker’s site or an SEO spam site) you may want to show that link on your
web site. However, that link could reduce your search engine ranking because it’s a known bad site, and when you include the link to it the crawler thinks you’re endorsing the site.

The url tag with nofollow in it is like this–
<a href=”http://www.examplebad.com”rel=”nofollow”&gt; Bad Site </a>

The nofollow tag is’nt essential in your SEO efforts. However it could help prevent your site ranking from being reduced, and maybe even increase your ranking a little. Anything that keeps your ranking from falling is a good measure to take.

Edit your page content with HTML 5


This is one of the new feature(attrib) of HTML 5 that makes the content of your own webpage editable. You can now edit text on your page just by using attribute “contenteditable” which is in its own way a super awesome feature in HTML 5!!

just go through this code below..


<html>

<head>

<title>

edit content

</title>

</head>

<body>

<p contenteditable=”true”> Edit this text by overwriting any part of it. </p>

</body>

</html>


….open your text editor and try out this piece of code. This is how content on a webpage is made editable.

This feature has also been used by popular social networking sites like Facebook where you can edit your own album name or your own previously saved comment.

PHP and Artificial Intelligence


AIML also known as Artificial Intelligence Markup Language teaches the bot how to think.
For PHP users there is an interface to do this job.
Humans have long been fascinated with Artificial Intelligence. Online artificial intelligence, often called bots, are all measured against the mother of all online intelligence, A.L.I.C.E. Standing for “Artificial Linguistic Internet Computer Entity,” A.L.I.C.E is a chat bot developed in the mid 90s that is capable of holding intelligent conversation, and giving relevant answers.
ALICE responds to the language AIML to get instruction how to think. There are several implementations of this in PHP called program E.

You can read about AIML here.

the ‘extern’ keyword in C


The ‘extern’ keyword specifies that the object is declared with external linkage somewhere else in the program.

By preceding a variable name with ‘extern’ , you can declare a variable without defining it. When you need to
refer to a variable that is defined in another part of your program, you can declare that variable using
extern.

    EXAMPLE 1


#include

int main(void)
{
extern float first, last; /* using global vars */
printf(“%f %f”, first, last);
return 0;
}
/* global definition of first and last */
float first = 10.23, last = 20.33;


This program will 10.23 20.33 because the global variables first and last used by the printf( )
statement are initialized to these values. The extern declaration will tell the compiler that first
and last are declared somewhere else (outside main), so the program will be compiled without error.

Extern allows you to declare a variable without defining it. However, if you give that
variable an initialization, the extern declaration becomes a definition.

“Definition” refers to the place where the variable is created or assigned storage; “declaration” refers to the place where nature of variable is stated but no storage is allocated.

the ‘extern’ keyword in C


The ‘extern’ keyword specifies that the object is declared with external linkage somewhere else in the program.

By preceding a variable name with ‘extern’ , you can declare a  variable without defining it. When you need to
refer to a variable that is defined in another part of your program, you can declare that variable using
extern.
 EXAMPLE 1

#include<stdio.h>

int main(void)
{
extern float first, last; /* using global vars */
printf(“%f %f”, first, last);
return 0;
}
/* global definition of first and last */
float first = 10.23, last = 20.33;

This program will 10.23 20.33 because the global variables first and last used by the printf( )
statement are initialized to these values. The extern declaration will tell the compiler that first
and last are declared somewhere else (outside main), so the program will be compiled without error.

Extern allows you to declare a variable without defining it. However, if you give that
variable an initialization, the extern declaration becomes a definition.

“Definition” refers to the place where the variable is created or assigned storage; “declaration” refers to the place where nature of variable is stated but no storage is allocated.