7 Things You Need to Present like Steve Jobs, regardsAli.com

24 09 2011

1 – Why should audience care ?
Answer the one question that matters most , why your audience should listen to you any way… read more at 7 Things You Need to Present like Steve Jobs





Microsoft UK Training with David Brent

21 05 2008

Part 1

.

.

.

Part 2





Funny Posters of David Brent, Microsoft

21 05 2008

Rule of the Game : Keep your ideas to your self





Microsoft offers cash back search

21 05 2008

Microsoft is expected to offer cash back to users of its search engine who buy products online, as it attempts to close the gap on rival Google.

Users will make savings on products sold by Microsoft’s advertiser partners via the so-called cashback service.

BBC News, Full Story Here





‘Pie terrorists’ attack Gates

21 05 2008

Microsoft tycoon Bill Gates became a victim of Belgium’s notorious “entarteurs” or pie throwers on a visit to the country in February 1998.

BBC News, See Full Video





Microsoft CEO’s egg attack

21 05 2008

Steve Ballmer, the CEO of Microsoft, was heckled and had eggs thrown at him during a lecture to university students at the Corvinus University in Budapest.

BBC News See Full video





Socket Programming- TCP client

2 01 2008

This a very basic tutorial for TCP server-client.

The code against tcp-server , the Clients Code

#define SRVR_PORT 4030 // The Server’s Port which Client is going to Connect.

#define MAXBUFLEN 100// Buffer Size for Sending/Receiving

int main(int argc, char *argv[])
{

//Declaration
int sockfd;
struct sockaddr_in their_addr; // connector’s address information
struct hostent *he;
int numbytes;
char buf[MAXBUFLEN];

//The Code to Take Server’s Address at Commandline

//You can remove this and assign your server’s Address you want

if (argc != 2)
{
fprintf(stderr,”usage: ./client 127.0.0.1\n”);
exit(1);
}

if ((he=gethostbyname(argv[1])) == NULL) { // get the host info
perror(“gethostbyname”);
exit(1);
}

//Creating the Socket(The Door for Communication)

if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror(“socket”);
exit(1);
}

//Setting the Attributes for Server Address


their_addr.sin_family = AF_INET; // host byte order
their_addr.sin_port = htons(SRVR_PORT); // short, network byte order
their_addr.sin_addr.s_addr = inet_addr(“127.0.0.1″);//*((struct in_addr *)he->h_addr);
memset(&(their_addr.sin_zero),”,8); // zero the rest

int addrlen = sizeof(struct sockaddr);

//Connecting to The Server

//connect return the status for successful connection or failure

int status;
status = connect(sockfd,(struct sockaddr*)&their_addr,addrlen);

while(1)
{

//Taking Input msg from Console

//Remove this if you not want from console Then use strcpy to fill the buffer

cout << “Enter ur message: “;
gets(buf);

//The buffer conatain the message you want to send to server

// The send method sends to the sevrer , just give socket id , buffer , and buffer size to send

// and off course give error on failure

if ( (numbytes=send(sockfd, buf, strlen(buf) , 0)) == -1)
{
perror(“send”);
exit(1);
}

// To Nullify or Empty to the buffer use memset method

memset(buf,”,MAXBUFLEN-1);

// The recv method is used for tcp recive , just sock id, buffer in which recv and length

// method return non-positive value for error

if ((numbytes=recv((int)sockfd,buf, MAXBUFLEN-1, 0)) == -1)
{
perror(“recv”);
exit(1);
}

cout << “from server>” << buf << endl;
memset(buf,”,MAXBUFLEN-1);

}

printf(“sent %d bytes to %s\n”, numbytes,inet_ntoa(their_addr.sin_addr));

close(sockfd); // It’s good to close the socket(the door) after Communication

return 0;

}

Let me know if you not uderstand any thing. I will upload the complete source code.





producing beep in c, linux

13 12 2007

You can use any method of the two produce a beep. Check it. It works.

Method 1:

char beep[] = {7, ”};
printf(“%c”, beep);

Method 2:

#include <stdio.h>
#include <unistd.h>

int main(){

Beep(587,500);

return 0;

}





President of Pakistan invites Microsoft

12 12 2007

Pakistan Times

DAVOS (Switzerland): President General Pervez Musharraf on Saturday invited Microsoft to invest in Pakistan and to use it as a hub of IT activity in the region.

President Musharraf in a meeting with Chairman of Microsoft Bill Gates invited him to take benefit of the conducive investment climate in the country and invest in Pakistan.

He said Pakistan was fast becoming one of the hubs of IT and provided highly qualified professional manpower. He informed him of the initiatives taken by the government in the IT sector and the progress on e-commerce and e-governance.

Bill Gates :
Bill Gates said Microsoft will help Pakistan achieve its objectives in IT.

He said the Gates Foundation, working under the United Nations in the health sector, can further expand its scope and asked for proposals from the government to identify the sectors where it could concentrate.





Socket Programming- TCP server

11 12 2007

A Server Side TCP implementation c code 1.0

int main(void)
{
//1.Declare
int sockfd;
struct sockaddr_in my_addr; // my address information
struct sockaddr_in their_addr; // connector’s address information
int addr_len, numbytes;
char buf[MAXBUFLEN];

if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror(“socket”);
exit(1);
}

//2. Set
my_addr.sin_family = AF_INET; // host byte order
my_addr.sin_port = htons(MYPORT); // short, network byte order
my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP
memset(&(my_addr.sin_zero), ”,8);

//3. Bind
if (bind(sockfd, (struct sockaddr *)&my_addr,sizeof(struct sockaddr)) == -1) {
perror(“bind”);
exit(1);
}

//4.Listen
int status = listen(sockfd, 5);

//5.Accepting Connections


socklen_t sin_size = sizeof(struct sockaddr);
int ctr=0;

while(ctr<3)
{
printf(“waiting for clients\n”);
int new_fd = accept(sockfd,(struct sockaddr*)&their_addr,&sin_size);
printf(“connceted…\n”);
pthread_t t;

//Receiving Clients and handling them
pthread_create(&t,NULL,Handler,(void*)new_fd);

ctr++;
}

//Closing Socket

close(sockfd);
return 0;

}