Translate

Labels

Thursday 28 February 2013

BINARY SEARCH


# include <stdio.h>
  main()
  {
    int n,a[20],i,j,t=0,m,low=0,high,mid;
    a[0]=0;
clrscr();
printf("\t\t\t\tBINARY SEARCH\n");
printf("\nEnter the no. of elements:\n");
    scanf("%d",&n);
    printf("\nEnter the elements:\n");
    for(i=1;i<=n;i++)
    scanf("%d",&a[i]);
    for(j=1;j<n;j++)
    for(i=1;i<n;i++)
    if (a[i]>a[i+1])
    {
      t=a[i];
      a[i]=a[i+1];
      a[i+1]=t;
    }
printf("\nThe ordered list is...\n");
    for(i=1;i<=n;i++)
printf("%d  ",a[i]);
printf("\n\nEnter the searching element:\n");
    scanf("%d",&m);
    high=n;
    while(low<=high)
    {
mid=(low+high)/2;
printf("\nMid element & position is... %d & %d",a[mid],mid);
      switch(m<a[mid])
      {
case 1:
high=mid-1;
break;
case 0:  if(m==a[mid])
{
  j=a[mid];
printf("\n\nThe element is present in the position %d.",mid);
  break;
}
else
low=mid+1;
j=0;
      }
      if(j==m) break;
    }
    if(j==0)
printf("\n\nThe element is not present");
    getch();
  }






INSERTION SORT



# include <stdio.h>
int a[100];
main()
{
int n,i,j,t,Z;
clrscr();
printf("\t\t\t\t INSERTION SORT \n");
printf("\nEnter the no. of elements:\n");
scanf("%d",&n);
printf("\nEnter the elements:\n");
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
printf("\nIterations:\n");
for(j=2;j<=n;j++)
{
      for(Z=1;Z<=n;Z++)
printf("%d  ",a[Z]);
printf("\n");
t=a[j];
insert(t,j-1);
}
for(Z=1;Z<=n;Z++)
printf("%d  ",a[Z]);
printf("\n\nThe sorted elements are...\n");
for(Z=1;Z<=n;Z++)
printf("%d  ",a[Z]);
getch();
}
insert(int r,int i)
{
int J,k;
J=i;
k=r;
while(k<a[J])
{
a[J+1]=a[J];
J--;
if(J==0)
break;
}
a[J+1]=r;
}


QUICK SORT



# include <stdio.h>
int a[100],l;
main()
{
int m,n,i;
clrscr();
printf("\t\t\t\tQUICK SORT\n");
printf("\nEnter the no. of elements:\n");
scanf("%d",&n);
l=n;
printf("\nEnter the elements:\n");
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
m=1;
    printf("\nIterations:\n");
quick(m,n);
for(i=1;i<=n;i++)
printf("%d  ",a[i]);
printf("\n\nThe sorted elements are...\n");
for(i=1;i<=n;i++)
printf("%d  ",a[i]);
getch();
}
quick(int m,int n)
{
int h,i,j,k,z;
for(z=1;z<l;z++)
{
if(a[z]<=a[z+1])
h=1;
else
{
h=0;
break;
}
}
if(h==0)
{
for(z=1;z<=l;z++)
printf("%d  ",a[z]);
printf("\n");
}
if(m<n)
{
i=m;
j=n+1;
k=a[m];
while(i<j)
{
do
i++;
while(a[i]<k);
do
j--;
while(a[j]>k);
if(i<j)
interchange(i,j);
}
interchange(m,j);
quick(m,j-1);
quick(j+1,n);
}
}
interchange(int x,int y)
{
int t,z;
t=a[x];
a[x]=a[y];
a[y]=t;
}



HEAP SORT



# include <stdio.h>
int a[100],j;
main()
{
int n,t,i,z;
clrscr();
printf("\t\t\t\t  HEAP SORT\n");
printf("\nEnter the no. of elements:\n");
scanf("%d",&n);
printf("\nEnter the elements:\n");
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
for(i=n/2;i>=1;i--)
adjust(i,n);
printf("\nInitial heap is...\n");
for(i=1;i<=n;i++)
printf("%d  ",a[i]);
printf("\n\nIterations:\n");
for(i=n-1;i>0;i--)
{
t=a[i+1];
a[i+1]=a[1];
a[1]=t;
adjust(1,i);
for(z=1;z<=i;z++)
printf("%d  ",a[z]);
printf("    \\     ");
for(z=i+1;z<=n;z++)
printf("%d  ",a[z]);
printf("\n");
}
getch();
clrscr();
printf("\nThe sorted elements are...\n");
for(i=1;i<=n;i++)
printf("%d  ",a[i]);
getch();
}
adjust (i,n)
{
int r,k;
r=a[i];
k=a[i];
j=2*i;
while(j<=n)
{
if((j<n)&&(a[j]<a[j+1]))
j+=1;
if(k>=a[j])
break;
a[j/2]=a[j];
j=2*j;
}
a[j/2]=r;
}

Monday 25 February 2013

MERGE SORT



# include <stdio.h>
main()
{
int x[100],y[100],z[100],n,i,l;
clrscr();
printf("\t\t\t\t   MERGE SORT\n");
printf("\n\nEnter the no. of elements:\n");
scanf("%d",&n);
printf("\nEnter the elements.\n");
for(i=1;i<=n;i++)
scanf("%d",&x[i]);
printf("\nIterations:\n");
l=1;
while(l<n)
{
mpass(x,y,n,l);
l=2*l;
mpass(y,x,n,l);
l=2*l;
}
for(i=1;i<=n;i++)
printf("%d  ",x[i]);
printf("\n");
getch();
clrscr();
printf("\nThe sorted elements are...\n");
for(i=1;i<=n;i++)
printf("%d  ",x[i]);
getch();
}
mpass(int x[],int y[],int n,int l)
{
int i,q,z;
i=1;
while(i<=n-(2*l)+1)
{
merge(x,i,i+l-1,i+(2*l)-1,y);
i=i+(2*l);
}
if(i+l-1<n)
merge(x,i,i+l-1,n,y);
else
for(q=i;q<=n;q++)
y[q]=x[q];
for(z=1;z<=n;z++)
printf("%d  ",x[z]);
printf("\n");
}
merge(int x[],int l,int m,int n,int z[])
{
int i,j,k,r;
i=k=l;j=m+1;
while((i<=m)&&(j<=n))
{
if(x[i]<=x[j])
{
z[k]=x[i];
i++;
}
else
{
z[k]=x[j];
j++;
}
k++;
}
if(i>m)
for(r=j;k<=n;k++)
{
z[k]=x[r];
k++;
}
else
for(r=i;r<=m;r++)
{
z[k]=x[r];
k++;
}
return;
}




STACK



  # include <stdio.h>
  # include <conio.h>
  void push();
  void pop();
  void list();
  int top=1,stack[10],z,o;
  main()
  {
int n,m,i,a,s;
    clrscr();
    printf("\t\t\t\tSTACK\n");
printf("\nEnter the size of the stack:\n");
    scanf("%d",&z);
    for(;;)
    {
      clrscr();
      printf("\t\t\t\tSTACK\n");
      printf("\n1.push");
      printf("\n2.pop");
      printf("\n3.list");
      printf("\n4.exit\n");
      printf("\nEnter your choice:");
      scanf("%d",&n);
      switch(n)
      {
case 1: if((top-1)>=z)
{
printf("The stack is full.\n");
getch();
break;
}
printf("Enter the no. of elements:\n");
scanf("%d",&m);
while(z-(top-1)<m)
{
if((top-1)>m)
break;
printf("%d elements not to be added.\n",m);
printf("Only %d elements to be added.\n\n",z-top+1);
printf("Enter the no. of elements:\n");
scanf("%d",&m);
}
printf("Enter the elements:\n");
for(i=1;i<=m;i++)
{
if (top>z)
{
printf("The stack is full.\n");
break;
}
scanf("\t%d",&a);
push(a);
}
break;
case 2: if((top-1)==0)
{
printf("The stack is empty.\n");
getch();
break;
}
printf("Enter the no. of elements to be deleted:\n");
scanf("%d",&o);
s=o;
while(s>=top)
{
if((top-1)==0)
break;
printf("%d elements not to be deleted.\n",o);
printf("Only %d elements to be deleted.\n",top-1);
printf("\nEnter the no. of elements to be deleted:\n");
scanf("%d",&s);
o=top-1;
}
for(i=0;i<s;i++)
{
if((top-1)<=0)
break;
pop();
}
getch();
break;
case 3: list();
break;
case 4: exit();
break;
default: printf("\nYour choice is wrong");
break;
      }
    }
  }
  void push(int a)
  {
      stack[top]=a;
      top++;
  }
  void pop()
  {
    printf("The popped element is: %d\n",stack[top-1]);
    top--;
  }
  void list()
  {
    int i;
    printf("stack:");
    for(i=1;i<=top-1;i++)
    printf("  --->  %d  ",stack[i]);
    printf("\n");
    getch();
  }






JPEG TO BMP


#include <stdio.h>
#include <jpeglib.h>
#include <stdlib.h>
#include <string.h>

/* we will be using this uninitialized pointer later to store raw, uncompressd image */
unsigned char *raw_image = NULL;

/* dimensions of the image we want to write */
int width;
int height;
int bytes_per_pixel;   /* or 1 for GRACYSCALE images */
int color_space; /* or JCS_GRAYSCALE for grayscale images */

typedef struct {
     long filesize;
     char reserved[2];
     long headersize;
     long infoSize;
     long width;
     long depth;
     short biPlanes;
     short bits;
     long biCompression;
     long biSizeImage;
     long biXPelsPerMeter;
     long biYPelsPerMeter;
     long biClrUsed;
     long biClrImportant;
} BMPHEAD;

int write_bmp_file( char *filename )
{

 BMPHEAD bh;

 memset ((char *)&bh,0,sizeof(BMPHEAD)); /* sets everything to 0 */

 //bh.filesize  =   calculated size of your file (see below)
 //bh.reserved  = two zero bytes
 bh.headersize  = 54L;//  (for 24 bit images)
 bh.infoSize  =  0x28L;//  (for 24 bit images)
 bh.width     = width ;//in pixels of your image
 bh.depth     = height;// in pixels of your image
 bh.biPlanes  =  1 ;//(for 24 bit images)
 bh.bits      = 24 ;//(for 24 bit images)
 bh.biCompression = 0L;;//  (no compression)

 int bytesPerLine;

 bytesPerLine = width * 3;  /* (for 24 bit images) */
 /* round up to a dword boundary */
 if (bytesPerLine & 0x0003) 
    {
    bytesPerLine |= 0x0003;
    ++bytesPerLine;
    }
 bh.filesize=bh.headersize+(long)bytesPerLine*bh.depth;

 FILE * bmpfile;

 printf("Bytes per line : %d\n", bytesPerLine);

 bmpfile = fopen(filename, "wb");
 if (bmpfile == NULL)
    {
    printf("Error opening output file\n");
    /* -- close all open files and free any allocated memory -- */
    exit (1);
    }
 fwrite("BM",1,2,bmpfile);
 fwrite((char *)&bh, 1, sizeof (bh), bmpfile);

 char *linebuf;
    
 linebuf = (char *) calloc(1, bytesPerLine);
 if (linebuf == NULL)
    {
     printf ("Error allocating memory\n");
    free(raw_image);
     /* -- close all open files and free any allocated memory -- */
     exit (1);   
    }


 int line,x;

 for (line = height-1; line >= 0; line --)
    {
    /* fill line linebuf with the image data for that line */
  for( x =0 ; x < width; x++ )
  {
   *(linebuf+x*bytes_per_pixel) = *(raw_image+(x+line*width)*bytes_per_pixel+2);
   *(linebuf+x*bytes_per_pixel+1) = *(raw_image+(x+line*width)*bytes_per_pixel+1);
   *(linebuf+x*bytes_per_pixel+2) = *(raw_image+(x+line*width)*bytes_per_pixel+0);
  }
  
    /* remember that the order is BGR and if width is not a multiple
       of 4 then the last few bytes may be unused
    */
    fwrite(linebuf, 1, bytesPerLine, bmpfile);
    }
 free(linebuf);
 fclose(bmpfile);



}



/**
 * read_jpeg_file Reads from a jpeg file on disk specified by filename and saves into the 
 * raw_image buffer in an uncompressed format.
 * 
 * \returns positive integer if successful, -1 otherwise
 * \param *filename char string specifying the file name to read from
 *
 */

int read_jpeg_file( char *filename )
{
 /* these are standard libjpeg structures for reading(decompression) */
 struct jpeg_decompress_struct cinfo;
 struct jpeg_error_mgr jerr;
 /* libjpeg data structure for storing one row, that is, scanline of an image */
 JSAMPROW row_pointer[1];

 FILE *infile = fopen( filename, "rb" );
 unsigned long location = 0;
 int i = 0;

 if ( !infile )
 {
  printf("Error opening jpeg file %s\n!", filename );
  return -1;
 }
 /* here we set up the standard libjpeg error handler */
 cinfo.err = jpeg_std_error( &jerr );
 /* setup decompression process and source, then read JPEG header */
 jpeg_create_decompress( &cinfo );
 /* this makes the library read from infile */
 jpeg_stdio_src( &cinfo, infile );
 /* reading the image header which contains image information */
 jpeg_read_header( &cinfo, TRUE );
 /* Uncomment the following to output image information, if needed. */

 printf( "JPEG File Information: \n" );
 printf( "Image width and height: %d pixels and %d pixels.\n", width=cinfo.image_width, height=cinfo.image_height );
 printf( "Color components per pixel: %d.\n", bytes_per_pixel = cinfo.num_components );
 printf( "Color space: %d.\n", cinfo.jpeg_color_space );

 /* Start decompression jpeg here */
 jpeg_start_decompress( &cinfo );

 /* allocate memory to hold the uncompressed image */
 raw_image = (unsigned char*)malloc( cinfo.output_width*cinfo.output_height*cinfo.num_components );
 /* now actually read the jpeg into the raw buffer */
 row_pointer[0] = (unsigned char *)malloc( cinfo.output_width*cinfo.num_components );
 /* read one scan line at a time */
 while( cinfo.output_scanline < cinfo.image_height )
 {
  jpeg_read_scanlines( &cinfo, row_pointer, 1 );
  for( i=0; i<cinfo.image_width*cinfo.num_components;i++) 
   raw_image[location++] = row_pointer[0][i];
 }
 /* wrap up decompression, destroy objects, free pointers and close open files */
 jpeg_finish_decompress( &cinfo );
 jpeg_destroy_decompress( &cinfo );
 free( row_pointer[0] );
 fclose( infile );
 /* yup, we succeeded! */
 return 1;
}


int main(int argc,char **argv)
{
 int x,y;

 if(argc != 3){ printf("Usage: %s source.jpg dest.bmp",argv[0]); return -1; }
 x=y=0;
 /* Try opening a jpeg*/
 if( read_jpeg_file( argv[1] ) > 0 )   write_bmp_file( argv[2] );

 else return -1;

 free(raw_image);
 return 0;
}

Sunday 24 February 2013

CALCULATION ON COMMAND PROMPT

The command processor CMD.EXE comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers:

C:\>set /a 2+2
4
C:\>set /a 2*(9/2)
8
C:\>set /a (2*9)/2
9
C:\>set /a "31>>2"
7

Note that we had to quote the shift operator since it would otherwise be misinterpreted as a "redirect stdout and append" operator.

For more information, type set /? at the command prompt.

CONTROL OVER A TO Z AND OTHER KEYS

CTRL+ A
Select all
CTRL+ B
Bold
CTRL+ C
Copy
CTRL+ E
Justify center
CTRL+ I
Italics
CTRL+ J
Justify full
CTRL+ L
Justify Left
CTRL+ M
Indent
CTRL+ Q
Remove paragraph Formatting
CTRL+ R
Justify right
CTRL+ T
Margin release
CTRL+ U
Underline


CTRL+ D
Opens Font Dialog Box
CTRL+ F
Find
CTRL+ G
Go to page, section, line, heading etc
CTRL+ H
Find and replace
CTRL+ K
Insert Hyperlink
CTRL+ N
Open a new document
CTRL+ O
Open an existing document
CTRL+ S
Save
CTRL+ W
Close an existing document
CTRL+ Y
Redo
CTRL+ Z
Undo


CTRL+ LEFT ARROW
Jumps one word left
CTRL+ RIGHT ARROW
Jumps one word right
CTRL+ DOWN ARROW
Jumps one para down
CTRL+ UP ARROW
Jumps one para up
CTRL+ BACKSPACE
Delete one word left
CTRL+ DELETE
Delete one word right
CTRL+ PAGE UP
To the beginning of the previous page
CTRL+ PAGE DOWN
to the beginning of the next page
CTRL+ P
Print Dialog box

INTERNET EXPLORER AND NETSCAPE SHORTCUT KEYS

Home
Jumps to the beginning of the page
END
Jumps to the end of the page
ESC
Stops the current page from loading
F11
Toggles full screen view
ALT+ LEFT ARROW
Goes back to the previous page
ALT+ RIGHT ARROW
Goes forward to the next page
ALT+ Home
Goes to your Home page
CTRL+ N
Opens a new browser window
CTRL+ W
Closes the active window
CTRL+ O
Opens the address book
CTRL+ R
Reloads the current page
CTRL+ B
Opens the Organized Favorites or Bookmarks windows
CTRL+ D
Add the current page to your Favorites or Bookmarks
CTRL+ H
Opens the history folder
CTRL+ F
Finds text on the current page

KEYBOARD SHORTCUTS


F2
Rename an item

F3
Open files

ALT+F4
Close window or quit program

F10
Activate the menu bar in a program

CTRL+ ESC
open start menu, use the arrow keys to select an item, or TAB to select the taskbar

ALT+ TAB
Return to previous program, or hold down the ALT key while repeatedly pressing tab to cycle through open programs

SHIFT+ DEL
delete items permanently without sending to recycle bin

CTRL+ A
Highlight all the items in window

CTRL+ C
Copy

CTRL+ X
Cut

CTRL+ V
Paste

CTRL+ Z
Undo

CTRL+ Y
Redo

COMMAND PROMPT


 List of F1-F9 Key Commands 

  • F1 / right arrow: Repeats the letters of the last command line, one by one.
  • F2: Displays a dialog asking user to "enter the char to copy up to" of the last command line
  • F3: Repeats the last command line
  • F4: Displays a dialog asking user to "enter the char to delete up to" of the last command line
  • F5: Goes back one command line
  • F6: Enters the traditional CTRL+Z (^z)
  • F7: Displays a menu with the command line history
  • F8: Cycles back through previous command lines (beginning with most recent)
  • F9: Displays a dialog asking user to enter a command number, where 0 is for first command line entered.
  • Alt+Enter: toggle fullScreen mode.
  • up/down: scroll thru/repeat previous entries
  • Esc: delete line
  • Note: The buffer allows a maximum of 50 command lines. After this number is reached, the first line will be replaced in sequence.

GMAIL


  • Note: Must have "keyboard shortcuts" on in settings.
  • C: Compose new message.
  • Shift + C: Open new window to compose new message.
  • Slash (/): Switch focus to search box.
  • K: Switch focus to the next most recent email. Enter or "O" opens focused email.
  • J: Switch focus to the next oldest email.
  • N: Switch focus to the next message in the "conversation." Enter or "O" expands/collapses messages.
  • P: Switch focus to the previous message.
  • U: Takes you back to the inbox and checks for new mail.
  • Y: Various actions depending on current view:
  • Has no effect in "Sent" and "All Mail" views.
  • Inbox: Archive email or message.
  • Starred: Unstar email or message.
  • Spam: Unmark as spam and move back to "Inbox."
  • Trash: Move back to "Inbox."
  • Any label: Remove the label.
  • X: "Check" an email. Various actions can be performed against all checked emails.
  • S: "Star" an email. Identical to the more familiar term, "flagging."
  • R: Reply to the email.
  • A: Reply to all recipients of the email.
  • F: Forward an email.
  • Shift + R: Reply to the email in a new window.
  • Shift + A: Reply to all recipients of the email in a new window.
  • Shift + F: Forward an email in a new window.
  • Shift + 1 (!): Mark an email as spam and remove it from the inbox.
  • G then I: Switch to "Inbox" view.
  • G then S: Switch to "Starred" view.
  • G then A: Switch to "All Mail" view.
  • G then C: Switch to "Contacts" view.
  • G then S: Switch to "Drafts" view.

MOZILLA FIREFOX SHORTCUTS



  • Ctrl + Tab or Ctrl + PageDown: Cycle through tabs.
  • Ctrl + Shift + Tab or Ctrl + PageUp: Cycle through tabs in reverse.
  • Ctrl + (1-9): Switch to tab corresponding to number.
  • Ctrl + N: New window.
  • Ctrl + T: New tab.
  • Ctrl + L or Alt + D or F6: Switch focus to location bar.
  • Ctrl + Enter: Open location in new tab.
  • Shift + Enter: Open location in new window.
  • Ctrl + K or Ctrl + E: Switch focus to search bar.
  • Ctrl + O: Open a local file.
  • Ctrl + W: Close tab, or window if there's only one tab open.
  • Ctrl + Shift + W: Close window.
  • Ctrl + S: Save page as a local file.
  • Ctrl + P: Print page.
  • Ctrl + F or F3: Open find toolbar.
  • Ctrl + G or F3: Find next...
  • Ctrl + Shift + G or Shift + F3: Find previous...
  • Ctrl + B or Ctrl + I: Open Bookmarks sidebar.
  • Ctrl + H: Open History sidebar.
  • Escape: Stop loading page.
  • Ctrl + R or F5: Reload current page.
  • Ctrl + Shift + R or Ctrl + F5: Reload current page; bypass cache.
  • Ctrl + U: View page source.
  • Ctrl + D: Bookmark current page.
  • Ctrl + NumpadPlus or Ctrl + Equals (+/=): Increase text size.
  • Ctrl + NumpadMinus or Ctrl + Minus: Decrease text size.
  • Ctrl + Numpad0 or Ctrl + 0: Set text size to default.
  • Alt + Left or Backspace: Back.
  • Alt + Right or Shift + Backspace: Forward.
  • Alt + Home: Open home page.
  • Ctrl + M: Open new message in integrated mail client.
  • Ctrl + J: Open Downloads dialog.
  • F6: Switch to next frame. You must have selected something on the page already, e.g. by use of Tab.
  • Shift + F6: Switch to previous frame.
  • Apostrophe ('): Find link as you type.
  • Slash (/): Find text as you type. 

REMOTE DESKTOP CONNECTION NAVIGATION



  • Ctrl + Alt + End: Open the NT Security dialog.
  • Alt + PageUp: Switch between programs.
  • Alt + PageDown: Switch between programs in reverse.
  • Alt + Insert: Cycle through the programs in most recently used order.
  • Alt + Home: Display start menu.
  • Ctrl + Alt + Break: Switch the client computer between a window and a full screen.
  • Alt + Delete: Display the Windows menu.
  • Ctrl + Alt + NumpadMinus: Place a snapshot of the entire client window area on the Terminal server clipboard and provide the same functionality as pressing Alt + PrintScreen on a local computer.
  • Ctrl + Alt + NumpadPlus: Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PrintScreen on a local computer.

ACCESSIBILITY



  • Right Shift for eight seconds: Toggle FilterKeys on and off. FilterKeys must be enabled.
  • Left Alt + Left Shift + PrintScreen: Toggle High Contrast on and off. High Contrast must be enabled.
  • Left Alt + Left Shift + NumLock: Toggle MouseKeys on and off. MouseKeys must be enabled.
  • NumLock for five seconds: Toggle ToggleKeys on and off. ToggleKeys must be enabled.
  • Shift five times: Toggle StickyKeys on and off. StickyKeys must be enabled.
  • 6.) Microsoft Natural Keyboard with IntelliType Software Installed
  • Win + L: Log off Windows.
  • Win + P: Open Print Manager.
  • Win + C: Open control panel.
  • Win + V: Open clipboard.
  • Win + K: Open keyboard properties.
  • Win + I: Open mouse properties.
  • Win + A: Open Accessibility properties.
  • Win + Space: Displays the list of Microsoft IntelliType shortcut keys.
  • Win + S: Toggle CapsLock on and off.

GENERIC FILE BROWSER



  • Arrow Keys: Navigate.
  • Shift + Arrow Keys: Select multiple items.
  • Ctrl + Arrow Keys: Change focus without changing selection. "Focus" is the object that will run on Enter. Space toggles selection of the focused item.
  • (Letter): Select first found item that begins with (Letter).
  • BackSpace: Go up one level to the parent directory.
  • Alt + Left: Go back one folder.
  • Alt + Right: Go forward one folder.
  • Enter: Activate (Double-click) selected item(s).
  • Alt + Enter: View properties for selected item.
  • F2: Rename selected item(s).
  • Ctrl + NumpadPlus: In a Details view, resizes all columns to fit the longest item in each one.
  • Delete: Delete selected item(s).
  • Shift + Delete: Delete selected item(s); bypass Recycle Bin.
  • Ctrl while dragging item(s): Copy.
  • Ctrl + Shift while dragging item(s): Create shortcut(s).
  • In tree pane, if any:
  • Left: Collapse the current selection if expanded, or select the parent folder.
  • Right: Expand the current selection if collapsed, or select the first subfolder.
  • NumpadAsterisk: Expand currently selected directory and all subdirectories. No undo.
  • NumpadPlus: Expand currently selected directory.
  • NumpadMinus: Collapse currently selected directory. 

GENERIC NAVIGATION


  • Tab: Forward one item.
  • Shift + Tab: Backward one item.
  • Ctrl + Tab: Cycle through tabs/child windows.
  • Ctrl + Shift + Tab: Cycle backwards through tabs/child windows.
  • Enter: If a button's selected, click it, otherwise, click default button.
  • Space: Toggle items such as radio buttons or checkboxes.
  • Alt + (Letter): Activate item corresponding to (Letter). (Letter) is the underlined letter on the item's name.
  • Ctrl + Left: Move cursor to the beginning of previous word.
  • Ctrl + Right: Move cursor to the beginning of next word.
  • Ctrl + Up: Move cursor to beginning of previous paragraph. This and all subsequent Up/Down hotkeys in this section have only been known to work in RichEdit controls.
  • Ctrl + Down: Move cursor to beginning of next paragraph.
  • Shift + Left: Highlight one character to the left.
  • Shift + Right: Highlight one character to the right.
  • Shift + Up: Highlight from current cursor position, to one line up.
  • Shift + Down: Highlight from current cursor position, to one line down.
  • Ctrl + Shift + Left: Highlight to beginning of previous word.
  • Ctrl + Shift + Right: Highlight to beginning of next word.
  • Ctrl + Shift + Up: Highlight to beginning of previous paragraph.
  • Ctrl + Shift + Down: Highlight to beginning of next paragraph.
  • Home: Move cursor to top of a scrollable control.
  • End: Move cursor to bottom of a scrollable control. 

GENERIC


  • Ctrl + C or Ctrl + Insert: Copy.
  • Ctrl + X or Shift + Delete: Cut.
  • Ctrl + V or Shift + Insert: Paste/Move.
  • Ctrl + N: New... File, Tab, Entry, etc.
  • Ctrl + S: Save.
  • Ctrl + O: Open...
  • Ctrl + P: Print.
  • Ctrl + Z: Undo.
  • Ctrl + A: Select all.
  • Ctrl + F: Find...
  • Ctrl+W : to close the current window
  • Ctrl + F4: Close tab or child window.
  • F1: Open help.
  • F11: Toggle full screen mode.
  • Alt or F10: Activate menu bar.
  • Alt + Space: Display system menu. Same as clicking the icon on the titlebar.
  • Escape: Remove focus from current control/menu, or close dialog box. 

WINDOWS HOTKEYS


  • Shift + F10 right-clicks.
  • Win + L (XP Only): Locks keyboard. Similar to Lock Workstation.
  • Win + F or F3: Open Find dialog. (All Files) F3 may not work in some applications which use F3 for their own find dialogs.
  • Win + Control + F: Open Find dialog. (Computers)
  • Win + U: Open Utility Manager.
  • Win + F1: Open Windows help.
  • Win + Pause: Open System Properties dialog.
  • Win + Tab: Cycle through taskbar buttons. Enter clicks, AppsKey or Shift + F10 right-clicks.
  • Win + Shift + Tab: Cycle through taskbar buttons in reverse.
  • Alt + Tab: Display CoolSwitch. More commonly known as the AltTab dialog.
  • Alt + Shift + Tab: Display CoolSwitch; go in reverse.
  • Alt + Escape: Send active window to the bottom of the z-order.
  • Alt + Shift + Escape: Activate the window at the bottom of the z-order.
  • Alt + F4: Close active window; or, if all windows are closed, open shutdown dialog.
  • Shift while a CD is loading: Bypass AutoPlay.
  • Shift while login: Bypass startup folder. Only those applications will be ignored which are in the startup folder, not those started from the registry (Microsoft\Windows\CurrentVersion\Run\)
  • Ctrl + Alt + Delete or Ctrl + Alt + NumpadDel (Both NumLock states): Invoke the Task Manager or NT Security dialog.
  • Ctrl + Shift + Escape (2000/XP ) or (Ctrl + Alt + NumpadDot) : Invoke the task manager. On earlier OSes, acts like Ctrl + Escape.
  • Printscreen: Copy screenshot of current screen to clipboard.
  • Alt + Printscreen: Copy screenshot of current active window to clipboard.
  • Ctrl + Alt + Down Arrow: Invert screen. Untested on OSes other than XP.
  • Ctrl + Alt + Up Arrow: Undo inversion.
  • Win + B : Move focus to systray icons.



Saturday 23 February 2013

INTERNET

View Your IP Address

First, what is an IP address? The technical definition goes something like this: "An IP (Internet
Protocol) address is a 32-binary digit number that identifies each sender or receiver of
information that is sent across the Internet. When you request an HTML page or send e-mail, the
Internet Protocol part of TCP/IP includes your IP address in the information."
To find out what your IP address is, click on START | RUN. Type in "WINIPCFG" without the quotes.

PC TRICKS


See How Long Windows Has Been Running

Click on START | PROGRAMS | ACCESSORIES | SYSTEM TOOLS | SYSTEM INFORMATION.
In the window that pops up, look at "Uptime" on the right side. You'll see many days, hours,
minutes, and seconds Windows has been running since your last restart.

PC TRICKS


Delete Your Temporary Files

Unfortunately, many Windows files leave unnecessary files in the TEMP directory from time to
time.
These files may be unneeded data files, files that the program has simply "forgotten" about, or
files created and not deleted due to a program's abnormal termination.
You can free up some room on your hard drive by visiting the WINDOWS\TEMP directory in your
Windows Explorer and delete the files there.
Be Careful! Definitely DO NOT delete files that were created today, or yesterday... files created
several weeks ago are usually safe to delete. If you are not sure which files to delete then do not worry about using this "trick" unless your drive space gets too low. 

PC TRICKS


Shrink Your Toolbar Size

Is your toolbar taking up too much room? Customize it! You can shrink the size of the buttons,
and if you know what each button does, you can remove the text labels underneath the buttons.
Click on the "View" menu, choose "Toolbars", and then select "Customize". On the "Customize
Toolbar" dialog box that follows, you can add or remove icons (buttons) to and from the toolbar,
shrink the size of the icons, and change how text is displayed near the icons, if at all.
When you are done modifying the toolbar, press "Close" to exit this dialog box.

PC TRICKS


Opening A Program With Keystrokes

Did you know you can assign certain keystrokes to open a program?
This way you won't have to stop what you're doing and double click on it with your mouse.
Right click on the chosen program on your desktop and select PROPERTIES. Click on the
Shortcut Tab. In the text box labeled SHORTCUT KEY, type your chosen letter. Ctrl + Alt will
automatically be added. Click OK. Now hit CTRL + ALT + letter.

MACRO CALL


 #define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}

OUTPUT:
64

EXPLANATION:

The macro call square(4) will substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64
  

Thursday 21 February 2013

RUNTIME ERROR

BOUNDARY OVERFLOW

 int main()
{
int val[5]={1,2,3,4,5};
val[5] = 100;
printf("%d",val[5]);
return 0;
}



Here val is a 5-elements integer array and the array is initialized. Next we are trying to assign 100 to val[5] leads to runtime error - boundary overflow. Since array index begins with 0 and we are trying to assign or access the 6th element via val[5] but the val is a 5-elements integer array. This is known as Array Index Out of Bounds error.

Wednesday 20 February 2013

SWAPPING WITH OUT TEMP VARIABLE


 int swap(int *a,int *b)
{
 *a=*a+*b;*b=*a-*b;*a=*a-*b;
}
main()
{
 int x=10,y=20;
 swap(&x,&y);
 printf("x= %d y = %d\n",x,y);
}

RUNTIME ERROR

STACK OVERFLOW

           main()
            {
            main();
            }

main function calls itself again and again. Each time the function is called its return address is stored in the call stack. Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an error.

Sunday 3 February 2013

FACE CODES FOR FACEBOOK CHAT


[[171108522930776]] - Troll face 
[[129627277060203]] - Poker face 
[[100002752520227]] - Okay 
[[164413893600463]] - Me Gusta 
[[189637151067601]] - Lol face 
[[106043532814443]] - Y U NO 
[[218595638164996]] - Yao Ming Face Meme 
[[100002727365206]] - Challenge Accepted