API – Application Programming Interface

Isn’t it the one idea that changed the entire way how the applications, services, utilities, not to mention mobile apps, are communicating?

Do you think Ifttt like start-up would have emerged if there are no API’s for any service. Probably Ifttt would have to make hundreds of agreements with each and every service of web.

A few technical Questions I came up before trying to read the API’s of the top services like Facebook, Android etc.  are :

  •   What is the best programming language to choose, so that the most of the Documentation examples(which uses a specific language to explain) are easy to understand ?
  •   What is the best scripting language to choose(for writing easy desktop applications) so that the targeted language has many libraries to ease the work-flow ?

well I researched a bit and came to a conclusion that Python and Java stand good together. Both of them have good libraries. but python’s ease to use system calls makes it favourable as we can use some of the scripting frameworks too. But Java is the official language of Android App Development. So at the end Java won in the battle although it is not good in making quick and easy scripts to make the work…..

Advertisements

Bash script for downloading bulk videos from a Cousera course

I have joined in the Algorithms: Design and analysis at coursera, today i came up with question asking a way to download all the Cousera videos at a time, so i have written a bash script to that problem..

#!/bin/bash
let vidlec=1;
while [[ vidlec -le 21 ]]; do
	wget "https://class.coursera.org/algo-005/lecture/download.mp4?lecture_id=$vidlec"
	let vidlec=vidlec+1
done

wget "https://class.coursera.org/algo-005/lecture/download.mp4?lecture_id=165"
wget "https://class.coursera.org/algo-005/lecture/download.mp4?lecture_id=167"
wget "https://class.coursera.org/algo-005/lecture/download.mp4?lecture_id=169"

Code Crazy Minions | codechef

Dead Easy Problem !

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
inline int get_int()
{
    int n=0;
    char c=0;
    while(c<33)
        c=getchar_unlocked();
    while(c>='0'&&c<='9')
    {
        n=(n<<3)+(n<<1)+(c-'0');
        c=getchar_unlocked();
    }
    return n;
}
/**//**//**//**/
int main()
{
    int t,critical,length,i,cou;
    char sprout[1001];
    t=get_int();
    for (; t--;)
    {
        cou=2;
        scanf("%s", sprout);
        critical=11*strlen(sprout);
        length=strlen(sprout);
        for (i = 1; i < length; ++i)
        {
            if (sprout[i]>=sprout[i-1])
                cou+=sprout[i]-sprout[i-1];
            else
                cou+=26+sprout[i]-sprout[i-1];
            cou++;
        }
        if (cou>critical)
            printf("NO\n");
        else
            printf("YES\n");
    }    
    return 0;
}

 

 

Google codejam round 1A went BAD

I don’t know why but first two questions felt too difficult for me, I haven’t even read the third question due to my English exam(on 8:30 am). But I was a little bit startled to see that I was ranked 3632(even with two penalties) by the end of the contest. may be if had remained silent I could have got a better rank(below 3000). which indirectly proves that I may pass in the Round 1C..