A tip to access the domain during propagation period

A tip to access the domain during propagation period

When you purchase/change the webhosting for a domain, it requires 24 to 72 hours to be propagated all over the world. There is a simple technique to access this domain during this period. Open the file ‘hosts’ located at this path ‘WINDOWS\system32\drivers\etc\’ and add the ip address and your domain name as shown in given example

64.90.xx.xx example.com

you can also do the same for sub domains

64.90.xx.xx mysql.example.com

Note: The file ‘hosts’ may be readonly if you didn’t touch it before so first change the readonly. In Windows 7, there may be an issue of security while saving, so the simple technique it to open the Notepad with administrative rights and open the ‘hosts’ file from file->open.

Drop Shadows using images – works on all browsers

Drop Shadows using images – works on all browsers

Drop shadow is a very common thing widely used in web designs to make them attractive and pleasant. There are many ways to implement this design in websites.

One of most working implementation for all browsers, is the use of tranparent png images adjusted across the edges of target box. For this, you have to draw a box with shadow and slice it in Adobe Photoshop. You can learn this thing at http://designlovr.com/photoshop-quicktip-2-shadows/

Let see the example for the implementation in webpage.

#page {
	position: relative;
	background: white;
	display: inline-block;
	border: 1px solid;
	margin: 26px 20px 26px;
}
.top-edge {
	background: url("../images/top-edge.png") repeat-x scroll left top
		transparent;
	display: block;
	height: 23px;
	position: absolute;
	top: -12px;
	width: 100%;
}
.left-edge {
	background: url("../images/left-edge.png") repeat-y scroll left top
		transparent;
	display: block;
	height: 100%;
	position: absolute;
	top: 0px;
	left: -14px;
	width: 15px;
}
.right-edge {
	background: url("../images/right-edge.png") repeat-y scroll left top
		transparent;
	display: block;
	height: 100%;
	position: absolute;
	top: 0px;
	right: -14px;
	width: 15px;
}
.bottom-edge {
	background: url("../images/bottom-edge.png") repeat-x scroll left top
		transparent;
	display: block;
	height: 23px;
	position: absolute;
	bottom: -12px;
	width: 100%;
}
.top-left-corner {
	background-image: url("../images/top-left-corner.png");
	background-repeat: no-repeat;
	display: block;
	top: -12px;
	left: -14px;
	height: 23px;
	width: 15px;
	position: absolute;
}
.top-right-corner {
	background-image: url("../images/top-right-corner.png");
	background-repeat: no-repeat;
	display: block;
	top: -12px;
	right: -14px;
	height: 23px;
	width: 15px;
	position: absolute;
}
.bottom-left-corner {
	background-image: url("../images/bottom-left-corner.png");
	background-repeat: no-repeat;
	display: block;
	bottom: -12px;
	left: -14px;
	height: 23px;
	width: 15px;
	position: absolute;
}
.bottom-right-corner {
	background-image: url("../images/bottom-right-corner.png");
	background-repeat: no-repeat;
	display: block;
	bottom: -12px;
	right: -14px;
	height: 23px;
	width: 15px;
	position: absolute;
}

 


<div id="page" align="center">
	
<div class="top-edge"></div>

	
<div class="left-edge"></div>

	
<div class="right-edge"></div>

	
<div class="bottom-edge"></div>

	
<div class="top-left-corner"></div>

	
<div class="top-right-corner"></div>

	
<div class="bottom-left-corner"></div>

	
<div class="bottom-right-corner"></div>


	
<div id="content"> Shadow Sample </div>

</div>

Remember, the box(HTML ELEMENT) for that you want shadow, must have CSS property ‘position: relative;’ and the shadow ELEMENT must be positioned absolutely ‘position: absolute;’. You can adjust the position using left,top,bottom,right css properties. You can also use IMG for this thing with absolute position but that will not a good idea because if image loading fails then your design may be distorted.

The above way is a very time consuming way of implementing the shadow but good thing is, it works fine in all browsers. but you need to slice the images very carefully and always try to decrease the size of image so that loading time should not be affected. Now, Shadows are supported in CSS also but compatibility is a issue for them, because different versions of Internet explorer make problem with them.

Using stylish fonts in website

Using stylish fonts in website

Now you can use your favorite font face in your website using following simple CSS.

<style type="text/css">

@font-face {
    font-family: custom_font;
    src: url('[fontname].eot');
    src: url('[fontname].eot?#iefix') format('embedded-opentype'),
         url('[fontname].woff') format('woff'),
         url('[fontname].ttf') format('truetype'),
         url('[fontname].svg#custom_font') format('svg');
    font-weight: normal;
    font-style: normal;
}

.custom {
 font-family: custom_font;
 }
 </style>

Replace [fontname] with your font name.

Below is the screenshot,

My Computer doesn’t have GPS but maps.google.com can mark my current location. Amazing!!!

My Computer doesn’t have GPS but maps.google.com can mark my current location. Amazing!!!

I found out this thing when I was seeing a contact webpage of a computer shop. Unintentionally, I clicked on “Get Direction” button and it asked for the permission to share my location information with the maps.google.com, I grant it then Google maps showed my current location with the difference of 15 to 20 feet as normally seen in GPS devices. I opened the guide of my laptop and searched about GPS or other location sensor device but didn’t find anything related to this topic. I went to my old PC and try this thing and it gives me the same location. This thing was amazing to me. A simple idea came to my mind that it would probably be a topic of IP Addressing but how? This question is very important. I tried this on Firefox too. Firefox asked for permission and there was also a link about geolocation http://www.mozilla.org/en-US/firefox/geolocation/. I went through it and find that my simple idea was right.
Firefox geolocation guide says about its working,
“Firefox gathers information about nearby wireless access points and your computer’s IP address. Then Firefox sends this information to the default geolocation service provider, Google Location Services, to get an estimate of your location. That location estimate is then shared with the requesting website.”

The most important thing for consideration is that if we are tracking by unauthorized parties? so, the answer is “NO” as stated in the guide,

“Firefox only requests a location when a website makes a request, and only shares your location when the user has approved the request. Firefox does not track or remember your location as you browse.”

Read this link for more information http://www.mozilla.org/en-US/firefox/geolocation/.

Now, Let’s play with a javascript code,
In Google Chrome, press Crtl + J and enter this code in console. It will ask for permission and display you an object in console with your longitude and latitude.

navigator.geolocation.getCurrentPosition(function(position){
console.log(position);
});

You can use this in your web applications to implement functionalities related to geolocation.
Read this link for more information about the working http://compnetworking.about.com/od/traceipaddresses/f/ip_location.htm.

Query to study Transactional Changes in MSSQL Database

Query to study Transactional Changes in MSSQL Database

When you have a Management System or any other type of Database application without technical documentation, you may be having a difficulty to find out and making the transactional flow of a procedure. There is a way to make this work out easy. You can use following query to run after a transaction. This query will give you the name of tables that will be affected with respect to time. Then you can easily judge the flow of a transaction. Always record the time at every trial.

 select
 t.name
 ,last_user_update
 ,user_seeks
 ,user_scans
 ,user_lookups
 ,user_updates
 ,last_user_seek
 ,last_user_scan
 ,last_user_lookup
 from
 sys.dm_db_index_usage_stats i JOIN
 sys.tables t ON (t.object_id = i.object_id)
 where
 database_id = db_id()
 ORDER BY last_user_update DESC
Query to study Transactional Changes in MSSQL Database

Find out the size of MSSQL Database using SQL

This MSSQL Query returns the records containing the sizes of log, primary data files and secondary data files for a database. Change the DatabaseName in where clause with your database.

SELECT DB_NAME(database_id) AS DatabaseName,
 Name AS Logical_Name,
 Physical_Name, CONVERT(VARCHAR,(size*8)/1024) + ' MB' AS Size
 FROM sys.master_files
 WHERE DB_NAME(database_id) = 'DatabaseName';

You can also find out the sizes of all databases using this query

SELECT
 DB_NAME(database_id) AS DatabaseName,
 CONVERT(VARCHAR,Sum((size*8)/1024)) + ' MB' AS Size
 FROM sys.master_files
 GROUP BY database_id

You can also do the same task with this transact-sql built-in function

sp_helpdb 'DatabaseName'

To learn more about it, visit at http://msdn.microsoft.com/en-us/library/ms178568.aspx