February 26, 2015

YouTube's Most Watched Videos | TOP 10 | UPDATED

03:21 Posted by Durga swaroop Perla , No comments
Psy Gentleman | Swaroop's BlogEver since Psy's Gangnam Style has crossed 2 Billion views, the only reason i go to that video is to check the number of views it has got. Many of you might be doing the same thing. And, quite recently Katy Perry's Dark Horse and Taylor Swift's Blank Space has crossed the 1 Billion mark becoming the third and fourth videos respectively to achieve this. And, there have been many new changes in the list. So, its time for another snapshot of the current top 10 videos of YouTube.
To look at the list from last year, here.

Not surprisingly all of them are Music Videos, because we all love music, except for the Charlie video which we absolutely love and adore.
So, Let's see how each of these videos is doing starting with #1, Gangnam Style.

February 16, 2015

C Program for decrypting Caesar's Cipher

06:17 Posted by Durga swaroop Perla No comments
Caesar's cipher is one of the most popular encryption techniques in Cryptography. It is also referred to as Caesar's shift cipher or simply Shifting cipher.  It is said to be widely used in private communications of Julius Caesar. The encryption of the plain text is done by shifting the letters by a previously agreed number. So, after a shift of 2, 'a' becomes 'c', 'b' becomes 'd' and so on..

This article will show you a program that can be used to decrypt the cipher text encrypted using this method. To decrypt, you need to know the key which is the shift used to encrypt. Using the key we'll just do the reverse of encryption to get the Plain text. And, we'll program all that.

For example, the following is a decryption with a left shift 3.
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
Plaintext:  THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
The following is the function implemented in C Programming for the decrytpion.

February 01, 2015

C Program that prints its own Source Code | C Programming Quine

05:25 Posted by Durga swaroop Perla No comments
Quine in programming terms is a program which outputs its own Source code. These are self-replicating programs and are very popular in the programming community. So, in this article we will see how we can achieve this.
           This problem may sound complex, but this is actually quite easy and simple. So, the way we proceed with this is by opening the source file from the program and print out each and every character.
Sounds simple, doesn't it? Lets code it.
Things you need to know for this : Usage of File Pointers
C Programming - Swaroop's Blog
Procedure: Lets break down the approach step by step
  1. Open the current file (fopen()) using a file pointer (in Read Mode)
  2. Read characters one after the other and print them until you reach the end of the file (EOF)
  3. Close the file
To open the file we'll use the fopen() function which takes in two parameters, the location of the file and mode of opening (Read/Write). Fortunately for us, there is a macro in C, to give us file's location, called  _FILE_  macro. Using this we can get the location/path of the current file.