<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>LeeJon.es</title>
	
	<link>http://leejon.es</link>
	<description>iCode</description>
	<lastBuildDate>Fri, 21 Oct 2011 01:16:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/leejon/GKhD" /><feedburner:info uri="leejon/gkhd" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Creating An Extensible PHP Logging Class in PHP</title>
		<link>http://feedproxy.google.com/~r/leejon/GKhD/~3/gANqZGgONb8/</link>
		<comments>http://leejon.es/creating-an-extensible-php-logging-class-in-php/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 01:16:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://leejon.es/?p=28</guid>
		<description><![CDATA[Often times in the development lifecycle of a PHP based project, we all tend to run into situations where running xdebug to find the cause of a defect just isn&#8217;t possible for one reason or another. In those situations, having &#8230; <a href="http://leejon.es/creating-an-extensible-php-logging-class-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Often times in the development lifecycle of a PHP based project, we all tend to run into situations where running xdebug to find the cause of a defect just isn&#8217;t possible for one reason or another. In those situations, having an extensible logging system with capabilities above and beyond the typical echo and die statements we all end up using becomes important. When the situation came up for about the 3rd time in as many weeks where we needed just such a component, I decided now was as good a time as any to roll my sleeves up and get to work creating an improved php logging class.</p>
<p>At <a title="Clear Idea Technology, Inc." href="http://www.clearidea.us/" target="_blank">Clear Idea</a>, we have a logging system built into our PHP framework but it can&#8217;t really function outside of our system, only logs to the database and it isn&#8217;t as extensible as I would like it to be. Don&#8217;t get me wrong, it does a nice job but it is becoming more important to have our components work with other systems besides just ours. With that in mind, I made that one of the criteria for this project. Make the new logging system capable of integrating into our current system.</p>
<p>I based the class design on a nice debug logging system I created about 15 years ago for a C++ library I used to sell. The concept being to have a standard interface to communicate with and allow for different log destinations and formatting based on the which delegate class is passed during initialization.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Creating+An+Extensible+PHP+Logging+Class+in+PHP+http%3A%2F%2Fis.gd%2FaZyeiP" title="Post to Twitter"><img class="nothumb" src="http://leejon.es/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Creating+An+Extensible+PHP+Logging+Class+in+PHP+http%3A%2F%2Fis.gd%2FaZyeiP" title="Post to Twitter">Tweet This Post</a></p></div><img src="http://feeds.feedburner.com/~r/leejon/GKhD/~4/gANqZGgONb8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://leejon.es/creating-an-extensible-php-logging-class-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leejon.es/creating-an-extensible-php-logging-class-in-php/</feedburner:origLink></item>
		<item>
		<title>Notifying a ViewController with UIApplicationDidBecomeActiveNotification</title>
		<link>http://feedproxy.google.com/~r/leejon/GKhD/~3/gXUzSjS_WYw/</link>
		<comments>http://leejon.es/notifying-a-viewcontroller-with-uiapplicationdidbecomeactivenotification/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 19:49:24 +0000</pubDate>
		<dc:creator>lee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://leejon.es/?p=55</guid>
		<description><![CDATA[If a running iOS application is switched out for another, its application delegate is notified by calls to the applicationWillResignActive and applicationDidEnterBackground methods. When reactivated, the delegate receives calls to the applicationWillEnterForeground and applicationDidBecomeActive methods. All fairly self explanatory,  except &#8230; <a href="http://leejon.es/notifying-a-viewcontroller-with-uiapplicationdidbecomeactivenotification/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If a running iOS application is switched out for another, its application delegate is notified by calls to the <strong>applicationWillResignActive</strong> and <strong>applicationDidEnterBackground</strong> methods. When reactivated, the delegate receives calls to the <strong>applicationWillEnterForeground</strong> and <strong>applicationDidBecomeActive</strong> methods. All fairly self explanatory,  except when you need to refresh some data in a UIViewController. As it turns out, there is a fairly straight forward way to handle this using the very handy <strong>NSNotificationCenter</strong> and <strong>UIApplicationDidBecomeActiveNotification</strong></p>
<p>First, attach to the notification in the <strong>viewWillAppear</strong> method of the target view controller:</p>
<pre class="brush: objc; title: ; notranslate">

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

	[[NSNotificationCenter defaultCenter] addObserver: self
											 selector: @selector( appActivated: )
												 name: UIApplicationDidBecomeActiveNotification
											   object: nil];

}
</pre>
<p>Next, be a good citizen and remove the observer in the <strong>viewWillDisappear</strong> method:</p>
<pre class="brush: objc; title: ; notranslate">
- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
	[[NSNotificationCenter defaultCenter] removeObserver:self ];
}
</pre>
<p>Finally, implement the appActivated observer method:</p>
<pre class="brush: objc; title: ; notranslate">
- (void)appActivated:(NSNotification *)note
{
	[self update];
}
</pre>
<p>Set a breakpoint on the appActivated method then fire up the app in the debugger. Double click the home button and switch to another app then double click and switch back to yours. At that point, if everything is configured correctly, you should see the debugger trap on your breakpoint.</p>
<p>Our mobile applications typically do a lot of communicating with webservices. One useful application of this technique we use is to check for network connectivity and make sure that the most current data is currently reflected in the view.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Notifying+a+ViewController+with+UIApplicationDidBecomeActiveNotification+http%3A%2F%2Fis.gd%2FNysk6k" title="Post to Twitter"><img class="nothumb" src="http://leejon.es/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Notifying+a+ViewController+with+UIApplicationDidBecomeActiveNotification+http%3A%2F%2Fis.gd%2FNysk6k" title="Post to Twitter">Tweet This Post</a></p></div><img src="http://feeds.feedburner.com/~r/leejon/GKhD/~4/gXUzSjS_WYw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://leejon.es/notifying-a-viewcontroller-with-uiapplicationdidbecomeactivenotification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leejon.es/notifying-a-viewcontroller-with-uiapplicationdidbecomeactivenotification/</feedburner:origLink></item>
	</channel>
</rss>

