<?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-8392817326307478609</id><updated>2011-07-08T13:10:50.135-04:00</updated><category term='AJAX'/><category term='Visual Studio'/><category term='VB.NET'/><category term='Science/Technology'/><category term='Tips/Tricks'/><category term='SQL'/><category term='JavaScript'/><category term='CSS'/><category term='HTML'/><category term='SQL Server'/><title type='text'>Get The Rooster</title><subtitle type='html'>Thoughts, rants, ideas, insights, and concepts by an odd 20-something web applications programmer.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8392817326307478609.post-4247251712228373017</id><published>2010-04-17T08:20:00.002-04:00</published><updated>2010-04-17T08:39:19.034-04:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jfzt1ETrnxk/S8mnpw7norI/AAAAAAAAAhQ/P_1u2mP0yzg/s1600/img_0039.jpg"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 230px; height: 171px;" src="http://2.bp.blogspot.com/_jfzt1ETrnxk/S8mnpw7norI/AAAAAAAAAhQ/P_1u2mP0yzg/s200/img_0039.jpg" alt="" id="BLOGGER_PHOTO_ID_5461080359114875570" border="0" /&gt;&lt;/a&gt;&lt;a href="http://www.cnn.com"&gt;asdf&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-4247251712228373017?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/4247251712228373017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=4247251712228373017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/4247251712228373017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/4247251712228373017'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2010/04/asdf.html' title=''/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_jfzt1ETrnxk/S8mnpw7norI/AAAAAAAAAhQ/P_1u2mP0yzg/s72-c/img_0039.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8392817326307478609.post-5698767964955077559</id><published>2009-09-23T09:17:00.005-04:00</published><updated>2009-09-23T09:25:57.898-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Using Variabled TOP Select Statements</title><content type='html'>After a day of trying to figure out how to get a stored procedure to work for me, I ran across something that makes my life a heck of a lot easier.  I always assumed this didn't work because I could never figure out the syntax, but luckily it does!  Ever need to select a certain number of rows based off a variable?  You can use the following to do just that:&lt;br /&gt;&lt;br /&gt;&lt;div style="padding:5px;border:1px solid gray;background-color:lightGray;"&gt;SELECT TOP (@top) * FROM &amp;lt;table&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-top:15px;"&gt;Now, if you need a certain number of random rows you can also use the following:&lt;/div&gt;&lt;div style="padding:5px;border:1px solid gray;background-color:lightGray;margin-top:15px;"&gt;SELECT TOP (@top) * FROM &amp;lt;table&amp;gt; ORDER BY NEWID()&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note: This is only applicable in SQL Server 2005+.  2000 you need to use dynamic SQL or a subselect.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-5698767964955077559?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/5698767964955077559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=5698767964955077559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/5698767964955077559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/5698767964955077559'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/09/using-variabled-top-select-statements.html' title='Using Variabled TOP Select Statements'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-8657982577524920192</id><published>2009-09-14T13:33:00.009-04:00</published><updated>2009-09-16T10:32:11.190-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>How To Fix: AJAX Isn't Returning Database Changes Without Clearing The Cache</title><content type='html'>I've recently been delving into AJAX, getting away from MicroSoft's built in framework/library for Visual Studio.  First, &lt;strike&gt;two&lt;/strike&gt; one complaint&lt;strike&gt;s&lt;/strike&gt; about AJAX:&lt;div&gt;&lt;ul&gt;&lt;li&gt;What a pain to have to have all different files for every AJAX call.  Why can't we do methods in one big file?!&lt;/li&gt;&lt;li&gt;&lt;strike&gt;Why are we still calling on ASP or PHP files?  In Windows Vista/7, you have to specially set up IIS to work well with these files.  We should be hitting class files directly or aspx files.  Get with the times!&lt;/strike&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Now that that's over, let's move on.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I had a list of recipes that when the user scrolled over the recipe name I wanted a little preview of the recipe image to pop up next to it (hence the previous post).  The AJAX was working fine, but I noticed that when I changed an image file name in the database and then reloaded the page, the new image didn't reflect for that recipe until I cleared my cache.  After a day of struggling, I found a post (which I lost the URL in my taste of victory) that cleared things up for me somewhat.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The browsers seem to cache the URL, which holds the ID of the recipe I want the image for, and then returns what it &lt;i&gt;expects &lt;/i&gt;the database to return.  Dastardly!  So, to avoid this, I simply added another variable to the URL that holds JavaScript's Date.getTime() value, or the value of milliseconds since like 1/1/1901.  Therefore, it's always changing and will always return the correct image!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border:1px solid gray;background-color:lightGray;padding:5px;"&gt;var currDate = new Date();&lt;br /&gt;var url = 'directory/aspPageName.asp?var1=' + recipeID  + '&amp;amp;rdm=' + currDate.getTime();&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;UPDATE: After talking to a colleague, I found out you can in fact hit an ASPX page! Just put the code in the page load sub and nothing in the html part.  Awesome!  However, my first gripe still stands, though he pointed out you can pass a parameter that the page load then reads and directs to another sub.  Not bad, but not perfect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-8657982577524920192?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/8657982577524920192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=8657982577524920192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/8657982577524920192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/8657982577524920192'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/09/how-to-fix-ajax-isnt-returning-database.html' title='How To Fix: AJAX Isn&apos;t Returning Database Changes Without Clearing The Cache'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-7036753124121500439</id><published>2009-09-09T12:52:00.010-04:00</published><updated>2009-09-15T10:13:07.052-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><title type='text'>Getting The Pixel Width And Height Of A String</title><content type='html'>I've recently been making an application that required a popup image to dynamically appear beside text, which is variable in length. Since I always want the image to show up 15px to the right of the text, I needed to get the width of the string. What I could do (if you are positive of the font face it's show in) is take the average width of each character, get the number of characters and get the width that way. However, you throw in a few "..." or move between browsers that have differeing rendering for the same font and you may be SOL depending on your application.&lt;br /&gt;&lt;br /&gt;I was looking around the web for a solution and found the following &lt;a href="http://www.codingforums.com/archive/index.php/t-100367.html"&gt;article&lt;/a&gt;. The article had an example with an existing TD, however, what you're doing, and what I did, may not be in a TD. So I came up with the following to make it dynamic:&lt;br /&gt;&lt;br /&gt;&lt;div style="BORDER-BOTTOM: gray 1px solid; BORDER-LEFT: gray 1px solid; PADDING-BOTTOM: 5px; BACKGROUND-COLOR: lightgray; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BORDER-TOP: gray 1px solid; BORDER-RIGHT: gray 1px solid; PADDING-TOP: 5px"&gt;function GetStringPixelWidth(str)&lt;br /&gt;{&lt;br /&gt;var elem = document.createElement('SPAN');&lt;br /&gt;elem.innerHTML = str;&lt;br /&gt;elem.style.visibility = 'hidden';&lt;br /&gt;document.body.appendChild(elem);&lt;br /&gt;var w = elem.offsetWidth;&lt;br /&gt;document.body.removeChild(elem);&lt;br /&gt;return w;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;One must append it to the document so the offsetWidth is actually calculated. I added it to the body, but you can add it to the parentElement that str is coming from so you can get the width of wrapping text.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;UPDATE: I found that in Mozilla FireFox, adding the TD doesn't work.  In light of this, I've updated the code to instead add a SPAN element.  I'm thinking FF doesn't know how to handle adding a single TD into the document; it kept returning 2 as the offsetWidth.  It didn't matter if I created TABLE and TR elements and nested them.  Always 2.  With the span, it's still a dynamic width, unlike DIVs, and can be independently added to the page with no issues.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-7036753124121500439?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/7036753124121500439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=7036753124121500439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/7036753124121500439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/7036753124121500439'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/09/getting-pixel-width-and-height-of.html' title='Getting The Pixel Width And Height Of A String'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-1843086466293555032</id><published>2009-07-14T09:03:00.009-04:00</published><updated>2009-07-21T16:55:37.585-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><title type='text'>Missing __doPostBack Method On ASP.NET Page</title><content type='html'>Sometimes, ASP.NET programming has called for a JavaScript call to .NET's JavaScript function __doPostBack. This function exists on (almost) every .aspx page with controls that would create a postback. Once in a while, however, you won't have a control that creates a postback (or for some other odd reason) and the __doPostBack function won't be available. In these situations, you can create your own custom method.&lt;div&gt;&lt;ol&gt;                &lt;li&gt;Add two hidden fields to hold the postback information.  You can add these anywhere on the page.&lt;br /&gt;&lt;br /&gt;               &lt;div style="background-color: #e3e3e3; border: 1px solid gray; padding: 5px;"&gt;&amp;lt;asp:HiddenField ID="__EVENTTARGET2" runat="server" /&amp;gt;&lt;br /&gt;&amp;lt;asp:HiddenField ID="__EVENTARGUMENT2" runat="server" /&amp;gt;&lt;br /&gt;               &lt;/div&gt;&lt;/li&gt;&lt;br /&gt;           &lt;li&gt;Create a custom JavaScript __doPostBack method. I often call it __doPostBack2 just incase for some reason the original is created. Don't want to confuse the application.  form1 is the form name.  It might be ASPForm or something.  Best way to find out is to view the source of the page and use that.&lt;br /&gt;&lt;br /&gt;               &lt;div style="background-color: #e3e3e3; border: 1px solid gray; padding: 5px;"&gt;function __doPostBack2(target,argument)&lt;br /&gt;{&lt;br /&gt;                       &lt;div style="margin-left:20px;"&gt;var f = document.getElementById('form1');&lt;/div&gt;&lt;div style="margin-left:20px;"&gt;document.getElementById('__EVENTTARGET2').value = target;&lt;/div&gt;&lt;div style="margin-left:20px;"&gt;document.getElementById('__EVENTARGUMENT2').value = argument;&lt;/div&gt;&lt;div style="margin-left:20px;"&gt;f.submit();&lt;/div&gt;}&lt;br /&gt;               &lt;/div&gt;&lt;br /&gt;           &lt;/li&gt;&lt;li&gt;Add the postback function to the element in question.&lt;br /&gt;&lt;br /&gt;               &lt;div style="background-color: #e3e3e3; border: 1px solid gray; padding: 5px;"&gt;&amp;lt;input id="txt1" type="text" ondblclick="javascript:__doPostBack2(this.id,this.value);" /&amp;gt;&lt;br /&gt;               &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;Next up: Adding custom events to controls.&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/8392817326307478609-1843086466293555032?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/1843086466293555032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=1843086466293555032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/1843086466293555032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/1843086466293555032'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/07/missing-dopostback-method-on-aspnet.html' title='Missing __doPostBack Method On ASP.NET Page'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-1362118013338875692</id><published>2009-07-09T09:48:00.002-04:00</published><updated>2009-07-09T09:52:31.489-04:00</updated><title type='text'>Finding Programming Answers</title><content type='html'>Can't figure out a programming problem?  Receiving an error message that gives you absolutely no clue what is actually wrong?  Let me fill you in on a trade secret: Google it.  Google everything.  It's your best friend.  That's right, copy the error message or a few keywords to describe your situation and slap that SOB into Google.&lt;br /&gt;&lt;br /&gt;If that doesn't fix your problem, join a forum. There are plenty of free, useful forums.  I like to use both &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/categories" target="_blank"&gt;Microsoft's MSDN forum&lt;/a&gt; and &lt;a href="http://www.vbforums.com/" target="_blank"&gt;VBForums&lt;/a&gt;.  Both have proven to be extremely helpful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-1362118013338875692?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/1362118013338875692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=1362118013338875692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/1362118013338875692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/1362118013338875692'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/07/finding-programming-answers.html' title='Finding Programming Answers'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-130911438637346089</id><published>2009-07-07T07:54:00.005-04:00</published><updated>2009-07-07T08:12:30.248-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Moving Elements With Javascript</title><content type='html'>Moving HTML objects, or elements, is a very useful tool and can often replace annoying Flash.  In this case, I'll be discussing sliding an element using JavaScript.  I recently had to do this quite a bit while helping recreate my girlfriend's online portfolio and I decided to make a quick post about it.&lt;br /&gt;&lt;br /&gt;There are two things you need to set up first:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If necessary, give an ID to the element you wish to move (this is important if you're not using the element itself to initiate the moving process, which if you are, you can just use the "this" JavaScript keyword to pass a reference to the element).&lt;/li&gt;&lt;li&gt;Set the element's CSS position property to absolute so it can be moved.  Leaving it as default or relative will create some very frustrating times for you.  Though you can set this in JavaScript when you call on the move function, I suggest setting up your page with the element already having this property since setting it at run time can screw up your page layout&lt;/li&gt;&lt;/ol&gt;Once they have been set up, moving an object really isn't that hard.  Basically, you need to move the element a certain number of pixels every X number of milliseconds.  Let's say you want an element to move 200 pixels to the right when clicked.  You can use the following HTML:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; background-color: rgb(227, 227, 227);padding:5px;"&gt;&amp;lt;div style="width:200px;height:200px;background-color:blue;position:absolute;" onclick="javascript:Move(this);"&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;On click you can now fire this JavaScript function:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; background-color: rgb(227, 227, 227);padding:5px;"&gt;var currElem = null;&lt;br /&gt;var intervalID = null;&lt;br /&gt;var moveInterval = 10;&lt;br /&gt;var totalMovement = 200;&lt;br /&gt;var totalMoved = 0;&lt;br /&gt;&lt;br /&gt;function Move(elem)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt;currElem = elem;&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; totalMoved = 0;&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; intervalID = setInterval('MoveElem()', 10);&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function MoveElem()&lt;br /&gt;{&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; if (totalMoved &gt;= totalMovement)&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; {&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 30px;"&gt; cancelInterval(intervalID);&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; }&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; else&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; {&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 30px;"&gt; totalMoved += 10;&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 30px;"&gt; currElem.style.left = totalMoved + 'px';&lt;/span&gt;&lt;br /&gt;    &lt;span style="margin-left: 15px;"&gt; }&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;We set the currElem global variable because you can't pass variables to a method using an interval or timer.  Then, once the is set, it's just a matter of incrementing the left amount (pushing the element to the right) until it's greater than or equal to the total amount you want it to move.  You can then increase or decrease the top to get a diagonal and many other things.  Varying the timeout time (in this case 10 milliseconds) and the interval distance will make the movement clunkier or smoother, depending on what you're looking for.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-130911438637346089?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/130911438637346089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=130911438637346089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/130911438637346089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/130911438637346089'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/07/moving-elements-with-javascript.html' title='Moving Elements With Javascript'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-2874322333372446656</id><published>2009-06-30T12:09:00.008-04:00</published><updated>2009-09-15T10:11:20.968-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><title type='text'>Custom Link In Gridview</title><content type='html'>One control I try to use as much as possible is the Gridview.  Quick, simple and customizable, for it's purpose, to the 'T'.  I do wish that the Gridview allowed more customization in the area of display.  Several times I've a display that required full width column spans throughout the table for some reason and I've had to resort to building my own HTML and injecting it into a div or literal control.  But, when I can, I use the Gridview.&lt;br /&gt;&lt;br /&gt;One hold back is that the Gridview has the command buttons, which is Update, Delete, etc, but only if tied to a data source object, which I'm not sure if anyone uses.  I often find that I need to put in a "View" linkbutton.  But how do we capture the linkbutton postback and then tie that to the correct ID of the row and execute what we need to?&lt;br /&gt;&lt;br /&gt;Let's say we have a program that develops tests and we have a Gridview that displays a list of all tests: Name (bound), Date Created (bound), View (item template &gt; link button).  Let's name the View linkbutton lnkView for convention-sake.  If there's one thing that good security calls for it's almost NEVER showing database IDs.  Just not a good idea.  So, where do we store the test's ID that we want to view for each row?  Easy, in the link button.  You can do the following to rename each lnkView to hold the ID of the given test of that row, given that ds is a DataSet holding your data from the database:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;Protected Sub GridView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.DataBound&lt;div style="margin-left:15px;"&gt;Dim rowIndex As Integer = 0&lt;br /&gt;For Each gvr As GridViewRow In GridView1.Rows&lt;div style="margin-left:15px;"&gt;Dim lnk As LinkButton = CType(gvr.FindControl("lnkView"), LinkButton)&lt;br /&gt;lnk.ID = "lnkView" + ds.Tables(0).Rows(rowIndex)("ID").ToString&lt;br /&gt;rowIndex += 1&lt;/div&gt;Next&lt;/div&gt;End Sub&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now that all of your lnkViews have been renamed, you can now capture it when a user clicks on it.  In the page load event, wrapped in a IsPostBack If statement, you can enter this to determine if the lnkView has been clicked and grab the ID of the test that it corresponds to:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;div style="margin-left:15px;"&gt;If IsPostBack Then&lt;div style="margin-left:15px;"&gt;If Request("__EVENTTARGET").ToString.Contains("lnkView") Then&lt;div style="margin-left:15px;"&gt;Dim TestID As Integer = CInt(Replace(Request("__EVENTTARGET").ToString, "lnkView", ""))&lt;/div&gt;End If&lt;/div&gt;End If&lt;/div&gt;End Sub&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;We kept "lnkView" in the lnkView's ID so we can easily decide if the postback target is the link button we're looking for.  The Request("__EVENTTARGET") grabs the ID of the control that caused the postback, in this case the lnkView linkbutton.  The Request might return the ClientID so it might looks something like:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;ctl00$GridView1$ctl02$lnkView181&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;but you can just parse it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-2874322333372446656?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/2874322333372446656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=2874322333372446656' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/2874322333372446656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/2874322333372446656'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/06/custom-link-in-gridview.html' title='Custom Link In Gridview'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8392817326307478609.post-2284036348555554668</id><published>2009-06-29T13:36:00.005-04:00</published><updated>2009-06-30T12:32:28.794-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>CSS Z-Index</title><content type='html'>One CSS rule (as I have come to learn them to be called) that is a pain in the ass is the Z-Index.  Why?  Because it works the way you want it about 60% of the time every time.  Besides the obvious movie reference (Anchorman for anyone not familiar), it's just a confusing rule.  Basically, it allows the programmer to stack elements on the Z-Index, as the rule name so aptly describes.  So here are some basic guides to Z-Index.&lt;ol&gt;&lt;li&gt;You should try any other possible method to get the stacking order you wish before using Z-Index&lt;/li&gt;&lt;li&gt;If Z-Index is the only way to go, every stacking element must have the CSS property 'position' set to 'absolute' or 'relative'&lt;/li&gt;&lt;li&gt;The lower the Z-Index, the lower in the stack it goes (less visible).&lt;/li&gt;&lt;/ol&gt;That's about it.  Again, I hate Z-Index, but I do find that sometimes you have to use it...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-2284036348555554668?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/2284036348555554668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=2284036348555554668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/2284036348555554668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/2284036348555554668'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/06/css-z-index.html' title='CSS Z-Index'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-7215548937057603915</id><published>2009-06-25T08:19:00.007-04:00</published><updated>2009-06-30T12:34:01.033-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Recursion With A Cursor</title><content type='html'>Recently, I had to create a SQL recursion to delete nested data.  Recursion doesn't come around often, but when it does and you use it correctly, it's so good.  Basically, you have a block of code that calls itself.  For example, I had to use it because I had nested data, which means that I had a hierarchy of data that related to each other.  I had the parent, the Item Type (IT), and then X number of Item Groups (IG).  I cannot nest ITs, but I could nest IGs, so I might come up with a structure like so:&lt;br /&gt;&lt;br /&gt;-IT&lt;br /&gt;  &lt;span style="padding-left:15px;"&gt;&lt;/span&gt;-IG1&lt;br /&gt;  &lt;span style="padding-left:15px;"&gt;&lt;/span&gt;-IG2&lt;br /&gt;     &lt;span style="padding-left:30px;"&gt;&lt;/span&gt;-IG3&lt;br /&gt;     &lt;span style="padding-left:30px;"&gt;&lt;/span&gt;-IG4&lt;br /&gt;        &lt;span style="padding-left:45px;"&gt;&lt;/span&gt;-IG5&lt;br /&gt;     &lt;span style="padding-left:30px;"&gt;&lt;/span&gt;-IG6&lt;br /&gt;-IT&lt;br /&gt;  &lt;span style="padding-left:15px;"&gt;&lt;/span&gt;-IG7&lt;br /&gt;  &lt;span style="padding-left:15px;"&gt;&lt;/span&gt;-IG8&lt;br /&gt;-IT&lt;br /&gt;&lt;br /&gt;In the database, I have one table for each IG which has the unique field TCSID as the primary key.   To show relationships in the table, rather then creating another linking table, I have another column called ParentTCSID, which would contain the parent IG's ID of the given IG.  In the example above, that would mean that if IG2's TCSID is 12, then IG3's and IG4's ParentTCSID would be set to 12.&lt;br /&gt;&lt;br /&gt;If one were to delete IG2, I would need to delete all children, that includes IG3,4,5,6.  If we were only going one level deep, I could just run something like:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;DELETE FROM IGTable WHERE ParentTCSID = 12&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;However, because IG5's ParentTCSID is actually the TCSID of IG4, that won't work. &lt;br /&gt;So, we use recursion.  Basically, we build a list of children of IG2, loop through them, delete them, then use the current child's TCSID to call on the same stored procedure to delete all the children for the current child, such as the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;ALTER PROCEDURE [dbo].[usp_DeleteIG]&lt;br /&gt;@TCSID int&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;&lt;br /&gt;--generate child list&lt;br /&gt;DECLARE @child TABLE(ID bigint)&lt;br /&gt;INSERT INTO @child&lt;br /&gt; SELECT TCSID FROM IGTable WHERE ParentTCSID = @TCSID&lt;br /&gt; &lt;br /&gt;--curs through&lt;br /&gt;DECLARE childCurs CURSOR &lt;span style="color:red;"&gt;LOCAL&lt;/span&gt;&lt;br /&gt; FOR SELECT ID FROM @child&lt;br /&gt;OPEN childCurs&lt;br /&gt;DECLARE @currID bigint&lt;br /&gt;FETCH NEXT FROM childCurs INTO @currID&lt;br /&gt;WHILE @@FETCH_STATUS = 0&lt;br /&gt;BEGIN&lt;br /&gt; --delete item&lt;br /&gt; DELETE FROM IGTable WHERE TCSID = @currID&lt;br /&gt;&lt;br /&gt; --recurs&lt;br /&gt; EXEC usp_DeleteIG @currID&lt;br /&gt;&lt;br /&gt; FETCH NEXT FROM childCurs INTO @currID&lt;br /&gt;END&lt;br /&gt;CLOSE childCurs&lt;br /&gt;DEALLOCATE childCurs&lt;br /&gt;&lt;br /&gt;--delete group&lt;br /&gt;   DELETE FROM IGTable WHERE TCSID = @TCSID&lt;br /&gt;END&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Note the red LOCAL in the code.  This is the key to the entire post.  If you were to run the above without it, you would get an error saying that the cursor childCurs is already open.  This is because, by default, cursors are global, so when you open it on the first run then recurse, when you try to open it again, SQL Server already thinks it's open.  By putting in the LOCAL keyword, the cursor only exists to the particular instance of the running code, thus allowing multiple cursors of the same name to be open at the same time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-7215548937057603915?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/7215548937057603915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=7215548937057603915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/7215548937057603915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/7215548937057603915'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/06/sql-recursion-with-cursor.html' title='SQL Recursion With A Cursor'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-1069983424520396328</id><published>2009-06-24T11:37:00.010-04:00</published><updated>2009-06-30T12:38:02.479-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Centering A Page Layout Using CSS</title><content type='html'>One thing that often stumps new developers is how to center a page layout for a site.  It is often over looked by rookies that display changes when you change the window size, and putting a margin-left CSS tag will not show a centered page layout when you increase or decrease the window size.  So, in order to have a centered page layout that will work in any browser at any resolution, you can use the following:&lt;div&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;&amp;lt;style&amp;gt;&lt;br /&gt;#frame&lt;br /&gt;{&lt;br /&gt;&lt;span style="padding-left:20px;"&gt;position:absolute;&lt;br /&gt;&lt;span style="padding-left:20px;"&gt;left:50%;&lt;br /&gt;&lt;span style="padding-left:20px;"&gt;width:780px;&lt;br /&gt;&lt;span style="padding-left:20px;"&gt;margin-left:-390px;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id="frame"&amp;gt;&lt;br /&gt;&lt;span style="padding-left:20px;"&gt;[page content]&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;position:absolute;&lt;/i&gt; pulls the div up out of relative positioning, allowing you to place it anywhere.  The 'left:50%' puts the left edge of the div in the center of the page.  We then set the width of the div, in this case 780px.  Then, to center the div's  center to the page's center, we pull back the left margin by &lt;i&gt;half&lt;/i&gt; the width of the div; in this case -390px.  If the width were set to 700px, the margin-left would then be -350px.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;That's it.  Easy, pretty, and works cross-browser/resolution.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-1069983424520396328?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/1069983424520396328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=1069983424520396328' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/1069983424520396328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/1069983424520396328'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/06/centering-page-layout-using-css.html' title='Centering A Page Layout Using CSS'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-4250198610351954026</id><published>2009-06-22T12:52:00.012-04:00</published><updated>2009-06-30T12:37:32.119-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips/Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Text Output Parameters For SQL Server 2005 - Tip</title><content type='html'>I've decided to change this blog into a programming tool and publish tips, tricks and insights.  For my first post in my newly formatted blog, I decided to keep it simple and reveal a little tip for people who might have suffered the same confusion. If you are hitting a SQL Server 2005 (and perhaps 2000) and are receiving a text output parameter, you might have received perhaps only the first letter of your expected output, even if when you run the query inside the DBMS it returns the entire string.  The answer: the size property.  It seems the default size for a varchar or nvarchar output parameter is only one character.  So, to receive any and all returned text, you must set the size, such as the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color:#e3e3e3;border:1px solid gray;padding:5px;"&gt;Dim retSupp As SqlParameter = cmd.Parameters.Add("@@returnMsg", SqlDbType.VarChar)&lt;br /&gt;retSupp.Size = Integer.MaxValue&lt;br /&gt;retSupp.Direction = ParameterDirection.Output&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If you expect a crazy large string in return, you can changed Integer.MaxValue to Long.MaxValue and get the same effect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-4250198610351954026?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/4250198610351954026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=4250198610351954026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/4250198610351954026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/4250198610351954026'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2009/06/text-output-parameters-for-sql-server.html' title='Text Output Parameters For SQL Server 2005 - Tip'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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-8392817326307478609.post-7443014697277149868</id><published>2008-12-02T21:34:00.006-05:00</published><updated>2008-12-11T10:59:42.225-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Science/Technology'/><title type='text'>PC vs. Mac</title><content type='html'>I have always been an MS boy. I went through a phase where I hopped the wagon and talked trash on them, but for the most part, I always respected MS and what they have done for technology. For the longest time, Mac users were a quiet group. It seems that recently, however, that they have been growing bolder with the famous "I'm a Mac" commercials. Because of this I have had to defend my position as an MS boy to many Mac users and I have come up with the following reasons why Macs really aren't better than PCs:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Reliability - Hardware - Most people's biggest gripe with the PC is that it's unreliable and it crashes too often. Granted, this is partly true. However, there are solid reasons why this is. First, hardware. Windows is sold on machines that are distributed by companies that try to sell the cheapest hardware to consumers to drive down prices. On top of that, everything is so customizable, people are putting things into computers they shouldn't or don't need. Apple makes all the hardware for their Macs, so they know the performance each will have, they don't have to program for missing hardware, old hardware, etc. This adds much more unreliability when you're not sure what kind of hardware your OS will be operating on. If MS managed their own hardware and put it out with an OS programmed for AT LEAST that hardware, then Windows would probably increase in reliability, at least on a hardware point of view.&lt;/li&gt;&lt;li&gt;Reliability - Software - One of the reasons Jobs and Gates went two seperate ways is because they had different opinions on the user experience/permissions for the computer. Macs hide system files and really cattle-shoot the user, unless you're extremely advanced and know where to go. On the other hand, Windows is wide-open. Windows has people poking around where they shouldn't be, moving/modifying/deleting files they shouldn't be. This isn't bad programming, it was a choice they made. It makes jobs like mine (programming) easier. &lt;/li&gt;&lt;li&gt;Third Party Apps - MS gives out free development software for Windows; anyone can get Visual Studios Express and make an application. On the other hand, Mac users typically have to apply for applications. This stems into reliability (I think most of these issues do) as well, but when you have people who don't really know what they're doing making programs, you're going to have crashes. A good amount of these third party apps are by people who don't understand what memory allocation really means, what the trash collector does, why this square peg won't fit into this circle hole. So, you've got people downloading bad apps that are corrupting files, wasting memory, etc. Again, not bad programming, just the choice Windows made to go to open the OS to everyone.&lt;/li&gt;&lt;li&gt;Viruses - One of the big things Mac users have over Windows is viruses. Yes, we know, you don't have a lot of viruses out there. Again, this is due to people being able to easily make a program. In 10 mins, if I can get a dumb enough user out there (and there are TONS of you) to install my app, I can wipe their computer clean. It's not hard. Also, PCs are so common, so many people/corporations use it, they have become a target. Why develop a virus that will only effect 12% of the community? Can't really blame that on Windows.&lt;/li&gt;&lt;li&gt;Consumer Idiocy - As aforementioned, PCs are much more customizable than Macs. This has people putting parts into PCs aren't good enough to run what they are trying to, but in the end, they just blame it on Windows. Really? Really?! You're trying to run iTunes, Office Excel, Mozilla, AIM, and a video game all at once on a 1.7 GHz processor and 1 GB of RAM? If people put more research into their customization, they'd have a better PC.&lt;/li&gt;&lt;li&gt;Price - One thing PC does have over Mac right out of the box is price, which as I said before is driven down by Dell, Gateway, etc using cheaper parts and competition to run down prices. The cheapest Mac out there still costs close to 2k. If you sunk 2k into a PC, and sunk it into it right, you'd have a hell of a computer. Instead, people are buying the $700 Dell Inspirion and loading it with downloaded music, PC games, and other large applications. I bought my PC for about 2k and it works great. I have a dual-core 2.4 GHz processor and 4 GB of RAM on a Vista machine and it boots in less than 15 seconds.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;OS - I'll give it to Apple, Mac has a nice UI. Vista is a step in the right direction, but it still doesn't compare. Apple's generally ship with nice ass graphic cards and video cards and have crisp, nice lines and colors. I'll give it to Apple, they do the UI right (mostly!! I have a few gripes with the Mac experience!). Another thing Apple does right is the external devices eject. On my XP/Vista computers, ejecting my external HD is a gamble; it might erase my crap, it might not. I never really know. When I ejected it from my father's Mac, the HD immediately stopped spinning and I knew it was safe to take out. Good job!&lt;/li&gt;&lt;li&gt;Applications - Office is great. I don't know what people are doing to bring it down all the tiem, but I use it often and rarely have issues with it. And the people on Macs usually end up buying Office for Mac anyway. iTunes sucks. It's awful. It's slow, clunky, and not very nice to look at. Did you know iTunes has several services install on the computer that run constantly, wasting memory? For instance, the iPod service checks every few seconds to see if an iPod has been inserted. WHY?! Is it that hard to grab an interrupt, check to see if it's iPod, and move on? That and Bonjour, which I have no idea what it does, but it messes up my VPN to work all the time and most of the people I know have uninstalled it completely. It uses an incredible amount of memory even when NOT running and still is not compatibly completely with Vista.&lt;/li&gt;&lt;li&gt;Other Issues - I hate, hate, hate that I can't double-click on a Mac window and have it expand. I'm a full screen person, I like all my windows full screen. Mac completely screws the pooch on that one. I hate it. The iDisk app doesn't always work. My father was trying to reformat an EHD he had, and iDisk kept messing it up. We had to use my Vista comp to fix it every time. My last issue has to be the attitude Mac users get. Oh, well I have a Mac so my shit doesn't smell. They get their little Apple car stickers and post it on everything. I love the ones that are forced to use a PC for whatever reason and put the Apple sticker of the Dell/Gateway/etc logo! That's hilarious. And I love the people that buy a Mac, then install that application that then allows them to install Windows on it! WTF is the point? Just sink that money into a PC and you'd have a damn good PC!&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;I guess that's about all. Again, I gave credit to both sides where it was due. This isn't a "PCs rule, Macs stink" post, just a "people don't see it this way" post. Again, I'll grant that Vista blows, but reading about Windows 7 and I'm pretty stoked. Think they'll give Vista users a discount as a sorry? :-P&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8392817326307478609-7443014697277149868?l=gettherooster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gettherooster.blogspot.com/feeds/7443014697277149868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8392817326307478609&amp;postID=7443014697277149868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/7443014697277149868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8392817326307478609/posts/default/7443014697277149868'/><link rel='alternate' type='text/html' href='http://gettherooster.blogspot.com/2008/12/pc-vs-mac.html' title='PC vs. Mac'/><author><name>Matt</name><uri>http://www.blogger.com/profile/00181073854758042891</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>
