Sunday, August 15, 2021

OS

 /* link.c */

#include <fcntl.h>
int main(int argc, char * argv[]) {
link(argv[1],argv[2]);
return 0;
}


/* mkdir.c */
#include <fcntl.h>
int main(int argc, char * argv[]) {
mkdir(argv[1],0700);
return 0;
}


/* unlink.c */
#include <fcntl.h>
int main(int argc, char * argv[]) {
unlink(argv[1]);
return 0;
}


/* myexec.c */ #include <stdio.h> main () { printf ("I'm process %d and I'm about to exec an ls -l\n",getpid ()); execl ("/bin/ls", "ls", "-l", NULL); /* Execute ls */ printf ("This line should never be executed\n"); }


Friday, March 23, 2012

Computer Science & Engineering

                                                          click link VIRTUAL LABS 



Sunday, January 1, 2012

Basic Security Concepts

Three basic security concepts important to information on the internet are confidentiality, integrity, and availability.

Sunday, December 25, 2011


What Is Hacking?


Hacking is quite simply the attempt to gain access to a computer system without
authorization.
What is Network Security?


Activities designed to protect your network are referred to as network security

Sunday, October 23, 2011

Two OO Design Principles

Cohesion and Coupling

Cohesion and Coupling deal with the quality of an OO design. Generally, good OO design calls for loose coupling and high cohesion. The goals of OO designs are to make the application

  • Easy to Create
  • Easy to Maintain
  • Easy to Enhance

COUPLING:


Coupling is the degree to which one class knows about another class. Let us consider two classes class A and class B. If class A knows class B through its interface only i.e it interacts with class B through its API then class A and class B are said to be loosely coupled.
If on the other hand class A apart from interacting class B by means of its interface also interacts through the non-interface stuff of class B then they are said to be tightly coupled. Suppose the developer changes the class B‘s non-interface part i.e non API stuff then in case of loose coupling class A does not breakdown but tight coupling causes the class Ato break.
So its always a good OO design principle to use loose coupling between the classes i.e all interactions between the objects in OO system should use the APIs. An aspect of good class and API design is that classes should be well encapsulated.

COHESION:

Cohesion is used to indicate the degree to which a class has a single, well-focused purpose. Coupling is all about how classes interact with each other, on the other hand cohesion focuses on how single class is designed. Higher the cohesiveness of the class, better is the OO design.
Benefits of Higher Cohesion:

  • Highly cohesive classes are much easier to maintain and less frequently changed.
  • Such classes are more usable than others as they are designed with a well-focused purpose.