Shared Notes shrink-all

BBlogPost

  Oct 09, 2014
  rajiv.m1991

HHtmlPage

  Sep 02, 2014
  rajiv.m1991

Vertical Align - Middle

Hello World

<style>.my-valignmiddle-div{display:block;height:100px;width:200px;border:1px solid;text-align:center;}.my-valignmiddle-div span{display:inline-block;vertical-align:middle;}.my-valignmiddle-div .v-align{height:100%;}</style>
<div class="my-valignmiddle-div">
  <span class="v-align"></span>
  <span>Hello World</span>
</div>

SCode

  May 17, 2014
  rajiv.m1991

Behaviour Of And & Or Keyword In Python

# AND's behaviour ( returns last True case if all conditions are true else returns 1st False case )

>>> 5 and False and 3
False

>>> 5 and True and 3
3

>>> True and None and False
None

>>> True and False and None
False

# OR's behaviour ( returns 1st True case )

>>> True or None or False or 3
True

>>> None or 3 or False
3

>>> 3 or 4 or 5
3

BBlogPost

  Nov 21, 2013
  rajiv.m1991

How To Disable Guest Login In Ubuntu?

If you're using the default LightDM,

edit the file /etc/lightdm/lightdm.conf

[SetDefaults]
allow-guest=false

Then restart it by

sudo restart lightdm

BBlogPost

  Nov 21, 2013
  rajiv.m1991

BBlogPost

  Nov 21, 2013
  rajiv.m1991

How To Install Multiple Django Version Using Virtualenv And Virtualenvwrapper In Ubuntu?

Hi guys, Are you finding difficulties to install multiple django version and switch between them easily? Here is the way.

We can achieve this by using virtualenv and virtualenvwrapper. virtualenv allows you  to set up multiple isolated Python environments and virtualenvwrapper allows create and manage multiple virtualenv seamlessly. Here is the simple steps to setup.

  1. Install virtualenv and virtualenvwrapper
    sudo pip install virtualenv virtualenvwrapper
  2. Create virtual env directory
    mkdir ~/.virtualenvs
  3. Set enviromental path in .bashrc file

    vi .bashrc add below lines to end of the file.

    VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.6
    export WORKON_HOME=$HOME/.virtualenvs
    export PIP_VIRTUALENV_BASE=$WORKON_HOME
    export PIP_RESPECT_VIRTUALENV=true
    source /usr/local/bin/virtualenvwrapper.sh
  4. Close your terminal and open new one. Create virtual environment
    mkvirtualenv env1
    After the above step you see the terminal something like
    (env1)[email protected]:~$
    Congrates.. Our virutual enviroment is ready and we can now install our Django version under env1,
  5. To install django 1.6
    pip install django==1.6
  6. If you want to work on django 1.4, create another virtual enviroment
    mkvirtualenv env2
    after this command and promt will be like this
    (env2)[email protected]:~$
  7. Then install django 1.4
    pip install django==1.4
  8. If you want to switch to env1
    workon env1
  9. If having any trouble with module not found errors, you might have to try enabling the global site-packages by the below command
    toggleglobalsitepackages

Done! Thanks.

SCode

  Dec 11, 2013
  rajiv.m1991

Datepicker - To Configure Enddate Based On Selected Startdate

<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}themes/green/css/LE_MetaId99.css">
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery/jquery.ui.datepicker.js"></script>
<script>
$(document).ready(function(){
    if ($("#id_start_date").length) {
        $("#id_start_date").datepicker({
            dateFormat: "dd/mm/yy",
            minDate: new Date(),
            onSelect: function(){
                enddate = $(this).val();
                splittedval = enddate.split('/');
                var date = new Date(splittedval[2], splittedval[1]-1, splittedval[0]);
                //date.setDate(date.getDate() + 1); // Uncomment this line to add 1 to the date
                $("#id_end_date").datepicker( "option", "minDate", date );
            }
        });
    }
    if ($("#id_end_date").length) {
        $("#id_end_date").datepicker({
            dateFormat: "dd/mm/yy",
            minDate: new Date()
        });
    }
    /* FOR Form Validation Purpose uncomment the following */
    /*
    $.validator.addMethod(
        "hasDatepicker",
        function(value, element) {
            // use following for the format DD/MM/YYYY
            var re = /^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/;
            // use following for the format MM/DD/YYYY
            // var re = /^(0[1-9]|1\d|2\d|3[01])\/(0[1-9]|1[0-2])\/(19|20)\d{2}$/;
            // use following for the format YYYY/MM/DD
            // var re = /^(19|20)\d{2}\/(0[1-9]|1\d|2\d|3[01])\/(0[1-9]|1[0-2])$/;
            return re.test(value);
        }
    );
    */
});
</script>

HHtmlPage

  Nov 21, 2013
  rajiv.m1991

The Seven Swaras

In the carnatic music system we distribute the 12 keys of an octave among the 7 swaras of a raga. The seven swaras are sa,re,ga,ma,pa,dha,ni.

Sa & Pa have one key associated with them each ie., the First and Fifth white key respectively.
Ma can take any of the two keys ie., either third black key or fourth white key.
Ri and Ga can share any two of the four keys between Sa (First white key) and Ma (Third black key).
Similarly Dha and Ni can share any two of the four keys after Pa (Fifth white key).

See below for details of representing the twelve keys of an octave in Carnatic keyboard notes.

Keyboard Map

  • s  - Shadjama - First key in an octave
  • r1 - Shuddha Rishaba - Second key in an octave
  • r2 - Chatushruthi Rishaba - Third key in an octave
  • r3 - Satsruthi Rishaba - Fourth key in an octave
  • g1 - Shuddha Gaandhaara - Third key in an octave
  • g2 - Saadhaarana Gaandhaara - Fourth key in an octave
  • g3 - Anthara Gaandhaara - Fifth key in an octave
  • m1 - Shuddha Madhyama - Sixth key in an octave
  • m2 - Prathi Madhyama - Seventh key in an octave
  • p  - Panchama - Eighth key in an octave 
  • d1 - Sudhdha Dhaivatha - Ninth key in an octave
  • d2 - Chatusruthi Dhaivatha - Tenth key in an octave
  • d3 - Shatsruthi Dhaivatha - Eleventh key in an octave
  • n1 - Sudhdha Nishaadha - Tenth key in an octave
  • n2 - Kaisiki Nishaadha - Eleventh key in an octave
  • n3 - Kaakali Nishaadha - Twelveth key in an octave

The above notations refer to middle octave of the keyboard.

Higher octave (octave immediately above) notations will also be the same as above except that they will be in capital letters. 
For instance: n3 in higher octave shall be written as N3

Lower octave notations will also be same as above except that they will be underlined.
For instance: n3 in lower octave shall be written as n3

Octave above the higher octave (i.e the second higher octave) will be indicated with a capital letter and an overscore above the note.
For instance: n3 in second higher octave shall be written as N3.

Carnatic-Western Keyboard Map

Below is a mapping of keys between classical Indian and Western notations:

Indian Notation Western Equivalent Keyboard key
s C First key in an octave
r1 C# (C Sharp) Second key in an octave
r2 / g1 D Third key in an octave
r3 / g2 D# (D Sharp) Fourth key in an octave
g3 E Fifth key in an octave  
m1 F Sixth key in an octave
m2 F# (F Sharp) Seventh key in an octave
p G Eighth key in an octave
d1 G# (G Sharp) Ninth key in an octave
d2 / n1 A Tenth key in an octave
d3 / n2 A# (A Sharp) Eleventh key in an octave
n3 B Twelveth key in an octave

The above notations refer to middle octave of the keyboard. 

Higher octave notations will also be the same as above except that they will be in capital letters. 
For instance: n3 in higher octave shall be written as N3

Lower octave notations will also be same as above except that they will be underlined.
For instance: n3 in lower octave shall be written as n3

Introduction to the Melakartha System

The Melekartha System is the most scientific system of creation and classification of ragas and forms the basic of the classical carnatic music system.

Melakartha system uses a powerful scientific algorithm to create the fundamental 72 ragas of the carnatic music system. All other ragas in the carnatic music system are derived from one/more of these 72 ragas. The derived ragas are called janya ragas.

In the Melakartha system we divide the 12 keys of an octave (in the keyboard) into 7 swaras as follows:

1. Shadjama

  • S = Shadjama = First key of the octave

2. Rishaba

  • R1 = Shudhdha Rishabha = Second key of the octave
  • R2 = Chathushruthi Rishabha = Third key of the octave
  • R3 = Sathshruthi Rishabha = Fourth key of the octave

3. Gandhara

  • G1 = Shudhdha Gandhara = Third key of the octave
  • G2 = Sadharana Gandhara = Fourth key of the octave
  • G3 = Anthara Gandhara= Fifth key of the octave

4. Madhyama

  • M1 = Shudhdha Madhyama = Sixth key of the octave
  • M2 = Prathi Madhyama = Seventh key of the octave

5. Panchama

  • P = Panchama = Eigth key of the octave

6. Daivatha

  • D1 = Shudhdha Daivatha = Nineth key of the octave
  • D2 = Chathushruthi Daivatha = Tenth key of the octave
  • D3 = Sathshruthi Daivatha = Eleventh key of the octave

7. Nishadha

  • N1 = Shudhdha Nishadha = Tenth key of the octave
  • N2 = Kaishika Nishadha = Eleventh key of the octave
  • N3 = Kaakali Nishadha = Twelveth key of the octave

You can see above that R2=G1, R3=G2, D2=N1 and D3=N2. The reason for this lies in the Melakartha algorithm.

The Melakartha algorithm is as follows:

  • A Melakartha Raga has all the 7 swaras in it.
  • A Melakartha Raga cannot have multiple entries for the same swara. For instance you cannot have both N1 and N2 in the same raga as they both are Nishadas.
  • The same frequency cannot occupy more than one swara, for instance, if R2 is the Rishabha in a raga then G1 cannot be used as Gandhara in that raga as G1=R2.
  • The swara order (increase in frequency called ArOhaNa) is Sa (Shadjama),Ri (Rishabha),Ga (Gandhara),Ma (Madhyama),Pa (Panchama),Dha (Daivatha),Ni (Nishadfha).

Based on the above algorithm we can form the Melakartha ragas as follows.

  • Sa and Pa are the same in all ragas as they have only one entry.
  • Ma has two entries so we can form two ragas for every given combination of all other swaras i.e. if we are given a sa,ri,ga,pa,da and ni combination we can form two melakartha ragas for that combination by using M1 as ma in one raga as M2 as ma in another raga.
    For instance, given S,R1,G2,P,D1,N1 we can form two Melakarthas as follows:
    S,R1,G2,M1,P,D1,N1 and S,R1,G2,M2,P,D1,N1
  • R1 has 3 entries and Ga has 3 entries where two entries are common to both (i.e. R2=G1 and R3=G2). Hence, considering the fact that frequency of Ga has to be always greater than Ri (i.e. the key for Ri cannot come after the key for Ga) ,we can have totally 6 combinations for Ri,Ga as follows:
    R1G1, R1G2, R1G3, R2G2, R2G3 and R3G3
  • Similarly we can have 6 entries for Dha,Ni combination as follows:
    D1N1, D1N2, D1N3, D2N2, D2N3 and D3N3

Thus we have unique 2 entries for Ma, 6 entries for Ri,Ga and 6 entries for Ni,Dha. This makes a total of 2x6x6 = 72 unique combinations of all the 7 swaras defined based on 12 keys in an octave.

Thus using the Melakartha algorithm we can create 72 Melakartha ragas. A mELakartha rAgA is also called a Sampoorna raga as it has all the 7 swaras in it.

http://www.srutiacademy.com http://www.karnatik.com/janyalist.shtml http://carnatica.net/sangeet/melachart.htm