Objective
To check if an entered string containing nested parenthesis are balanced and valid. This write-up presents a function with which a string is checked for balanced parenthesis.
Continue reading “Balanced Parenthesis Check”
To check if an entered string containing nested parenthesis are balanced and valid. This write-up presents a function with which a string is checked for balanced parenthesis.
Continue reading “Balanced Parenthesis Check”
Let a and b be integers, not both zero. The largest integer d such that d exactly divides both a and b is called the greatest common divisor of a and b . The GCD of the two integers a and b is denoted as gcd(a, b)
Continue reading “GCD of n integers”
The Sieve of Eratosthenes is a process to find all primes not exceeding a specific positive integer. The process is simple. First all the numbers within the range is populated in a list.The process strikes out all the numbers in the list which are multiple of some previous number. This strike-out process starts with the integer 2, thus first all the multiple of 2 upto the limit n are striked out. Note that the number 2 itself is not striked out, because it is not a multiple of any integer lesser than it (except 1). Next the just following unstriked integer is selected, which is in this case 3, and then all the multiples of 3 are striked out from the like, and again the next unstriked out integer is selected and the process continues until no such integer remains in the list which is unstriked and a multiple of some integer lesser that it. Note that the next integer to strike out after the ith unstriked integer is i * i , as all the multiples of i less than i are striked in the previous passes. At the end if the process only those numbers will be still unstriked in the list which are not a multiple of some other integer lesser that it, thus only the prime numbers will remain unstriked in the list. At the end of the process the list can be rescanned and the unstriked integers could be found.
Read more about Sieve of Eratosthenes here: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
Read the complete implementation
Everybody has used the GNU or UNIX cat program in the command line. It is used to concatenate files and dump it into the standard output, or can simply be redirected to another file. Long ago i started to write my own version of the cat program. I have implemented each and every function which cat supports, and also made it look identical, except some messages. Although this is not a cat clone, and has no connection with the source code of GNU cat. This code was made by inspecting the output behaviour of GNU cat. This is named wcat. I started this because this was the most simple code to write and was intended for the Whitix OS project run by Mathew (http://www.whitix.org/). This is a very good OS development project for the beginners to start with. I could not at present actively participate in this project because of the time limitations here at my end.
Check out the code

ID3 tag is an mp3 audio media file tagging system. The ID3 tags are stored in a pre-defined location in the mp3 media file, either in the start or at the end (or both). There are two major versions of the ID3 tags. ID3v1 and ID3v2. The tag store data about the song, like track name, album name, artist name, genre, track no, year, composer, licensing information, lyrics, even multiple images inside the tag. To get more information about ID3 tag please check the official website of ID3 tag: http://www.id3.org/, also check this article What are ID3 Tags all about?
Synchronization safe integers are related to ID3v2 tags. ID3v2 tags has a dynamic structure where the length of the tag is variable and inside the tag, there can stay a lot of frames which again can be of dynamic sizes. The size of the tag is stored in the ID3v2 tag header is of length 4 bytes long. These 4 bytes are stored in a special format which is called a synchronization safe integer. Also from ID3v2.4 tags also the frame size bytes which are stored in the frame headers, describing the frame’s length, are stored as 4 byte synchronization safe integer.
A floating point number is given. the task is to evaluate the value of its square root. We will discuss how to find the square root of a real number in this post, and also present a C Language code which does this job. The value of the root will be evaluated with the Hero’s method.
Continue reading “Hero’s Method : Evaluating square root of a real number”
Problem: Convert an integer from a given endian to its opposite endian
In computation endian refer to the ordering of bytes within a single word of 16-bit, 32-bit, or 64-bit. A 16-bit word contains 2 bytes. Say 0x12AB is a 16-bit hexadecimal integer. It’s most significant byte is 12 and the least significant byte is AB. When it is stored with the most significant byte 12 first in lower memory address, and the least significant byte AB is stored next to it, in higher memory address, then this storing format is called the big-endian. If the leas significant byte AB is stored first in higher memory address and the most significant byte is stored next to it, that is in the lower memory address then this format is known as the little-endian. Similarly for a 32-bit word say 0x1A2B3C4D , for little-endian format the least significant byte 4D would be stored first in lower memory address, and next would be 3C, next 2B and then at last the most significant byte would be stored 1A.
Problem : To generate all Combinations of a set of distinct elements
Before we start discussing about the implementation we will go through the basic definitions of Combinations. Then we discuss the method to generate all the Combinations with examples and descriptions. Then the source code to implement the method will be presented. Continue reading.
We will make a “virus” which will block orkut, facebook, google, gmail, twitter and some others in Microsoft Windows systems. This is a very easy to code and effective one, and very good to play prank with friends. But before anything you do, please note that I will NOT be liable for any kind of damage done to any computer system or any other physical or intellectual property. You and only you are liable for everything. Sorry for the message, but i personally do not think such things will happen. To make sure such things do not happen, do not apply this to any man who does important works with the sites which are blocked and whoever you apply this upon, remember to unblock the sites shortly. The antidote is also supplied with this post.