Nov 11, 2015

Java 3D

yoyoBG = new BranchGroup();
                        // Make the apperance
 Appearance app = new Appearance();
            ColoringAttributes ca = new ColoringAttributes();
            ca.setColor(0.0f,1.0f,0.5f);
            app.setColoringAttributes(ca);
            //Start position
translate.set(new Vector3f(0.1f, 0.15f, 0.2f));
            TransformGroup  TGT = new TransformGroup(translate);
            BG.addChild(TGT);
            //Rotate
            rotate.rotZ(Math.PI*1.0d);
           TransformGroup  TGR = new TransformGroup(rotate);
            //Create the Cylinder
            Cylinder cy = new Cylinder(0.1f, 0.02f);
cy.setAppearance(app);
TGR.addChild(cy);
TGT.addChild(TGR);
            //Create the Cone
            Cone co1 = new Cone(0.1f, 0.2f);
            co1.setAppearance(app2);
            yoyoTGR7.addChild(co1);
            yoyoTGT7.addChild(yoyoTGR7); //Give the object value in main object value
            //Create the Cone
Sphere sp1=new Sphere(0.15f);
Sp1.setApperance(app3);
yoyoTGT11.addChild(sp1);
yoyoTGT7.addChild(yoyoTGR11); //Give the object value in main object value



BED ICT -1 _Part ii My Answer

01)  (i)  Marks[2]=15
      (ii)  Marks[1] = Marks[3]
             Marks[3]=Marks[4]
             Marks[4]=Marks[1]
      (iii) Sector,Cl aster,Track  
      (iv) 128 Bit
       (v) Disk Operating System
       (vi) E:
              cd work
              E:\work>copy sample.txt D:\Work
       (vii)Control Panel\All Control Panel Items\Network and Sharing Center
       (viii)Control Panel\All Control Panel Items\Programs and Features
       (ix) Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an                  Internet Protocol (IP) host with its IP address and other related configuration information such as the                      subnet mask and default gateway.
        (x)

02)
(i)  int[] MyAr = new int[10]
(ii) MyAr[0]=23
      MyAr[1]=45
      MyAr[2]=23
      MyAr[3]=45
     MyAr[4]=23
      MyAr[5]=45
     MyAr[6]=23
      MyAr[7]=45
     MyAr[8]=23
      MyAr[9]=45
(iii)  
    int[] marks =new int[10];
    marks[0]=23;
    marks[1]=56;
    marks[2]=67;
    marks[3]=32;
    marks[4]=56;
    marks[5]=123;
    marks[6]=56;
    marks[7]=167;
    marks[8]=432;
    marks[9]=656;

    int max=marks[0];
    for (int n=0;n<marks.length;n++){
          if (max>marks[n]){
           max=marks[n];
        }
    }
 System.out.print(max);
    }

03)
(i)
 import java.sql.*;


(ii)


 St.executeUpdate(sql);
      sql = "INSERT INTO SchMIS " + "VALUES (004, 'Nihal J.K', '12C')";
    
(iii)


(iv)


04)

(i)    X,Y,Z

(ii)  
 yoyoBG = new BranchGroup();
          // Make the apperance
 Appearance app = new Appearance();
            ColoringAttributes ca = new ColoringAttributes();
            ca.setColor(0.0f,1.0f,0.5f);
            app.setColoringAttributes(ca);
            //Start position
translate.set(new Vector3f(0.1f, 0.15f, 0.2f));
            TransformGroup  TGT = new TransformGroup(translate);
            BG.addChild(TGT);
            //Rotate
            rotate.rotZ(Math.PI*1.0d);
           TransformGroup  TGR = new TransformGroup(rotate);
            //Create the Cylinder
            Cylinder cy = new Cylinder(0.1f, 0.02f);
cy.setAppearance(app);
TGR.addChild(cy);
TGT.addChild(TGR); 

(iii)    a.  //Start position
translate.set(new Vector3f(0.3f, 0.4f, 0.2f));
            TransformGroup  TGT1 = new TransformGroup(translate);
            BG.addChild(TGT1);
          
            //Create the Cylinder
            Cylinder cy = new Cylinder(0.02f, 0.2f);
cy.setAppearance(app);
TGR.addChild(cy);
TGT1.addChild(TGR); 

         b.
            translate.set(new Vector3f(0.1f, 0.1f, 0.4f));
            TransformGroup  TGT2 = new TransformGroup(translate);
            BG.addChild(TGT2);
           Cylinder cy = new Cylinder(0.08f, 0.4f);
cy.setAppearance(app);
TGR.addChild(cy);
TGT1.addChild(TGR); 

How to copy a file in MS-DOS

Copying a single file from one location to another
  1. Using the cd command, move to the directory that contains the file you want to copy.
  2. Type a command similar to the below command.
copy myfile.txt c:\my\location
In the above example, you would substitute "myfile.txt" with the name of the file you want to copy, and "c:\my\location" with the destinationdirectory.
Copying multiple files to another location
  1. Using the cd command, move to the directory that contains the files you want to copy.
  2. Once in the directory that contains the files you want to copy, type a command similar to one of the below commands.
copy *.* c:\mydir
In the above example, the command would copy every file in the current directory to the "mydir" directory.
copy *.txt c:\mydir
In the above example, the command would copy every txt, or text file, in the current directory into the "mydir" directory.
Tip: Additional examples of wildcard characters can be found on ourwildcard definition.
xcopy hope example /e
If you need to copy files, directories, and subdirectories use the xcopy command. In the above example this xcopy command copies all directories (even empty directories) and files from the hope directory into the example directory.
Copying files with spaces in the file names
Many times you will encounter a file with spaces in the file name. To copy these files surround the full file name and file extension in quotes as shown below.
copy "computer hope.txt" "there is hope.txt"
In the above example the "computer hope.txt" file is surrounded in quotes to let the command line know the complete file. In our example we are also copying the file to a file name with spaces so it is also surrounded in quotes.
How to copy files to another drive
You can also copy files from the current location to any other drive. For example, if you have a USB flash drive that is drive letter F: you can use the command below to copy the file all JPEG image files to the flash drive.
copy *.jpg f:
Related pages and help

How to copy files in Linux and Unix

Below are steps on how to copy a single file from one directory to another directory as well as how to copy multiple files from one directory to another directory.
Copying a single file from one location to another.
  1. Using the cd command, move to the directory that contains the file you want to copy.
  2. Type a command similar to the below command.
cp myfile.txt /usr/bin
In the above example, you would substitute "myfile.txt" with the name of the file you want to copy, and "/usr/bin" with the destination directory.
Copying multiple files to another location
  1. Using the cd command, move to the directory that contains the files you want to copy.
  2. Once in the directory that contains the files you want to copy, type a command similar to one of the below commands.
cp *.* /usr/bin
In the above example, the command would copy every file in the current directory to the "/usr/bin" directory.
cp *.txt /usr/bin
In the above example, the command would copy every txt, or text file, in the current directory into the "/usr/bin" directory.
Additional examples of wildcard characters can be found on our wildcarddefinition.
Copying files with spaces in the file names
Many times you will encounter a file with spaces in the file name. To copy these files surround the full file name and file extension in quotes as shown below.
cp "computer hope.txt" "there is hope.txt"

Nov 10, 2015

Spooling

The OSI Model's Seven Layers Defined and Functions Explained





The Open Systems Interconnect (OSI) model has seven layers. This article describes and explains them, beginning with the 'lowest' in the hierarchy (the physical) and proceeding to the 'highest' (the application). The layers are stacked this way:
  • Application
  • Presentation
  • Session
  • Transport
  • Network
  • Data Link
  • Physical

PHYSICAL LAYER

The physical layer, the lowest layer of the OSI model, is concerned with the transmission and reception of the unstructured raw bit stream over a physical medium. It describes the electrical/optical, mechanical, and functional interfaces to the physical medium, and carries the signals for all of the higher layers. It provides:
  • Data encoding: modifies the simple digital signal pattern (1s and 0s) used by the PC to better accommodate the characteristics of the physical medium, and to aid in bit and frame synchronization. It determines:

    • What signal state represents a binary 1
    • How the receiving station knows when a "bit-time" starts
    • How the receiving station delimits a frame
  • Physical medium attachment, accommodating various possibilities in the medium:

    • Will an external transceiver (MAU) be used to connect to the medium?
    • How many pins do the connectors have and what is each pin used for?
  • Transmission technique: determines whether the encoded bits will be transmitted by baseband (digital) or broadband (analog) signaling.
  • Physical medium transmission: transmits bits as electrical or optical signals appropriate for the physical medium, and determines:

    • What physical medium options can be used
    • How many volts/db should be used to represent a given signal state, using a given physical medium

DATA LINK LAYER

The data link layer provides error-free transfer of data frames from one node to another over the physical layer, allowing layers above it to assume virtually error-free transmission over the link. To do this, the data link layer provides: 

  • Link establishment and termination: establishes and terminates the logical link between two nodes.
  • Frame traffic control: tells the transmitting node to "back-off" when no frame buffers are available.
  • Frame sequencing: transmits/receives frames sequentially.
  • Frame acknowledgment: provides/expects frame acknowledgments. Detects and recovers from errors that occur in the physical layer by retransmitting non-acknowledged frames and handling duplicate frame receipt.
  • Frame delimiting: creates and recognizes frame boundaries.
  • Frame error checking: checks received frames for integrity.
  • Media access management: determines when the node "has the right" to use the physical medium.

NETWORK LAYER

The network layer controls the operation of the subnet, deciding which physical path the data should take based on network conditions, priority of service, and other factors. It provides: 

  • Routing: routes frames among networks.
  • Subnet traffic control: routers (network layer intermediate systems) can instruct a sending station to "throttle back" its frame transmission when the router's buffer fills up.
  • Frame fragmentation: if it determines that a downstream router's maximum transmission unit (MTU) size is less than the frame size, a router can fragment a frame for transmission and re-assembly at the destination station.
  • Logical-physical address mapping: translates logical addresses, or names, into physical addresses.
  • Subnet usage accounting: has accounting functions to keep track of frames forwarded by subnet intermediate systems, to produce billing information.

Communications Subnet

The network layer software must build headers so that the network layer software residing in the subnet intermediate systems can recognize them and use them to route data to the destination address. 

This layer relieves the upper layers of the need to know anything about the data transmission and intermediate switching technologies used to connect systems. It establishes, maintains and terminates connections across the intervening communications facility (one or several intermediate systems in the communication subnet). 

In the network layer and the layers below, peer protocols exist between a node and its immediate neighbor, but the neighbor may be a node through which data is routed, not the destination station. The source and destination stations may be separated by many intermediate systems.

TRANSPORT LAYER

The transport layer ensures that messages are delivered error-free, in sequence, and with no losses or duplications. It relieves the higher layer protocols from any concern with the transfer of data between them and their peers. 

The size and complexity of a transport protocol depends on the type of service it can get from the network layer. For a reliable network layer with virtual circuit capability, a minimal transport layer is required. If the network layer is unreliable and/or only supports datagrams, the transport protocol should include extensive error detection and recovery. 

The transport layer provides:
  • Message segmentation: accepts a message from the (session) layer above it, splits the message into smaller units (if not already small enough), and passes the smaller units down to the network layer. The transport layer at the destination station reassembles the message.
  • Message acknowledgment: provides reliable end-to-end message delivery with acknowledgments.
  • Message traffic control: tells the transmitting station to "back-off" when no message buffers are available.
  • Session multiplexing: multiplexes several message streams, or sessions onto one logical link and keeps track of which messages belong to which sessions (see session layer).
Typically, the transport layer can accept relatively large messages, but there are strict message size limits imposed by the network (or lower) layer. Consequently, the transport layer must break up the messages into smaller units, or frames, prepending a header to each frame. 

The transport layer header information must then include control information, such as message start and message end flags, to enable the transport layer on the other end to recognize message boundaries. In addition, if the lower layers do not maintain sequence, the transport header must contain sequence information to enable the transport layer on the receiving end to get the pieces back together in the right order before handing the received message up to the layer above.

End-to-end layers

Unlike the lower "subnet" layers whose protocol is between immediately adjacent nodes, the transport layer and the layers above are true "source to destination" or end-to-end layers, and are not concerned with the details of the underlying communications facility. Transport layer software (and software above it) on the source station carries on a conversation with similar software on the destination station by using message headers and control messages.

SESSION LAYER

The session layer allows session establishment between processes running on different stations. It provides: 

  • Session establishment, maintenance and termination: allows two application processes on different machines to establish, use and terminate a connection, called a session.
  • Session support: performs the functions that allow these processes to communicate over the network, performing security, name recognition, logging, and so on.

PRESENTATION LAYER

The presentation layer formats the data to be presented to the application layer. It can be viewed as the translator for the network. This layer may translate data from a format used by the application layer into a common format at the sending station, then translate the common format to a format known to the application layer at the receiving station. 

The presentation layer provides: 

  • Character code translation: for example, ASCII to EBCDIC.
  • Data conversion: bit order, CR-CR/LF, integer-floating point, and so on.
  • Data compression: reduces the number of bits that need to be transmitted on the network.
  • Data encryption: encrypt data for security purposes. For example, password encryption.

APPLICATION LAYER



The application layer serves as the window for users and application processes to access network services. This layer contains a variety of commonly needed functions: 

  • Resource sharing and device redirection
  • Remote file access
  • Remote printer access
  • Inter-process communication
  • Network management
  • Directory services
  • Electronic messaging (such as mail)
  • Network virtual terminals

Paging & Virtual Memory

Virtual Memory - giving the illusion of more physical memory than there really is (via demand paging) ƒ
 Pure Paging - The total program is kept in memory as sets of (non-contiguous) pages ƒ No illusion of virtual memory ƒ
 Demand Paging - A program’s “working set” is kept in memory, reference outside WS causes corresponding code to be retrieved from disk (“page fault”) ƒ Provides the illusion of virtual memory CS3204 - Arthur Paging Systems ƒ Processes (programs) are divided into fixed size pieces called Pages ƒ Main memory is divided into fixed size partitions called Blocks (Page Frames) ƒ Pure Paging - entire program is kept in memory during execution, but pages are not kept in contiguous blocks ƒ Demand paging - only parts of program kept in memory during execution, pages are not kept in contiguous blocks

Basic Linux Commands

Basic Linux Commands

CommandExampleDescription
catSends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.
cat .bashrcSends the contents of the ".bashrc" file to the screen.
cdChange directory
cd /homeChange the current working directory to /home. The '/' indicates relative to root, and no matter what directory you are in when you execute this command, the directory will be changed to "/home".
cd httpdChange the current working directory to httpd, relative to the current location which is "/home". The full path of the new working directory is "/home/httpd".
cd ..Move to the parent directory of the current directory. This command will make the current working directory "/home.
cd ~Move to the user's home directory which is "/home/username". The '~' indicates the users home directory.
cpCopy files
cp myfile yourfileCopy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.
cp -i myfile yourfileWith the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.
cp -i /data/myfile .Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before overwriting the file.
cp -dpr srcdir destdirCopy all files from the directory "srcdir" to the directory "destdir" preserving links (-p option), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another directory.
dddd if=/dev/hdb1 of=/backup/Disk duplicate. The man page says this command is to "Convert and copy a file", but although used by more advanced users, it can be a very handy command. The "if" means input file, "of" means output file.
dfShow the amount of disk space used on each mounted filesystem.
lessless textfileSimilar to the more command, but the user can page up and down through the file. The example displays the contents of textfile.
lnCreates a symbolic link to a file.
ln -s test symlinkCreates a symbolic link named symlink that points to the file test Typing "ls -i test symlink" will show the two files are different with different inodes. Typing "ls -l test symlink" will show that symlink points to the file test.
locateA fast database driven file locator.
slocate -uThis command builds the slocate database. It will take several minutes to complete this command. This command must be used before searching for files, however cron runs this command periodically on most systems.
locate whereisLists all files whose names contain the string "whereis".
logoutLogs the current user off the system.
lsList files
lsList files in the current working directory except those starting with . and only show the file name.
ls -alList all files in the current working directory in long listing format showing permissions, ownership, size, and time and date stamp
moreAllows file contents or piped output to be sent to the screen one page at a time.
more /etc/profileLists the contents of the "/etc/profile" file to the screen one page at a time.
ls -al |morePerforms a directory listing of all files and pipes the output of the listing through more. If the directory listing is longer than a page, it will be listed one page at a time.
mvMove or rename files
mv -i myfile yourfileMove the file from "myfile" to "yourfile". This effectively changes the name of "myfile" to "yourfile".
mv -i /data/myfile .Move the file from "myfile" from the directory "/data" to the current working directory.
pwdShow the name of the current working directory
more /etc/profileLists the contents of the "/etc/profile" file to the screen one page at a time.
shutdownShuts the system down.
shutdown -h nowShuts the system down to halt immediately.
shutdown -r nowShuts the system down immediately and the system reboots.
whereisShow where the binary, source and manual page files are for a command
whereis lsLocates binaries and manual pages for the ls command.

# 1: cd
The "Change Directory" command enables you to navigate to another directory.
The cd command is THE most important command there is in linux i think. As the command suggests, it enables the user to change / jump to a directory.
Example: cd Downloads
Example: cd /etc/
Example: cd .. (Directory up!)


note: Afther you have typed cd and entering the first or two letters of the directory you can press the TAB key to autocomplete the directory! so... cd  Do (press tabkey) will autocomplete it to Downloads. i use this a lot <--

#2: man
The man command shows the users the "manual" of the command. In some situation you might need to get more information about the command you are using. The man command shows you this information about the command.
Example: man cp
This will open up the "cp" manual document for us in the shell. The manual shows us the parameters available for the commands.
note: To close the manual simply press "Q".

#3: ls
In the absolute top 15 there's no way the ls command is missing. On the third place, the ls command. The ls command is used to list the files/directories within a directory.
Example: ls
It shows us the directories available.

#4: cp
The cp command is available for us to "Copy" things. This might be usefull for duplicating files f.e.
Example: cp file file2
note: file is on this case the file the user wants to be copied... file2 is the name of the copied file. It's that simple.

#5 mv
The mv command is used for "Move" operations. The mv commands enables the users to move a file/directory to a specified location.
Example: mv /home/bas/Desktop/bla /home/bas/Desktop/fiets

note: the first part of the command is the file that has to be moved. The second part (after the whitespace) is the target directory. Make sure you type in the full path using this command!

#6 mkdir
This command is used to "make" directories, NOT Files.. (thit is possible with another command which i will bring up later in this tutorial)
Example: mkdir testdirectory
note: The name of the directory is case sensitive which means that Testdirectory is a complete different directory as testdirectory.

#7 rmdir
When you are able to make directories, you also want to know how to remove them. Removing directories is done by the rmdir command and belongs to the absolute basic commands in shell bashing.
Example: rmdir fiets
note: When the directory is not empty the command will prompt an error message:
rmdir: failed to remove `fiets': Directory not empty

So make sure it's completely empty before removing it.

#8 touch
Now we know how to make directories and deleting them, i now want to use the touch command. The touch command is used to make files.
Example: touch vogel
This will create the file vogel for us in the directory.

#9 rm
The rm command stand for remove. The rm command is used in order the delete files instead of directories.
Example: rm vogel
note: To remove files you must have the right permission bits set on the specific file.

#10 tar
Sometimes you have to archive files. Archiving files is a way to pack a set of files to one single file. The operation is done by the tar command.
Example: tar -cvf test.tar test (Creating a tar file from directory or file test)
Example: tar -xvf test.tar myexctractfolder (Extracts the particular tar file in the current working directory)
In the example i used parameters. These parameters are telling the tar command how to behave and how to execute.  After the parameters i entered the name of the file which is test.tar. The second part is the source directory/file of the tar file. In this situation a directory called test.

#11 pwd
Sometimes you really wonder where you are in the system. PWD is the solution for that problem.
PWD stands for Path Working Directory.
Example: pwd

#12 ifconfig
ifconfig is a command showing you information about the ethernet adapters on your system. It contains very usefull information like gateway, ip,  and packet statistics. For the average user this command is rarely used, but i think it's worth knowing it.
Example: ifconfig
note: To gain information about the wireless adapters on your system type iwconfig.

#13 locate
Locate is an extremely fast seaching command. It shows the directories or files each on a new line.
Example: locate syslog
Example: locate syslog | more (Piping structure used to invert the data from locate to the more command)
note: Some keywords returns enormous ammounts of hits. Use MORE to  (see example)  clear things up a bit.

#14 ping
Ping is used as a network diagnostic command by professionals. Ping offers information about the network we are on and if the other system responds to us. In cases of troubleshooting network related problems, ping can do a great job to determine the domain of the problem.
Example: ping www.google.com
The command returns the interval and % of loss during the test.
note: You can stop ping bij pressing crtl-c at the same time.

#15 chmod
The chmod command. The chmod command comes from "Change Mode" back to the unix times. It's a great command to restrict access to directories or files. But before i show you an example on how to use it, some theory.
Chmod is qiet an advanced command to use. So therefore you really need to understand how it works.
chmod works with so called persmission bits. These bits can be set to a certain level of restrictions.

We have the following bits available:
7full
6read and write
5read and execute
4read only
3write and execute
2write only
1execute only
0none
source: http://en.wikipedia.org/wiki/Chmod

Use Proxy Server and How to Use Proxy Server

A proxy server is a computer that acts as an intermediary between the user's computer and the Internet. It allows client computers to make indirect network connections to other network services. If use proxy server, client computers will first connect to the proxy server, requesting some resources like web pages, games, videos, mp3, e-books, any other resources which are available from various servers over Internet. As soon as getting such request, the proxy server will seek for the resources from the cache in its local hard disk. If the resources have been cached before, the proxy server will return them to the client computers. If not cached, it will connect to the relevant servers and request the resources on behalf of the client computers. Then it 'caches' resources from the remote servers, and returns subsequent requests for the same content directly.
Nowadays, we use proxy server for various purpose like sharing Internet connections on a local area network, hide our IP address, implement Internet access control, access blocked websites and so on. Bellow are some benefits why people use proxy server:
  • To share Internet connection on a LAN. Some small businesses and families have multiple computers but with only one Internet connection, they can share Internet connection for other computers on the LAN with a proxy server.
  • To speed up Internet surfing. If use proxy server, all requests from client computers will reach the proxy server at first, if the proxy server has cached the required resources in its local hard disk before with the web cachefunction, clients will get feedback directly from proxy server, it will be more quickly than direct accessing.
  • To hide the IP address of the client computer so that it can surf anonymous, this is mostly for security reasons. A proxy server can act as an intermediary between the user's computer and the Internet to prevent from attack and unexpected access.
  • To implement Internet access control like authentication for Internet connection, bandwidth control, online time control, Internet web filter and content filter etc.
  • To bypass security restrictions and filters. For example, many work offices have blocked facebook and myspace however, you can use proxy server to bypass such restrictions and access blocked websites easily.
  • To scan outbound content, e.g., for data leak protection.
  • To circumvent regional restrictions. For example, a server using IP-based geolocation to restrict its service to a certain country can be accessed using a proxy located in that country to access the service.

II. How to Use Proxy Server for IE, Firefox, Thunderbird, MSN, Yahoo, Skhpe, CuteFTP

To use proxy server for the above advantages, you need to make proxy server settings on the client computers first of all. Suppose the proxy server address is "192.168.1.100", bellow are how to use proxy server for IE, Firefox, Thunderbird, MSN, Yahoo, Skhpe, CuteFTP by make proxy server settings in them.
Use Proxy Server for IE
Click "Tools" -> "Internet Options" -> "Connections" -> "LAN Settings" -> select "Use a proxy server for your LAN" -> "Advanced", configure as bellow.
IE8 Proxy Settings
Figure 1
Use Proxy Server for Firefox
Click "Tools" -> "Options" -> "Advanced" -> "Network" -> "Connections" -> "Settings" -> "Manual proxy configuration", configure as bellow.
Firefox Proxy Settings
Figure 2

Encryption and decryption

Encryption and decryption

symmetric Key



Asymatric 
When discussing encryption, there are a few terms with which you should be familiar. The "message" is the actual data for our concern, also frequently referred to as "plain text" (denoted as "M"). Although referred to as plain text, M is not necessarily ASCII text; it might be any type of unencrypted data. It is "plain" in the sense that it does not require decryption prior to use. The encrypted message is "cipher text" (denoted as "C").
Mathematically, encryption is simply a function from the domain of M into the range of C; decryption is just the reverse function of encryption. In practice, the domain and range of most cryptography functions are the same (that is, bit or byte sequences). We denote encryption with 'C = E(M)', and decryption with 'M = D(C)'. In order for encryption and decryption to do anything useful, the equality M = D(E(M)) will automatically hold (otherwise we do not have a way of getting plain text back out of our cipher text).

Encryption and decryption, part 2

In real-life cryptography, we are not usually concerned with individual encryption and decryption functions, but rather with classes of functions indexed by a key. 'C = E{k}(M)' and 'M = D{k}(C)' denote these. For keyed functions, our corresponding automatic equality is M = D{k}(E{k}(M)). With different key indexes to our function classes, we do not expect equalities like the above (in fact, finding them would usually indicate bad algorithms): M != D{k1}(E{k2}(M)). This inequality works out nicely because all the folks without access to the key K will not know which decryption function to use in deciphering C.
The design of specific cryptographic algorithms has many details, but the basic mathematics are as simple as their portrayal in this tutorial.

Hard Drive Sector and Clusters

Home | Introduction | Abbreviations & Acronyms | The Difference Between the Internet and the World Wide Web | XP Tweaks | Adjusting Virtual Memory | Tips & Tricks | Trouble Shooting Tips | What is the differences between spyware, adware, malware? | Windows XP Startup & Shutdown Errors | Hard Drive Sector and Clusters | Scannow sfc Problems | CD\DVD Drive not Recognized | How to Visually Identify Your Memory | Vista UAC | Vista Disk Clean Up | NetWork Essentials | OSI Reference Model | High Speed TroubleShooting

A Sector in the context of computing refers to a small area of a storage device, for example a hard disk drive.

For instance, a typical hard disk drive when low-level formatted is split into tracks, sectors and clusters :
  • Tracks are concentric circles around the disk.
  • Sectors are segments of a track.
  • Clusters are a set of sectors.



track-sector-example.jpg

In the example above in fig 1.1 we have only illustrated one track, one sector and one cluster, but you can see where the other tracks, sectors and clusters would reside.

A typical hard drive may have 30 or more tracks and 10 or more sectors per track.

The size of a cluster will vary depending on the size of the partition.
 
Bad Sector
A bad sector refers to a single sector that has some physical flaw, although a disk can operate with a bad sector, any data that was stored in that sector will be lost, further, no data can be written to that sector.
Lost Cluster
A lost cluster is a cluster that the operating system has classed as being in use, but actually contains no data. The ScanDisk utility within Windows is designed to search for lost clusters and make them available to the file system again.
The Boot Process and the boot sector
Boot sector refers to a single sector (normally the first in the active partition) that contains the code to boot the operating system.

Before the boot sector is read, the computer's bios will call a small program called an MBR (Master Boot Record) which normally resides in the first record of the first disk.

The MBR will query the 
FAT (File Allocation Table) to establish the primary partition and then pass control over to the boot sector of that partition.

The small program stored in the boot sector is then executed and the operating system will begin to load.