<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3648250232562063802</id><updated>2011-09-11T18:26:24.165-07:00</updated><title type='text'>Random Thoughts</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nikeaa.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nikeaa.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>nikeaa</name><uri>http://www.blogger.com/profile/09198305066828737690</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3648250232562063802.post-2829152445172917984</id><published>2009-09-10T14:21:00.000-07:00</published><updated>2009-09-10T14:37:57.450-07:00</updated><title type='text'></title><content type='html'>Been doing some distance calculations using lattitude and longitude. One of the things that I needed to know was the number of miles in a degree of longitude at the equator. The answer is 69.1703234283616.&lt;br /&gt;I was also needing to calculate if two points were within each others radius. For instance if point 1 has a radius of 10 miles, and point 2 has a radius of 25 miles, do the circles that those radii form intersect each other anywhere. The formula for this is below:&lt;br /&gt;&lt;br /&gt;(r1 + r2) ^ 2 &lt;= (clat1 - clat 2) ^ 2 + (clon1 - clon2) ^ 2&lt;br /&gt;&lt;br /&gt;where&lt;br /&gt;lat1 = the latitude of the first point&lt;br /&gt;lat2 = the latitude of the second point&lt;br /&gt;lon1 = the longitude of the first point&lt;br /&gt;lon2 = the longitude of the second point&lt;br /&gt;r1 = the radius from the first point&lt;br /&gt;r2 = the radius from the second point&lt;br /&gt;clat1 = (lat1 * 69.1703234283616)&lt;br /&gt;clat2 = (lat2 * 69.1703234283616)&lt;br /&gt;clon1 = ((lon1 * 69.1703234283616) * cos(lat1))&lt;br /&gt;clon2 = ((lon2 * 69.1703234283616) * cos(lat2))&lt;br /&gt;&lt;br /&gt;Now, since clat1, clat2, clon2, and clon2 all use constants, or lat/lon values of the same point, the calculation results will be the same everytime for a particluar lat/lon pair, so I store the results of these calculation in the database as well, to save calculation time later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3648250232562063802-2829152445172917984?l=nikeaa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nikeaa.blogspot.com/feeds/2829152445172917984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3648250232562063802&amp;postID=2829152445172917984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default/2829152445172917984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default/2829152445172917984'/><link rel='alternate' type='text/html' href='http://nikeaa.blogspot.com/2009/09/been-doing-some-distance-calculations.html' title=''/><author><name>nikeaa</name><uri>http://www.blogger.com/profile/09198305066828737690</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3648250232562063802.post-5323073283976438984</id><published>2009-09-10T07:58:00.000-07:00</published><updated>2009-12-17T17:01:24.705-08:00</updated><title type='text'>Redirecting Non-www Host to www Host in C#</title><content type='html'>Today I was tasked with redirecting all of the pages of a site (we'll call it site.com) without the "www" subdomain (site.com) to the one with the "www" (www.site.com). One of the things I wanted was that if the request was for "site.com/about.html" that it would be redirected to "www.site.com/about.html" not to "www.site.com/index.html". Below is the code I used in the Application_BeginRequest event handler in my global.asax file to accomplish this:&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;if (Request.Url.Host.ToLower() == "site.com") {&lt;br /&gt;&lt;/span&gt;&lt;span style="padding: 10px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Response.Status = "301 Moved Permanently";&lt;br /&gt;Response.AddHeader("Location", Request.Url.ToString().Replace("site.com", "www.site.com"));&lt;br /&gt;Response.End();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;This has the effect that was desired. Each individual page of the site will be redirected from "site.com" to "www.site.com".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3648250232562063802-5323073283976438984?l=nikeaa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nikeaa.blogspot.com/feeds/5323073283976438984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3648250232562063802&amp;postID=5323073283976438984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default/5323073283976438984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default/5323073283976438984'/><link rel='alternate' type='text/html' href='http://nikeaa.blogspot.com/2009/09/redirecting-non-www-host-to-www-host-in.html' title='Redirecting Non-www Host to www Host in C#'/><author><name>nikeaa</name><uri>http://www.blogger.com/profile/09198305066828737690</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3648250232562063802.post-5782985605176652504</id><published>2008-10-29T18:42:00.000-07:00</published><updated>2009-12-17T17:03:10.579-08:00</updated><title type='text'></title><content type='html'>I have been searching the internet to find a free, good quality U.S. zip code database. I have found two options that I may use:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;1. GeoNames.com - This database covers all countries and has over eight million place names. It is available for download or can be accesses via a web service.&lt;br /&gt;2. The TIGER database from the U.S. Census Bureau - This database covers only the United States, but has information down to the address level, so lookups can be done via address. It is available for download, or there are sites that have created web services based on the data.&lt;br /&gt;&lt;br /&gt;Either way, I think I want to have my own database for this data, then I can do however much of whatever I want with it. I will be posting an update when I decide what I am going to use, and as I implement my choice.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3648250232562063802-5782985605176652504?l=nikeaa.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nikeaa.blogspot.com/feeds/5782985605176652504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3648250232562063802&amp;postID=5782985605176652504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default/5782985605176652504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3648250232562063802/posts/default/5782985605176652504'/><link rel='alternate' type='text/html' href='http://nikeaa.blogspot.com/2008/10/my-first-blog-post-woo-hoo-i-have-been.html' title=''/><author><name>nikeaa</name><uri>http://www.blogger.com/profile/09198305066828737690</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
