Thursday, March 29, 2012

What is the Answer for 6÷2(1+2) , Is it 9 or 1

Hi guys,

It is a mathematical problem, How can we solve this If we use BODMAS/ PEMDAS the answer can be 1 or 9.
Lets try this
  6÷2(1+2)
  =6÷2(3)
  =6÷2*3
  =6÷6
  =1

OR


6÷2(1+2)
  =6÷2(3)
  =6÷2*3
  =3*3 because 6÷2 is 3
  =9


In BODMAS order Bracket, Order, Division, Multiplication, Addition, Subtraction
In PEMDAS order  Parenthesis, Exponentiation, Multiplication,  Division , Addition, Subtraction

So the above two operation orders are contradict each other by changing the position of Multiplication and Division but mathematically the both Operators have same procedural.

So, If Multiplication and Division come next to each other We can solve the problem by applying left to right order. That is the left operator should solve first and after that the second left operator.

If we apply above theory to the problem

=6÷2*3
=6÷2 = 3
=3*3 = 9

But that is not the way, The way of doing this is,

if the answer is 9
1. plug an unknown value for any digit so that the equation should looks like the below
       6÷Y(1+2) = 9
2. Now solve the equation for finding out the value for Y
       6÷1Y+2Y = 9
       6÷3Y = 9
       6 = 9*3Y
       6÷9 = 3Y
       0.667 = 3Y
       Y = 0.667 ÷ 3
       Y = 0.222
We know in our equation we replace 2 by  Y so, Y should come as 2 So,

if the answer is 1

1. plug an unknown value for any digit so that the equation should looks like the below
       6÷Y(1+2) = 1
2. Now solve the equation for finding out the value for Y
       6÷1Y+2Y = 1
       6÷3Y = 1
       6 = 1*3Y
       6÷1 = 3Y
       6 = 3Y
       Y = 6 ÷ 3
       Y = 2                Yes that's it we have got Y=2 if the answer is 1 So, the answer for 6÷2(1+2) = 1


   

Wednesday, March 28, 2012

Money For You If it is true?

Hi Guys,

I was at busy moment on the internet and had a chance to read something about wazzub and I have search about it on google. The yahoo answer give me some good information about wazzub You also can read that on the link http://answers.yahoo.com/question/index?qid=20111229144031AALiIap
and if you pretty confident please visit the link below and register with wazzub

1) http://signup.wazzub.info/?lrRef=414db4a6


2) http://signup.wazzub.info/?lrRef=3ea009a3

Ok guys see you later...

Thursday, February 2, 2012

Connecting Visual Basic 2010 with MySql database Cont...

Today We are going to learn that, How to write code in VB 2010 for connect to MySql Database

1. Open up new Visual Studio Project and create a form

2. Right Click on the form you create, and choose view code option

3. In the window you have shown, Type the code below

Imports MySql.Data.MySqlClient

the above line should be appear in the very top of the window that is, The above line should be type above public class formname

After that type the below code after the class declaration, That is after the line
public class formname


Dim ServerString As String = "Server=localhost;User Id=root;Password=pass;Database=dtbname"
Dim SQLConnection As MySqlConnection = New MySqlConnection

The above code line I use my server as localhost and user id as root password for the root is pass and the database is dtbname. You can use your own database details instead of the above

The second line of above code should be typed like what I have entered but you can change only the variable name SQLConnection to your own variable name

After that type the code below


SQLConnection.ConnectionString = ServerString


        Try
            If SQLConnection.State = ConnectionState.Closed Then
                SQLConnection.Open()
            Else
                SQLConnection.Close()
                MsgBox("Connection is closed")
            End If
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

Thats it you have connected to MySql database from Visual Basic 2010

Tomorrow we will show how to retrieve data from MySql table....

Sunday, January 1, 2012

Connecting Visual Basic 2010 with MySql database

Hi guys,

I'm going to show you, how to connect VB 2010 with MySql database

1. You have to download WAMP SERVER 2.2A or other versions for your windows operating system. If you are using 64 bit OS you have to download 64 bit compatible version of  WAMP SERVER 2.2A.


You can download WAMP SERVER 2.2A for your OS in this link http://www.wampserver.com/en/



2. Install the WAMP SERVER 2.2A by running the downloaded file

3. Download mysql database connecter. You can get it from this link http://www.mysql.com/downloads/connector/net/

4 Run the downloaded connecter to attach it with VB 2010 Reference list

5 Open Visual Studio 2010 and create new windows application

6 In solution explorer window click Show All File button


7 Right click on References folder in the window shown above and select add references option

8 Select the Brows tab on showing Addreference window navigate to Programe Files (x86) by clicking the down arrow in Look in combo box

And You will be shown a folder called MySql


Double click the MySql Folder and go beyond by clicking until get Go to \MySQL Connector Net 6.4.4\Assemblies\v4.0 and you will be having a window like the one below shown

Double click on MySql.Data.dll and you will be getting to your Visual Studio main window from thetre click on Solution Explorer à  References à Addreference like the above process you will be having a window like the above one and choose the .NET tab in the shown window

9. In the shown window click on Component Name tab after that scroll the scroll bar until getting to the MySql.Data file

Double click on MySql.Data that’s it now you can make connection to your WAMP SERVER and can add data retrieve data

Tomorrow We will show  code in visual basic for adding and receiving data to MySql tables……




  Screen shot Demo is shown below....




Friday, July 8, 2011

Basic Java Class

Hi! Today I'm going to talk some thing about the basic java source file
We know all programming languages has to compile before they execute to change the platform.
Java source file can be write in notepad or any other IDEs like NetBeans and what ever the IDE or notepad we are using we have to follow some restrictions to make compile our code.
In our source file the first part that is the top part of the source file must be the package declaration part which declare our source file to a particular place where some other source files also can be included.

The second part will be the import statement part which tell the compiler some source file we have to attached from other packages to our package because we are using the source code of that particular package.

The third thing i the class declaration where our favourite java class going to be declared.

If we don't have the first part and second part we talked above. The class declaration will be the first part

for example :

class Test{



The above code just compile fine and can't run the file because the JVM looks for the main method for starting the execution our above code don't have main method so at the runtime JVM pass an exception.

If we make the class as public we have to have the sourcefile name as same to the public class name. One java file can contain more than one class but only one class can declare as public and if a class declared public the source file must be named as the public class name

Full Example

package myPackage;//package declaration

import java.util.*;//import statement
import java.io.*; //import statement

public class A{
B b = new B();
}

class B{
Random random = new Random();
}


the above class must be named as A.java

Sunday, June 26, 2011

Getting the Method Information of a given class

Hello guys After some time,
All Java Programmers and Developers Know java is a Object Oriented Programming language. Java can be explain with few words, which is "classes and make objects using the class and interact between objects" so every object have the template as their classes.
Here we are going to show how can we get the information of a given class at the run time. To overcome the problem we have to use the Reflection API which is inbuilt with jdk. Reflection is a very useful tool for developers because if we would like to make some changes to our class at runtime it is the most suitable way.
I would like to show a small program which will provide the all methods of a given class at runtime.
import java.lang.reflect.*;
public class MethodsFinder {
  public static void main(String args[]){
         try {
            Class classes = Class.forName(args[0]);
            Method[] methods = classes.getDeclaredMethods(); 
            System.out.println(classes);
            for (int i = 0; i < methods.length; i++)
            System.out.println(methods[i].toString());
         }
         catch (Exception e) {
            System.err.println("Your error is " + e);
         }
      }
   }Save the above code in a notepad, name the notepad as "MethodsFinder.java"
Compile the source file as     "javac MethodsFinder.java"
and run the file by giving your class as argument as java MethodsFinder java.lang.String
the above underline class is my argument therefor It will provide the output as


 

















 The above output shows all the methods of String class which is an inbuilt class in java. We can get the method details of any given classes just by changing the argument at runtime. Ok guys I thing you have got my point and do it yourself.



Wednesday, June 1, 2011

Renew IP Adress

We all facing the problem which occurs when we are browsing internet. The problem is at the browsing time our browser displays a message which is "Page not found" error message. After showing this message we check our modem and other all connections with the internet but the problem is not in that devices. This type of problem occurs because to renew your IP address, which stands for Internet Protocol Address.
We can renew the IP address by doing the process given below.
1. Go to run dialog box by pressing window key and r key (window + r)
2. Type the word cmd on the run dialog box
3. Click ok button on run dialog box
4. Then comand prompt will appear
5. In command prompt type ipconfig /release and press enter key
6. You can see the IP address of your machine in command prompt
7. Type the words ipconfig /renew in the next line and press enter key
8. Ok you change your IP address and exit from command prompt

The picture demo shown below