Friday, 19 September 2014

Linux command line : File System

Linux Filesystem Management


Aim : To study file system in Linux.

Theory : Linux supports a large number of file systems, from journaling to clustering to cryptographic. Linux is a wonderful platform for using standard and more exotic file systems and also for developing file systems. 

Following Commands are used in File system management
badblocks
Used to search a disk or partition for badblocks.
cfdisk
Similar to fdisk but with a nicer interface.
debugfs
Allows direct access to filesystems data structure.
df
Shows the disk free space on one or more filesystems.
dosfsck
Check and repair MS-Dos filesystems.
du
Shows how much disk space a directory and all its files contain.
dump
Used to back up an ext2 filesystem. Complement is restore.
dumpe2fs
Dump filesystem superblock and blocks group information. Ex: dumpe2fs /dev/hda2
e2fsck
Check a Linux second extended filesystem.
e2label
Change the label on an ext2 filesystem.
exportfs
Used to set up filesystems to export for nfs (network file sharing).
fdisk
Used to fix or create partitions on a hard drive.
fdformat
Formats a floppy disk.
fsck
Used to add new blocks to a filesystem. Must not be run on a mounted file system.
hdparm
Get/set hard disk geometry parameters, cylinders, heads, sectors.
mkfs
Initializes a Linux filesystem. This is a front end that runs a separate program depending on the filesystem's type.
mke2fs
Create a Linux second extended filesystem.
mkswap
Sets up a Linux swap area on a device or file.
mount
Used to mount a filesystem. Complement is umount.
rdev
Query/set image root device, swap device, RAM disk size of video mode. What this does is code the device containing the root filesystem into the kernel image specified.
rdump
Same as dump.
rmt
Remote magtape protocol module.
restore
Used to restore an ext2 filesystem.
setfdprm
Set floppy drive parameters.
swapoff(8)
Used to de-activate a swap partition.
swapon(8)
Used to activate a swap partition.
sync
Forces all unwritten blocks in the buffer cache to be written to disk.
tune2fs
Adjust tunable filesystem parameters on second extended filesystems.
umount
Unmounts a filesystem. Complement is mount.




Tuesday, 16 September 2014

Program to implement curve generation using Bezeir curve algorithm.

#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<graphics.h>
void main(){
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TCC\\BGI");
int x[4],y[4],px,py,i;
cout<<"Enter four control points of bezier curve:" ;
for(i=0;i<4;i++) cin>>x[i]>>y[i];
double t;
for(t=0.0;t<=1.0;t+=0.001){
px=(1-t)*(1-t)*(1-t)*x[0]+3*t*(1-t)*(1-t)*x[1]+3*t*t*(1-t)*x[2]+t*t*t*x[3];
py=(1-t)*(1-t)*(1-t)*y[0]+3*t*(1-t)*(1-t)*y[1]+3*t*t*(1-t)*y[2]+t*t*t*y[3];
putpixel(px,py,WHITE);
delay(2);
}
getch();
closegraph();
}

SQL Integrity Constraints

SQL Integrity Constraints

Integrity Constraints are used to apply business rules for the database tables.

The constraints available in SQL are Foreign Key, Not Null, Unique, Check.

Constraints can be defined in two ways
1) The constraints can be specified immediately after the column definition. This is called column-level definition.
2) The constraints can be specified after all the columns are defined. This is called table-level definition.

1) SQL Primary key:

This constraint defines a column or combination of columns which uniquely identifies each row in the table.

2) SQL Foreign key or Referential Integrity :

This constraint identifies any column referencing the PRIMARY KEY in another table. It establishes a relationship between two columns in the same table or between different tables. For a column to be defined as a Foreign Key, it should be a defined as a Primary Key in the table which it is referring. One or more columns can be defined as Foreign key.

3) SQL Not Null Constraint :

This constraint ensures all rows in the table contain a definite value for the column which is specified as not null. Which means a null value is not allowed.

4) SQL Unique Key:

This constraint ensures that a column or a group of columns in each row have a distinct value. A column(s) can have a null value but the values cannot be duplicated.

5) SQL Check Constraint :

This constraint defines a business rule on a column. All the rows must satisfy this rule. The constraint can be applied for a single column or a group of columns.

Monday, 15 September 2014

ADT bundle download links

http://www.4shared.com/zip/mf0bzmci/adt-bundle-windows-x86-2013103.html?locale=en

http://developer.android.com/sdk/index.html

Saturday, 13 September 2014

DCL Commands

DCL

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.
  • GRANT – allow users access privileges to database
  • REVOKE – withdraw users access privileges given by using the GRANT command
Grant




Revoke



DML Commands

DML

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.
  • SELECT – retrieve data from the a database
  • INSERT – insert data into a table
  • UPDATE – updates existing data within a table
  • DELETE – Delete all records from a database table
Select 



Insert 

Update


Delete 


Friday, 12 September 2014

DDL commands

Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
  • CREATE - to create objects in the database
  • ALTER - alters the structure of the database
  • DROP - delete objects from the database
  • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
  • RENAME - rename an object

Create


Alter


Drop



Truncate




Rename