<?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>A Contagious Blog</title>
	<atom:link href="http://contagious.nu/feed/" rel="self" type="application/rss+xml" />
	<link>http://contagious.nu</link>
	<description>Bringing you nonsense since 2006</description>
	<lastBuildDate>Tue, 09 Feb 2010 18:32:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Project</title>
		<link>http://contagious.nu/2010/02/new-project/</link>
		<comments>http://contagious.nu/2010/02/new-project/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 18:30:58 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Doctrine & Symfony]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://contagious.nu/2010/02/new-project/</guid>
		<description><![CDATA[Don&#8217;t worry, I&#8217;m not dead. I was working on a project on the way home from Florida last weekend. I&#8217;m going to release it as soon as I buy the domain and move it to the web.
It&#8217;s kind of cool. Maybe someone will enjoy it.
]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t worry, I&#8217;m not dead. I was working on a project on the way home from Florida last weekend. I&#8217;m going to release it as soon as I buy the domain and move it to the web.</p>
<p>It&#8217;s kind of cool. Maybe someone will enjoy it.</p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2010/02/new-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing keyboard volume on iPhone 3Gs</title>
		<link>http://contagious.nu/2010/01/fixing-keyboard-volume-on-iphone-3gs/</link>
		<comments>http://contagious.nu/2010/01/fixing-keyboard-volume-on-iphone-3gs/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 15:32:46 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=200</guid>
		<description><![CDATA[So, I got my iPhone 3Gs about six months ago, upgraded from my original iPhone. It&#8217;s amazing what a little bit more RAM and processor speed can do for you.



(William Hook)
Anyway, so, one of the things I noticed was that when I upgraded my phones (I use the other one for a iFitness and Notes [...]]]></description>
			<content:encoded><![CDATA[<p>So, I got my iPhone 3Gs about six months ago, upgraded from my original iPhone. It&#8217;s amazing what a little bit more RAM and processor speed can do for you.</p>
<div style="text-align:center;">
<img alt="iPhone 3Gs" src="http://farm4.static.flickr.com/3543/3656233025_d3f27c5332.jpg" title="iPhone 3Gs" width="450" height="300" />
</div>
<p>(<a href="http://www.flickr.com/photos/williamhook/3656233025/">William Hook</a>)</p>
<p>Anyway, so, one of the things I noticed was that when I upgraded my phones (I use the other one for a iFitness and Notes while at the gym, shopping, or something similar) that the keyboard clicks on the keyboard of my 3Gs got <em>very</em> quite while the clicks the keyboard of my original iPhone were just as loud as previously. </p>
<p>Some research later, I found out that Apple lowered the clicking noise of the keyboard on the 3.1.2 update. Bummer. So, my savage search for a fix began.</p>
<p>After scoping the Apple discussion board for a fix, I found out that there is a little trick to get the volume audible again, and even a way to adjust it the way you like. Make sure your phone isn&#8217;t on silent and follow the directions</p>
<ol>
<li>Open the iPod application</li>
<li>Play a song for a few seconds and pause it</li>
<li>Go home, turn up the volume as high as you&#8217;d like</li>
<li>Open Settings, go to Sound, and then manually use the slider to turn down the ringer volume</li>
<li>Go back home and you&#8217;ll find that your ringer volume was changed, but the volume of the clicks remains at the level it should have been</li>
</ol>
<p>Not sure how long this fix will last, but it works fine two days later!</p>
<div style="text-align:center;">
<img alt="" src="http://i47.tinypic.com/6yp3r6.jpg" title="screen" class="alignnone" width="320" height="480" />
</div>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2010/01/fixing-keyboard-volume-on-iphone-3gs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting timezone with javascript and PHP.</title>
		<link>http://contagious.nu/2009/12/detecting-timezone-with-javascript-and-php/</link>
		<comments>http://contagious.nu/2009/12/detecting-timezone-with-javascript-and-php/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 14:37:53 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=193</guid>
		<description><![CDATA[While working on Boxed Thoughts last night, I came across a problem. The auto-detection I had previously written for finding a timezone had broke. After a bit of pondering I decided to scrap the entire thing and redo it from scratch. Easy? Not really.
On BT, every date is printed through a function that formats, times, [...]]]></description>
			<content:encoded><![CDATA[<p>While working on <a href="http://v3.notemine.com/">Boxed Thoughts</a> last night, I came across a problem. The auto-detection I had previously written for finding a timezone had broke. After a bit of pondering I decided to scrap the entire thing and redo it from scratch. Easy? Not really.</p>
<p>On BT, every date is printed through a function that formats, times, and adds appropriate data to the date.</p>
<pre class="brush: php;">
    echo display_date(time(), $format, ...);
</pre>
<p>There is just one vital problem with finding a timezone server-side: you can&#8217;t.</p>
<p>Javascript was my alternative. So, after attempting to create/finding buggy scripts that would do the deed in javascript, I stubbled upon <a href="http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/">Jeff Bezos&#8217;s blog post</a>.</p>
<p>After a bit of reading, learning, and eventually falling in love, I packaged his idea up in a simple function:</p>
<pre class="brush: javascript;">
function determineTimezone() { 

    var rightNow = new Date();
    var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
    var temp = jan1.toGMTString();
    var jan2 = new Date(temp.substring(0, temp.lastIndexOf(&quot; &quot;)-1));
    var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);

    var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
    temp = june1.toGMTString();
    var june2 = new Date(temp.substring(0, temp.lastIndexOf(&quot; &quot;)-1));
    var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
    var dst;
    if (std_time_offset == daylight_time_offset) {
        dst = &quot;0&quot;; // daylight savings time is NOT observed
    } else {
        dst = &quot;1&quot;; // daylight savings time is observed
    }

}
</pre>
<p>Now that we have the actual javascript done, how do we translate this information to the server for PHP to work with?<br />
I had two methods. The first was to use an AJAX request to send that data to the server for it to store in the user session. I disliked this, though, because it required additional calls to the server, and at BT, we&#8217;re all about not wasting and reserving resources.<br />
The second method I chose was to create two cookies, one containing the offset information and the other containing the daylight savings information. </p>
<pre class="brush: javascript;">
function determineTimezone() { 

    var rightNow = new Date();
    var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
    var temp = jan1.toGMTString();
    var jan2 = new Date(temp.substring(0, temp.lastIndexOf(&quot; &quot;)-1));
    var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);

    var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
    temp = june1.toGMTString();
    var june2 = new Date(temp.substring(0, temp.lastIndexOf(&quot; &quot;)-1));
    var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
    var dst;
    if (std_time_offset == daylight_time_offset) {
        dst = &quot;0&quot;; // daylight savings time is NOT observed
    } else {
        dst = &quot;1&quot;; // daylight savings time is observed
    }

    //We use jquery's cookie plugin.
    $.cookie('timezone_offset', daylight_time_offset);
    $.cookie('timezone_daylightsavings', dst);
    return null;
}
</pre>
<p>Now we go to the server end:</p>
<pre class="brush: php;">
class common {
...
public static function fetchTimezone() { 

	$offset = $_COOKIE['timezone_offset']; //
        $time_zone_dst = $_COOKIE['timezone_daylightsavings'];

        $offset *= 3600;
        $zone = timezone_name_from_abbr('', $offset, $time_zone_dst);

        return $zone;

    }
...
}
</pre>
<p>PHP can happily read the data placed by javascript now. So we push the contents of the cookies into <strong>timezone_name_from_abbr();</strong> and get a nice little location. For example, in my case you get &#8220;america/chicago&#8221;.<br />
<em>Just as a note, I suggest you save your cookies in the user session, just as a time saver.</em></p>
<p>Last but not least, we actually need to display the date:</p>
<pre class="brush: php;">
function display_date($date, $format, ...) {
...
        $time_zone_name = common::fetchTimezone();

        $datetime = new DateTime($date);
        $datetime-&gt;setTimezone(new DateTimeZone($time_zone_name));      

        return $datetime-&gt;format($format);
}
</pre>
<p>First we get the result of common::fetchTimezone(); that we created above. Then we can use PHP&#8217;s nifty DateTime and DateTimeZone classes to do the hard work for us. and last, you return the format, exactly the same as you would with date();</p>
<p>The only drawback to this method is that on the first page load, PHP will not have a cookie to get the timezone:</p>
<p>     Server side executed [reads nonexistent cookie]<br />
                     |                        |<br />
                     v                       v<br />
     HTML/Javascript rendered [sets the cookie]</p>
<p>Therefore it will default to your server&#8217;s original timezone on the first load. Other than that, there shouldn&#8217;t be any problems. Of course, you&#8217;ll need to splice some of the above into your own code, but it should be similar. </p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/12/detecting-timezone-with-javascript-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging IE7 is a pain</title>
		<link>http://contagious.nu/2009/11/debugging-ie7-is-a-pain/</link>
		<comments>http://contagious.nu/2009/11/debugging-ie7-is-a-pain/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 18:51:51 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=190</guid>
		<description><![CDATA[I hate Internet Explorer with an ever burning passion. It&#8217;s not the fact that it pretty much rejects every kind of javascript I compose, or the fact that it renders CSS without any kind of pattern or sequence. No, that&#8217;s not it at all. I just hate the fact that there is absolutely no native [...]]]></description>
			<content:encoded><![CDATA[<p>I hate Internet Explorer with an ever burning passion. It&#8217;s not the fact that it pretty much rejects every kind of javascript I compose, or the fact that it renders CSS without any kind of pattern or sequence. No, that&#8217;s not it at all. I just hate the fact that there is absolutely no native way to debug your content to get it to work.</p>
<div style="text-align:center;">
<img src="http://contagious.nu/wp-content/uploads/2009/11/internet_explorer.png" alt="internet_explorer" title="internet_explorer" width="256" height="256" class="alignnone size-full wp-image-191" />
</div>
<p>Now, while IE7 was a vast improvement over IE6 (I don&#8217;t even bother messing with those users, sorry guys, you&#8217;re pretty much hopeless, even <a href="http://mashable.com/2009/09/22/google-wave-internet-explorer/">Google ditched you</a>), it still sucks horribly. For developers, it is not very friendly. IE8, on the other hand, was god sent. However, IE8 has a <em>good</em> rendering engine, leaving IE7&#8217;s behind. Also, based on statistics, IE7 still holds just as much traffic as IE8 (even being a year after launch) and less than half of the traffic of both IE6 and IE7 combined <a href="http://www.w3schools.com/browsers/browsers_stats.asp">(w3)</a>. Now, one can honestly say that Microsoft sucks at pushing out updates to their users but that is ridiculous &#8211; even Opera can do it without much effort. </p>
<p>Anyway, I&#8217;m looking for some tips to debug in IE7 (other than Visual Studio). I have tried both companion.js and debug-bar so I&#8217;m going out on a limb here.</p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/11/debugging-ie7-is-a-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s been awhile</title>
		<link>http://contagious.nu/2009/11/its-been-awhile/</link>
		<comments>http://contagious.nu/2009/11/its-been-awhile/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 16:08:12 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=186</guid>
		<description><![CDATA[So I thought I would share this: 



A lot of people seem to have forgotten, or never noticed, that Lady Gaga wrote songs for a lot of people (Britney Spears, PCD, Fergie, +) before she was finally scout out.
]]></description>
			<content:encoded><![CDATA[<p>So I thought I would share this: </p>
<div style="text-align:center;">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/a7j2jWS_Vcw&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/a7j2jWS_Vcw&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
</div>
<p>A lot of people seem to have forgotten, or never noticed, that Lady Gaga wrote songs for a lot of people (Britney Spears, PCD, Fergie, +) before she was finally scout out.</p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/11/its-been-awhile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boxed Thoughts: Coming soon</title>
		<link>http://contagious.nu/2009/09/boxed-thoughts-coming-soon/</link>
		<comments>http://contagious.nu/2009/09/boxed-thoughts-coming-soon/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 18:07:23 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=183</guid>
		<description><![CDATA[v3.notemine.com
Check that link for a preview of Boxed Thoughts. After a (long) time of work, it looks like it&#8217;s starting to surface. Now just to move those Propel components I forgot to take out&#8230;
]]></description>
			<content:encoded><![CDATA[<p><a href="http://v3.notemine.com">v3.notemine.com</a></p>
<p>Check that link for a preview of Boxed Thoughts. After a (long) time of work, it looks like it&#8217;s starting to surface. Now just to move those <em>Propel</em> components I forgot to take out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/09/boxed-thoughts-coming-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wow.</title>
		<link>http://contagious.nu/2009/08/wow/</link>
		<comments>http://contagious.nu/2009/08/wow/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 18:44:09 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/2009/08/wow/</guid>
		<description><![CDATA[My Macbook still sounds like a plane, and I launched a small online portfolio because I need work.
Go see
]]></description>
			<content:encoded><![CDATA[<p>My Macbook still sounds like a plane, and I launched a small online portfolio because I need work.</p>
<p><a href="http://contagious.nu/design/">Go see</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/08/wow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Planes</title>
		<link>http://contagious.nu/2009/08/planes/</link>
		<comments>http://contagious.nu/2009/08/planes/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 01:08:39 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=175</guid>
		<description><![CDATA[



[Source]

This is kind of like what my MacBook sounds like. I think I should take it in soon.
]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;">
<img src="http://contagious.nu/wp-content/uploads/2009/08/20174021_7d607476031.jpg" alt="20174021_7d60747603" title="20174021_7d60747603" width="418" height="312" class="alignnone size-full wp-image-178" />
</div>
<div style="text-align:right;">
[<a href="http://www.flickr.com/photos/cmiper/20174021/">Source</a>]
</div>
<p>This is kind of like what my MacBook sounds like. I think I should take it in soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/08/planes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C and the iPhone</title>
		<link>http://contagious.nu/2009/08/objective-c-and-the-iphone/</link>
		<comments>http://contagious.nu/2009/08/objective-c-and-the-iphone/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 16:53:20 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=172</guid>
		<description><![CDATA[


The other day I was wondering (almost completely out of the blue) how to write an iPhone application. After a bit of exploration and refresh on basic C, I learned the objective-C language. After that, I had to apply it to Apple&#8217;s methods for creating iPhone apps. It took about two and a half days [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;">
<img src="http://contagious.nu/wp-content/uploads/2009/08/Picture-1.png" alt="Objective-C" title="Objective-C" width="376" height="221" class="alignnone size-full wp-image-173" />
</div>
<p>The other day I was wondering (almost completely out of the blue) how to write an iPhone application. After a bit of exploration and refresh on basic C, I learned the objective-C language. After that, I had to apply it to Apple&#8217;s methods for creating iPhone apps. It took about two and a half days and had it&#8217;s ups and downs. If you&#8217;re not used to C or MVC structure, it will be hard as shit. I&#8217;m still new to it, but so for I&#8217;ve written an app that has a home screen and a options that menu folds down over the current view.<br />
I&#8217;ll be diving into it a little deeper after I release the v3 of <a href="http://notemine.com">Notemine</a>. But for those who are aspiring to create one with little to no language, it&#8217;s easy and there is a lot of online documentation out there to get you started.</p>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/08/objective-c-and-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPod Cords</title>
		<link>http://contagious.nu/2009/07/ipod-cords/</link>
		<comments>http://contagious.nu/2009/07/ipod-cords/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 19:49:43 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://contagious.nu/?p=169</guid>
		<description><![CDATA[I update my iPod about once every week. It&#8217;s an old school iPod Photo from back in the day, before technology could fit into your skinny jeans. 
Anyway, my usual cord went MIA. Then I went and got another one. When I opened the drawer full of my miscellaneous and unused cables, I found out [...]]]></description>
			<content:encoded><![CDATA[<p>I update my iPod about once every week. It&#8217;s an old school <a href="http://en.wikipedia.org/wiki/IPod_Photo#iPod_Photo_.28Spin_Off.29">iPod Photo</a> from back in the day, before technology could fit into your skinny jeans. </p>
<p>Anyway, my usual cord went MIA. Then I went and got another one. When I opened the drawer full of my miscellaneous and unused cables, I found out that I have like six of those things. Of all of the things I lose (I can honestly set something down and two minutes later forget where I put it) I have never had trouble finding an iPod cord. Possibly because I have so many of them. Then again, who doesn&#8217;t have a couple of them laying around their house. Weird, isn&#8217;t it?</p>
<div style="text-align:center;">
<img src="http://contagious.nu/wp-content/uploads/2009/07/connecterr.jpg" alt="connecter" title="connecter" width="240" height="360" class="alignnone size-full wp-image-170" />
</div>
]]></content:encoded>
			<wfw:commentRss>http://contagious.nu/2009/07/ipod-cords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
