Google Mail is More Secure than Ever

July 27, 2008

Well friends, when we use the INTERNET do we really wonder how much of our information is being leaked to the world with or without our knowledge.Not really but it also affects our privacy especially if privacy and secureness is one of ur need for sending information.Google recently intoduced the use of HTTPS which is the secured version of http protocol , n perhaps its make use of IPSEC, KEBEROS And SSL.HOwever one downside of security is that it reduces performance as you may have noticed.To access ur inbox using secure version use can use:

https://mail.google.com

or

enable it by default

You can even disable it but beware it will make ur connection slower due to encrytion and decryption , but ita up to u to choose security or performance.

Sexondly google introduce a new feature where u can have a log of activities to ur emai l and this might be useful  wen u 4got to signout ur email at another place u can even see where it was and hence take due action .wow here r screen shots.

Itis found at the bottom of your inbox, and by clicking on more details you get ..


GOOGLE KNOL

July 25, 2008

wow what  an exciting feature google has lauched called KNOL , wich is a community abt sharing thing s ur know and also respect the copyright , here is the link i discovered and hpe u will enjoy them,http://knol.google.com, woow google R0Cks!


2day Im going to The Orange P@rty at UOM

July 18, 2008

Wow, only 1 year left to finish university course so ot 2 enjoy a bit too , so going to the party 2nite. will keep in touch


Some functions in Postgresql relative to my case study

July 18, 2008
 CREATE OR REPLACE FUNCTION AssignID()RETURNS INTEGER AS '
   DECLARE

      id integer;
 BEGIN
	SELECT into id max(Refc)
	FROM customer;

        return (id+1);
 END;
'LANGUAGE PLPGSQL;

select * from AssignID();

Create a table in PostgreSql

July 15, 2008
    CREATE TABLE customer (
             Refc 		SERIAL,
             title 		varchar(3) NOT NULL,
             fname 		varchar(25) NOT NULL,
             lname 		varchar(25) NOT NULL,
             address 	varchar(50) NOT NULL,
             phone 		varchar(7) NOT NULL,
             nic 		varchar(14) NOT NULL,
            CONSTRAINT customer_pkey PRIMARY KEY ( Refc ),
            CONSTRAINT vehicle_Refc_key UNIQUE (Refc)

        );

--INSERT INTO customer VALUES(1,'Mr','Atish Koomar','Rajub','School Lane Chamouny,Savanne','6455673','F090234201723');
--INSERT INTO customer VALUES(2,'Mr','Vikesh','Hosanee','Rose-Hill','9675645','H2202872401243');
------------------------------------------------------------------------------
CREATE TABLE vehicle (
      Refv 			integer NOT NULL,
     DOA 			date 	NOT NULL,
     make 			varchar(30) NOT NULL,
     vtype 			varchar(15) NOT NULL,
     origin 		varchar(30) NOT NULL,
    description 		varchar(50) NOT NULL,
    vyear 			date 	NOT NULL,
    colour 		varchar(15) NOT NULL,
    purchase_price 	double precision NOT NULL,
   reserved 		boolean NOT NULL,
   sold 			boolean NOT NULL,
   engine 		varchar(35) NOT NULL,
   speed_trans            integer NOT NULL,
   CONSTRAINT vehicle1_pkey PRIMARY KEY (Refv),
   CONSTRAINT vehicle1_Refv_key UNIQUE (Refv)
);
--INSERT INTO vehicle values(1,'2008-02-15','Subaru Imprezza','Car','Japan','4-Door Handle Cosmic wheels support','2007-01-01','Grey-Black',1200000,false,false,'3000CC',6);
--INSERT INTO vehicle values(2,'2008-02-22','Nissan Skyline','Car','China','4-Door-Cosmic wheels-Tuned Sporty Look','2007-12-09','Red',1500000,false,false,'3500CC',6);
------------------------------------------------------------
CREATE TABLE spareparts (
    Refs 		integer NOT NULL,
   DOA 		date NOT NULL,
   origin 	varchar(15) NOT NULL,
   description 	varchar(50) NOT NULL,
   stype 		varchar(18) NOT NULL,
   make 		varchar(20) NOT NULL,
   buying_price   double precision NOT NULL,
   numstock 	integer NOT NULL,
   sold 		boolean NOT NULL,
   reserved 	boolean NOT NULL,
   CONSTRAINT spareparts_pkey PRIMARY KEY (Refs) ,
  CONSTRAINT spareparts_Refs_key UNIQUE (Refs)
  );
--INSERT INTO spareparts VALUES(1,'2008-04-28','Indonesia','Sporty Aerodynamic Wipers','4x4','Toyota',1500,2,false,false);
--INSERT INTO spareparts VALUES(2,'2008-03-02','China','Fly Wheel','Car','Zenith',3500,5,false,false);

CREATE TABLE spsales (
     salesid 	integer NOT NULL,
     Refs 		integer references spareparts(Refs) NOT NULL,
     Refc 		integer references customer(Refc) NOT NULL,
     tax 		real NOT NULL,
     Cur_date 	date NOT NULL,
     selling_price 	real NOT NULL,
     qty		int  NOT NULL,
    CONSTRAINT spsales_pkey PRIMARY KEY (salesid) ,
    CONSTRAINT spareparts_salesid_key UNIQUE (salesid));

--INSERT INTO spsales VALUES(1,1,1,15.5,CURRENT_DATE,3700.05,1);
--INSERT INTO spsales VALUES(2,2,2,15.5,CURRENT_DATE,300.50,2);

CREATE TABLE Vehisale (
     SALESID 		integer NOT NULL,
     Refv 			integer references vehicle(Refv) NOT NULL,
     Refc 			integer references customer(Refc) NOT NULL,
     tax 			real NOT NULL,
     Cur_date 		date NOT NULL,
     selling_price 		real NOT NULL,
    CONSTRAINT Vehisale_pkey PRIMARY KEY (SALESID) ,
    CONSTRAINT Vehisale_SALESID_key UNIQUE (SALESID));

--INSERT INTO Vehisale VALUES(1,1,1,15.5,CURRENT_DATE,1700000);
--INSERT INTO Vehisale VALUES(2,2,2,15.5,CURRENT_DATE,1200000);

Ile Aux Cerfs with my Neighbours and close mates

July 12, 2008
Me at Ile aux Cerf

Me at Ile aux Cerf

What a saturday ,My mates vickram , vishal, arvin ,me and sanju at ile aux cerf. what a nice time we had , yeah i am using my holidays for enjoying since didn’t got a trainee stage  and please feel free to leave any comment , Time is something that we cannot get back once we missed it !. Then we proceeded to the casino at curepipe (lake point) and then planned for the nite club but we wer so tired and hence proceeded to KFC where we enjoyed a nice meal together .. those zinger stuff etc and then rolled back home wat an incredible day.


July 7, 2008

Postgresql Codes to add in an array

  create or replace function AddArray(integer [],integer[])returns integer[]) as '
declare

                  a alias for $1;
                  b alias for $2;
                  c integer [];

             begin
                 c:=''{}'';
                    for i in 1..5 loop

                       c[i]:=a[i]+b[i];

                    end loop;

                    return c;

  end;
' language plpgsql;

select AddArray('{12,21,53,1,34}','{23,56,7,8,2}');

Link to linux Resources

July 4, 2008

A very nice place for tutorial :

http://linux.die.net/man/3/readdir

Special thanks for all thse codes published goes to sydney,kooshal, yannick, vanessen and vikesh and all those who contributed .


using structures loops etc

July 4, 2008

Write a program that performs the following:
It creates an array of a structure student (What the structure contains is your choice).
It executes a loop that displays a menu as follows:
1.Add new student
2.Modify a student information
3.Display Array
4.Exit
It allows the user to choose one of the above menu options.
If the user chooses option 1, the program allows the input of the student information, builds a structure, create a thread passing the created structure as argument. The thread simply adds the structure to the array.
If the user chooses option 2, the program allows the entry of a key (such as student id), creates a thread passing the key as argument. The thread requests for the field to be modified and the new value and makes the required modification.
If the user chooses option 3, the program creates a thread that displays all filled elements of the array.


In each of the above cases the thread exits after having performed its task.

————————————————————————————

# include<stdio.h>
//# include<pthread.h>

struct student{
char name[15];
int id;
}//end structure

void printMenu();
void * funct1(void* arg);
void * funct2(void * arg);
void * funct3(void* k1);

struct student s[10];
int num=0;
// main
int main(){
int x=0;

//——–menu
printMenu();
while(scanf(“%d”,x)){

//———————first choice
if(x==1){
struct student s1;
printf(“enter name:\n”);
scanf(“%s”,s1.name);
printf(“enter id:\n”);
scanf(“%d”,s1.id);
pthread_t p;
pthread_create(&p,NULL,funct1,(void*)&s1);
num++;
printMenu();
}//endif

//——– ———–second choise

else if(x==2){
int k=0;
printf(“enter the key\n”);
scanf(“%d”,k);
pthread_t p1;
pthread_create(&p1,NULL,funct2,(void*)&k);
printmenu();

}//end elseif

//——————–third choise

else if(x==3){
pthread_t p3;
pthread_create(&p3,NULL,funct3,(void*)&x);
printMenu();

}//ending else if
else
exit(0);
}//while
}//main

//——————————– function 1———————-
void * funct1(void* arg){

char *nm;
int *i1;
nm=(*char)arg.name;
i1=(*int)arg.id;
s[num-1].name=(*nm);
s[num-1].id=(*i1);

}//end function

//——————————–function 2———————–
void * funct2(void* k1){

printf(“which modification to make:/n1.id/n2.name/nchoice:”);
scanf(“%d”,x);

int *ids;
ids=(*int)k1;
int idd=ids;
int i=0;
int break_while=0;

if(x==1){
printf(“enter new id:”);
int idi;
scanf(“%d”,idi);

while(break_while==0){

if(s[i].id==idd){
s[i].id=idi;
break_while=1;}//if
else
i++;

}//while

}//if x=1

else{
printf(“enter new name:”);
char nm[15];
scanf(“%s”,nm);

while(break_while==0){

if(s[i].id==idd){
s[i].name=nm;
break_while=1;}//if
else
i++;

}//while

}//else;

}//end function 2
//—————————-function 3———————
void * funct3(void* k1){
int i=0;

for(i;i<num;i++){
printf(“\nstudent:”,i);
printf(“\nstudent id:”,s[i].id);
printf(“\nstudent name:”,s[i].name);

}//end i

}//end funct3

//—————————- function printMenu
void printMenu(){
printf(“1. Add new student\n”);
printf(“2.Modify a student Information\n”);
printf(“3.Display array\n”);
printf(“4.exit\n”);

}//


using signals,along with pipes and files

July 4, 2008

#include <stdio.h>
#include <stdlib.h>
# include<fcntl.h>
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>
#include <time.h>

struct itimerval timer;
int which = ITIMER_REAL;
int fd[2];
char line [100];
int timex;

void  f0();
void f1();

int main(){
pipe(fd);
int p=fork();

int t=rand();
t=(t % 1000);
printf(“time interval:%d”,t);

struct itimerval v;
v.it_interval.tv_sec = 0;
v.it_interval.tv_usec = t;  /* random milliseconds */
v.it_value.tv_sec = 0;           /* Zero seconds */
v.it_value.tv_usec = t;

if (p==0){

int f=open(“intext.txt”,O_RDONLY);
int i=0;

//–  the loop —
for(i;i< 5;i++){
int t=rand();
t=(t % 1000);
timex=* t;
read(f,line,5);
line[6]=i;

signal(SIGALRM,f0);
setitimer( which, &v, NULL );
int k=0;
for(k;k<5;k++) pause();

}//for
}//if

else{
timer.it_interval.tv_sec = 0;
timer.it_interval.tv_usec =500000;  /* five hundred milliseconds */
timer.it_value.tv_sec = 0;           /* Zero seconds */
timer.it_value.tv_usec =500000;

signal(SIGALRM,f1);
setitimer( which, &timer, NULL );
int j=0;
for(j;j<5;j++){ pause();}

}//else
return 1;
}//main

void  f0(){
close (fd[0]);
write(fd[1],line,6);
printf(“writing in pipe at random time %d\n”,timex);

}

void  f1(){
int z= open(“outext.txt”,O_WRONLY|O_APPEND);

char l[50];
close (fd[1]);
int s=read(fd[0],l,6);
write(z,l,6);
if(s>0){
printf(“writing in output file \n”);}

else{ printf(“not read\n”);}

}