<?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>Matt MacAulay</title>
	<atom:link href="http://mattmacaulay.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattmacaulay.ca</link>
	<description>Software Development &#124; Technology &#124; Meatspace</description>
	<lastBuildDate>Thu, 06 May 2010 18:39:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Log in by username or email in Authlogic</title>
		<link>http://mattmacaulay.ca/2010/04/25/log-in-by-username-or-email-in-authlogic/</link>
		<comments>http://mattmacaulay.ca/2010/04/25/log-in-by-username-or-email-in-authlogic/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:10:22 +0000</pubDate>
		<dc:creator>mmacaulay</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://mattmacaulay.ca/?p=20</guid>
		<description><![CDATA[While I&#8217;m excited to see what the future holds for single sign-on systems, I don&#8217;t think we&#8217;re at the point where we can discard the traditional site registration paradigm, though, traditional user registration models still have a place in today&#8217;s &#8216;nets. One pain point I have with some sites is that I can never remember [...]]]></description>
			<content:encoded><![CDATA[<p>While I&#8217;m excited to see what the future holds for <a href="http://openid.net">single</a> <a href="http://oauth.net/">sign-on</a> <a href="http://mashable.com/2010/04/21/facebook-kills-facebook-connect/">systems</a>, I don&#8217;t think we&#8217;re at the point where we can discard the traditional site registration paradigm, though, traditional user registration models still have a place in today&#8217;s &#8216;nets. One pain point I have with some sites is that I can never remember what username I used to register &#8211; sure, most of the time it&#8217;s the same one, but occasionally someone will have taken it before me. Other sites use your email address to log you in and do away with the concept of a username altogether. This is preferable as you&#8217;re not likely to forget your email address (and if you are, you&#8217;ve probably got bigger problems than being able to log in to some social site). Unfortunately, some sites have a real need for usernames, especially if users can interact with each other &#8211; you don&#8217;t want them to be able to see each other&#8217;s email addresses unless they&#8217;ve explicitly permitted it.</p>
<p>There&#8217;s a simple solution for this &#8211; let users log in with their username <em>or</em> email address. Earth-shattering, I know, but it&#8217;s the small things right?</p>
<p>I&#8217;ve been working on a small Rails site in my free time using the excellent <a href="http://github.com/binarylogic/authlogic">Authlogic</a>. This thing really simplifies a lot of the usual toil and drudgery associated with implementing a membership system, and lets you get back to the part where you can work on features. </p>
<p>It also lets you implement log in with username or email very easily:</p>
<p>user_session.rb:</p>
<pre class="brush:[ruby]">
class UserSession < Authlogic::Session::Base
  find_by_login_method :find_by_login_or_email
end
</pre>
<p>user.rb:</p>
<pre class="brush:[ruby]">
class User < ActiveRecord::Base
  def self.find_by_login_or_email(login)
    User.find_by_login(login) || User.find_by_email(login)
  end
end
</pre>
<p>That's it, you can also change your login page thusly:</p>
<p>views/user_session/new.html.erb:</p>
<pre class="brush:[ruby]">
   &lt;%= f.label :login, "Username or email address" %&gt;&lt;br /&gt;
   &lt;%= f.text_field :login %&gt;
</pre>
<p>And you're done! I love when things Just Work &trade;.</p>
<p>I found this on <a href="http://stackoverflow.com/questions/1331705/cant-put-email-address-field-on-login-form-authlogic">Stack Overflow</a>, but it's probably somewhere in the <a href="http://rdoc.info/projects/binarylogic/authlogic">Authlogic Documentation</a> as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattmacaulay.ca/2010/04/25/log-in-by-username-or-email-in-authlogic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware Fusion: Reinstalling Windows in Bootcamp</title>
		<link>http://mattmacaulay.ca/2010/03/24/vmware-fusion-reinstalling-windows-in-bootcamp/</link>
		<comments>http://mattmacaulay.ca/2010/03/24/vmware-fusion-reinstalling-windows-in-bootcamp/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 14:51:17 +0000</pubDate>
		<dc:creator>mmacaulay</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://mattmacaulay.ca/?p=18</guid>
		<description><![CDATA[My Windows 7 RC installation has expired, sadly. I had it installed in a Boot Camp partition and was using it in VMware Fusion as well. After reinstalling my licensed version of Vista (sad face), I discovered that VMware Fusion no longer works. Not surprising really, but how to fix? The answer, as it turns [...]]]></description>
			<content:encoded><![CDATA[<p>My Windows 7 RC installation has expired, sadly. I had it installed in a Boot Camp partition and was using it in VMware Fusion as well. After reinstalling my licensed version of Vista (sad face), I discovered that VMware Fusion no longer works. Not surprising really, but how to fix? The answer, as it turns out, is pretty straightforward:</p>
<ul>
<li>Make sure VMware Fusion is shut down.</li>
<li>In Finder, navigate to /Users/{username}/Library/Application Support/VMware Fusion/Virtual Machines/</li>
<li>Delete the Boot Camp and Helper folders</li>
</ul>
<p>The next time you start up VMware Fusion, you&#8217;ll be able to set up your Boot Camp partition again. Easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://mattmacaulay.ca/2010/03/24/vmware-fusion-reinstalling-windows-in-bootcamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sarcastic Font</title>
		<link>http://mattmacaulay.ca/2010/02/14/sarcastic-font/</link>
		<comments>http://mattmacaulay.ca/2010/02/14/sarcastic-font/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 15:17:23 +0000</pubDate>
		<dc:creator>mmacaulay</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://mattmacaulay.ca/?p=12</guid>
		<description><![CDATA[Just stumbled upon the Sarcastic Font. Help support this important cause!]]></description>
			<content:encoded><![CDATA[<p>Just stumbled upon the <a href="http://glennmcanally.com/sarcastic/">Sarcastic Font</a>.</p>
<p>Help support this important cause!</p>
<p><img src="http://mattmacaulay.ca/wp-content/uploads/2010/02/Screen-shot-2010-02-14-at-10.13.48-AM.png" alt="Because everyone just loves sarcasm" width="216" height="22" class="alignnone size-full wp-image-14" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mattmacaulay.ca/2010/02/14/sarcastic-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter API strips retweets out of user timelines</title>
		<link>http://mattmacaulay.ca/2010/02/05/twitter-api-strips-retweets-out-of-user-timelines/</link>
		<comments>http://mattmacaulay.ca/2010/02/05/twitter-api-strips-retweets-out-of-user-timelines/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 19:06:59 +0000</pubDate>
		<dc:creator>mmacaulay</dc:creator>
				<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://mattmacaulay.ca/?p=11</guid>
		<description><![CDATA[Just discovered an interesting gotcha in the Twitter API: calls to the user_timeline method will have retweets stripped out. From http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-user_timeline: Note: For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with &#8216;RT&#8217; in RSS and Atom). If you&#8217;d like them included, you can merge [...]]]></description>
			<content:encoded><![CDATA[<p>Just discovered an interesting gotcha in the Twitter API: calls to the user_timeline method will have retweets stripped out.</p>
<p>From <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-user_timeline">http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-user_timeline</a>:</p>
<blockquote><p>
Note: For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with &#8216;RT&#8217; in RSS and Atom). If you&#8217;d like them included, you can merge them in from statuses retweeted_by_me.
</p></blockquote>
<p>Huh. So in other words, making a call like this:</p>
<p>http://twitter.com/statuses/user_timeline.xml?screen_name=mmacaulay&#038;count=1</p>
<p>might give you an empty result. Sneaky. Even if you increase the count parameter there or remove it altogether, you might end up with an empty result if the user does nothing but retweet things. If you want to see the same thing as you&#8217;d see by viewing the user&#8217;s timeline on twitter.com you&#8217;ll have to make an extra call to retweeted_by_me. </p>
<p>Dear Twitter developers: it would be nice if instead of stripping out the retweets you did one of two things:</p>
<ul>
<li>If I make a request with count=n, return the <strong>first n non-retweet statuses</strong></li>
<li>Allow me to specify whether or not retweets are included in the response via another parameter</li>
</ul>
<p>Oh well. It&#8217;s Friday.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattmacaulay.ca/2010/02/05/twitter-api-strips-retweets-out-of-user-timelines/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone SDK and Interface Builder &#8211; Less is more</title>
		<link>http://mattmacaulay.ca/2010/01/30/iphone-sdk-and-interface-builder-less-is-more/</link>
		<comments>http://mattmacaulay.ca/2010/01/30/iphone-sdk-and-interface-builder-less-is-more/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 16:55:40 +0000</pubDate>
		<dc:creator>mmacaulay</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://mattmacaulay.ca/?p=9</guid>
		<description><![CDATA[So I&#8217;ve been tasked with maintaining an iPhone app that my company built on contract over the summer. At the time, the guy who built it (let&#8217;s call him Ray) didn&#8217;t know anything about iPhone or Mac OS development, and neither did I. In fact I&#8217;d never even owned a Mac before a few months [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been tasked with maintaining an iPhone app that my company built on contract over the summer. At the time, the guy who built it (let&#8217;s call him Ray) didn&#8217;t know anything about iPhone or Mac OS development, and neither did I. In fact I&#8217;d never even owned a Mac before a few months ago when I purchased the MBP I&#8217;m typing this on. We&#8217;re a .NET shop here, and although we consider ourselves pretty progressive and open to new things, developing software in the Apple ecosystem is radically different to anything we&#8217;ve done before.</p>
<p>Ray left the company at the end of 2009, leaving me to carry on in maintenance mode until our support contract is up. While I was never involved in the project during the initial development phase, I did hear some interesting stories from Ray about how complex the app had become &#8211; among other things: 20000 lines of code! For a piece of software with modest functionality, and built with modern tools from the company who prides itself on user experience above all else, it seemed like an <strong>awful lot</strong> to me!</p>
<p>I reluctantly set out to learn the ins and outs of the app, and of course iPhone dev/Xcode/Objective-C and all the other fun stuff that comes with it. At first, I just accepted the fact that the app was complex and went about fixing bugs without really giving it a second thought. That was until earlier this week, when during our weekly status call with the client, one of the issues that was brought up was the fact that certain screens in the app don&#8217;t meet the interface guidelines set forth by the client. Things like colours or fonts not matching what&#8217;s in their PSDs can be a lot of toil and drudgery when all those colours and fonts are defined throughout the app in a lot of repetitive code. While we were discussing it, the client wonders why Interface Builder wasn&#8217;t used to create all the UI screens. I&#8217;m wondering the same thing myself.</p>
<p>Some developers view WYSIWYG tools as lazy, inefficent, and less flexible than &#8220;doing it by hand&#8221;. In some cases, I believe this to be true. I&#8217;ve never used a HTML WYSIWYG tool such as Dreamweaver in my life, and I intend to keep it that way. On the other hand, writing Windows desktop software in Visual Studio with .NET or even MFC is miles ahead of the drudgery of the Windows SDK stuff I remember doing in school. ASP.NET web apps have been the bread and butter of my company (and my career) since it&#8217;s inception, so we&#8217;re used to writing UIs in HTML by hand. </p>
<p>What is the recommended approach in iPhone world? Well, after some googling around I came across this: <a href="http://iphonedevelopment.blogspot.com/2009/10/dont-fear-interface-builder.html">Don&#8217;t Fear The Interface Builder</a>. I think this quote sums it up nicely:</p>
<blockquote><p>If you’re writing tons of code to implement your user interface, that’s lots of code you have to write, maintain, and debug.</p></blockquote>
<p>This is exactly the feeling I got when I started going over the endless lines of code doing things like instantiating buttons or table views and placing them on the screen &#8211; that&#8217;s a lot of code to debug and maintain! Things that don&#8217;t really have anything to do with the core functionality of the app. Now that I&#8217;m up to my neck in a sea of code, much of which serves no other purpose than rendering widgets, I&#8217;m feeling the pain. Before he left, I had the sense that Ray was too, although I&#8217;m not sure what prompted him to take the route he did, or if he realized the implications of writing all that UI code. If he reads this, I hope he doesn&#8217;t take it the wrong way, hindsight is 20/20 and I can&#8217;t say for sure if I wouldn&#8217;t have made the same decisions he did.</p>
<p>For now, I&#8217;ve decided to take the positive view that it&#8217;s an opportunity to learn about the innards of how iPhone (and to some degree OS X) apps are created. In the future, when I get the opportunity to work on a new iPhone project from the beginning, I&#8217;ll be sure to take this all into careful consideration. After all, when it comes to software and lines of code, I truly believe that less is more.</p>
<p>-M</p>
]]></content:encoded>
			<wfw:commentRss>http://mattmacaulay.ca/2010/01/30/iphone-sdk-and-interface-builder-less-is-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
