Just feel the annoyance and irritation when the CD tray of your computer opens and closes, opens and closes, again and again, again and again, and does not stop until you shut down the computer. We will be writing a tiny shell script with which we would do the above stuff. Although this is very cruel if you apply this to some one, then please be sure to fix it before he/she shoots you with a 50 caliber rifle. So keep on reading to know how to make the simple script to make an infinite CD-ROM tray open close loop in GNU+Linux
Beginners Guide to GCC
GCC is the default compiler in the GNU+Linux systems, and is used to compile small applications, big softwares, and the kernel. Often beginners are overwhelmed with the amount of information provided in the gcc manual. This tutorial highlights the most useful commands and describes how to use them, how to read warnings and errors from the compiler output and compile the C Language sourcecodes with gcc. This tutorial does not cover advanced options and topics, in depth details are avoided. This tutorial will give the basic idea, and after reading this i hope that the manual pages would be easier to read.
All Combinations Without Repetitions
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.
Make a website block virus
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.
Split and Join Files
A lot of time we need to carry large sized files and we do not have enough space in a single media. At that time we need to split the large file into several small ones and then carry them in separate media. Also small files are very useful in uploading a large file for sharing or backup in online storage services. Here is a very simple way how you can split a large file in several equally sized small ones in Linux/Unix and again join them in Linux/Unix or in Microsoft Windows.
r-Permutations With Repetitions
Problem : To generate all r-Permutation with repetitions of a set of distinct elements
Before we start discussing about the implementation we will go through the basic definitions of Permutations. Then we discuss the method to generate r-Permutations with repetitions with examples, and at last we implement a C Language Program of the problem. Continue reading.
Swapping Values
Problem:Developing Algorithm to interchange of the values stored in two given variables.
The exchanging of the values between two given variables is commonly known as value “swap” and the process is known as “swapping”.This can be archived by various approaches. Below, we will discuss about two different approaches with a total of three processes, and see their benefits and pitfalls.
Linux / Unix Shell Commands: Problems and Solutions (1st issue)
This is the first issue of the “Linux / Unix Shell Commands: Problems and Solutions” series. This issue features the questions taken from different year question papers of Computer Science Honours, Part II Practical examination of Calcutta University, India, Kolkata. This section carries 5 marks. When going through the papers I noticed that the questions were repeated in different years. Also there were common questions in different groups in the same year. I have tried by best to solve the questions and kept it as simple as possible. Each solution comes with a description of what the sequence of commands do. I have also provided more than one solution where applicable.
A note for the students: Please do not try to remember each and every command without understanding how they work. If you do not know the commands it is recommended that first learn the basics and know what the commands do. Refer any standard text book, the command manual pages, or the GNU website. If anything cannot be understood in this solution refer the man pages, if any mistake is found please leave a comment or contact me. The main intention of this solution is to act as a ready reference to save time.
Update Information: Updated at 17.03.2012
Continue reading “Linux / Unix Shell Commands: Problems and Solutions (1st issue)”
Jumble Word Solver
Jumbled Word: A string of characters is given, the task is to find all the meaningful words that can be created by rearranging its letters. Solving a jumble word means to find all the meaningful words that can be made with the initial string.
Objective Of The Article
In this article first we will describe how a jumbled word can be solved and then we present a very simple computer program. After this we present an advanced computer program which will make the solution very fast with the help of a specially designed tree.
Article Revision: 3
Notice 25.9.2009 : This article is undergoing an update and will be made online soon .
Here is another related post Jumbled word solver with C++ and Perl implementation with hash and list: Jumble word solver again.
*Please Note:* This article is very old and lengthy, I am planning for either a revision or a rewrite for the trie tree part which reflect the recent modifications. At the time I wrote this I did not know that the datastructure which I worked out was a trie :) therefore the long explanation.
Continue reading “Jumble Word Solver”
Generating Twin Primes, Cousin Primes and Sexy Primes
Twin Prime: A twin prime is a set of two prime numbers whose absolute difference is 2. Let p1 and p2 primes such that p2 – p1 = 2, then the set { p1 , p2 } are twin primes.
Objective Of The Article
The objective of this article is to describe the basic algorithm to search for the twin primes first, and then make some modifications to make it better and faster. At last we present the final code
Article Revision: 2
Continue reading “Generating Twin Primes, Cousin Primes and Sexy Primes”
