Monday, November 12, 2012

Changing the BOOTMGR location

BOOTMGR is the fie which boots windows. Normally it is installed to your first hard-drive. So there can be instances where you install your new Windows into newly bought hard-disk, but without your old hard disk you can’t boot your computer. To check whether this is your case, just go to BIOS and disable the hard you think you don’t have windows installed on and try to boot. If it gets booted then no problem, else you can do this easy fix.

Actually this is very easy fix since a software will take care of all the trouble. You just need to download EasyBCD which is luckily a freeware but a very valuable software. After installing it you can do the following,

  1. Click on BCD Backup Repair         
  2. Select Change Location
  3. Select the new partition.
  4. Click ok.

After this simple process, you are good to go!!!

Thank you.

Saturday, November 10, 2012

Ansoft HFSS quick guide to dipole simulation.


If you know HFSS, then this will be understandable. If not i recon that you should go through a detailed tutorial. This is just a side note so that one will be able to follow the steps easily. 

  1. Open HFSS.
  2. Start a New Project
  3. Insert HFSS
  4. Set solution type
  5. Set units
  6. Set design properties (variables)
  7. Draw one pole of the dipole.
  8. Set the material.
  9. Duplicate it along the x-axis
  10. Draw a rectangle in YZ-plane
  11. Make it the lumped port
  12. Draw the E-field vector.
  13. Insert the radiation boundary. (Select faces and apply the boundary)
  14. Make the material to vacuum.
  15. Add solution setup.
  16. Define frequencies to feed
  17. Define the frequency sweep.
  18. Validate & Analyse.
  19. For far field make sure to insert Infinite Sphere for Radiation.
Thank you.

Thursday, November 8, 2012

HP-Pavilion dv6 3122tx errors


Ok this all started with a simple update. I usually use ATI-hotfixes for my driver updates since hp hardly release compatible driver updates to switchable graphics enabled laptops. But this time surprisingly my catalyst controller itself asked me whether I would like to install the new catalyst controller 12.10 or something. I thought what the hell, if it is the new driver and if my catalyst controller is suggesting it I should not worry. So I went straight ahead and updated the driver. Everything has gone smoothly, until I switch on the laptop next day.

I switched on the laptop and I couldn't click on any of my task bar buttons and my laptop charger is also not detected. And there were random flickering in my display. I got worried and then I restored windows. The restore also crashed for I don’t know what reason. It gave me lots of software issues but the hardware was ok. So I spent around 3~4 hours and repaired the software.But now the messed up part is that sometimes my display driver (Ati 5650) does not get detected in the device manager. But sometimes it does.

So currently I am only using the Intel drivers and using the Intel hd driver in the laptop, but the laptop is expensive only because of its video driver and without it it’s not worth the amount. So these days I’m trying to fix that error.

Today I removed Catalyst Controller and the ATI drivers from my laptop. Now hoping to download them directly from the hp website and see how it goes. HP-pavilion dv6 is a good laptop but with switchable graphics it sucks. :D

Thank you.

Sunday, October 7, 2012

WAMP server on a LAN

Previously I posted about configuring WAMP server on a PC. Now it's time to move another step further, that is to configure the server so that anyone in the LAN can access the server. Luckily I have two PCs at home and a router between them.

So I installed the WAMP server on my desktop computer so that it can become the server in the LAN. I believe that desktop is more powerful and reliable. Now I should be able to connect to my desktop-web-server when I type the IP of the server in my browser, which is basically how the internet works. If we type an IP address it will directly generate a port 80 request on that server. But it was not happening.

I got the HTTP 404 reply, which means the access is forbidden. What does this mean? It means that my browser generates the HTTP request to the IP but I don't have permission to access the web server. I went through the 'httpd.conf' file in my web server to find out what's going on. Then I found out something similar to an Access List inside the file. So I changed it. There were entries,

Deny from all

I changed them to,

Allow from all

Then I tried requesting the IP address through my web browser again. Now I got the reply back, and it was the WAMP sever index page. So the web server can be accessed within the LAN now.

Then, I went one step further, here what i did was, instead of putting,

Allow from all

I typed,

Allow from 192.168.1.3

Note: 192.168.1.3 was my laptop's IP address.

Now only I can access the web server. :) Better security.

Thank you.

Saturday, October 6, 2012

WAMP server on a PC

This weekend I was thinking of hosting a web site. :D  To facilitate it, I needed a web server, and I did not have any clue of how to do this thing. But I've overheard people talking about this thing called an Apache server or something. So I googled Apache Server along with my need. Since Google always knows exactly what we need, it came up with all sorts of solutions.

Then I went through a few articles and got to know about the WAMP server.

WAMP = Windows, Apache. MySQL, PHP

Name it-self gave me a slight insight of it's usage. It is obviously a method to integrate Windows OS with Apache web server and is powered by both PHP for scripting and MySQL for databases.This was what I wanted. So I downloaded it to my Laptop and start experimenting on it.

From google I found out that by typing 'localhost' in my web browser I can access the web sites within my server. But in my case it was different, that is once I typed 'localhost' it directed me to some Windows Application namely IIS7. 

I read about it and understood the mechanism behind this problem. It is that whenever I type 'localhost' in my browser it starts a http request to my loop back  address. (127.x.x.x:80) Then I realized that IIS7 is listening to the port 80 on my laptop. There are two options now, one is to prevent IIS7 from listening to port 80 and the other is to change the port which Apache web server listens to.

As usual I did both. First I found out the configuration file for the Apache Web Server,  httpd.conf, and I read it to understand. It was straight forward. 

I replaced the entry 

LISTEN 80
to
LISTEN 8080.

Then I restarted the service and typed 'localhost:8080' in my web browser. It directed me to the WAMP server index page and proved that I was right.

The other way was to disable IIS7 and doing this was pretty easy.

First typed services.msc in run. Then disabled World Wide Web Publishing Service from the list. But here you don't need to change the listening port number of the 'httpd.conf'.

Either way the server is now up in my PC.

You can access it by typing 'localhost' or 'localhost:8080' according to the way you did the setup.

Thank you.

Saturday, September 15, 2012

MySQL in Java (the code)


In my previous post I have mentioned about the MySQL connector which facilitates the connection between MySQL and Java. Now it's time to connect the database in coding.

Before attempting the code make sure your MySQL is working. Also create a database in the MySQL named 'data' and create a table within it named 'testtable'. Please go through MySQL commands, (just the basic stuff) so that you can clearly understand the code.

Moreover testtable should have three columns which accept TEXT data type.

I have implemented the following code to check the connectivity of the MySQL.

Code:


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Pradeepa Senanayake
 */
public class MySQLtest {


    public static void main(String[] args) {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/data","root","root");
            conn.createStatement().execute("insert into testtable values ('abc' , 'abc' , 'abc' );");
            conn.close();
        } catch (Exception ex) {
            System.out.println(ex);
        }
     
    }
}

~ Class.forName("com.mysql.jdbc.Driver"); ~
               This will dynamically add the Class 'Driver' to the run-time by accessing the given path. This is the jdbc(Java DataBase Controller) driver needs to connect to MySQL.

~ Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/data","root","root"); 
               This is the connection to the database from within the Java program.
               Here, you should note that "data" is the database name. "root" is the username and password for MySQL.
               If your database name, username and the password are different, you should change the command accordingly.

~ conn.createStatement().execute("insert into testtable values ('abc' , 'abc' , 'abc' );"); ~
               This is how we send a command to MySQL.

insert into testtable values ('abc' , 'abc' , 'abc' );   >>
This is a standard MySQL command to add 'abc' text value to the first three columns  in the 'testtable' table.

                 So basically the command is,

conn.createStatement().execute( ***Database Command As A String*** );

That's it, if you did all of the above correct your program should work. And after you executed your program make sure your database is updated.

Thank you.

MySQL in java (the connector)

In almost all the programs there is a necessity to store data. Databases are the places where we can store data which we have extracted or created within our program. There is a well known open-source database known as MySQL and I'll be explaining how to connect MySQL with java within this post.

First, you need to have the MySQL connector for java and that can be downloaded from,

http://dev.mysql.com/downloads/connector/j/

After you download the MySQL connector you need to extract it to somewhere.

Then go inside the 'mysql-connector-java-x.x.xx' folder and copy all the contents into \jdk x..x_xx\jre\lib\ext folder. ( In my case this directory was at C:\Program Files\Java\jdk1.7.0_03\jre\lib\ext )

Now you have successfully placed the files in the appropriate locations. Now it's time to change your Environmental Variables.

In Windows7 you can directly type 'Environment Variables' in search bar located in the start menu and access the window which allows you to edit them.

Go to environmental Variables and under System Variables there is an entry called CLASSPATH. If there is no entry you have to add a new entry. If you have a CLASSPATH entry then you need to edit it.

In my case I've put the following path to the CLASSPATH variable, 'C:\Program Files\Java\' part can differ according to the place where you have installed java. But make sure you type the path exactly as below.

.;C:\Program Files\Java\jdk1.7.0_03\jre\lib\ext\mysql-connector-java-5.1.21-bin.jar

Now you've successfully setup the MySQL connector for java. Next post will consider about coding.

Tank you.




Mac OS X on Virtual box

I found a great step by step guide on how to install Mac OS 10.8 into virtual box. I followed it and it works like a charm.

http://www.macbreaker.com/2012/07/mountain-lion-virtualbox.html

Performance is not bad.
I dedicated 2GB ram and 20GB hard for the operating system. So far so good.

Thank you.

Welcome

This blog will contain posts on the things that i experiment on. No specific theme will be there. Just random experiments, mostly Computing and Electronics. Follow up.

Thanks.