Showing posts with label How to. Show all posts
Showing posts with label How to. Show all posts

Saturday, June 6, 2015

How to configure xampp with already Installed MySQL server

Xampp is a collection of software package which comes with “Apache”, “MySQL”, “PHP” and “Perl”. With this bunch of software you can maintain a web server functions in your local machine. Here with this post I’m going to tell you how to configure xampp in order to run different MySQL servers in same computer without creating a conflict between servers. 

First you have to install xampp in your computer. 



















After successful installation you can open the xampp control panel using setup window or from your start menu or start screen.
Here in my computer I have already installed MySQL server which is use to develop standalone applications using C# or java. So here if you have pre-installed MySQL server here is the way to use both MySQL and xampp’s MySQL server without any errors.



















In your xampp control panel you can see some buttons to start the apache and MySQL server. But below those buttons you can see textual descriptions of the xampp. Here we named it as xampp console. Now in console you can see some red colored texts which are appeared to be errors in xampp control panel. In there  you can see some text looks like this “MySQL Service detected with wrong path ” and list of errors that tell you that MySQL server cannot be started.

The reason is you have already configured MySQL server which is incompatible with xampp.
But you can recover this error by editing the configuration files in xampp.

first   click on apache “Config” button which is located before the “Logs” button. See below image  for a clear view.

Then click on “PHP(php.ini)”. Then a notepad will be opened with some text.


Now press “Ctrl+H” to get the find and replace dialog box. (alternately you can go to edit à replace). Now in find text box type 3306 and in replace box type 3307 and click “replace all”.

After that save the php.ini file and close it. Now again come to xampp control panel and again click on MySQL “Config” button and click on “my.ini”.

Again you are with a notepad. Now again press “Ctrl+H” and type 3306 as find text and 3307 as replace text and click on “Replace All”. Now save changes and close the notepad.

Now in xampp control panel you can see a button named “config” which is located at top right corner below the close button.

Now click on it and click on the “service and port settings” button. Now in this window navigate to “MySQL” tab and use following settings.
            Service name : mysql4
            Main port : 3307












hen click on “save” and again click on “save”.

Now you are almost done.
Now click on “Quit” button to terminate the xampp.




Note : do not close from windows default close button. Because this will not close xampp permanently.
Now open xampp again from your desktop or anywhere.
Now you can see there are no any red colored texts in the xampp console.
Now start your apache and MySQL server. If you are done correctly it will work fine.






Now click on MySQL “Admin” button to access your databases in xampp’s MySQL server.

Thursday, April 30, 2015

How to view basic information about your computer

How to view basic information about your computer

In Microsoft Windows you can view your computer's basic information easily. Here I'm going to list out how to do it.

Basically there are many ways to display computer's basic information.

Method 1

(for windows XP,vista and 7)
Click on the “start” button .In windows XP you can find it at the left side of the task bar. In Windows Vista and 7 there is a windows logo at left side of your task bar.

Then a menu will appear in left side of your monitor (with default task bar settings).
Then you can see a button named “computer”(actually this is not a button).
Then keep your mouse pointer on it and perform a right click.
Then again you can see a drop down menu. Here at the bottom you can see “Properties” click on it and now you can see your computer's basic information.

Method 2

In your desktop there is an icon named “Computer”(in Win 8,7 and Vista) or “My Computer”(In Win XP) .Then simply right click on it. Now there is a drop down list. Form that click on properties(at the bottom of the list).Now you can view your computer's basic information.

Method 3

(for windows XP,vista and 7)
Click on “Start” in task bar and click on control panel. Now you have control panel on your screen. If your view is “Control Panel Home” Then click on “System and Maintenance”.Then click on “System” and now you can view your computer's basic information.


If your view is “Classic view” Then double click on “System” and now you can view your computer's basic information.

Method 4

(for windows vista )
Click on “Start” then “All Programs” then “Accessories” then open “Welcome Center” . Here you can see some links to open various tasks.
Double click on “View computer details”. Now you can view your computer's basic information.
Method 5

(for windows vista and 7)
Open “Computer”. Then in computer window below the address bar there is a link name “System Properties”. Click on it.
There you can see your computer's basic information.


Method 6

Open “Computer” . Then right click on computer window (not on disk drives). Then in pop up menu You can see “Properties”. Click on it and your computer's basic information is on your screen.

Method 7

(for windows 8 and 8.1)
If you are in Start screen go to desktop by click on “desktop” tile or pressing “Windows key +D”. Then move your mouse to the right border of your screen. Then you can see a pop up menu. Then click on “Settings”. Then click on “PC info” and your computer's basic information is on your screen.
Method 8

(for windows 8 and 8.1)
If you are in Start screen go to desktop by click on “desktop” tile or pressing “Windows key +D”. Then press “Windows key+ i” combination. Then you can see a pop up menu. Then click on “PC info” and your computer's basic information is on your screen.

Method 9

(for windows 8 and 8.1)


Use key combination “windows key +x”. Then at bottom left of your screen pop up menu will appear. Click on “System” and your computer's basic information is on your screen.

---------------------Related articles----------------------


How to use sounds in a C# application

How to use sounds in a C# application

Various programs use various sounds to give an alert about various tasks. Here in C# we can use various sounds with form's load event,for a button click, for a check box etc... Basically there are two methods to use sound in C#.
First one is :-By using beep tones and second is by using audio files(.wav,.mp3 etc...).
So this post is about beep tones.
In Windows operating system there are various sounds to inform user about some tasks like “low battery”, “updates available” etc.. In some cases windows use beep tones also. So let's get know about how to use beep tones in a C# application.

First create new project and name it as “beeptest”.



Now double click on your form1 and here you have code window and you are at form's load event.

Then type this code →
                        Console.Beep();



and press “F5” or go to debug and click on “Start Debugging”.

Now you can here a beep tone when form loads.
Now try to use beeps with a button.
Now get a button to form and change it's text as “Click to beep” .


Then double click on the button and type this code in button's click event.
                      Console.Beep();



Now if you run this and click on the button you can here a beep tone.

Now let's study about the code “Console.Beep();”.
This is the general form of beep tones. But you can change the frequency of beeps. Now look at the code below.

                       Console.Beep(Frequency,Time period);

Here frequency varies from 37Hz to 32767Hz. If you want to use base sounds you can use low frequencies like 37,40 ,50 39 etc..

Time period means the amount of time that you can here the beep. Here in C# to here a beep sound for a 1 second you must use time period as “1000”.

Now get a new button and code this in it's click event.
                         Console.Beep(400,1000);
After running and clicking on the button1 you can here a beep tone with 400Hz frequency for a period of one second.
Try some more examples by changing frequency and time period.

Now I think you have got it.
Here we are going to make a soft organ with the help of beep tones.
Now open a new project and name it as “softorgan”.
Now change your form's name as you like or keep it as it's default (form1).
Here we have to use 13 buttons.
Get a button to the form.
Now change it's text property as “&S”.
Now get a label to the form and keep it under the button and change it's text property to “C”.
Now get another button and change it's text property as “&E”.
Now get another label to the form and keep it under the button and change it's text property to “C#”.
Accordingly get another 11 buttons and change there text properties as , “&D”, “&R”,“&F”,“&G”,“&Y”,“&H”,“&U”,“&J”, “&I”, “&K” and “&L”. Then get 11 labels and change their text properties as “D”, “Eb”, “E”, “F”, “F#”, “G”, “Ab”, “A”, “Bb”, “B”and “C”.
Now look at the picture below and align your buttons and labels as keys in keyboard.

Now it's time to code.

Double click on key C (first button) and type this code →
                                 Console.Beep(261,200);
Now code these codes accordingly second button and so on.
Second button(C#)        Console.Beep(277,200);
Third button(D)             Console.Beep(293,200);
Fourth button(Eb)         Console.Beep(311,200);
Fifth button(E)              Console.Beep(329,200);
Sixth button(F)              Console.Beep(349,200);
Seventh button(F#)       Console.Beep(370,200);
Eighth button(G)           Console.Beep(392,200);
Ninth button(Ab)          Console.Beep(415,200);
Tenth button(A)            Console.Beep(440,200);
Eleventh button(Bb)     Console.Beep(466,200);
Twelfth button(B)         Console.Beep(494,200);
Thirteenth button(C)     Console.Beep(523,200);


You can change the amount of time period by increasing or decreasing the value “200”.

Now it' time to play our soft organ.
Press F5 or go to debug menu and click on “start debugging”.
Now you can play using your mouse or using appropriate key in your keyboard.
(ex: to play C press “s” in your keyboard)
Thank you!


Related articles -------------------------




Tuesday, March 31, 2015

Data Types in JAVA

Data Types

Premitive

Object

Integers
  • byte (-27 to 27-1)
  • short (-215 to 215-1)
  • int (231 to 231-1)
  • long (263 to 263-1)
(reference data type or array data type) 

Ex: String
Floating point
  • float (231 to 231-1)
  • double(263 to 263-1)
Characters
  • char (0 to 216-1)
Boolean
  • boolean(true/false)

Sunday, March 29, 2015

Getting started with JAVA programming

Getting started with JAVA programming 

 Are you new to java? If yes here is the way to become a java expert. How to install JAVA Development Kit on your computer 

 Step 1 

      Download java development kit from oracle. 

       Click here to download. (Use the images to get an idea)


Click on accept



Select your download type 64 bit or 32 bit 
and wait until downlaod complete.
Step 2
            After download complete run the setup.
Step 3
            Do not change install location and set it to be default
Step 4
            Wait until installation to be complete.
Step 5
           Now you have JAVA installed in your computer.

Step 6
           Then you need to set path to compile a java program. Here is the way.

Go to your java installed location. In my case it may be c:\program files\java\jdk1.7.0\ (may vary due to java version)

create a new folder named “My docs”.



Open that folder.
Now you are inside the folder named “My docs”
Now open notepad and type start and save it as “cmd.bat” in “My docs” folder.



Now go to c:\program files\java\jdk1.7.0\ bin (your may be vary)


Now copy the path in your address bar

if you are a window 8 user follow these steps;

  1. Drag the Mouse pointer to the Right bottom corner of the screen
  2. Click on the Search icon and type: Control Panel
  3. Click on -> Control Panel -> System -> Advanced System Settings
  4. Click on Environment Variables, under System Variables, find PATH, and double click on it.

  5. Now click on variable value field, put a ; at end of the value.

  6. Now paste copied path after the semi colon
  7. click on ok then again ok and ok.

Now go to c:\program files\java\jdk1.7.0\My docs
Now open CMD.bat file
Then type “javac” and press enter
If you get text like in the image below you are successful.


Now it is time to code java.

How to start java coding

Now you can start to code java. Here is an example
Open notepad .Type these text
class a1{

         public static void main(String args[]){

                     System.out.println("Hello JAVA");

        }

}
Now save this as "a1.java" in "My docs" folder.
Now open "CMD.bat" and type javac a1.java and press enter
Then if it was successful type java a1 and press enter.
Now in cmd you can see a text "hello JAVA".
Now do not close cmd keep it minimized and code some more java program.then save it.
Now again type javac and then type name of your saved java program with .java extension .
Then type java and  saved java program and press enter.


-------------------------------------------------------------

RECOMMENDED BY AUTHOR

Wednesday, February 4, 2015

Use of colors in HTML

we can use RGB colors in web pages to make the page more colorful.
Syntax of RGB color code is rgb(rr,gg,bb)


As an example to show green color using RGB code we can write as following, rgb(0,255,0)


You can get RGB code of a color by using “Adobe Photoshop” or any image processing software. But in HTML we us corresponding hexadecimal value of a RGB color code.
Example : for red color 
  • RGB value = (255,0,0)
  • Hex value = #ff0000


But most web browsers support 17 main colors.
They are 
  1. Aqua
  2. Black
  3. Blue
  4. Fuchsia
  5. Gray
  6. Green
  7. Lime
  8. Maroon
  9. Navy
  10. Olive
  11. Orange
  12. Purple
  13. Red
  14. Sliver
  15. Teal
  16. White
  17. Yellow
we can use them without hex value.
We can use following HTML code 
<HTML>
<HEAD>
<TITLE>Colors</TITLE>
</HEAD>
<BODY>
<H1><FONT color=”red”>This is in red color</FONT></H1>
<H2><FONT color=#0000FF >This is in green</FONT></H2>
<P><FONT color=”blue”>This is some text</FONT></P>
</BODY>
</HTML>



The output will be,

How to use background colors.


<HTML>
<HEAD>
<TITLE>Colors</TITLE>
</HEAD>
<BODY BGCOLOR=”orange”>
<H1><FONT color=”red”>This is in red color</FONT></H1>
<H2><FONT color=#0000FF >This is in green</FONT></H2>
<P><FONT color=”blue”>This is some text</FONT></P>
</BODY>
</HTML>


output,