Tuesday, October 9, 2012

Create Dynamic Graphs in Excel

1. Convert each column of data into Table :
  • Select a column then click Insert->Table

2. Define a name for first column.
  • Go to to Formulas->Define Name and then give a name for the Table.
  • For selecting the table just click on the header of the column.
3.Create a Drop-down list for selecting field for the chart
  • Go to Data->Data Validation. In the Allow field select List.
  • While selecting the source press F3 and then select the desired list (Table name given in step 2)
4.Create a row where data will change based on drop-down selection
  • Select a blank row in the sheet for providing data for the chart
  • Type the following formula
            =INDEX(<source data table column 1>,MATCH(<drop-down list cell location>,<source table of the drop-down list>,0));

5.Repeat step 4 for each column.
6.Make a chart and select the data source as this new data row.

Vi Editor shortcuts

dd
delete the line
u
Undo
U
Undo all changes on a line
CTRL+R
Redo
/
Search
n
Search the same phrase again
N
Search in the opposite direction
?
Search in backward direction(use instead of /)
CTRL+O
Go back to where we came from
CTRL+I
Go to newer position
%
Move the cursor to the matching parenthesis
:s/old/new/ge
Replace all occurrences of old with new
ge in above command
Find every occurrence in the whole file, with a prompt whether to substitute or not
CTRL+G
Displays your current location in the file and file status
G
Moves to the end of the file
<number>G
Moves to that line number
gg
Moves to first line
:!<command>
To execute a shell command from within the shell
v
Select line
:r!dir
Reads the output of the command and put it below cursor
y ->
Copies text (y -yank)
p ->
Pastes text (p -paste)
:set xxx

Sets search option xxx where options are:
ic :- ignore case
is  :- incsearch -->show partial search
h|s :- highlight all matching phrases

Saturday, September 15, 2012

Restore windows bootloader without installation disc

  • Download MBRFix from Sysint, and extract the archive.
  • Navigate to the archive through the command line and run the following command, substituting mbrfix with mbrfix64 if you are on a 64-bit system.
          mbrfix /drive 0 fixmbr /yes

For more details see the  MBRFix documentation

Tuesday, September 11, 2012

Implementation of getch() and getche() in Linux

#include <stdio.h>
#include <termios.h>
   
    int getch()
    {
        struct termios initialrsettings, newrsettings;
        char ch[2];
        tcgetattr(fileno(stdin), &initialrsettings);
        newrsettings = initialrsettings;
        newrsettings.c_lflag &= ~ECHO;
        newrsettings.c_lflag &= ~ICANON;
        if(tcsetattr(fileno(stdin), TCSAFLUSH, &newrsettings) != 0)
            fprintf(stderr,"Could not set attributes\n");
        else
        {
        fgets(ch,2,stdin);
        tcsetattr(fileno(stdin), TCSANOW, &initialrsettings);
        return ch[0];
        }
    }
   
    int getche()
    {
        struct termios initialrsettings, newrsettings;
        char ch[2];
    
        tcgetattr(fileno(stdin), &initialrsettings);
        newrsettings = initialrsettings;
        newrsettings.c_lflag &= ~ICANON;
        if(tcsetattr(fileno(stdin), TCSAFLUSH, &newrsettings) != 0)
            fprintf(stderr,"Could not set attributes\n");
        else
        {
        fgets(ch,2,stdin);
        tcsetattr(fileno(stdin), TCSANOW, &initialrsettings);
        return ch[0];
        }
    }

Sunday, September 9, 2012

Add item to Send to menu

Open the following location and paste the link to the new sendTo item into this folder -
%APPDATA%/Microsoft/Windows/SendTo

Customize windows 7 theme

Applications to provide a awesome look to windows 7

1. fullmetro theme from deviantart.
2. xwidget
3. Rainmeter
4.eXtraButtons
5.win7 context menu editor
6.DefaultProgramsEditor to change icons
7. Rocketdock

Saturday, September 8, 2012

Useful Linux Shortcuts

  • Ctrl-c - Interrupter
  • Ctrl-d - Terminator
  • Ctrl-u - Killer
  • Ctrl-s - Stop scrolling
  • Ctrl-q - Resume scrolling
  • Ctrl-h - Eraser
  • sttysane - Restores sanity

Wednesday, June 6, 2012

Vedic mathematics technique to calculate the inverse of a prime number.


  • The solution consists of a digit part which is zero always.
  • The decimal part repeats after every (n – 1) digits.
  • The decimal part is calculated by multiplying (or dividing) each successive digit with a calculated fixed number.
  • The carry is added to (or subtracted from) the next successive digit. 

The fixed multiplicand is calculated as follows: 
  • Prime numbers ending with 1.
              E.g.:
                      Consider a number ab.
                      Then the fixed multiplicand is = ab - a
                          ·         1/11 = 11 - 1 = 10. 
                          ·         1/31 = 31 - 3  = 28. 
                          ·         1/71 = 71 - 7  = 64. 
                          ·         1/101 = 101 - 10  = 91.
                          ·         1/131 = 131 - 13  = 118.
                          ·         1/971 = 971 - 97  = 874.
      
    • Prime numbers ending with 7.
              E.g.:
                      Consider a number ab.
                      Then the fixed multiplicand is = (a × b) + 5.
                          ·         1/7 = (0 × 7) + 5. 
                          ·         1/17 = (1 × 7) + 5.
                          ·         1/977 = (97 × 7) + 5.

    • Prime numbers ending with 9.
              E.g.:
                      Consider a number ab.
                      Then the fixed multiplicand is = Ten’s digit  + 1
                          ·         1/19 = 1 + 1 = 2.
                          ·         1/29 = 2 + 1 = 3.
                          ·         1/1129 = 112 + 1 = 113. 

    • Prime numbers ending with 3.
              E.g.:
                      Consider a number ab.
                      Then the fixed multiplicand is = (a × b) + 1.
                          ·         1/13 (1 × 3) + 1.
                          ·         1/23 = (2 × 3) + 1.
                          ·         1/1123 = (122 × 3) + 1.


    Some solutions:
    1/7 = 0.142857…
    1/13 = 0.076923076923…
    1/17 = 0.0588235294117647…
    1/19 = 0.052631578947368421…
    1/23 = 0.0434782608695652173913…
    1/29 = 0.0344827586206896551724137931…

    Wednesday, April 18, 2012

    PROCESS MANAGEMENT

    ps –ax                                      : display all processes
    ps –u                                        : displays detailed results
    ps –aux                                    : displays detailed redults of all processes
    KILL pid                                  : force killing a process immediately
    kill pid                                      : signals a interrupt
    kill -STOP pid(CTRL + Z)       : freezes a program
    kill -CONT pid                        : resumes the program
    bg or fg                                   : resume a program previously freezed using (CTRL + Z)
    • Append '&' at the end of a command to make it run in the background mode