Which Anti Virus

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 31 August 2013

Make Calculator Yourself using java.

Posted on 20:19 by Unknown
write a following code in netbeans IDE 7.1 and save file as calc.java and run it and you will have your own calculator... 

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package calculator;

/**
 *
 * @author NISH
 */
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;


public class Calculator extends JFrame implements ActionListener{
    JTextField txt;
    JButton btn[]=new JButton[9];
    JPanel jp1,jp2,jp3;
    JButton plus,minus,mul,div,zero,dot,equal,cncl,square,sqrt,fact;
    String str;
    Boolean flag=false,flag_eq=false,flag_op=false,flag_a=false,flag_b=false;
        Character opr=null;
        String first=null,second=null;
        Double a,b;
        Double ans=0.0;
        Integer x,y,z=0;
   public Calculator()
   {
       this.setLayout(new FlowLayout());
       txt=new JTextField("",19);
       txt.setBounds(0, 0, 200, 20);
     
       jp1=new JPanel();
       jp2=new JPanel(new GridLayout(5, 4, 5, 5));
     
       jp1.add(txt);
       plus=new JButton("" +  "+" + "");
       minus=new JButton("" +  "-" + "");
       mul=new JButton("" +  "*" + "");
       div=new JButton("" +  "/" + "");
       zero=new JButton("" +  "0" + "");
       dot=new JButton("" +  "." + "");
       equal=new JButton("" +  "=" + "");
       cncl=new JButton("" +  "C" + "");
       square=new JButton("" +  "^" + "");
       sqrt=new JButton("" +  "VX" + "");
       fact=new JButton("" +  "X!" + "");
       for(int i=0;i<13;i++)
       {
           if(i==3)
           {
               jp2.add(plus);
           }
           if(i==6)
           {
               jp2.add(minus);
           }
           if(i==9)
           {
               jp2.add(mul);
           }
         
           if(i<9)
           {
                btn[i]=new JButton(" " + (i +1) +" ");
                jp2.add(btn[i]);
           }
       }
       jp2.add(zero);
       jp2.add(dot);
        jp2.add(div);
        jp2.add(cncl);
        jp2.add(square);
       jp2.add(sqrt);
        jp2.add(fact);
       jp2.add(equal);
     
       add(jp1);
       add(jp2);
     
       for(int i=0;i<9;i++)
       {
           btn[i].addActionListener(this);
       }
       plus.addActionListener(this);
       minus.addActionListener(this);
       mul.addActionListener(this);
       div.addActionListener(this);
       zero.addActionListener(this);
       dot.addActionListener(this);
       equal.addActionListener(this);
       cncl.addActionListener(this);
       square.addActionListener(this);
       sqrt.addActionListener(this);
       fact.addActionListener(this);
     
   }
   public static void main(String args[])
   {
       Calculator cl=new Calculator();
       cl.setTitle("Calculator");
       cl.setSize(240, 230);
       cl.setVisible(true);
       cl.setResizable(false);
   }

    @Override
    public void actionPerformed(ActionEvent e) {
       
        for(int i=0;i<9;i++)
        {
            if(e.getSource().equals(btn[i]))
            {
                if(flag_eq==true)
                {
                    txt.setText(null);
                    flag_eq=false;
                }
                if(flag_op==true)
                {
                    txt.setText(null);
                    flag_op=false;
                }
                if(txt.getText()!=null)
                {
                    str=txt.getText();
                    txt.setText(str + String.valueOf((i+1)));
                }
                else
                {
                    txt.setText(String.valueOf((i+1)));
                }
            }
        }
     
        if(e.getSource().equals(plus))
        {
            first=txt.getText().toString();
            opr='+';
            flag_op=true;
            //txt.setText("");
        }
        if(e.getSource().equals(minus))
        {
            first=txt.getText().toString();
            opr='-';
            flag_op=true;
           
            //txt.setText("");
        }
        if(e.getSource().equals(mul))
        {
            first=txt.getText().toString();
            opr='*';
            flag_op=true;
            //txt.setText("");
        }
        if(e.getSource().equals(div))
        {
            first=txt.getText().toString();
            opr='/';
            flag_op=true;
            //txt.setText("");
        }
        if(e.getSource().equals(zero))
        {
                if(txt.getText()!=null)
                {
                    str=txt.getText();
                    txt.setText(str + "0");
                }
                else
                {
                    txt.setText("0");
                }
        }
        if(e.getSource().equals(cncl))
        {
            txt.setText("");
        }
        if(e.getSource().equals(square))
        {
           first=txt.getText().toString();
           opr='^';
           flag_op=true;
           //txt.setText("");
        }
        if(e.getSource().equals(fact))
        {
           long l=1;
         
           for(int i=Integer.parseInt(txt.getText().toString());i>=1;i--)
           {
               l=l*i;
           }
           txt.setText(String.valueOf(l));
        }
        if(e.getSource().equals(sqrt))
        {
           txt.setText(String.valueOf(Math.sqrt(Double.parseDouble(txt.getText().toString()))));
        }
        if(e.getSource().equals(dot))
        {
            if(txt.getText()!=null)
                txt.setText(txt.getText().toString() + ".");
            else
                txt.setText(".");
        }
        if(e.getActionCommand().equals("="))
           
        {
             
                   a=Double.parseDouble(first);
                   b=Double.parseDouble(txt.getText().toString());
                 
             if(opr=='/')
             {
                if(first.indexOf(".")!=-1 && txt.getText().indexOf(".")!=-1)
                {
                      txt.setText(String.valueOf((Double.parseDouble(first) / Double.parseDouble(txt.getText().toString()))));
                }
             
                else
                {
                    txt.setText(String.valueOf(Float.parseFloat(first) / Float.parseFloat(txt.getText().toString())));
                }
             }
             else
              {
             switch(opr)
             {
                case '+':
                   
                        ans=a+b;
                       
                   
                    break;
                case '*':
                   
                        ans=a*b;
                     
                   
                    break;
                case '-':
                   
                        ans=a-b;
                       
                   
                    break;
                 case '^':
                 
                    ans=Math.pow(a, b);
                   
                    break;
               
            }
                String st= String.valueOf(ans);
                st=st+0;
                int indx=st.indexOf(".");
                if( st.charAt(indx+1)=='0' && st.charAt(indx+2) =='0')
                {
                    String st1=st.substring(0, indx);
                    txt.setText(st1);
                }
                else
                {
                    txt.setText(String.valueOf(ans));
                }
               
               
                flag_eq=true;
               
            }  
         
        }
    }
}


OUTPUT:-



Read More
Posted in java | No comments

Thursday, 29 August 2013

COMMON ERROR OF PC AND THEIR SOLUTION

Posted on 06:56 by Unknown



1. MONITOR LED IS BLINKING
Check all the connections like Monitor Cable, Data cables, RAM, Display Card , CPU connections.sometimes loose connection may cause this type of problem.

2. CONTINUOUS THREE BEEPS
Problem in RAM Connection .mostly of beeping sounds produced form RAM.

3. THREE BEEPS ( 1 Long 2 Short)
Problem in Display Card Connection..MAKE IT CLEAN

4. THREE LONG BEEPS PERIOD WISE
Problem in BIOS or RAM (Basic Input Output System)(Ram Access Memory)

5. CONTINUOUS NON-STOP BEEPING
Key Board Problem (I.e.; Some Key is pressed for Longer time)

6. FDD LED IS GLOWING CONTINUOUSLY
Data cable to be connected properly (twisted cable).do not use brakeble wire.

7. NO DISPLAY ON THE SCREEN AT ALL
Hard Disk cable connected wrongly. Connect rightly seeing the Red mark (Faces power supply) and then Restart.chek it from cpu to monitor.

8. POWER LED IS OFF
a. Check main power cord
b. Check S.M.P.S.
c. Check Mother Board connection
d. Check switch once again at cpu and monitor

9. SHOWING CMOS ERROR
Replace 3 Volt battery of Mother Board . Set Original Settings Manually.(Refer­ CMOS Setup chart) Enter your search terms.Submit search form.

10. SHOWING FDD ERROR OR FLOPPY DRIVE IS NOT WORKING PROPERLY
Check Power cord of FDD , Data Cables , set CMOS & Finally the Check drive.

11. SHOWING HDD ERROR OR HARD DISK FAILURE
a. Check Power Cord
b. Check connection of HDD
c. Check Data cable
d. Check Hard Disk parameters in CMOS or Auto detecting Setting Partitions by Fdisk Command, then format it to set track 0.

12. MOTHER BOARD HANGS DUE TO UNSTABILIZED POWER SUPPLY
a. Check S.M.P.S
b. RAM not functioning properly.
c. Software problem (due to using pirated software)
d. CPU fan not functioning properly.
e. warm air shouldn't be temperd inside CPU.

13. DANCING SCREEN
a. Check Display card connection
b. Virus Problem
c. Video Memory Problem

14. SHAKING SCREEN
a. Earthing problem
b. Magnetic waves comes around.

15. CPU CABINET SHOCK
a. Check Earthing
b. Check main power cord.

16. NON-SYSTEM DISK ERROR
a. Floppy Drive having different disk (Non-Bootable Disk) OR CMOS Parameters for Hard Disk may not be set properly.
b. Hard Disk Partitions may not be created.
c. Hard Disk may not be formatted.

17. MISSING OPERATING SYSTEM
The System files missing namely Ie; command.com} -User File IO.SYS & MS_DOS.SYS } - Hidden Files. These above three files required for Start up of the system that can be transferred by using SYS C: Command OR While the time of formatting by using Format c:/u/s

18. MISSING COMMAND INTERPRETOR
May the file Command.com is corrupted OR Infected by Virus OR Some one has Erased it.

19. SHOWING I/O ERRORa. The type of Hard Disk in CMOS may not be set properly.
b. Operating system used for formatting is not valid.

20. SHOWING DIVIDE OVER- FLOW MESSAGE
a. May some Directories or Files crash with other files.
b. Use CHKDSK/F or SCANDISK Command to correct it.

21. HARD DISK MAKING NOISE WHILE PROCESSING
a. Unstabilized power supply.
b. Check for Loose Contact.
c. Do not use Y Connectors for Hard Disk.
d. It may create Bad Sector OR Weak Hard Disk.

22. HARD DISK HANGS WHILE PROCESSING
Check for Bad Sector by using CHKDSK or SCANDISK Command. If found format the Hard Disk and set Partition before that area.(This is the only procedure to use Hard Disk with Bad Sector) OR (To avoid Bad Sectors use Standard Power Supply)

23. HARD DISK NOT DETECTED
a. Check Power Connector
b. Check Data Cables
c. Check Jumpers

24. PARTITION NOT SHOWN
Operating System where the Hard Disk formatted is not supported with present Mother Board. For Eg: Hard Disk formatted with Pentium System will hide their partitions for 486 System.

25. MMX/DLL FILE MISSING
May the above files may be corrupted due to power failure or Virus. Make available above files from other Computer. OR Reinstall Windows 98 Operating System. (This procedure will not make any effect on existing Data).

26. WINDOWS REGISTRY ERROR
This will happen due to sudden ON/OFF of the system. Final solution is to Reinstall Operating System.

27. DISPLAY COLOUR DOES NOT MATCH
a. Configure Display Card properly with their CD.
b. The Standard setting for Windows is set it to 800x600 for better performance.

28. UNKNOWN DEVICE FOUND
May the Driver utility is not provided with operating system . Insert Driver CD and install software for the above Device...
Read More
Posted in general | No comments

Thursday, 1 August 2013

WiFi DIRECT in Andoird

Posted on 20:14 by Unknown
The Samsung Galaxy S II is the follow-up to their widely popular phone Galaxy S. It’s an amazing phone with 4.3 inches Super AMOLED Plus display measuring 4.3 inches screen size and powered with dual core processor. This article is about the Samsung Galaxy S2over looked feature of Wi-Fi Direct.
Wi-Fi Direct in Samsung Galaxy S2
The Direct Wi-Fi functionality is among the most overlooked feature of Samsung Galaxy S II. The Samsung Galaxy S II phone is equipped with the rich feature of Wi-Fi direct function. Using Wi-Fi Direct allows Wi-Fi devices to communicate with other for faster data transfer without the need of wireless access points or the need of Wi-Fi hotspot.
The Wi-Fi Direct features works not just like Bluetooth but its 100 % faster and has better range of coverage. It was supposed to get in Nokia phones but Samsung beat everyone has introduced this feature in Samsung Galaxy S 2 phone, something which makes the Galaxy S2 phone proud. Surprise that this feature was never looked on.
With Wi-Fi direct you can transfer a mp3 file of 5 to 6 MB virtually instance without any processing time. So that means that you can transfer 700 MB of movie on go at anywhere under 5 minutes using Wi-Fi direct but only requirement is that the device should be in the range.
For transferring files using the Wi-Fi Direct from one device to another you need to disable your existing Wi-Fi network that you are connected on both of the devices and then proceed with the Wi-Fi Direct feature.
How to Transfer Files using Wi-Fi Direct on Galaxy S2
First thing you should have two Wi-Fi direct enable devices. The Samsung Galaxy S2 phone is Wi-Fi Direct enabled and there are not so many smartphones which are Wi-Fi Direct enabled. Just like few Windows phones which required pairing of the devices to transfer files via Bluetooth this Wi-Fi direct also requires pairing of both the devices first and then transfer of files is done. As of now we can count those devices with such features on finger tip. Here is how you would do it on those devices -
  • First you need to set up Wi-Fi direct, Go to Menu and click on Settings on the first device.Samsung Galaxy S2 Settings
  • Now click on Wireless and Network which is the place to manage your wireless networks.Samsung Galaxy S2 Wireless network
  • Now you would find Wi-Fi Direct Settings, tap on it.Wi-Fi Direct Settings
  • You would be prompted to click on OK. Do it.Prompt
  • One thing you would notice here if you have current Wi-Fi connection ON. Your mobile phone would automatically prompt you to shut down any Wi-Fi signal that you are connected to and then the process begins. In my case there Galaxy S2 is not connected to any WiFi. Once you do that you would be automatically taken to configure your Wi-Fi direct with device name and password of it. When you are done click on ‘Save‘Wi-Fi Direct Configure
  • Also similar setup is need on the other device on which you wanted to transfer the data, so repeat the steps again on the second device.
  • Very soon, as the second device is Wi-Fi Direct enabled, your phone would discover the other devices. Now to connect simply tap on the device and it would be paired up.
  • Now go to the files which you want to transfer lets say a music file tap on it and it will give you options from which you need to tap on ‘Share music via‘.Share music option
  • Now among the various options select the option of Wi-Fi, which is by now the Wi-Fi Direct ready to be sent on the other device. The devices will be popped up in the next menu and you just need to tap on the other device.
  • Now on the other handset you get a request to accept the file. Once you click on that, within no time it would be transferred to your mobile.Share music via
Now as I got a hang on to try this out on the Samsung Galaxy S2 phone, I observed that the data transfer rate is 2 to 3 MB per second and so a whole movie of 700 MB can be transferred to other device within 3 to 4 minutes of time with Wi-Fi Direct. All the proud owners of Samsung Galaxy S II phone, did you happen to come across this option? Did you try it any time?

Note:-
Now day many device support Wi-Fi direct but there is some error while sending file so there is application in market place called  SuperBeam | WiFi Direct Share it may work if above method is not work..
Read More
Posted in Android, Android Apps, apps, general, Samsung | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Online Mobile Recharge Websites
    Hey here is the list of websites which helps you to make a online recharge of your mobile. Rechargeitnow.com FastRecharge.com Indiamobilerec...
  • GTU Paper Solution and Material as Per GTU syllabus
    Go to this website and download the Study material of GTU Syllabus. http://gtu-paper.blogspot.com/
  • C Program Library files(Header Files)
    1. <stdio.h>: input and output  function in program. 2. <conio.h>: to clear screen and  pause information function. 3. <ctype...
  • Windows 8 - Keyboard shortcuts
    Press this key To do this Right Shift for eight seconds Turn Filter Keys on and off Left Alt+Left Shift+PrtScn (or PrtScn) Turn High Contras...
  • How To Install Android on PC or Laptop
    Android has a got very important place in our Tech World.Now in market you can get many devices running on Android like Smartphones to Table...
  • HOW TO : Speed Up Youtube Buffering Speed
    1. Click start then type  system.ini  in the input address box 2. Then you will see the file  system.ini,  click it and it will open in a no...
  • Different Operating System and Their RAM Support
    Windows 8 64 bit Enterprise  Professional : 512 GB Windows 8 64 bit :128 GB Windows 8 32 bit : 4 GB Windows 7 64 bit Ultimate, Enterprise ...
  • Make Calculator Yourself using java.
    write a following code in netbeans IDE 7.1 and save file as calc.java and run it and you will have your own calculator...  /*  * To change t...
  • How To recover Saved Password In Firefox ?
    1. Open Firefox Web Broweser 2. Then Click on FireFox > Option > Option as shown in below picture 3. Then a POP Up box will appear, In...
  • How To Check Antivirus Strength or Test Antivirus Software or Check Antivirus Which is Used by You is Good or Worst?
    One of the most asked question is  Which antivirus has good strength or How to check antivirus strength? This post is for them who want to c...

Categories

  • Android
  • Android Apps
  • apps
  • BlackBerry
  • Cprog
  • dfd
  • erd
  • Facebook
  • general
  • Hacking
  • HTC
  • ios
  • java
  • Mobile
  • nokia
  • Samsung
  • Srs
  • Window Apps
  • Windows 8

Blog Archive

  • ▼  2013 (91)
    • ►  November (6)
    • ►  October (5)
    • ►  September (17)
    • ▼  August (3)
      • Make Calculator Yourself using java.
      • COMMON ERROR OF PC AND THEIR SOLUTION
      • WiFi DIRECT in Andoird
    • ►  July (8)
    • ►  June (13)
    • ►  May (12)
    • ►  April (27)
Powered by Blogger.

About Me

Unknown
View my complete profile