Dec 31, 2010
Dec 29, 2010
Dec 23, 2010
Binary to Decimal in Java
Code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class BinarytoDecimal {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the binary value:");
String binary = br.readLine();
System.out.println("Decimal value is : "+Integer.parseInt(binary,2));
}
}
Output:
Enter the binary value: 110
Decimal value is : 6
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class BinarytoDecimal {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the binary value:");
String binary = br.readLine();
System.out.println("Decimal value is : "+Integer.parseInt(binary,2));
}
}
Output:
Enter the binary value: 110
Decimal value is : 6
Decimal to Binary in Java
Code:
import java.lang.*;
import java.io.*;
public class DecimalToBinary{
public static void main(String args[]) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the decimal value:");
String decimal= bf.readLine();
int i = Integer.parseInt(decimal);
String binary = Integer.toBinaryString(i);
System.out.println("Binary: " + binary );
}
}
Output:
Enter the decimal value: 15
Binary: 1111
import java.lang.*;
import java.io.*;
public class DecimalToBinary{
public static void main(String args[]) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the decimal value:");
String decimal= bf.readLine();
int i = Integer.parseInt(decimal);
String binary = Integer.toBinaryString(i);
System.out.println("Binary: " + binary );
}
}
Output:
Enter the decimal value: 15
Binary: 1111
Dec 20, 2010
Free ATM Card
In almost all banks in India , if you open a savings account, they will offer you ATM card for free, in oder to withdraw money. But recently i have seen an Adv from a popular bank in bangalore. The Adv goes like this
"Open a Savings Account in our bank and We will offer you Free ATM card".
The Adv is funny isn't it..!!!
"Open a Savings Account in our bank and We will offer you Free ATM card".
The Adv is funny isn't it..!!!
Dec 18, 2010
Black and White, Read All over
If any one ask this question to you, they would be spell "READ" as "RED". Dont get confuse, because the answer is very simple. Its "NEWS PAPER". The letters are in black color and its printed in a White sheet and it can be read all over the world.
Thats what its called as "Black and White, Read All over".
Thats what its called as "Black and White, Read All over".
Dec 14, 2010
Nettipattam Wall Hangers
Nettipattam is an ornament for Elephant which would add glory to their trunk. During festival seasons, all elephants in Kerala would be wearing this. Nowadays, its available in the market of different size. Many people prefer this as their car hangers, which was made of polymer
For wide range of nettipattam, you can visit
http://www.godsowncraft.com/
For wide range of nettipattam, you can visit
http://www.godsowncraft.com/
Dec 8, 2010
Short Circuit Operators
&& and || are called short circuit operators. These operators are used for "AND" and "OR" operation respectively.
Ex.
if(a && b), Suppose if a is false, it wont even check the value of b, it skip the condition itself. Take an another example:
if(refVal!=null && refVal.isValid() ) ,
in this consider refVal is the reference variable and it has not been assigned to any object, so the value of refVal=null, so if its checking refVal.isValid(), it will throw the NullPointerException. Since, the first condition is false, it skips the second condition.
Ex.
if(a && b), Suppose if a is false, it wont even check the value of b, it skip the condition itself. Take an another example:
if(refVal!=null && refVal.isValid() ) ,
in this consider refVal is the reference variable and it has not been assigned to any object, so the value of refVal=null, so if its checking refVal.isValid(), it will throw the NullPointerException. Since, the first condition is false, it skips the second condition.
Dec 7, 2010
Dec 6, 2010
Facebook offers Rs 38 lakh package for IIT Madras students
Social networking site Facebook has offered a package of Rs 38 lakh (USD 85,000) for IIT Madras students during the ongoing placement season.Facebook after conducting all the rounds, will conduct another interview via Skype from the US and when a student gets selected he/she will be offered USD 85,000 package.Last year the highest package was offered by Tower Research Capital at Rs 28 lakhs per annum and about 225 companies had visited the institute for selecting 700 candidates. This time, while the leading package was offered by Facebook.
How many squares are there in a Chess board ?
When you are asking this question to any people, they immediately reply you as 64. But people forget that even the chess board is a square. In addition to that, four squares can form a square.. Like this it comes in a combination way. So, the calculation goes like this
- Number of Squares in Chess board = ( (n * (n+1) * (2n+1) ) / 6 )
- For Chess board, n=8
- Number of Squares = (8 * 9 * 17 ) / 6 = (72 * 17) / 6 = 12 * 17 =204
So, Number of Squares in Chess board = 204 Squares.
Dec 3, 2010
Tips to avoid Snoring
It recommends working out whether snoring comes from the nose or throat, reports the Daily Express. If you can make a snoring noise with your mouth open and closed, try this: stick your tongue out as far as it will go and grip it between your teeth.Try to make a snoring noise. If it is reduced, you are probably a "tongue-base snorer", meaning your tongue is vibrating and causing the problem. If you are a "nose snorer" you snore with a closed mouth, it says.
- Sleep on your side
- The theory is that when we lie on our backs the tongue and muscles in the throat collapse, constricting the airway and causing snoring.
- Higher pillows
- This aims to keep the airways open by supporting the neck so the throat is less constricted. It works fairly well until you fall asleep and slump down in the bed.
- Breathe Right Nasal Strips
- These are supposed to open your nostrils from the outside and they certainly do seem to do this. They can also provide temporary relief from nasal congestion and stuffiness caused by colds and allergies.
- Snoreeze Oral Strips
- These dissolving mint-flavoured strips target the main cause of snoring and are ideal if you tend to snore more when lying on your back. They contain a time-release formula, which coats the back of the throat throughout the night and reduces the vibrations of the soft tissues, helping to stop snoring.
- Snoreeze Throat Spray
- This lubricates and tones the soft tissues at the back of the throat that vibrate and make you snore.
- Nozovent
- This is a piece of flexible plastic which you push into your nostrils to make them wider and allow easier breathing. It looks like something from the Spanish Inquisition but users report good results.
- SomnoGuard
- This is a bit like the gumshield worn by a rugby player, but it is reported to produce good results. The idea is to bring your lower jaw and tongue forward, making more space for breathing. The drawback is that it takes sometime to get used to and is costly.
- Rhynil Herbal Spray
- The British Snoring and Sleep Apnoea Association says its herbal nasal spray shrinks the lining of the nostril, creating more space to breathe. It also tightens the tissue of the roof of the mouth, making it less likely to vibrate. It smells pleasant and a friend who tried it said it reduced snoring significantly.
- Abstinence
- You should cut down on cigarettes or, better still, give up completely. Also, try to have your last alcoholic drink at least four hours before you go to bed. (ANI)
Dec 2, 2010
Keep your PC Clean
If your PC is faster, you will always love to work and do whatever you need. I will share with you some of my opinions to make your PC work faster.
- Clean Temporary Files:
- Open run command([Start+ run] or press windows key+ R key in keyboard) and type cmd and press Enter key, it will open the folder which has all your temporary files. Delete all the files there by pressing Shift key + Del Key
- Delete your Cookies:
- Open run command and type inetcpl.cpl, it will open you Internet Options window. In that, click "Delete" and select Delete All, it will clean all your unwanted files from your browser
- De fragmentation
- Go to Start + All Programs + Accessories + System Tools + Disk Defragmenter, and select your drive that you need to defragment and click defragment, it will automatically do its job.
- De fragmentation helps in allocating memory efficiently
- Disk Cleanup
- Go to Start + All Programs + Accessories + System Tools + Disk Cleanup and Select your Drive. It will take some time, so you start it at night time and leave it, it will clean your pc
If you guys know some other ways, to clean the PC, please update me with your comments
Dec 1, 2010
LIFE IN ENGINEERING
With a little humor, we can rhythmically describe mindset of students in all the semesters in a funny way. Lets have a glance on them
- New Life, but boring in the First Semester
- Homesick, but Blooming friendship in the Second Semester
- Slow, but Interesting Gang Selection in the Third Semester
- Number of Arrears, but Gang Support in the Fourth Semester
- Huge Syllabus, but Mass Bunk in the Fifth Semester
- Critical Time, but Fine Time training in the Sixth Semester
- Fears about the Future, but Final year Mass in the Seventh Semester
- Doing the Project with Joy, but feeling abut the Farewell in the Eight Semester
Subscribe to:
Posts (Atom)