Monday, 10 February 2014

More than 100 Keyboard Shortcuts must read & Share

Keyboard Shortcuts (Microsoft Windows)
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)
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)
15. CTRL+A (Select all)
16. F3 key (Search for a file or a folder)
17. ALT+ENTER (View the properties for the selected item)
18. ALT+F4 (Close the active item, or quit the active program)
19. ALT+ENTER (Display the properties of the selected object)
20. ALT+SPACE BAR (Open the shortcut menu for the active window)
21. CTRL+F4 (Close the active document in programs that enable you to have multiple documents open simultaneously)
22. ALT+TAB (Switch between the open items)
23. ALT+ESC (Cycle through items in the order that they had been opened)
24. F6 key (Cycle through the screen elements in a window or on the desktop)
25. F4 key (Display the Address bar list in My Computer or Windows Explorer)
26. SHIFT+F10 (Display the shortcut menu for the selected item)
27. ALT+SPACE BAR (Display the System menu for the active window)
28. CTRL+ESC (Display the Start menu)
29. ALT+Underlined letter in a menu name (Display the corresponding menu) Underlined letter in a command name on an open menu (Perform the corresponding command)
30. F10 key (Activate the menu bar in the active program)
31. RIGHT ARROW (Open the next menu to the right, or open a sub menu)
32. LEFT ARROW (Open the next menu to the left, or close a sub menu)
33. F5 key (Update the active window)
34. BACKSPACE (View the folder one level up in My Computer or Windows Explorer)
35. ESC (Cancel the current task)
36. 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. SPACE BAR (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 (Restorethe 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)
13. Accessibility Keyboard Shortcuts
14. Right SHIFT for eight seconds (Switch FilterKeys either on or off)
15. Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
16. Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
17. SHIFT five times (Switch the StickyKeys either on or off)
18. NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
19. Windows Logo +U (Open Utility Manager)
20. Windows Explorer Keyboard Shortcuts
21. END (Display the bottom of the active window)
22. HOME (Display the top of the active window)
23. NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
24. NUM LOCK+Plus sign (+) (Display the contents of the selected folder)

MMC Console keyboard shortcuts

1. SHIFT+F10 (Display the Action shortcut menu for the selected item)
2. F1 key (Open the Help topic, if any, for the selected item)
3. F5 key (Update the content of all console windows)
4. CTRL+F10 (Maximize the active console window)
5. CTRL+F5 (Restore the active console window)
6. ALT+ENTER (Display the Properties dialog box, if any, for theselected item)
7. F2 key (Rename the selected item)
8. 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 Microsoft 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.)

Microsoft Internet Explorer Keyboard Shortcuts
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)


Thursday, 9 January 2014

A program to swap two numbers using bitwise operators.

Program:
#‎include‬<stdio.h>
int main(){
int i = 65;
int k = 120;
printf("\n value of i=%d k=%d before swapping", i, k);
i = i ^ k;
k = i ^ k;
i = i ^ k;
printf("\n value of i=%d k=%d after swapping", i, k);
return 0;
}
Explanatio n:
i = 65; binary equivalent of 65 is 0100 0001
k = 120; binary equivalent of 120 is 0111 1000
i = i^k;
i...0100 0001
k...0111 1000
---------
val of i = 0011 1001
---------
k = i^k
i...0011 1001
k...0111 1000
---------
val of k = 0100 0001 binary equivalent of this is 65
---------( that is the initial value of i)
i = i^k

Tuesday, 7 January 2014

C PROGRAM FOR CONVERTING NUMBER INTO STRING FOMATE

#include<stdio.h>
#include<conio.h>
void fun(int);
void fun1(int);
void fun2(int);
main()
{
    int a,b,c,d,e,f,g,n;
    clrscr();
    a=b=c=d=e=f=g=0;
    printf("Enter a no.");
    scanf("%d",&n);
    if((a=n/1000)>0)
    {
    //printf("%d",a);
        if((b=a/10)>0)
        {
            fun1(b);
            //fun((a%10));
        }
        fun((a%10));
        printf(" thousand ");
     }
     c=n%1000;
     if((d=c/100)>0)
     {
        fun(d);
        printf(" hundred ");
     }
     e=c%100;
     if(e>=10 && e<=19)
     fun2(e);
    else
    {
    if((f=e/10)>0)
     {
        fun1(f);
     }
     if((g=e%10)>0)
     {
        fun(g);
     }
     }
     getch();
     return 0;
}
void fun(int i)
{
    switch(i)
    {
    case 0:
        break;
    case 1:
        printf("one ");
        break;
    case 2:
        printf("two ");
        break;
    case 3:
        printf("three ");
        break;
    case 4:
        printf("four ");
        break;
    case 5:
        printf("five ");
        break;
    case 6:
        printf("six ");
        break;
    case 7:
        printf("seven ");
        break;
    case 8:
        printf("eight ");
        break;
    case 9:
        printf("nine ");
        break;
    default:
        printf("nothing ");
        break;
}
}
void fun1(int i)
{
    switch(i)
    {
    case 0:
        break;
    case 1:
        printf("one ");
        break;
    case 2:
        printf("twenty ");
        break;
    case 3:
        printf("thirty ");
        break;
    case 4:
        printf("fourty ");
        break;
    case 5:
        printf("fifty ");
        break;
    case 6:
        printf("sixty ");
        break;
    case 7:
        printf("seventy ");
        break;
    case 8:
        printf("eighty ");
        break;
    case 9:
        printf("ninety ");
        break;
    default:
        printf("nothing ");
        break;
}
}
void fun2(int i)
{
    switch(i)
    {
    case 10:
        printf("ten");
        break;
    case 11:
        printf("elaone ");
        break;
    case 12:
        printf("twelve ");
        break;
    case 13:
        printf("thirteen ");
        break;
    case 14:
        printf("fourteen ");
        break;
    case 15:
        printf("fifteen ");
        break;
    case 16:
        printf("sixteen ");
        break;
    case 17:
        printf("seventeen ");
        break;
    case 18:
        printf("eighteen ");
        break;
    case 19:
        printf("nineteen ");
        break;
    default:
        printf("nothing ");
        break;
}
}
Out Put:
Enter a no: 9531
nine thousand five hundred thirty one

Saturday, 19 October 2013

Write code snippets to swap two variables in five different ways.

a.      /* swapping using three variables*/ (Takes extra memory space)
Int a=5, b=10, c;
c=a;
a=b;
b=c;

b.      /* using arithmetic operators */
a=a+b;
b=a-b;
a=a-b;

c.       /* using bit-wise operators */
a=a^b;
b=b^a;
a=a^b;

Line
Operation
Value of a
Value of b

1
-
5
10
Initial values
2
a=a^b
15
10

3
b=a^a
15
5

4
a=a^b
10
5
values after swapping


d.      /* one line statement using bit-wise operators */ (most efficient)
a^=b^=a^=b;

The order of evaluation is from right to left. This is same as in approach (c) but the three statements are compounded into one statement.

e.       /* one line statement using arithmetic & assignment operators */
a=(a+b) - (b=a);
In the above axample, parenthesis operator enjoys the highest priority & the order of evaluation is from left to right. Hence (a+b) is evaluated first and replaced with 15. Then (b=a) is evaluated and the value of a is assigned to b, which is 5. Finally a is replaced with 15-5, i.e. 10. Now the two numbers are swapped.

Friday, 27 September 2013

A C-program to print Hello world without using any semicolon

Explanation:
Solution: 1
void main(){
    if(printf("Hello world")){
    }
}

Solution: 2
void main(){
    while(!printf("Hello world")){
    }
}

Solution: 3
void main(){
    switch(printf("Hello world")){
    }
}

Thursday, 15 August 2013

Happy Independence Day

?#?include?<stdio.h>
int main (void)
{
int a=10, b=0, c=10;
char* bits ="TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!";
a = bits[b];
while (a != 0) {
a = bits[b];
b++;
while (a > 64) {
a--;
if (++c == 'Z') {
c /= 9;
putchar(c);
} else {
putchar(33 ^ (b & 0x01));
}
}
}
return 0;
}

output:---

Monday, 12 August 2013

Java Abstraction

Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context.
Abstraction in OOP:
In general computer software, when we talk about abstraction the software language itself is an example for the concept of abstraction. When we write a statement as,
a = b + c;
we are adding two values stored in two locations and then storing the result in a new location. We just describe it in an easily human understandable form. What happens beneath? There are registers, instruction sets, program counters, storage units, etc involved. There is PUSH, POP happening. High level language we use abstracts those complex details.
When we say abstraction in Java, we are talking about abstraction in object oriented programming (OOP) and how it is done in Java. Concept of abstraction in OOP, starts right at the moment when a class is getting conceived. I will not say, using Java access modifiers to restrict the properties of an object alone is abstraction. There is lot more to it. Abstraction is applied everywhere in software and OOP.
Abstraction in Java:
Having read the above section, you might have now come to an idea of how abstraction is done in Java.
When we conceptualize a class
When we write an ‘interface’
When we write an ‘abstract’ class, method
When we write ‘extends’
When we apply modifiers like ‘private’, … 
Abstraction and Encapsulation:
When a class is conceptualized, what are the properties we can have in it given the context. If we are designing a class Animal in the context of a zoo, it is important that we have an attribute as animalType to describe domestic or wild. This attribute may not make sense when we design the class in a different context.
Similarly, what are the behaviors we are going to have in the class? Abstraction is also applied here. What is necessary to have here and what will be an overdose? Then we cut off some information from the class. This process is applying abstraction.
When we ask for difference between encapsulation and abstraction, I would say,encapsulation uses abstraction as a concept. So then, is it only encapsulation. No, abstraction is even a concept applied as part of inheritance and polymorphism.
We got to look at abstraction at a level higher among the other OOP concepts encapsulation, inheritance and polymorphism.
Abstraction and Inheritance:
Let us take inheritance also in this discussion. When we design the hierarchy of classes, we apply abstraction and create multiple layers between each hierarchy. For example, lets have a first level class Cell, next level be LivingBeing and next level be Animal. The hierarchy we create like this based on the context for which we are programming is itself uses abstraction. Then for each levels what are the properties and behaviors we are going to have, again abstraction plays an important role here in deciding that.
What are some common properties that can be exposed and elevated to a higher level, so that lower level classes can inherit it. Some properties need not be kept at higher level. These decision making process is nothing but applying abstraction to come up with different layers of hierarchy. So abstraction is one key aspect in OOP as a concept.


in all these areas, we use abstraction as a concept. I think example Java code for all the above is very trivial. If you find it difficult to understand abstraction, pour your question in the comments section, I will be more than happy to answer it.