<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>debugger; &#187; Uncategorized</title>
	<atom:link href="http://www.akmattie.net/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.akmattie.net/blog</link>
	<description>Andrew Mattie's Web Development Adventures</description>
	<lastBuildDate>Thu, 06 Mar 2008 06:47:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE8 + Mapping Apps = Teh Suck</title>
		<link>http://www.akmattie.net/blog/2008/03/05/ie8-mapping-apps-teh-suck/</link>
		<comments>http://www.akmattie.net/blog/2008/03/05/ie8-mapping-apps-teh-suck/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 06:47:22 +0000</pubDate>
		<dc:creator>amattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.akmattie.net/blog/2008/03/05/ie8-mapping-apps-teh-suck/</guid>
		<description><![CDATA[Into browser mapping apps? Excited about IE8? I&#8217;ll raise my hand for both.
Anyway, if you have the slightest interest in either of those things, you should go check out my coworker&#8217;s post titled &#8220;Google Maps + IE8 Beta 1 = Epic Fail.&#8221;
]]></description>
			<content:encoded><![CDATA[<p>Into browser mapping apps? Excited about IE8? I&#8217;ll raise my hand for both.</p>
<p>Anyway, if you have the slightest interest in either of those things, you should go check out my coworker&#8217;s post titled &#8220;<a href="http://www.greyhats.com/2008/03/05/ie8-beta1-google-maps-epic-fail/" target="_blank">Google Maps + IE8 Beta 1 = Epic Fail</a>.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.akmattie.net/blog/2008/03/05/ie8-mapping-apps-teh-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Ways to Serve Up Your JavaScript</title>
		<link>http://www.akmattie.net/blog/2007/02/12/best-ways-to-serve-up-your-javascript/</link>
		<comments>http://www.akmattie.net/blog/2007/02/12/best-ways-to-serve-up-your-javascript/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 08:40:42 +0000</pubDate>
		<dc:creator>amattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.akmattie.net/blog/2007/02/12/best-ways-to-serve-up-your-javascript/</guid>
		<description><![CDATA[While this all just seems like common sense to me, it apparantly isn&#8217;t to some people / development teams. As I said before, I&#8217;ve been stumbling onto more and more sites lately that exhibit JavaScript programming practices that seem a little off at best. Some sites just seem to slap together frameworks without thinking about [...]]]></description>
			<content:encoded><![CDATA[<p>While this all just seems like common sense to me, it apparantly isn&#8217;t to some people / development teams. As I said before, I&#8217;ve been stumbling onto more and more sites lately that exhibit JavaScript programming practices that seem a little off at best. Some sites just seem to slap together frameworks without thinking about the repercussions and just call it a day. Yeah, for the most part it doesn&#8217;t matter in the short run, but in the long run, poor programming can drive up IT costs in the form of additional hardware and bandwidth as well as drive away your website visitors due to frustration with loading times</p>
<p>Other individuals / companies have certainly written about this before, but I haven&#8217;t seen anything on it in a while now and I figured it&#8217;d be nice to have a refresher. Without further ado, following are some practices that we follow at <a href="http://www.diversesolutions.com">Diverse Solutions</a> that, as a website visitor, I wish more companies would follow.</p>
<ol>
<li><strong>Shrink Your Code</strong>: This really seems like common sense to me, but far too many people aren&#8217;t even aware of the tools available to help developers in this area or just don&#8217;t care enough about the benefits. JS compressors, in case you&#8217;re not aware, do anything from strip unnecessary whitespace and comments to actually changing the names of private variables to smaller names to save space. We use <a href="http://alex.dojotoolkit.org/shrinksafe/">Dojo ShrinkSafe</a>, but I&#8217;ve heard <a href="http://www.crockford.com/javascript/jsmin.html">JSMin</a> does a pretty good job too, and I know that there are a number of others that will probably fit the bill as well. They are pretty easy to use if you take the time to set them up, and the benefits are definitely worth it. In most of our apps, we&#8217;ve created batch files that run ShrinkSafe on most JS files in the deploy directory so that we don&#8217;t have to really mess with it after we&#8217;ve set it up.</li>
<li><strong>Compress Your Code</strong>: Use server-side compression <em>if</em> the client truly supports decompression. GZIP can be your friend, but it can also be your enemy if the client doesn&#8217;t support it properly but says it does (looking at you, IE6). Some claim it&#8217;s not that big of a deal and that the problem isn&#8217;t very widespread, but we&#8217;ve had our fair share of clients who had problems with us compressing JavaScript. The problem is primarily related to <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496">this bug</a>, but there are other things that can cause problems with compressed content as well. Basically, we&#8217;ve found that you&#8217;re best bet is just to conditionally serve compressed JS to browsers that say they support it <em>except for anything below IE6 SP2</em>. You can do this with server-side code if you intercept your requests to JS files. We run IIS 6 and use <a href="http://www.port80software.com/products/zipenable/">ZipEnable</a> so that we don&#8217;t have to write anything extra to take care of this.</li>
<li><strong>Don&#8217;t Include Libraries You Don&#8217;t Use</strong>: This, again, seems like common sense. I&#8217;ve happened upon way too many sites that include Prototype or Dojo or something just because they likely think that they are going to use it, but they never end up using a single part of it. My advice is to only include the library <em>after</em> you&#8217;ve learned how to use it, not before.</li>
<li><strong>Use Versioning</strong>: This is something we fairly recently started doing, and we don&#8217;t know why we never did it before. Versioning is especially important because of <a href="http://support.microsoft.com/kb/321722/EN-US/">this bug</a> in IE6. Basically, versioning involves appending a querystring to the end of every script&#8217;s tag src attribute. The querystring doesn&#8217;t / shouldn&#8217;t change the file being requested, but because you can change the querystring when you deploy, the browser will re-request the file with the next request and get the new version of your script. It can definitely be a pain to manually manage changing the querystring at the end of all of your JS files, so we have the value of the querystring variable set as a server side variable that we can just change in one place to make everyone&#8217;s browser reload everything. Sure it reloads some files unnecessarily, but like everything else regarding JS optimization, it&#8217;s a balance between extra work and better practices.</li>
<li><strong>Minimize Client Requests</strong>: Yahoo! pre-compiles some of their YUI libraries so that developers can just include one or two files in their apps and get the functionality they need, and we do the same thing with most of our libraries / applications. Separating thousands of lines of JS into separate files can really help with organizational purposes, but serving those multiple files to the client can really be a drag to visitors, especially in light in of studies like <a href="http://yuiblog.com/blog/2006/11/28/performance-research-part-1/">these</a>. What we&#8217;ve done to help fix this is create a quick server-side app that reads an XML config file to determine which JS files to include in the single request. We can then ask for something like /CompressedScripts/Prototype.js to get our Prototype.js file, the <a href="http://clientside.cnet.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/">Event.onDOMReady</a> file, Justin Palmer&#8217;s awesome <a href="http://encytemedia.com/event-selectors/" aiotitle="EventSelectors">EventSelectors</a> extension, something we wrote for generating SOAP requests, and <a href="http://www.sylvainzimmer.com/index.php/archives/2006/06/25/speeding-up-prototypes-selector/">Sylvain Zimmer&#8217;s impressive $$ addon</a>. That&#8217;s five potential requests that we&#8217;ve merged into one request, saving an incredible amount of unnecessary requests over the lifetime of our app. I should note that we don&#8217;t use versioning (point 4) on our libraries just because it would probably degrade performance most of the time since the libraries rarely change.</li>
</ol>
<p>Anyway, that should get you started. Of course you can do even further, but like I said, it&#8217;s definitely a balance between extra work on your end and unnecessary bandwidth / slow-ish performance on the client end.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.akmattie.net/blog/2007/02/12/best-ways-to-serve-up-your-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pushin&#8217; It To The Client</title>
		<link>http://www.akmattie.net/blog/2007/02/01/pushin-it-to-the-client/</link>
		<comments>http://www.akmattie.net/blog/2007/02/01/pushin-it-to-the-client/#comments</comments>
		<pubDate>Fri, 02 Feb 2007 07:55:24 +0000</pubDate>
		<dc:creator>amattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.akmattie.net/blog/2007/02/01/pushin-it-to-the-client/</guid>
		<description><![CDATA[Anyone can criticize a website for not having a nice enough design or layout or having a confusing UI. Maybe there&#8217;s not enough or too much whitespace on a site, maybe the colors suck, or maybe the business model is stupid. For the most part, this is what the general public will see and judge [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone can criticize a website for not having a nice enough design or layout or having a confusing UI. Maybe there&#8217;s not enough or too much whitespace on a site, maybe the colors suck, or maybe the business model is stupid. For the most part, this is what the general public will see and judge a company&#8217;s website, and often the company itself, on. For the most part, it doesn&#8217;t matter to people what language or development environment was used to build the web application; all that matters is that it works the way it should. No one except IT / development really cares about what is underneath the hood of these applications.</p>
<p>As a developer myself though, I have a curiousity that exceeds most others&#8217; desires to know <em>how</em> these applications were build. I<em> </em>want to know what is underneath the hood and how good the developers themselves are. In the past, it was nearly impossible for outsiders like me to look at the underbellies of these applications to gauge the skills of those to made them. However, with the past few years, application code in the form of JavaScript has been pushed to the client an amazing rate and new tools have surfaced that make it easier to dig into this code.</p>
<p>This code is where the crux of my issues with a number of companies lies. You&#8217;d think that with the massive amounts of money that these &#8220;Web 2.0&#8243; companies have been raising lately that <em>someone </em>there would ensure that the code that is pushed to the client is both secure and efficient. In my opinion, security hasn&#8217;t changed all that much. All JavaScript / AJAX forces a developer to do is just take more time to ensure that the way he would have done things otherwise was the right way to do things. AJAX just reduces some of the guesswork that a hacker / cracker / whatever would have had to put in to break the app the way they wany. On the other hand, the efficiency of that code is something new that web developers must learn and get used to.</p>
<p>My entire family is a family of engineers. We&#8217;re obsessed with efficiency, optimizations, and often perfection. I might actually be the worst of them all, as I&#8217;m <em>always</em> trying to make things better &#8212; just ask my wife, as it drives her crazy. Therefore, I&#8217;m going to attempt to focus my quest to make things better on a number of very popular websites that I have already singled out. You&#8217;ll see this come to fruition in a number of posts of posts over the next few weeks. After that, I&#8217;m not sure which direction I&#8217;ll end up taking with this blog.</p>
<p>However before I can tell other companies what they are doing wrong and how I think they can do things better, I&#8217;ll have to share my own practices that I use on a daily basis to deliver what I feel is the best code possible with the constraint of time over my head. You&#8217;ll find all of this in my next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.akmattie.net/blog/2007/02/01/pushin-it-to-the-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebHost4Life Hacked? You decide.</title>
		<link>http://www.akmattie.net/blog/2007/01/28/webhost4life-hacked-you-decide/</link>
		<comments>http://www.akmattie.net/blog/2007/01/28/webhost4life-hacked-you-decide/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 07:42:38 +0000</pubDate>
		<dc:creator>amattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.akmattie.net/blog/2007/01/28/webhost4life-hacked-you-decide/</guid>
		<description><![CDATA[So I&#8217;ve wanted to share this for quite some time, but I never had a space in which to do it.
I&#8217;m currently the webmaster of transportdesigns.com, the website for my dad&#8217;s business of the same name. I used / am using WebHost4Life to host it just because I didn&#8217;t really know of any good Windows [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve wanted to share this for quite some time, but I never had a space in which to do it.</p>
<p>I&#8217;m currently the webmaster of <a href="http://www.transportdesigns.com">transportdesigns.com</a>, the website for my dad&#8217;s business of the same name. I used / am using WebHost4Life to host it just because I didn&#8217;t really know of any good Windows web hosts (Windows needed because of an ASP.NET app I am making) and because it was reasonably priced. Also, because of all the <a href="http://blog.dreamhost.com/2006/05/04/web-hostings-dirty-laundry/">crap</a> littered around Google pertaining to web hosting reviews, it&#8217;s nearly impossible to find out whether or not a company is good just by doing a search on it.</p>
<p><em>Anyway</em>, things were okay for a while. I wasn&#8217;t too impressed with their backend, but as long as it was stable, cheap, and had the functionality I was looking for, I was okay. Late November rolls around, and I get an IM from my dad asking him what the black box was doing on the middle of his page over top of the content. Hmm, I don&#8217;t remember putting a black box on top of the content, so lets go check it out.</p>
<p>Here&#8217;s what I find: <a href="http://transportdesigns.com/index2.html">http://transportdesigns.com/index2.html</a>. Uh, whaaa? There <em>is</em> a black box in the center of the page. I look closer, and discover that that sweet box is actually an IFRAME tag linking to http://81.95.146.133/sutra/in.cgi?17. I <em>definitely</em> don&#8217;t remember putting that there. I investigate it a bit more, and put everything I found into an urgent support request to WebHost4Life. Following is my request in it&#8217;s entirity.</p>
<blockquote><p><span id="lblDescription" style="font-weight: normal">It seems that someone has hacked into the web server that houses my website and has changed the index.html page. I renamed the page to index2.html and fixed the original for the time being so that you may do an investigation into this issue. Before you write me off as an ignorant web hosting newbie who doesn&#8217;t understand the implications or definition of hacking, please read my description of the problem below.</span></p>
<p>My specific problem is that the former index.html page (again, now index2.html) has maliciously had an iframe inserted below the html tag that links to the following url: http://81.95.146.133/sutra/in.cgi?17. The URL then issues a 302 redirect to http://81.95.146.133/sp/new/index.php, which contains just a single script tag with what looks like compressed JavaScript on it (so that I cannot tell what the JavaScript actually does).</p>
<p>I have searched Google for this IP, and found the following site detailing the malicious nature of the activity surrounding the IP: http://national.auscert.org.au/render.html?it=6537&amp;cid=2998.</p>
<p>I keep the FTP and control panel passwords for my web host encrypted on my hard drive with a stronger cipher than is necessary <em>[I use <a href="http://keepass.info/">KeePass</a>]</em>. No one else knows any of my passwords nor my decryption key to open the password file on my hard drive. I know that I would never deface my own home page, so I am convinced that this occurred due to an internal security problem on your end.</p>
<p>I am absolutely livid that this has happened to my home page while being hosted at your company and consider it to be a massive security issue (which is why I marked the request with such a high priority). Please investigate this matter as soon as possible and let me know of the outcome so that I can take appropriate actions.</p></blockquote>
<p>Four hours later, I get a response from &#8220;Peter C.&#8221;</p>
<blockquote><p>We are now running a fix to remove all the IFRAM tags you stated above in all of your pages. Could you please remove all the IFRAM tags in your pages if you see any? I would suggest you not to open those inflected pages in IE before they are fixed. If you found it happen again, please open a new ticket and report the issue. Thank you for your cooperations!</p></blockquote>
<p>So my friend &#8220;Peter&#8221; tells me that they are &#8220;running a fix&#8221; to remove all the &#8220;IFRAM&#8221; tags in all of my pages. Based on what he said, I have to assume that this is a widespread hack on their servers and that they wrote a script to fix everyones&#8217; pages who may have been affected. He also says that I shouldn&#8217;t open the &#8220;inflected pages in IE before they are fixed.&#8221; Thanks Peter. I&#8217;ll just call up all of my dad&#8217;s potential website visitors and let them know to use Firefox for a while. I write back.</p>
<blockquote><p>As far as I was aware, the IFRAME was only added to the index.html page. However, your response _DOES NOT_ address my issue. Was the server hacked?? If so, why was I not informed earlier? What assurances do I have that this will not happen again. Finally, what kind of compensation do you plan on giving me for this absolutely massive security issue and the poor way your company has handled it by not notifying me after the likely hack??</p>
<p>I am still very upset over this whole issue and will spread the word about the infiltration into your network unless I get some good answers as soon as possible.</p></blockquote>
<p>I get a response from &#8220;Candy.&#8221;</p>
<blockquote><p>Could you please let us know when specifically you have discovered this issue so that we could have a closer look on? Thanks.</p></blockquote>
<p>Wouldn&#8217;t it make sense that, with such a critical issue, I didn&#8217;t just wait for two weeks before letting them know? Cmon now. I respond.</p>
<blockquote><p>The issue was discovered within about 10 minutes of my support request post. Therefore, I was notified of the problem at about 11/20/2006 2:30 PM.</p></blockquote>
<p>&#8220;Rick&#8221; responds now.</p>
<blockquote><p>We did not receive any reports from other customers about the same issue. Also, we also double checked our security settings and everything is good. Have you made sure you do not grant write permission to any users on your files? Hackers are likely to insert codes to your script if you grant write permission to the files.</p></blockquote>
<p>What?! At the moment, it was a purely HTML site you bozos! I don&#8217;t think any l33t haxors inserted any &#8220;codes to my script&#8221; through my HTML files that only had the default read permissions. My response:</p>
<blockquote><p>There are absolutely no dynamic scripts on that site that are anywhere public. In addition, the one ASPX page that I _am_ developing that sits on that server does not use any sort of file write mechanisms. I don&#8217;t claim that my code is flawless in any way, but I also am certain that there is no way that the code I have written so far on that site could be used to change files within that directory. In addition, I have not granted write permissions to any files whatsoever on this server. You will be able to see that yourself if you investigate further. Please look into the issue further and get back to me as soon as possible. &#8230; I am still not satisfied at all with the answers I have received.</p></blockquote>
<p>&#8220;Rick&#8221; responds again.</p>
<blockquote><p>Are there any special permission setting on your root folder? I can reset to default permission for you. Also, we suggest you to change all your password, say ftp, control panel to prevent hacking access.</p></blockquote>
<p>Like I told him before, I <em>have not</em> changed the default permissions. This is getting really stupid. I respond, again.</p>
<blockquote><p> There are no special permissions set on my root folder. You can check it if you&#8217;d like. The only users who have write access to any of my folders are the SYSTEM user and Administrator. None of the users I have control over have ever had write access to any folders within my directory, including the root directory. Therefore, I am lead to believe that the attack came from somewhere outside of my control. I will reset my password(s), but I still would like to know if my password was leaked from your system or the server was attacked or another user on the server was able to use a script to write to other directories or any number of the other possibilities. I have refrained from publicizing this attack on my blog until now, but this whole thing &#8220;blame the problem on a rogue user script or bad file permissions or user error thing&#8221; is becoming quite tiring. I am willing to answer questions regarding my script or my file permissions, but I can assure you again that my script never used any of the System.IO (file access) libraries, that my file permissions were never changed, and that my FTP password was definitely not leaked anywhere.</p>
<p>In addition, I was told in my first response that a &#8220;fix&#8221; had been written that was removing all of the IFRAME tags from my pages. If no other customers reported any incident, and since the problem was only on my main page, why was the script even written and what did it actually change on my site?</p></blockquote>
<p>&#8220;William&#8221; responds with &#8220;we will have senior staff to reply to your question shortly.&#8221; You know, as an aside, I really wish that their support staff could speak / write better English. Anyway, along comes Mark to finish out the support request.</p>
<blockquote><p>Steve, up to now, we did not have another customer on the same machine reported they are hacked. So we believe it should not be a hacking to our global setting but only your account.</p>
<p>Of course, this case is being recorded. We have checked through the entire server and it seems fine. The two possible method the hacker change your site is through change your webpage or modify it by FTP access.</p>
<p>Right now we checked your file permission settings and it is solid. However you may need to change your FTP password regalarly as well.</p></blockquote>
<p>So that&#8217;s it. In my opinion, I received absolutely terrible customer service from <strong>five</strong> different people across six different responses, and not one of them offered me a half-decent explanation other than the flimsy idea about that hacked FTP account. Lame. Also, they completely avoided my question about this mysterious &#8220;fix&#8221; that was running through all of my 10 or so HTML pages to remove the IFRAME tag (of which only index.html was affected by the way). If it really was only me that was affected, why did they write that script. Did they even write it? Did they lie to me? Why wasn&#8217;t it removed from the index2.html page as it exists right now?</p>
<p>I&#8217;m still pretty upset about the whole issue and would switch web hosting companies away from them in a second if I got a referral on a better one. Not that it would have soothed my anger against them at all, but I can&#8217;t believe they didn&#8217;t even offer me a month of free service to keep my mouth shut. Can&#8217;t anyone provide even a tenth of what <a href="http://www.dreamhost.com">Dreamhost</a> offers us in the Linux hosting world?</p>
<p>What do you think? Hacked? Are there even any other viable possibilities?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.akmattie.net/blog/2007/01/28/webhost4life-hacked-you-decide/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Lots to Say</title>
		<link>http://www.akmattie.net/blog/2007/01/23/lots-to-say/</link>
		<comments>http://www.akmattie.net/blog/2007/01/23/lots-to-say/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 19:00:08 +0000</pubDate>
		<dc:creator>amattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.akmattie.net/blog/2007/01/24/test/</guid>
		<description><![CDATA[I&#8217;ve had a lot to say lately and have often commented to my friends that I needed a blog, but I&#8217;ve never had the ambition to perform the necessary upkeep on it and post to it often enough. Maybe I still won&#8217;t, but I realize now that at least I&#8217;ll have something I can use [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a lot to say lately and have often commented to my friends that I needed a blog, but I&#8217;ve never had the ambition to perform the necessary upkeep on it and post to it often enough. Maybe I still won&#8217;t, but I realize now that at least I&#8217;ll have <em>something</em> I can use as an outlet about so many different things I observe and wish I could publicize.</p>
<p>I&#8217;m cooking up some pretty good posts on a myriad of different topics, so hopefully I&#8217;ll have something worthwhile up here real soon. Until then, this little post will just have to fill the void.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.akmattie.net/blog/2007/01/23/lots-to-say/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
