<?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>Tom Dalling</title>
	
	<link>http://www.tomdalling.com</link>
	<description>Thoughts of a software developer</description>
	<lastBuildDate>Fri, 26 Feb 2010 08:07:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TomDalling" /><feedburner:info uri="tomdalling" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Hilarious Massive Facebook Privacy Flaw</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/DRCsqp71yrk/hilarious-massive-facebook-privacy-flaw</link>
		<comments>http://www.tomdalling.com/random-stuff/hilarious-massive-facebook-privacy-flaw#comments</comments>
		<pubDate>Thu, 25 Feb 2010 02:26:57 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Random Stuff]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=372</guid>
		<description>My girlfriend just acquired a strange bug with sending private messages in Facebook. Firstly, she tries to send a normal private message like so:

And then, it sends it to some completely random person that she&amp;#8217;s not even friends with.

So much for &amp;#34;private&amp;#34; messages.
I tested it in a different browser on a different computer, and it [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/DRCsqp71yrk" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/random-stuff/hilarious-massive-facebook-privacy-flaw/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/random-stuff/hilarious-massive-facebook-privacy-flaw</feedburner:origLink></item>
		<item>
		<title>SOLID Class Design: The Interface Segregation Principle</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/5ughEVkqwmE/solid-class-design-the-interface-segregation-principle</link>
		<comments>http://www.tomdalling.com/software-design/solid-class-design-the-interface-segregation-principle#comments</comments>
		<pubDate>Thu, 18 Feb 2010 13:17:15 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=352</guid>
		<description>This is that last part of a five part series about SOLID class design principles by Robert C. Martin. The SOLID principles focus on achieving code that is maintainable, robust, and reusable. In this post, I will discuss the Interface Segregation Principle.
The Interface Segregation Principle (ISP): Clients should not be forced to depend upon interfaces [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/5ughEVkqwmE" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/software-design/solid-class-design-the-interface-segregation-principle/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/software-design/solid-class-design-the-interface-segregation-principle</feedburner:origLink></item>
		<item>
		<title>SOLID Class Design: The Dependency Inversion Principle</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/6rXzVss5yHo/solid-class-design-the-dependency-inversion-principle</link>
		<comments>http://www.tomdalling.com/software-design/solid-class-design-the-dependency-inversion-principle#comments</comments>
		<pubDate>Sat, 19 Dec 2009 07:40:54 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=307</guid>
		<description>This is part four of a five part series about SOLID class design principles by Robert C. Martin. The SOLID principles focus on achieving code that is maintainable, robust, and reusable. In this post, I will discuss the Dependency Inversion Principle.
The Dependency Inversion Principle (DIP): High level modules should not depend upon low level modules. [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/6rXzVss5yHo" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/software-design/solid-class-design-the-dependency-inversion-principle/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/software-design/solid-class-design-the-dependency-inversion-principle</feedburner:origLink></item>
		<item>
		<title>SOLID Class Design: The Liskov Substitution Principle</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/CdqgfjBvxuM/solid-class-design-the-liskov-substitution-principle</link>
		<comments>http://www.tomdalling.com/software-design/solid-class-design-the-liskov-substitution-principle#comments</comments>
		<pubDate>Sat, 21 Nov 2009 06:49:27 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=267</guid>
		<description>This is part three of a five part series about SOLID class design principles by Robert C. Martin. The SOLID principles focus on achieving code that is maintainable, robust, and reusable. In this post, I will discuss the Liskov Substitution Principle.
The Liskov Substitution Principle (LSP): functions that use pointers to base classes must be able [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/CdqgfjBvxuM" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/software-design/solid-class-design-the-liskov-substitution-principle/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/software-design/solid-class-design-the-liskov-substitution-principle</feedburner:origLink></item>
		<item>
		<title>SOLID Class Design: The Open Closed Principle</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/VQ8SMU-Iyjc/solid-class-design-the-open-closed-principle</link>
		<comments>http://www.tomdalling.com/software-design/solid-class-design-the-open-closed-principle#comments</comments>
		<pubDate>Sat, 14 Nov 2009 09:22:03 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=245</guid>
		<description>This is part two of a five part series about SOLID class design principles by Robert C. Martin. The SOLID principles focus on achieving code that is maintainable, robust, and reusable. In this post, I will discuss the Open Closed Principle.
The Open Closed Principle (OCP): You should be able to extend a classes behavior, without [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/VQ8SMU-Iyjc" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/software-design/solid-class-design-the-open-closed-principle/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/software-design/solid-class-design-the-open-closed-principle</feedburner:origLink></item>
		<item>
		<title>SOLID Class Design: The Single Responsibility Principle</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/ujNPLsKMkiA/solid-class-design-the-single-responsibility-principle</link>
		<comments>http://www.tomdalling.com/software-design/solid-class-design-the-single-responsibility-principle#comments</comments>
		<pubDate>Thu, 12 Nov 2009 07:37:12 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=232</guid>
		<description>This is part one of a five part series about SOLID class design principles by Robert C. Martin. The SOLID principles focus on achieving code that is maintainable, robust, and reusable. In this post, I will discuss the Single Responsibility Principle.
The Single Responsibility Principle (SRP): A class should have one, and only one, reason to [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/ujNPLsKMkiA" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/software-design/solid-class-design-the-single-responsibility-principle/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/software-design/solid-class-design-the-single-responsibility-principle</feedburner:origLink></item>
		<item>
		<title>Why Inline Comments Are Generally a Bad Idea</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/q_J8GQ2B2g0/why-inline-comments-are-generally-a-bad-idea</link>
		<comments>http://www.tomdalling.com/coding-styleconventions/why-inline-comments-are-generally-a-bad-idea#comments</comments>
		<pubDate>Thu, 08 Oct 2009 06:20:03 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Style/Conventions]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=208</guid>
		<description>Bellow is a single function commented in two different ways. Which one is better?

NSString* MD5StringOfString&amp;#40;NSString* inputStr&amp;#41;
&amp;#123;
	//UTF8 encoding is used so the hash can be compared with hashes of ASCII strings
	NSData* inputData = &amp;#91;inputStr dataUsingEncoding:NSUTF8StringEncoding&amp;#93;;
&amp;#160;
	unsigned char outputData&amp;#91;CC_MD5_DIGEST_LENGTH&amp;#93;;
	CC_MD5&amp;#40;&amp;#91;inputData bytes&amp;#93;, &amp;#91;inputData length&amp;#93;, outputData&amp;#41;;
&amp;#160;
	NSMutableString* hashStr = &amp;#91;NSMutableString string&amp;#93;;
	int i = 0;
	for &amp;#40;i = 0; i &amp;#60; CC_MD5_DIGEST_LENGTH; ++i&amp;#41;
		&amp;#91;hashStr appendFormat:@&amp;#34;%02x&amp;#34;, [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/q_J8GQ2B2g0" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/coding-styleconventions/why-inline-comments-are-generally-a-bad-idea/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/coding-styleconventions/why-inline-comments-are-generally-a-bad-idea</feedburner:origLink></item>
		<item>
		<title>Coding Tip: Replace Complicated Conditions With Boolean Variables</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/6ugRN5f1M68/coding-tip-replace-complicated-conditions-with-boolean-variables</link>
		<comments>http://www.tomdalling.com/coding-tips/coding-tip-replace-complicated-conditions-with-boolean-variables#comments</comments>
		<pubDate>Sat, 03 Oct 2009 09:02:27 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=196</guid>
		<description>Consider the following if statement:

if&amp;#40;dragOperation != NSDragOperationCopy &amp;#38;&amp;#38; NSPointInRect&amp;#40;currentMouseLocation, self.bounds&amp;#41;&amp;#41;&amp;#123;
    //do something
&amp;#125;

Even though you may have worked out what the condition represents, it probably took you a little longer than it should. It&amp;#8217;s complicated, making it time consuming to read, and prone to bugs upon modification. Thankfully, there is an easy remedy:


BOOL [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/6ugRN5f1M68" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/coding-tips/coding-tip-replace-complicated-conditions-with-boolean-variables/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/coding-tips/coding-tip-replace-complicated-conditions-with-boolean-variables</feedburner:origLink></item>
		<item>
		<title>MD5 Hashes in Cocoa</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/nNhM42gZmLA/md5-hashes-in-cocoa</link>
		<comments>http://www.tomdalling.com/cocoa/md5-hashes-in-cocoa#comments</comments>
		<pubDate>Thu, 24 Sep 2009 03:12:25 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=175</guid>
		<description>Let&amp;#8217;s jump straight into the code:

#import &amp;#60;CommonCrypto/CommonDigest.h&amp;#62;
&amp;#160;
NSString* MD5StringOfString&amp;#40;NSString* inputStr&amp;#41;
&amp;#123;
	NSData* inputData = &amp;#91;inputStr dataUsingEncoding:NSUTF8StringEncoding&amp;#93;;
	unsigned char outputData&amp;#91;CC_MD5_DIGEST_LENGTH&amp;#93;;
	CC_MD5&amp;#40;&amp;#91;inputData bytes&amp;#93;, &amp;#91;inputData length&amp;#93;, outputData&amp;#41;;
&amp;#160;
	NSMutableString* hashStr = &amp;#91;NSMutableString string&amp;#93;;
	int i = 0;
	for &amp;#40;i = 0; i &amp;#60; CC_MD5_DIGEST_LENGTH; ++i&amp;#41;
		&amp;#91;hashStr appendFormat:@&amp;#34;%02x&amp;#34;, outputData&amp;#91;i&amp;#93;&amp;#93;;
&amp;#160;
	return hashStr;
&amp;#125;

Now for the explanation.

First, the input string is encoded into UTF8 data so that the hash comes out the same [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/nNhM42gZmLA" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/cocoa/md5-hashes-in-cocoa/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/cocoa/md5-hashes-in-cocoa</feedburner:origLink></item>
		<item>
		<title>Coding Tip: Use The Ternary Conditional Operator</title>
		<link>http://feedproxy.google.com/~r/TomDalling/~3/Fo46dgnfzUo/coding-tip-use-the-ternary-conditional-operator</link>
		<comments>http://www.tomdalling.com/coding-tips/coding-tip-use-the-ternary-conditional-operator#comments</comments>
		<pubDate>Wed, 09 Sep 2009 06:01:24 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Coding Tips]]></category>

		<guid isPermaLink="false">http://www.tomdalling.com/?p=152</guid>
		<description>The ternary conditional operator (?:) can be used as a short-hand version of an if statement. It is a feature of many languages.
For example, this code:

int height;
if&amp;#40;isTall&amp;#41;
    height = 50;
else
    height = 10;

can be better written as:

int height = isTall ? 50 : 10;

The ?: operator is good for [...]&lt;img src="http://feeds.feedburner.com/~r/TomDalling/~4/Fo46dgnfzUo" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.tomdalling.com/coding-tips/coding-tip-use-the-ternary-conditional-operator/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.tomdalling.com/coding-tips/coding-tip-use-the-ternary-conditional-operator</feedburner:origLink></item>
	</channel>
</rss>
