Friday, 21 November 2014

you tube download

This post is for downloading the videos from you tube without using any downloader for the same.
Following is the page of a youtube website.



Now for downloading the video just write ss before the url.so it would become
following page will be open



Now you can select either MP4 360p, MP4 720p and more as available.This can be used to download youtube video direct without any downloader.



Tuesday, 18 November 2014

CUT THE STICKS



If there are N sticks, A cut operation is performed such that length of all of them are reduced by the length of the smallest stick.
Suppose we have 6 sticks of length
5 4 4 2 2 8
then in one cut operation we make a cut of length 2 from each of the 6 sticks. For next cut operation 4 sticks are left (of non-zero length), whose length are
3 2 2 6
Above step is repeated till no sticks are left.
Input Format 
The first line contains a single integer N. 
The next line contains N integers: a
0, a1,...aN-1 separated by space, where ai represents the length of ith stick.
Output Format 
 output will be the number of sticks that are cut in separate lines

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
int findmin(int * b,int n);
int check(int *a,int n);
int main() {
int n,i,min;
 scanf("%d",&n);
    int arr[n],count=0;
    for(i=0;i<n;i++)
        {
        scanf ("%d",&arr[i]);
        }
     while(check(arr,n))
    {
         min = findmin(arr,n);
         for(i=0;i<n;i++)
             { if(arr[i]>0){
              arr[i]=arr[i]-min;
                 count++;}
              }
         printf("%d\n",count);
         count=0;
        
    }
   
    return 0;
}

  int  check(int *a,int n)
    {
    int i;
    for(i=0;i<n;i++)
        {
        if(a[i] > 0)
            {return 1;
            }
        }
       return 0;
   }
   
  int findmin(int * b,int n) 
      { int i, min=1000;
      for(i=0;i<n;i++)
          {
          if((b[i]>0) && b[i] < min)
              min=b[i];
          }
       return min;
      

      }

Monday, 17 November 2014

LONELY INTEGER

Program:to find number occurring only once

If there are integers in an array,you have to find out the numer that occurs only once

Input Format
The first line of the input indicates the number of integers. 
The next line is integers that form the array.

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int lonelyinteger(int a_size, int* a) {
    int a_count[100],i,count=0,c;
   for(i=0;i< 100;i++)
       {
       a_count[i]=0;
       }
    for(i=0;i< a_size;i++)
        {c=*(a+i);
        a_count[c]=(a_count[c])+1;
        }
    for(i=0;i< 100;i++)
        {
           if(a_count[i]==1)
            {return (i); }
        }
   
   
return count;

}
int main() {
    int res;
   
    int _a_size, _a_i;
    scanf("%d", &_a_size);
    int _a[_a_size];
    for(_a_i = 0; _a_i < _a_size; _a_i++) {
        int _a_item;
        scanf("%d", &_a_item);
       
        _a[_a_i] = _a_item;
    }
   
    res = lonelyinteger(_a_size, _a);
    printf("%d", res);
   
    return 0;

}

Saturday, 15 November 2014

hiding folder completely

Following post is for hiding a folder completely.Folder is here at D:\test\ with name abc as shown in the image


Now for hiding the folder open command prompt and go to folder test and then type folloeing command at cmd prompt to hide it
Attrib +r +h +s abc



Folder will get hidden
And if you try to view it by even using folder option show hidden files and folder,it will not be unhide.



Now if you want to view the folder,you can do by this unchecking hide protected operating system files as shown



Either you can do it by using command prompt by using following
Attrib –r –s –h abc




Friday, 14 November 2014

IRCTC TATKAAL RESERVATION TRICK

Magic auto fill is a great tool for reservation during peak hours of tatkaal.It allows you to fill all the details of passenger in advance using magic auto fill,which you can use to enter in irctc form during reservation.
First visit the following link to find the 
http://ctrlq.org/irctc/  and click the reservation form

following page will be displayed



now fill the details of all the passenger you want to enter,and click on the i m felling lucky button.

then following screen will be displayed.



now drag this magic auto fill to your bookmark bar.if bookmark bar is not visible,use ctrl+shift+b (in chrome).Drag it as shown below


Bookmark of Magic auto fill will be attached to your bookmark bar.Now open the reservation page fill the journey to ,from and date and after clicking the book now fill all the details by just clicking on the magic auto fill bookmark


following will be very helpful during tatkaal hours,you just have to fill the captcha and make payment.