Sunday, July 22, 2012

Reloading a Page using JavaScript

Ways to reload a page using Java script.

When doing web development if you need to reload / refresh a page using Java script, you can use one of the following three methods.

  1. <script language="javascript" type="text/javascript">
  2.     function ReloadMethod1() {
  3.         window.location.href = window.location.href;
  4.     }
  5.     function ReloadMethod2() {
  6.         window.location.reload();
  7.     }
  8.     function ReloadMethod3() {
  9.         history.go(0);
  10.     }
  11. </script>
  12. <input type="button" value="Reload" onclick="window.location.href=window.location.href" />
  13. <%--Calling Javascript function on button click.--%>
  14. <input type="button" value="Reload" onclick="ReloadMethod2()" />
  15. <input type="button" value="Reload" onclick="window.location.reload()" />
  16.  
  17. <!-- ASP Buttons -->
  18. <asp:Button ID="Button1" runat="server" Text="Reload" OnClientClick="window.location.href=window.location.href" />
  19. <%--Calling Javascript function on button click.--%>
  20. <asp:Button ID="Button2" runat="server" Text="Reload" OnClientClick="ReloadMethod2()" />
  21. <asp:Button ID="Button3" runat="server" Text="Reload" OnClientClick="ReloadMethod3()" />

Sunday, July 08, 2012

Enabling Windows Aero

Recently suddenly my computer lost Windows Aero effects. After trying out many things I found that it is due to the Log Me In mirror driver.

It seems Log Me In mirror driver is not compatible with Windows Aero effects so if you also lost Windows Aero and you have Log Me In installed on your machine to activate Aero back first try disabling “LogMeIn Mirror Driver” and restart your machine.

This can be done by going to Device Manager by clicking,

Start –> Control Panel –> Administrative Tools.

Then double click on Computer Management. Now in the Computer Management window click on the Device Manager.

Another way to reach the Device Manager is by pressing the Windows key and the Pause key in your keyboard simultaneously.

Now expand the Display Adapters and right click on LogMeIn Mirror Driver and click on Disable.

Device Manager

This will disable the Log Me In mirror driver enabling Windows Aero after you restart your machine.

If you cannot see Aero effects after the restart search for the word Aero in your start menu and click on the Aero troubleshooter and follow the wizard to get Aero effects back.

Aero

Sunday, July 01, 2012

Creating Database Table and Moving Data

When the need comes to port tables from one server / database to another server / database there is an easy way than creating the tables manually and importing data into table.
 
By using the following query you can import the table structure and the data of the required table.
  1. SELECT *
  2. INTO [DestinationServerName\SQLServerInstanceName].[DestinationDatabaseName].[OwnerName].[DestinationTableName]
  3. FROM [SourceServerName\SQLServerInstanceName].[SourceDatabaseName].[OwnerName].[SourceTableName]
 
Using the above method you can transfer tables between different databases, Server instances or different database servers.
Consider the following example in which I am transferring the Customers table from Northwind database to my Test database.
 
  1. SELECT *
  2. INTO [Test].[dbo].[Customers]
  3. FROM [Northwind].[dbo].[Customers]
 
Here SELECT statement will behave the same way as in a normal SELECT * FROM TableName statement meaning you can use all the techniques used in SELECT statements to filter the data needed to be ported. For example following query will only bring customers who are from UK.
  1. SELECT *
  2. INTO [Test].[dbo].[Customers]
  3. FROM [Northwind].[dbo].[Customers]
  4. WHERE Country = 'UK'
 
One thing to remember is, this method will not import the keys, meaning if you had a primary key set to CustomerId it will not exist in your new table. So you need to add the keys (primary and secondary) to the new table to match it with the source table. If you had identity specification turned on in your source table this will set it for you, so you do not need to set it again.

Monday, June 25, 2012

Painted Desert – Arckaringa South Australia

One of the most famous places in Australian outback is the painted desert. Which consists of different beautiful landscapes which was formed millions years ago while it way covered by water when it was under the sea. Since these attractions are in remote locations for some of us it will be difficult to find them. I agree some of the attractions are in the guide books but I assure you they are not that easy to find when you are on your own without any phone facilities or mobile data connections to browse maps. So for people who are interested in visiting these places I hope this article will help them to locate some of the attractions. Remember to cache your GPS or maps before you leave town or simply buy a detailed map.

All these places are accessible through unsealed / dirt roads and it is always better if you have an AWD or a 4WD. But if you are travelling in dry whether and if you are cautious you will be able to visit all of them in a 2WD as well. Few other things to remember when going to outback places are mentioned in my other post.

The Breakaways

The breakaways has colourful small hills which are broken away from Stuart Range, hence their name “The Breakaways”

You will not miss the road to the lookout since you need to turn right just before the Dingo fence when you travel from Coober Pedy to Oodnadatta. There will also be road signs for this.

Map


View Larger Map

Dingo Fence

Dingo fence or Dog fence is holding the title of longest man made object in the world having a length of 5614 kms. This runs from Surfaces Paradise in Queensland to Bight in near Western Australia border. This was put up to protect the live stock on the south side of the country from the northern predators.

You can have a look into this if you travel about 15 kms from Cobber Pedy to Oodnadatta.

 

Map


View Larger Map

Painted Desert

Painted desert lookout is also giving you a great view onto the vivid coloured mountains. There is a walk of about 15-20 minutes after parking your car. The way is marked in a nature friendly manner by collecting stones to make up arrows as seen in my photos. Some parts of the walk is bit challenging so if you do not like walking or afraid of heights or slopes best is to wait in the car.

Map


View Larger Map

On your way to these you will encounter other interesting natures creations as well.

Monday, June 18, 2012

Samsung Galaxy S2 not Connecting to Kies

Last week I spent few hours to figure out why Samsung Galaxy S2 was not connecting to Samsung Kies through USB cable. I could browse phone contents using Windows Explorer, transfer files, music and photos, even I could use Kies Air but Kies on my computer kept on ignoring the phone. It always displayed connecting but never got connected.

To resolve the connection problem several times I used the connection troubleshooter which comes with Kies, reinstalled Kies, updated Kies, restarted phone and computer but had no success. Then suddenly I figured this was happening because the phone is in wrong connection mode. By some application or setting the USB connection mode was set to Camera (PTP). Because of this Kies could not connect with the phone. To correct the connection problem simply I had to change the connection mode to Media Device (MTP).

This can be done by accessing the notification area.

Picture1Picture2Screenshot_2012-06-18-23-07-23

Select Media device (MTP) to correctly connect to Kies.

Screenshot_2012-06-18-23-07-47

Saturday, June 09, 2012

Quarry Road Lookout – Beetaloo South Australia

If you are travelling in Beetaloo and also if you are enjoying the views of nature a good place to visit is Quarry road lookout. Quarry road it self is having some good views in your way. If you have sometime to spend there is a table and chair for you to sit down and have some food. Another good thing is you do not have to walk, you can park your car right in the lookout and enjoy.

Map


View Larger Map

Tuesday, June 05, 2012

Things to Remember when Travelling in Outback and Remote Places

I thought to share with you few things to remember while travelling in remote places. I know most of you are aware of these but thought to put a post since most of us forgets these even though we know these.

  • Always take sufficient amount of drinking water to survive for about 2 days.
  • Always take sufficient food supplies to survive for about 2 days.
  • Before starting your trip check your spare tyre.
  • Before leaving each town check your fuel level and calculate the fuel required to reach your next town.
  • Check for the fuel station opening and closing times of the town you are planning to visit.
  • Get a fly mask or at least carry some water in a bottle to use on face to escape the fly attack while in outback.
  • If you are not 100% familiarized with your vehicle do not speed too much.
  • Always watch for animals.
  • Take a blanket or two to keep you warm in case the unforeseen happen.
  • If you are taking any medication do not forget to take medicine.
  • It is always better to have a first aid kit while you are travelling.
  • If you have knowledge to repair then a tool kit will be handy.

I know there are many more things, so feel free to comment.

Hope these helps.