Saturday, July 23, 2022

9_Regular Expressions

Regular expressions-

Sometimes in HTML, the developer defines more than one class name ( that’s class input has more than one name

Here  the email or phone number in Gmail has the following HTML STRUCTURE

<input type="email" class="whsOnd zHQkBf" jsname="YPqjbf" autocomplete="username" spellcheck="false" tabindex="0" aria-label="Email or phone" name="identifier" autocapitalize="none" id="identified" dir="ltr" data-initial-dir="ltr" data-initial-value="" badinput="false" aria-invalid="true">

 You can see that the input class attribute is composed of more than one name - whsOnd zHQkBf

In order to frame the CSS path for this, we can use regular expression as –

* à  perform a partial match with the class attribute value. The CSS value shall be input[class*= whsOnd]

This means the subtext whsOnd is present in the actual text whsOnd zHQkBf

 ^ à perform a match with the class. The CSS value shall be input[class^= ‘whsOnd’]. This means the actual text whsOnd zHQkBf starts with the subtext whsOnd.


$ àperform a match with the class. The CSS value shall be input[class$=’zHQkBf’]. This means the actual text whsOnd zHQkBf ends with the subtext zHQkBf.

For each of these three regular expression usages, the code will look as –

Using *

driver.get("https://accounts.google.com/");

driver.findElement(By.cssSelector("input[class*= whsOnd]")).sendKeys("admin");

 

Using ^

driver.get("https://accounts.google.com/");

driver.findElement(By.cssSelector("input[class^='whsOnd']")).sendKeys("admin"); 


****************Code for regular Expression to identify UserName Field*******************

**

 * @author Mann

 *

 */


import java.time.Duration;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.edge.EdgeDriver;

public class RegularExpressions_3 {

public static void main(String[] args) {

System.setProperty("webdriver.edge.driver", "C:/Users/Mann/SeleniumTutorials/msedgedriver.exe");

WebDriver driver= new EdgeDriver();

   driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(3));

// using *

driver.get("https://accounts.google.com/");

driver.findElement(By.cssSelector("input[class*= whsOnd]")).sendKeys("admin");


// using $

//driver.findElement(By.cssSelector("input[class$='zHQkBf']. ")).sendKeys("admin");

// using ^

//driver.findElement(By.cssSelector("input[class^='whsOnd']")).sendKeys("admin");

//driver.findElement(By.name("user_name")).sendKeys("admin");

}}


Wednesday, June 22, 2022

AVL TREE

 // Through this code we will learn how to insert in a BST and then perform different rotations so that it becomes AVL Tree. 


// Video Link to each function used in this code is given here -

Sub Functions for Rotations   - https://youtu.be/5lG8WfL0KTU

// Actual code starts here ....

#include <stdio.h>

#include <stdlib.h>

struct node {

  int key;

  struct node *left, *right;

};

// Create a node

struct node *newNode(int item) {

struct node *temp = (struct node *)malloc(sizeof(struct node));

  temp->key = item;

  temp->left = temp->right = NULL;

  return temp;

}

// preoder Traversal

void preorder(struct node *t) {

  if(t!=NULL)

  {

  printf("%d -> ", t->key);

  preorder(t->left);

  preorder(t->right);

  }

    }

  // Inoder Traversal

void inorder(struct node *t) {

  if(t!=NULL)

  {

    inorder(t->left);

  printf("%d -> ", t->key);

    inorder(t->right);

  }

    }

// Find the inorder successor

struct node *minValueNode(struct node *node) {

  struct node *current = node;

  // Find the leftmost leaf

  while (current && current->left != NULL)


    current = current->left;

  return current;

}

// Deleting a node

struct node *deleteNode(struct node *root, int key) {

  // Return if the tree is empty

  if (root == NULL) return root;

  // Find the node to be deleted

  if (key < root->key)

    root->left = deleteNode(root->left, key);

  else if (key > root->key)

    root->right = deleteNode(root->right, key);

  else {

    // If the node is with only one child or no child

    if (root->left == NULL) {

      struct node *temp = root->right;

      free(root);

      return temp;

    } else if (root->right == NULL) {

      struct node *temp = root->left;

      free(root);

      return temp;

    }

    // If the node has two children

    struct node *temp = minValueNode(root->right);

    // Place the inorder successor in position of the node to be deleted

    root->key = temp->key;

   // Delete the inorder successor

   root->right = deleteNode(root->right, temp->key);

 }

  return root;

}

// Sub function for height()

int height(struct node *t)

{

if(!t)

return 0;

 if (!(t->left) && !(t->right)) // --> assume leaf node is at height 1

 return 1;

  int l,r;

 l=height(t->left);

 r=height(t->right);

 int p=l>r?l:r;

 return(1+(p));

 }

// Sub function for diff()

int diff(struct node *t)

{

int left= height(t->left);

int right= height(t->right);

int difference;

difference=left-right;

return difference;

}

// Sub function for LL_Rotation

struct node *LL_Rotation(struct node *t)

{

struct node *curr;

curr=t->left;

t->left=curr->right;

curr->right=t;

return curr;

}

// Sub function for RR_Rotation


struct node *RR_Rotation(struct node *t)

{

struct node *curr;

curr=t->right;

t->right=curr->left;

curr->left=t;

return curr;

}


// Sub function for RL_Rotation

struct node *RL_Rotation(struct node *t)

{

t->right=LL_Rotation(t->right);

t=RR_Rotation(t);

return t;

}

// Sub function for lR_Rotation

struct node *LR_Rotation(struct node *t)

{

t->left=RR_Rotation(t->left);

t=LL_Rotation(t);

return t;

}

// calculating balanceing  factor 

struct node *balance( struct node *curr)

{

int getbalance=diff(curr);

if (getbalance>1)

{

if(diff(curr->left)>0)

curr=LL_Rotation(curr);

else

curr=LR_Rotation(curr);

}

else if(getbalance<-1)

{

if(diff(curr->right)>0)

curr=RL_Rotation(curr);

else

curr=RR_Rotation(curr);

}

return curr;

}


// Insert a node

struct node *insert(struct node *curr, int key) 

{

  // Return a new node if the tree is empty

  if (curr == NULL) return newNode(key);

  // Traverse to the right place and insert the node

  if (key < curr->key)

  {

  curr->left = insert(curr->left, key);

   

  }

    

  else

  {

  curr->right = insert(curr->right, key);

  

  }

   

   curr=balance(curr);

   return curr;

}


// Driver code


int main() {


  struct node *root = NULL;

  root = insert(root, 3);

  root = insert(root, 2);

  root = insert(root, 1);


  root = insert(root, 6);

  root = insert(root, 7);

  root =insert(root, 10);

  root = insert(root, 14);

  root = insert(root, 4);

  printf("Inorder traversal: ");

  inorder(root);

printf("pre-order traversal: ");

 preorder(root);

  //printf("\nAfter deleting 10\n");

  //root = deleteNode(root, 10);

 // printf("Inorder traversal: ");


 // inorder(root);


}




Tuesday, June 21, 2022

1. BST Code

 // Binary Search Tree operations in C


#include <stdio.h>

#include <stdlib.h>


struct node {

  int key;

  struct node *left, *right;

};


// Create a node

struct node *newNode(int item) {

  struct node *temp = (struct node *)malloc(sizeof(struct node));

  temp->key = item;

  temp->left = temp->right = NULL;

  return temp;

}


// Inorder Traversal

void inorder(struct node *root) {

  if (root != NULL) {

    // Traverse left

    inorder(root->left);


    // Traverse root

    printf("%d -> ", root->key);


    // Traverse right

    inorder(root->right);

  }

}


// Insert a node

struct node *insert(struct node *node, int key) {

  // Return a new node if the tree is empty

  if (node == NULL) return newNode(key);


  // Traverse to the right place and insert the node

  if (key < node->key)

    node->left = insert(node->left, key);

  else

    node->right = insert(node->right, key);


  return node;

}


// Find the inorder successor

struct node *minValueNode(struct node *node) {

  struct node *current = node;


  // Find the leftmost leaf

  while (current && current->left != NULL)

    current = current->left;


  return current;

}


// Deleting a node

struct node *deleteNode(struct node *root, int key) {

  // Return if the tree is empty

  if (root == NULL) return root;


  // Find the node to be deleted

  if (key < root->key)

    root->left = deleteNode(root->left, key);

  else if (key > root->key)

    root->right = deleteNode(root->right, key);


  else {

    // If the node is with only one child or no child

    if (root->left == NULL) {

      struct node *temp = root->right;

      free(root);

      return temp;

    } else if (root->right == NULL) {

      struct node *temp = root->left;

      free(root);

      return temp;

    }


    // If the node has two children

    struct node *temp = minValueNode(root->right);


    // Place the inorder successor in position of the node to be deleted

    root->key = temp->key;


    // Delete the inorder successor

    root->right = deleteNode(root->right, temp->key);

  }

  return root;

}


// Driver code

int main() {

  struct node *root = NULL;

  root = insert(root, 8);

  root = insert(root, 3);

  root = insert(root, 1);

  root = insert(root, 6);

  root = insert(root, 7);

  root = insert(root, 10);

  root = insert(root, 14);

  root = insert(root, 4);


  printf("Inorder traversal: ");

  inorder(root);


  printf("\nAfter deleting 10\n");

  root = deleteNode(root, 10);

  printf("Inorder traversal: ");

  inorder(root);

}

Tuesday, May 31, 2022

Linked List Series - 1 P1- Sort and Reverse a Linked List

 //   Linked List Series - 

// P1- Sort and Reverse a Linked List 

Program

# include <stdio.h>

# include <stdlib.h>

struct node

{

   int data;

   struct node *link;

};

struct node *insert(struct node *p, int n)

{

   struct node *temp;

   if(p==NULL)

   {

      p=(struct node *)malloc(sizeof(struct node));

      if(p==NULL)

      {

            printf("Error\n");

         exit(0);

      }

      p-> data = n;

      p-> link = NULL;

   }

   else

   {

      temp = p;

      while (temp-> link!= NULL)

      temp = temp-> link;

      temp-> link = (struct node *)malloc(sizeof(struct node));

      if(temp -> link == NULL)

      {

            printf("Error\n");

         exit(0);

      }

       temp = temp-> link;

       temp-> data = n;

       temp-> link = null;

      }

      return(p);

}


void printlist ( struct node *p )

{

      printf("The data values in the list are\n");

      while (p!= NULL)

      {

            printf("%d\t",p-> data);

         p = p-> link;

      }

}


/* a function to sort reverse list */

struct node *reverse(struct node *p)

{

   struct node *prev, *curr;

   prev = NULL;

   curr = p;

   while (curr != NULL)

   {

      p = p-> link;

      curr-> link = prev;

      prev = curr;

      curr = p;

   }

   return(prev);

}

/* a function to sort a list */

struct node *sortlist(struct node *p)

{

   struct node *temp1,*temp2,*min,*prev,*q;

   q = NULL;

   while(p != NULL)

   {

         prev = NULL;

      min = temp1 = p;

      temp2 = p -> link;

      while ( temp2 != NULL )

      {

              if(min -> data > temp2 -> data)

         {

                     min = temp2;

                     prev = temp1;

         }

         temp1 = temp2;

         temp2 = temp2-> link;

      }

      if(prev == NULL)

             p = min -> link;

      else

             prev -> link = min -> link;

      min -> link = NULL;

      if( q == NULL)

      q = min; /* moves the node with lowest data value in the list

pointed to by p to the list

   pointed to by q as a first node*/

         else

         {

            temp1 = q;

            /* traverses the list pointed to by q to get pointer to its

last node */

            while( temp1 -> link != NULL)

                         temp1 = temp1 -> link;

            temp1 -> link = min; /* moves the node with lowest data value

in the list pointed to

   by p to the list pointed to by q at the end of list pointed by

   q*/

      }

   }

   return (q);

}


void main()

{

      int n;

      int x;

      struct node *start = NULL ;

      printf("Enter the nodes to be created \n");

      scanf("%d",&n);

      while ( n- > 0 )

      {

              printf( "Enter the data values to be placed in a

node\n");

         scanf("%d",&x);

         start = insert ( start,x);

      }

      printf("The created list is\n");

      printlist ( start );

      start = sortlist(start);

      printf("The sorted list is\n");

      printlist ( start );

      start = reverse(start);

      printf("The reversed list is\n");

      printlist ( start );

}


Friday, September 10, 2021

Python for Indian Stock Market Analysis


Created on Sat Sep 11 10:14:16 2021

@author: Mann

"""


pip install nsetools

from nsetools import Nse

nse = Nse()

print (nse)


#Since it is a dictionary you can easily chop off fields of your interest.

q = nse.get_quote('infy') # it's ok to use both upper or lower case for codes.

from pprint import pprint # just for neatness of display

q['averagePrice']


pprint(q)

msft = nse.Ticker("infy")

# To get all listed indices 

nse.get_index_list()

nse.get_index_quote("nifty bank") # code can be provided in upper|lower case.

# List of Traded Stock Codes & Names

all_stock_codes = nse.get_stock_codes()

#This is a dictionary with more that thousand entries.


print (all_stock_codes)

#List of Index Codes Similar to above, there is a way to get the list of codes of all the traded indices. Unlike in previous section, the return type is list.

index_codes = nse.get_index_list()

pprint(index_codes)


Sunday, April 18, 2021

Data Structure Lab - Program- 3

 Program 3- 

Write a C program that uses stack operations to convert a given infix expression into its postfix Equivalent, Implement the stack using an array.


Warm-up Exercise 


Stacks Push and POP Operation


Solution ) 


#include<stdio.h>

#include<stdlib.h>      /* for exit() */

#include<ctype.h>     /* for isdigit(char ) */

#include<string.h>

          #define SIZE 100

          /* declared here as global variable because stack[]

* is used by more than one fucntions */

char stack[SIZE];

int top = -1;

/* define push operation */

void push(char item)

{

if(top >= SIZE-1)

{

printf("\nStack Overflow.");

}

else

{

top = top+1;

stack[top] = item;

}

}


/* define pop operation */

char pop()

{

char item ;

if(top <0)

{

printf("stack under flow: invalid infix expression");

getchar();

/* underflow may occur for invalid expression */

/* where ( and ) are not matched */

exit(1);

}

else

{

item = stack[top];

top = top-1;

return(item);

}

}


/* define function that is used to determine whether any symbol is operator or not

(that is symbol is operand)

* this fucntion returns 1 if symbol is opreator else return 0 */

int is_operator(char symbol)

{

if(symbol == '^' || symbol == '*' || symbol == '/' || symbol == '+' || symbol =='-')

{

return 1;

}

else

{

return 0;

}

}


/* define fucntion that is used to assign precendence to operator.

* Here ^ denotes exponent operator.

* In this fucntion we assume that higher integer value

* means higher precendence */

int precedence(char symbol)

{

if(symbol == '^')/* exponent operator, highest precedence*/

{

return(3);

}

else if(symbol == '*' || symbol == '/')

{

return(2);

}

else if(symbol == '+' || symbol == '-')          /* lowest precedence */

{

return(1);

}

else

{

return(0);

}

}


void InfixToPostfix(char infix_exp[], char postfix_exp[])

{

int i, j;

char item;

char x;


push('(');                               /* push '(' onto stack */

strcat(infix_exp,")");                  /* add ')' to infix expression */


i=0;

j=0;

item=infix_exp[i];         /* initialize before loop*/


while(item != '\0')        /* run loop till end of infix expression */

{

if(item == '(')

{

push(item);

}

else if( isdigit(item) || isalpha(item))

{

postfix_exp[j] = item;              /* add operand symbol to postfix expr */

j++;

}

else if(is_operator(item) == 1)        /* means symbol is operator */

{

x=pop();

while(is_operator(x) == 1 && precedence(x)>= precedence(item))

{

postfix_exp[j] = x;                  /* so pop all higher precendence operator and */

j++;

x = pop();                       /* add them to postfix expresion */

}

push(x);

/* because just above while loop will terminate we have

oppped one extra item

for which condition fails and loop terminates, so that one*/


push(item);                 /* push current oprerator symbol onto stack */

}

else if(item == ')')         /* if current symbol is ')' then */

{

x = pop();                   /* pop and keep popping until */

while(x != '(')                /* '(' encounterd */

{

postfix_exp[j] = x;

j++;

x = pop();

}

}

else

{ /* if current symbol is neither operand not '(' nor ')' and nor

operator */

printf("\nInvalid infix Expression.\n");        /* the it is illegeal  symbol */

getchar();

exit(1);

}

i++;



item = infix_exp[i]; /* go to next symbol of infix expression */

} /* while loop ends here */

if(top>0)

{

printf("\nInvalid infix Expression.\n");        /* the it is illegeal  symbol */

getchar();

exit(1);

}

if(top>0)

{

printf("\nInvalid infix Expression.\n");        /* the it is illegeal  symbol */

getchar();

exit(1);

}



postfix_exp[j] = '\0'; /* add sentinel else puts() fucntion */

/* will print entire postfix[] array upto SIZE */

}


/* main function begins */

int main()

{

char infix[SIZE], postfix[SIZE];         /* declare infix string and postfix string */


/* why we asked the user to enter infix expression

* in parentheses ( )

* What changes are required in program to

* get rid of this restriction since it is not

* in algorithm

* */

printf("ASSUMPTION: The infix expression contains single letter variables and single digit constants only.\n");

printf("\nEnter Infix expression : ");

gets(infix);

InfixToPostfix(infix,postfix);                   /* call to convert */

printf("Postfix Expression: ");

puts(postfix);                     /* print postfix expression */


return 0;

}



Data Structure Lab-Program-2

 Program -2 

 Write a C program that uses functions to perform the following: 

1. Create a doubly-linked list of integers

2. Delete a given integer from the above doubly linked list. 

3. Display the contents of the above list after deletion


warmup Exercise- 

Click here to code Doubly Linked List

Create and traverse in doubly Linked List

Insert New node at different positions


Solution ) 


/*Doubly Linked List - Coded By Dr. M. Mann @ IIIT Sonepat */

#include<stdio.h>

#include<stdlib.h>

struct node

{

    int data;

    struct node *prev;

    struct node *next;

}*head;

void creation(int n)

{

    head=(struct node *)malloc(sizeof(struct node));

    struct node *temp;

    struct node *newnode;

    printf("Enter data =");

    scanf("%d",&head->data);

    head->prev=NULL;

    head->next=NULL;

    temp=head;

    for(int z=2;z<=n;z++)

    {

       newnode=(struct node *)malloc(sizeof(struct node));

       printf("Enter data=");

       scanf("%d",&newnode->data);

       newnode->prev=temp;

       newnode->next=NULL;

       temp->next=newnode;

       temp=temp->next;

    }

}

void traverse()

{

    struct node *temp=head;

    while(temp)

    {

        printf("Entered data=%d\n",temp->data);

        temp=temp->next;

    }

}

void delete()

{

    int del;

    printf("Enter Which Node you want to delete=");

    scanf("%d",&del);

    struct node *temp=(struct node *)malloc(sizeof(struct node));

    temp=head;

    while(temp)

    {

        if(head->data==del)

        {

            head=temp->next;

            break;

        }

        else if(temp->next->data==del)

        {

            temp->next=temp->next->next;

            temp->next->next->prev=temp;

            break;

        }

        temp=temp->next;

    }

}

void main()

{

    int n;

    printf("Enter number of doubly list=");

    scanf("%d",&n);

    creation(n);

    traverse();

    delete();

    traverse();

}

Data Structure Lab-Program-1

 Dear Students 

It is advised to go through the Theory part in order to understand Lab Experiments, Here I am just giving your some revision exercise so that you will be ready for different code in DS Lab.


Go through the Structure Video discussed in C programming 

Video-1 



 Link for Other brush up Videos 



After this Study following post first one by one in sequence



Program-1 
 Write a C program that uses functions to perform the following: 
1. Create a singly linked list of integers. 
2. Delete a given integer from the above-linked list. 
3. Display the contents of the above list after deletion.

Solution 

/*
Code -Dr. Mukesh Mann @IIIT Sonepat
*/
#include<stdio.h>
#include<stdlib.h>
struct node
{
 int data;
 struct node *link;
}*head;
void createnode(int n)
{
 head=(struct node *)malloc(sizeof(struct node));
 int data;
 printf("Enter head data=");
 scanf("%d",&data);
 head->data=data;
 head->link=NULL;
 struct node *temp=(struct node *)malloc(sizeof(struct node));
 temp=head;
 struct node *newnode;
 for(int a=0;a<n-1;a++)
 {
  newnode=(struct node *)malloc(sizeof(struct node));
  printf("Enter node data=");
  scanf("%d",&data);
  newnode->data=data;
  newnode->link=NULL;
  temp->link=newnode;
  temp=temp->link;
 }
}
void traverse()
{
 struct node *temp=(struct node *)malloc(sizeof(struct node));
 temp=head;
 while(temp)
 {
  printf("Data you entered=%d\n",temp->data);
  temp=temp->link;
 }
}

void delete()
{
 struct node *temp=(struct node *)malloc(sizeof(struct node));
 temp=head;
 int del;
 printf("Enter data of the which you want to delete=");
 scanf("%d",&del);
 while(temp->data)
 {
     if(head->data==del)
     {
         head=temp->link;
         free(temp);
         break;
     }
     else if(temp->link->data==del)
     {
         temp->link=temp->link->link;
         break;
     }
      temp=temp->link;
 }
}
void main()
{
 int n;
 printf("Enter number of nodes in list=");
 scanf("%d",&n);
 createnode(n);
 traverse();
 delete();
 traverse();
}

Tuesday, January 26, 2021

MSP- न्यूनतम समर्थन मूल्य

 Article by-  Dr. Mukesh Mann 

 Understanding Role of MSP in Farmers Protest 


MSP- Minimum Support price 

• The intervention of government to provide a facility in less amount than the actual cost 

• Market Intervention - Govt gives a guarantee to give MSP to farmers in APMC mandis

. • Procurement- Government will procure at this price. 

******************************************************************************** 


Who will decide this MSP-? 

1. CACP- Commission on agricultural cost and prices, they estimate total cost incurred for a particular crop. Once commission recommendation, parliament decide on MSP through cabinet committee on economic affairs, Now this MSP is decided before any crop is cultivated so that farmers can decide if they wish to cultivate or not 

2. Who operates MSP- APMC ensures that no sale and purchase below MSP took place ( mainly two crops are there - Rice and Wheat), After that FCI takes these purchased crops and store it and further distribute it. Categories in which MSP is given by Govt

 • cereals- ( 7 Types) - main is Rice and Wheat

 • Pulses- 

• Oilseeds 

• Commercial crops (Like Sugarcanes (FRP)) 

Total Crops- 22 +1 = 23 (as on sugarcane it is Fair and Remunerative Price (FRP) which is almost similar to MSP) 

******************************************************************************** 


Why only 6% of farmers get the opportunity to sell their crop at MSP 

To understand this, we need to understand that APMC facilitate that crop should be sold at MSP (say MSP for wheat is 1900/ quintal) but it does not guarantee to purchase it if it is not sold at that MSP except two cases- Rice and Wheat In these two cases, the government guarantees to procure through FCI centers that rice and wheat if not sold at APMC at MSP, then they will procure it at MSP, Now in a real scenario- When a farmer goes to these FCI centers, they been said that since there is no space in their godown they can come after two-three days, But now imagine a farmer who comes to these centers after paying conveyance to the truck, they are forced to wait for two-three days Which may increase their conveyance further

In this journey, they decide to sell it at APMC through agents at a lower rate than MSP, say agent purchase it at Rs1500/ quintal. Now the agent who purchases this crop at Rs 1500/ quintal goes to FCI centers and due to corruption by some officers, they sell it at price say - Rs 1600/ quintal. At this stage these corrupt officers make fake entries of this purchased crop from these agents at MSP price (Rs 1900) , thus taking their commission of Rs 300, The story does not end here, 

Some traders outside APMC exchange low-quality rice and wheat with high quality in FCI though these corrupt officers and that is also the reason why the quality of rice and wheat rasan bhandar is so poor that people prefer not to take it from these shops rather they prefer to purchase it from outside Subsequently, supply from FCI godown has been decreased and it gets spoiled. 

******************************************************************************** 


Why MSP was started?


 • 1962- Defeat in war with China , thus economy was down 

• 1964-1965- India went through Drought 

• 1965- War with Pakistan and people migration from Bangladesh, thus we need to feed them also, 

• PL-480 (public law -480) - America provides us food at a lower rate. 

We were not in a position to produce enough grain at that time. 

Norman Borlaug (American agriculture scientist, (and MS Swaminathan, India) procure seeds from Mexico and these were given to farmers in Punjab and Haryana, argues to use good quality fertilizers and pesticides and thereby government promote farmers to use these so that India can produce enough food. 

But there was a lack of motivation among farmers so a committee was formed called Laxmi kant jha committee recommends that if the government gives a guarantee to farmers that if they will get an MSP from their crop then farmers will get enough motivation to cultivate crops using said resources.

 Thus n 1996, government give MSP for wheat only, so that each person in our country have food to eat But over time due to politics, parties keep on announcing MSP from different crops and now there are 23 crops in the list for which government has to give MSP. 

In 1980 we became independent in food security, but yes we were not good at distribution, at present we are an exporter of food. 

***************************************************************


But now why MSP, we are independent in food security, why do not remove MSP now? 

Congress in 2013, passes a national food security bill, the worlds biggest social scheme under which 80 core plus people will get a guarantee or food security in India, Mid-day meal scheme Targeted public distribution system (TPDS) through which poor people will get food at a very low price (per person 5kg for each of Rice ( Rs3) , wheat ( Rs. 2) , and cereal ( Rs, 1) = Rs 30 for 15 kg in total ),

Thus a person can eat in Rs 30 for the whole month Under TPDS, a huge subsidy was given to people who are against laws of WORLD TRADE ORGANISATION that such type of subsidy in food cannot be given but the government somehow managed that. Now, the question is from where we get this food- obviously through FCI, which procures mainly rice and wheat at MSP but the actual cost to FCI is almost double because it has to make new godowns, transport, and maintenance, and other stuff. In rough the wheat was purchased at MSP of Rs. 1900 cost Rs 3800 to the government, and now the government has to provide that to people through these schemes at almost free of cost. 

******************************************************************************** 


Why debate with MSP? 

Farmers asking for increment, the government want it to lower 

A committee was formed called the national farmer's commission under Swaminathan Ji, The commission recommends, we can count how much cost is incurred in farming as -

• A2 - How much he cost e spends in seeds, pesticides, fertilizer 

• A2+FL - A2 + Family Labor

 • C2 - A2+FL +opportunity cost + capital

 Where,

 Opportunity cost - if he would have rented that land for another purpose then how much he would have been received.

 Capital - if suppose he rather than spending Rs5 lac on farming if he would have put that amount in bank and had gained interest out of that Now commission recommends if we multiply C2 with 1.5 that should be MSP and only if we give this cost to farmers then only we are fair to farmers. Now government gets afraid of how they will give such a high cost, already they are giving huge subsidies to farmers. Now in 2014, the Modi government promises to give 1.5 of MSP, and

In 2018 just before the election they announce that yes we are giving 1.5 times of cost But actually, that cost which government announces was – 1.5*(A2+FL) and not the 1.5*C2 as recommended by the Swaminathan commission,

But, farmers are demanding 1.5*C2. Other farmers are also demanding MSP on crops other than 23 crops. Now because farmers are getting MSP they do not want to try different crops because on other crops there is no MSP. ******************************************************************************** 


Why framers from Punjab and Haryana are protesting?

• Right from the days of the green revolution, people from these areas have enough land and due to the fixing of MSP, they become richer than other farmers in the country. 

• Data says that total FCI procure 88 % rice in Punjab and Haryana on MSP

• Data says that total FCI procures 70 % wheat in Punjab and Haryana on MSP. 

• Thus total economy of Punjab and Haryana depends on MSP. Now they are afraid of thinking that because these three laws did not say anything about MSP therefore in the future, MSP will be withdrawn and the two states will be affected at large. 

******************************************************************************** 


Solution:- 

• Farmers demand- they want to pass MSP as a bill through parliament but the government says that since MSP has not been passed till now by any government and it is always notified each year so we can not make it law. 

• Also, the government is saying where we have written MSP word in these laws.

 • Registration of contractors with the government before the contract with farmers.

 • Essential commodity Act - Only in extraordinary circumstances essential commodities are regulated- 

If a private player wishes to store essential commodity so that they can produce some product then it is permitted, 

I don't think it has an issue because we are already independent in essential commodities.

 Extraordinary circumstances such as -

 war, natural calamities, drought, 

Price Rise (last one year or an average of 5 years ) >=100% for ( vegetables, fruits, flowers) 

Price Rise (last one year or an average of 5 years ) >=50% for (cereals, oilseed etc).

 Also, as there is no word on MSP in these acts, therefore, I don’t think that this will affect MSP in the future; 

if we see it another way then we know that As the government has to distribute food under TPDS schemes and if there is MSP and the government can buy it from FCI at one place with fixed MSP then the government does not need to procure food from private parties at a different cost to distribute it to people under TPDS scheme, thus it seems that it is beneficial to the government to buy at MSP otherwise they have to buy it from other parties which may sell it at different prices.


Note - 


Above Explanation is my own understanding of the subject and it is not related directly and indirectly to any person's emotions, caste and anything which differ from above

Monday, November 23, 2020

Tutorial 12 Normalization Third Normal Form

 


Tutorial 11 Normalization Second Normal Form


 

Tutorial 10 Normalizatin First Normal Form


 

Tutorial 9 Functional Dependencies part 8


 

Tutorial 8 Functional Dependencies part 7


 

Tutorial 7 Functional Dependencies part 6


 

Tutorial 6 Functional Dependencies part 5


 

Tutorial 5 Functional Dependencies part 4


 

Tutorial 4 Functional Dependencies part 3


 

Tutorial 3 Functional Dependencies part 2


 

Tutorial 2 Functional Dependency Part 1


 

9_Regular Expressions

Regular expressions- Sometimes in HTML, the developer defines more than one class name ( that’s class input has more than one name Here ...