Friday, June 12, 2009

Digital Clock Using "C"

This is Very simple

there is an header file called "dos.h" which contains predefined structures for time and date.
So i have declared here two variables of type

struct date d;
struct time t;


to get the current system date and time call function getdate() & gettime() where these functions take date , time respectively.

getdate(&d);
gettime(&t);

PredefinedStructures :
date:
struct date {

int da_year; /* current year */
char da_day; /* day of the month */
char da_mon; /* month (1 = Jan) */

};

time:
struct time {
unsigned char ti_min; /* minutes */
unsigned char ti_hour; /* hours */
unsigned char ti_hund; /* hundredths of seconds */
unsigned char ti_sec; /* seconds */
};

-------------------------------------------------------------------------------------------
Program : Digital clock
-------------------------------------------------------------------------------------------
#include"stdio.h"
#include"dos.h"
#include"conio.h"

void main()
{
struct date d;
struct time t;
clrscr();

do{
getdate(&d);
gettime(&t);

gotoxy(15,11);
textcolor(YELLOW);
cprintf("***************************************");
gotoxy(15,13);
cprintf(" Digital Clock using C ");
gotoxy(15,15);
cprintf("***************************************");
textcolor(WHITE);
gotoxy(35,17);
cprintf(" by shyamala ");
gotoxy(15,19);
textcolor(YELLOW);
cprintf("***************************************");

textcolor(WHITE);

gotoxy(23,24);
cprintf("Date(dd/mm/yy) : %d/%d/%d",d.da_day,d.da_mon,d.da_year);
gotoxy(23,26);
cprintf("Time(hr/min/sec) : %d/%d/%d",t.ti_hour,t.ti_min,t.ti_sec);

gotoxy(27,30);

textcolor(RED);
cprintf("Dear User Hit Any key to Exit!!");

delay(100);
}
while(!kbhit());
}


------------------------------------------------------------------------------------------------
Ouput :
------------------------------------------------------------------------------------------------













Keep rocking
Shyamala

Tuesday, June 9, 2009

100 windows keyboard shortcuts list

Windows key board shortcuts

The General Shortcuts

We’ll kickoff the list with some really general shortcuts that you often used.

  1. CTRL+C (Copy)
  2. CTRL+X (Cut)
  3. CTRL+V (Paste)
  4. CTRL+Z (Undo)
  5. DELETE (Delete)
  6. SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
  7. CTRL while dragging an item (Copy the selected item)
  8. CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
  9. F2 key (Rename the selected item)
  10. CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
  11. CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
  12. CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
  13. CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
  14. CTRL+SHIFT with any of the arrow keys (Highlight a block of text)
  15. SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
  16. CTRL+A (Select all)
  17. F3 key (Search for a file or a folder)
  18. ALT+ENTER (View the properties for the selected item)
  19. ALT+F4 (Close the active item, or quit the active program)
  20. ALT+ENTER (Display the properties of the selected object)
  21. ALT+SPACEBAR (Open the shortcut menu for the active window)
  22. CTRL+F4 (Close the active document in programs that enable you to have multiple documents open simultaneously)
  23. ALT+TAB (Switch between the open items)
  24. ALT+ESC (Cycle through items in the order that they had been opened)
  25. F6 key (Cycle through the screen elements in a window or on the desktop)
  26. F4 key (Display the Address bar list in My Computer or Windows Explorer)
  27. SHIFT+F10 (Display the shortcut menu for the selected item)
  28. ALT+SPACEBAR (Display the System menu for the active window)
  29. CTRL+ESC (Display the Start menu)
  30. ALT+Underlined letter in a menu name (Display the corresponding menu)
  31. Underlined letter in a command name on an open menu (Perform the corresponding command)
  32. F10 key (Activate the menu bar in the active program)
  33. RIGHT ARROW (Open the next menu to the right, or open a submenu)
  34. LEFT ARROW (Open the next menu to the left, or close a submenu)
  35. F5 key (Update the active window)
  36. BACKSPACE (View the folder one level up in My Computer or Windows Explorer)
  37. ESC (Cancel the current task)
  38. SHIFT when you insert a CD-ROM into the CD-ROM drive (Prevent the CD-ROM from automatically playing)

Dialog Box Keyboard Shortcuts

  1. CTRL+TAB (Move forward through the tabs)
  2. CTRL+SHIFT+TAB (Move backward through the tabs)
  3. TAB (Move forward through the options)
  4. SHIFT+TAB (Move backward through the options)
  5. ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
  6. ENTER (Perform the command for the active option or button)
  7. SPACEBAR (Select or clear the check box if the active option is a check box)
  8. Arrow keys (Select a button if the active option is a group of option buttons)
  9. F1 key (Display Help)
  10. F4 key (Display the items in the active list)
  11. BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

Microsoft Natural Keyboard Shortcuts

  1. Windows Logo (Display or hide the Start menu)
  2. Windows Logo+BREAK (Display the System Properties dialog box)
  3. Windows Logo+D (Display the desktop)
  4. Windows Logo+M (Minimize all of the windows)
  5. Windows Logo+SHIFT+M (Restore the minimized windows)
  6. Windows Logo+E (Open My Computer)
  7. Windows Logo+F (Search for a file or a folder)
  8. CTRL+Windows Logo+F (Search for computers)
  9. Windows Logo+F1 (Display Windows Help)
  10. Windows Logo+ L (Lock the keyboard)
  11. Windows Logo+R (Open the Run dialog box)
  12. Windows Logo+U (Open Utility Manager)

Accessibility Keyboard Shortcuts

  1. Right SHIFT for eight seconds (Switch FilterKeys either on or off)
  2. Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
  3. Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
  4. SHIFT five times (Switch the StickyKeys either on or off)
  5. NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
  6. Windows Logo +U (Open Utility Manager)

Windows Explorer Keyboard Shortcuts

  1. END (Display the bottom of the active window)
  2. HOME (Display the top of the active window)
  3. NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
  4. NUM LOCK+Plus sign (+) (Display the contents of the selected folder)
  5. NUM LOCK+Minus sign (-) (Collapse the selected folder)
  6. LEFT ARROW (Collapse the current selection if it is expanded, or select the parent folder)
  7. RIGHT ARROW (Display the current selection if it is collapsed, or select the first subfolder)

Shortcut Keys for Character Map

  1. After you double-click a character on the grid of characters, you can move through the grid by using the keyboard shortcuts:
  2. RIGHT ARROW (Move to the right or to the beginning of the next line)
  3. LEFT ARROW (Move to the left or to the end of the previous line)
  4. UP ARROW (Move up one row)
  5. DOWN ARROW (Move down one row)
  6. PAGE UP (Move up one screen at a time)
  7. PAGE DOWN (Move down one screen at a time)
  8. HOME (Move to the beginning of the line)
  9. END (Move to the end of the line)
  10. CTRL+HOME (Move to the first character)
  11. CTRL+END (Move to the last character)
  12. SPACEBAR (Switch between Enlarged and Nor mal mode when a character is selected)

Microsoft Management Console (MMC) Main Window Keyboard Shortcuts

  1. CTRL+O (Open a saved console)
  2. CTRL+N (Open a new console)
  3. CTRL+S (Save the open console)
  4. CTRL+M (Add or remove a console item)
  5. CTRL+W (Open a new window)
  6. F5 key (Update the content of all console windows)
  7. ALT+SPACEBAR (Display the MMC window menu)
  8. ALT+F4 (Close the console)
  9. ALT+A (Display the Action menu)
  10. ALT+V (Display the View menu)
  11. ALT+F (Display the File menu)
  12. ALT+O (Display the Favorites menu)

MMC Console Window Keyboard Shortcuts

  1. CTRL+P (Print the current page or active pane)
  2. ALT+Minus sign (-) (Display the window menu for the active console window)
  3. SHIFT+F10 (Display the Action shortcut menu for the selected item)
  4. F1 key (Open the Help topic, if any, for the selected item)
  5. F5 key (Update the content of all console windows)
  6. CTRL+F10 (Maximize the active console window)
  7. CTRL+F5 (Restore the active console window)
  8. ALT+ENTER (Display the Properties dialog box, if any, for the selected item)
  9. F2 key (Rename the selected item)
  10. CTRL+F4 (Close the active console window. When a console has only one console window, this shortcut closes the console)

Remote Desktop Connection Navigation

  1. CTRL+ALT+END (Open the micro$oft Windows NT Security dialog box)
  2. ALT+PAGE UP (Switch between programs from left to right)
  3. ALT+PAGE DOWN (Switch between programs from right to left)
  4. ALT+INSERT (Cycle through the programs in most recently used order)
  5. ALT+HOME (Display the Start menu)
  6. CTRL+ALT+BREAK (Switch the client computer between a window and a full screen)
  7. ALT+DELETE (Display the Windows menu)
  8. CTRL+ALT+Minus sign (-) (Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PRINT SCREEN on a local computer.)
  9. CTRL+ALT+Plus sign (+) (Place a snapshot of the entire client window area on the Terminal server clipboard and provide the same functionality as pressing ALT+PRINT SCREEN on a local computer.)

Internet Explorer navigation

  1. CTRL+B (Open the Organize Favorites dialog box)
  2. CTRL+E (Open the Search bar)
  3. CTRL+F (Start the Find utility)
  4. CTRL+H (Open the History bar)
  5. CTRL+I (Open the Favorites bar)
  6. CTRL+L (Open the Open dialog box)
  7. CTRL+N (Start another instance of the browser with the same Web address)
  8. CTRL+O (Open the Open dialog box, the same as CTRL+L)
  9. CTRL+P (Open the Print dialog box)
  10. CTRL+R (Update the current Web page)
  11. CTRL+W (Close the current window)

Keep Rocking

Shyamala

Monday, June 8, 2009

JVM-Java Virtual Machine

JVM- Java Virtual Machine

At the heart of the Java platform lies the Java Virtual Machine, or JVM. Most programming languages compile source code directly into machine code, suitable for execution on a particular microprocessor architecture. The difference with Java is that it uses bytecode - a special type of machine code.

The designers of Java chose to use a combination of compilation and interpretation. Programs written in Java are compiled into machine language, but it is a machine language for a computer that doesn't really exist. This so-called "virtual" computer is known as the Java virtual machine. The machine language for the Java virtual machine is called Java bytecode. There is no reason why Java bytecode could not be used as the machine language of a real computer, rather than a virtual computer.

A program written in Java could certainly be compiled into the machine language of a real computer. And programs written in other languages could be compiled into Java bytecode. However, it is the combination of Java and Java bytecode that is platform-independent, secure, and network-compatible while allowing you to program in a modern high-level object-oriented language.

“Java is WORA Write Once Run Anywhere”

The Architecture of the Java Virtual Machine

The behavior of a virtual machine instance is described in terms of subsystems, memory areas, data types, and instructions. These components describe an abstract inner architecture for the abstract Java virtual machine.


Figure shows a block diagram of the Java virtual machine that includes the major subsystems and memory areas.


Figure The internal architecture of the Java virtual machine.

Each Java virtual machine has

ü a class loader subsystem: a mechanism for loading types (classes and interfaces) given fully qualified names.

ü Java virtual machine organizes the memory it needs to execute a program into several runtime data areas.

ü an execution engine: a mechanism responsible for executing the instructions contained in the methods of loaded classes.

Each instance of the Java virtual machine has one method area and one heap. These areas are shared by all threads running inside the virtual machine. As the program runs, the virtual machine places all objects the program instantiates onto the heap.

“Bytecode is independent , JVM is dependent.”

Friday, June 5, 2009

Creating Jar file (Java executables) - Very simple

Step 1:
Create a Hello.java class .
public class Hello{
public static void main(String args[]){
System.out.println("welcome to Java’s chronicle");
}
}

Step-2 :
Compile the above java file.

Cmd > javac Hello.java

Step- 3:
Create a mainClass.txt with the following contents

Main-Class: Hello

Note :
Remember the above must be terminated with carriage return coz some of the OS expects CR to create Manifest file.

Step- 4:
Go to command prompt create jar file

Cmd > jar -cvmf mainClass.txt my1.jar Hello.class
success :
added manifest
adding: Hello.class(in = 411) (out= 282)(deflated 31%)

where :
c-create jar

v-verbose
m-mainclassfile

Step 5:
To list the contents of jar

Cmd > jar tf my1.jar

META-INF/
META-INF/MANIFEST.MF
Hello.class

Step 6:
To Execute jar

Cmd > java –jar my1.jar

I just tried explaining in a layman terminology ...Hope it is useful
Further any queries kindly get back to me......

Keep Rocking
Shyamala