<?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>Ecommerce trends, online retail news and opinion, user experience design : Our Blog : Alexander Interactive &#187; Kyle Banker</title>
	<atom:link href="http://www.alexanderinteractive.com/blog/author/kbanker/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexanderinteractive.com/blog</link>
	<description>The pulse of Alexander Interactive</description>
	<lastBuildDate>Tue, 07 Feb 2012 23:39:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mortimer Password Manager, Redesigned (v1.2)</title>
		<link>http://www.alexanderinteractive.com/blog/2009/08/mortimer-password-manager-redesigned-v1-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mortimer-password-manager-redesigned-v1-2</link>
		<comments>http://www.alexanderinteractive.com/blog/2009/08/mortimer-password-manager-redesigned-v1-2/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 16:23:56 +0000</pubDate>
		<dc:creator>Kyle Banker</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[mortimer]]></category>
		<category><![CDATA[password management]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://ai.qa.aistg.com/blog/2009/08/mortimer-password-manager-redesigned-v1-2/</guid>
		<description><![CDATA[Mortimer, our multi-user, Rails-based password manager, has received a complete, front-end redesign along with multiple bug fixes and security improvements. Here are some screenshots of the latest release: Comparing this to the original application&#8217;s design, you&#8217;ll see huge improvements in usability and aesthetics. Many thanks to Devin Ikram for the novel design work and to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/aiaio/mortimer/tree/master">Mortimer</a>, our multi-user, Rails-based password manager, has received a complete, front-end redesign along with multiple bug fixes and security improvements. Here are some screenshots of the latest release:</p>
<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a onclick="window.open('http://www.alexanderinteractive.com/blog/assets_c/2009/08/mortimer-login-70.html','popup','width=1236,height=773,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://www.alexanderinteractive.com/blog/assets_c/2009/08/mortimer-login-70.html"><img class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" src="http://www.alexanderinteractive.com/blog/assets_c/2009/08/mortimer-login-thumb-425x265-70.png" alt="mortimer-login.png" width="425" height="265" /></a></span><br />
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a onclick="window.open('http://www.alexanderinteractive.com/blog/assets_c/2009/08/mortimer-passwords-74.html','popup','width=1236,height=773,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://www.alexanderinteractive.com/blog/assets_c/2009/08/mortimer-passwords-74.html"><img class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" src="http://www.alexanderinteractive.com/blog/assets_c/2009/08/mortimer-passwords-thumb-425x265-74.png" alt="mortimer-passwords.png" width="425" height="265" /></a></span><br />
Comparing this to the <a href="http://www.alexanderinteractive.com/blog/assets_c/2009/02/mortimer-17.html">original application&#8217;s design</a>, you&#8217;ll see huge improvements in usability and aesthetics.  Many thanks to <a href="http://www.alexanderinteractive.com/blog/author/devin-ikram/">Devin Ikram</a> for the novel design work and to Ashley Cross, <a href="http://www.alexanderinteractive.com/blog/author/skottey-forden-1/">Skottey Forden</a>, and <a href="http://www.alexanderinteractive.com/blog/author/tom-rosario/">Tom Rosario</a> for the solid, cross-browser, front-end implementation.</p>
<p>Enjoy this latest release of Mortimer. If you&#8217;d like to participate in Mortimer&#8217;s development, don&#8217;t hesitate to <a href="http://github.com/aiaio/mortimer/tree/master">fork us on Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderinteractive.com/blog/2009/08/mortimer-password-manager-redesigned-v1-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tip: Using Procs with Thoughtbot&#8217;s Paperclip</title>
		<link>http://www.alexanderinteractive.com/blog/2009/06/tip-using-procs-with-thoughtbots-paperclip/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tip-using-procs-with-thoughtbots-paperclip</link>
		<comments>http://www.alexanderinteractive.com/blog/2009/06/tip-using-procs-with-thoughtbots-paperclip/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 18:20:22 +0000</pubDate>
		<dc:creator>Kyle Banker</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ai.qa.aistg.com/blog/2009/06/tip-using-procs-with-thoughtbots-paperclip/</guid>
		<description><![CDATA[Thoughtbot&#8217;s Paperclip allows easy and reliable management of attachments. Using it is as simple as adding a few columns to your model and invoking the has_attached_file class method with the desired options. One of Paperclip&#8217;s as-yet-undocumented features is the option to pass an anonymous function to the :url, :path, and :styles parameters of the has_attached_file [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://thoughtbot.com/projects/paperclip">Thoughtbot&#8217;s Paperclip</a> allows easy and reliable management of attachments. Using it is as simple as adding a few columns to your model and invoking the <strong>has_attached_file</strong> class method with the desired options.<br />
One of Paperclip&#8217;s as-yet-undocumented features is the option to pass an <a href="http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Method_Calls#Understanding_blocks.2C_Procs_and_methods">anonymous function</a> to the <strong>:url</strong>, <strong>:path</strong>, and <strong>:styles</strong> parameters of the <strong>has_attached_file</strong> class method.<br />
In the example below, a Product has many ProductImages.  No problem, except that I might not want every product image to have the same style attributes (e.g., a product could have a header image of &#8217;200&#215;400&#8242; and a main image of &#8217;300&#215;300&#8242;). Certainly one way to handle this would be to create a distinct class for each type of product image (HeaderProductImage, MainProductImage, etc.).<br />
But another, and perhaps more interesting solution, is to pass an anonymous function to the <strong>:styles</strong> parameter. That function can then return a customized style attribute for any kind of image:<br />
<script src="http://gist.github.com/128238.js"></script><br />
<noscript></p>
<pre>
<code>
class Product < ActiveRecord::Base
has_many :images, :class_name => "ProductImage"
end
class ProductImage < ActiveRecord::Base
belongs_to :product
has_attached_file :image,
:storage => :filesystem,
:path => ":rails_root/public/images/products/:attachment/:id/:style/:basename.:extension",
:url => "/images/products/:attachment/:id/:style/:basename.:extension",
# Because the :styles key can take a Proc object as an argument, we can specify the image
# styles dynamically based on the image's label.
:styles => Proc.new {|this|
defionition = ProductImageDefinitions.detect {|spec| spec[:label] == this.instance.label}
definition[:styles].merge(:thumb => '200x200>')
}
end
</code>
</pre>
<p></noscript><br />
When Paperclip processes the attachment, it passes itself to the anonymous function. The model can then be accessed by calling the <strong>#instance</strong> attribute on the passed-in reference (see above).<br />
The ProductImage class defines a <strong>#label</strong> attribute. The label acts as a key to a hash, ProductImageDefinitions, which specifies styles for various kinds of product images (you might define this somewhere in config/initializers).<br />
<script src="http://gist.github.com/129460.js"></script><br />
<noscript></p>
<pre>
<code>
ProductImagesDefinitions = {
'main' => {:styles => {:large => "1200x600!", :medium => "600x300!"},
'header' => {:styles => {:large => "400x600!", :medium => "200x300!"}
}
</code>
</pre>
<p></noscript><br />
This allows for a high level of flexibility since adding a new kind of product image is simply a matter of modifying the ProductImageDefinitions hash.  For a nice interface, you might write <a href="http://gist.github.com/129471">a module like this one</a> to allow for the following manipulation of product images:<br />
<script src="http://gist.github.com/129462.js"></script><br />
<noscript></p>
<pre>
<code>
# Create product images.
@product.product_images.create(:label => 'main', :image => # Attachment object)
@product.product_images.create(:label => 'header', :image => # Attachment object)
# Access product images.
@product.available_images('main')
@product.available_images('header')
</code>
</pre>
<p></noscript><br />
Not bad, right?  The same kind of on-the-fly configuration can be applied to the <strong>:url</strong> and <strong>:path</strong> parameters. Thus does Paperclip&#8217;s support for anonymous functions enhance an already superb library.<br />
For the record, I myself am still on the fence about whether this application of anonymous functions can be considered a good practice in terms of readability and maintainability.<br />
But from the perspective of <strong>the sheer fun and practicality of the functional paradigm in Ruby</strong>, I&#8217;m going to consider it a worthwhile excursion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderinteractive.com/blog/2009/06/tip-using-procs-with-thoughtbots-paperclip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tip: Conditional Validations for ActiveRecord</title>
		<link>http://www.alexanderinteractive.com/blog/2009/04/tip-conditional-validations-for-activerecord/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tip-conditional-validations-for-activerecord</link>
		<comments>http://www.alexanderinteractive.com/blog/2009/04/tip-conditional-validations-for-activerecord/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 14:28:30 +0000</pubDate>
		<dc:creator>Kyle Banker</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ai.qa.aistg.com/blog/2009/04/tip-conditional-validations-for-activerecord/</guid>
		<description><![CDATA[Is isn&#8217;t always desirable, or even necessary, to validate every attribute in a given model with every save. For example, I recently had to build out a tabbed interface for editing products. Normally, when a user would press save, with the controller code calling update_attributes, errors would appear for attributes outside the current tab. The [...]]]></description>
			<content:encoded><![CDATA[<p>Is isn&#8217;t always desirable, or even necessary, to validate every attribute in a given model with every save.  For example, I recently had to build out a tabbed interface for editing products.  Normally, when a user would press save, with the controller code calling update_attributes, errors would appear for attributes outside the current tab.<br />
The need for intelligent, conditional validation begat the following module, which can be included in any ActiveRecord class:<br />
<script src="http://gist.github.com/97286.js"></script><br />
<noscript><br />
<code></p>
<pre>
module SelectiveAttributeValidatable
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :update_attributes, :check
end
end
module InstanceMethods
# Store the set of attributes passed in to #update_attributes.
def update_attributes_with_check(attrs)
@attrs_to_validate = attrs.keys.map(&#038;:to_s)
update_attributes_without_check(attrs)
end
# Returns true if a given attribute was passed in to #update_attributes.
def should_validate?(attr)
if self.new_record?
attrs_to_validate_on_create.include?(attr)
else
@attrs_to_validate.blank? ||
@attrs_to_validate.include?(attr) ||
self.status == 'ENABLED'
end
end
# This method must be overwritten in the class
# where this module is included. Specify whichever
# attributes you want validated on create:
#   ['name', 'sku']
def attrs_to_validate_on_create
[]
end
# Allows the should_validate callback to be thrown.
def method_missing(method, *args)
if method.to_s =~ /^should_validate_([_\w]+)[?]/
return should_validate?($1)
else
super
end
end
end
end
</pre>
<p></code><br />
</noscript><br />
After including this module, you&#8217;ll need to add conditions to your validations, as follows:<br />
<script src="http://gist.github.com/97290.js"></script><br />
<noscript><br />
<code></p>
<pre>
validates_presence_if       :description,  :if => :should_validate_description?
validates_numericality_of  :age,            :if => :should_validate_age?
</pre>
<p></code><br />
</noscript><br />
Once you&#8217;ve implemented the conditions on your validation, any call to update_attributes will validate only the attributes included in that call.<br />
<strong>Caveat</strong><br />
You probably want to make sure that your objects are eventually valid. In my case, this entails storing an enabled/disabled state on the object.  This way, I can specify that when the object is enabled, all of the validations should be in effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderinteractive.com/blog/2009/04/tip-conditional-validations-for-activerecord/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip: Reloading ActiveRecord Instances</title>
		<link>http://www.alexanderinteractive.com/blog/2009/02/tip-reloading-activerecord-instances/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tip-reloading-activerecord-instances</link>
		<comments>http://www.alexanderinteractive.com/blog/2009/02/tip-reloading-activerecord-instances/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 12:20:39 +0000</pubDate>
		<dc:creator>Kyle Banker</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[shoulda]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://ai.qa.aistg.com/blog/2009/02/tip-reloading-activerecord-instances/</guid>
		<description><![CDATA[When writing unit tests in Rails, I&#8217;ll often make a change to an ActiveRecord instance, requiring a reload for the next assertion to pass (oversimplified): context "A new group" do setup do @group = Factory(:group) end context "with an added entry" do setup do @entry = Factory(:entry, :title => "WEB", :group => @group) @group.reload end [...]]]></description>
			<content:encoded><![CDATA[<p>When writing unit tests in Rails, I&#8217;ll often make a change to an ActiveRecord instance, requiring a reload for the next assertion to pass (oversimplified):<br />
<script src="http://gist.github.com/70318.js"></script><br />
<noscript><br />
<code></p>
<pre>
context "A new group" do
setup do
@group = Factory(:group)
end
context "with an added entry" do
setup do
@entry = Factory(:entry, :title => "WEB", :group => @group)
@group.reload
end
should "add an entry to the group"
assert @group.entries.include?(@entry)
end
end
end
</pre>
<p></code><br />
</noscript><br />
Instead of calling <b>#reload</b> on all the affected objects, I&#8217;ve found it useful to include a simple helper method that, when called, reloads any in-scope ActiveRecord instances:<br />
<script src="http://gist.github.com/70290.js"></script><br />
<noscript><br />
<code></p>
<pre>
class Test::Unit::TestCase
private
def reload_activerecord_instances
self.instance_variables.each do |ivar|
if ivar.is_a?(ActiveRecord::Base) &#038;&#038; ivar.respond_to?(:reload)
ivar.reload
end
end
end
end
</pre>
<p></code><br />
</noscript><br />
This has proven especially helpful when I&#8217;m handling several ActiveRecord objects and need to update them all at once. Cleaner, less repetitive code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderinteractive.com/blog/2009/02/tip-reloading-activerecord-instances/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mortimer: A Rails Password Manager</title>
		<link>http://www.alexanderinteractive.com/blog/2009/02/mortimer-a-rails-password-manager/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mortimer-a-rails-password-manager</link>
		<comments>http://www.alexanderinteractive.com/blog/2009/02/mortimer-a-rails-password-manager/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 14:28:12 +0000</pubDate>
		<dc:creator>Kyle Banker</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[password management]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://ai.qa.aistg.com/blog/2009/02/mortimer-a-rails-password-manager/</guid>
		<description><![CDATA[Today we release mortimer, our Rails-based password management application. The goal was to produce a secure, multi-user password vault providing basic user permissions and a simple interface. Here&#8217;s a screenshot from the current app: Public-key Cryptography mortimer secures password using public-key cryptography. Each user on the system has a unique key pair. When you create [...]]]></description>
			<content:encoded><![CDATA[<p>Today we release <a href="http://github.com/aiaio/mortimer/tree/master">mortimer</a>, our Rails-based password management application. The goal was to produce a secure, multi-user password vault providing basic user permissions and a simple interface. Here&#8217;s a screenshot from the current app:</p>
<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.alexanderinteractive.com/blog/assets_c/2009/02/mortimer-17.html" onclick="window.open('http://www.alexanderinteractive.com/blog/assets_c/2009/02/mortimer-17.html','popup','width=976,height=611,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.alexanderinteractive.com/blog/assets_c/2009/02/mortimer-thumb-500x313-17.png" alt="mortimer.png" class="mt-image-none" style="" width="500" height="313" /></a></span><br />
<h3><strong>Public-key Cryptography</strong></h3>
<p><strong>mortimer</strong> secures password using public-key cryptography. Each user on the system has a unique key pair. When you create a password entry, <strong>mortimer</strong> stores a uniquely-encrypted version of that password entry for each user with access to that password. This ensures that any time a password changes, all users have access to the change, with no compromise in security.  And since all private keys are symmetrically encrypted with the user&#8217;s password, even a compromised database is fairly useless.<br />
<h3><strong>Precautions</strong></h3>
<p>Many would still argue that &#8220;web application&#8221; and &#8220;password manager&#8221; are mutually exclusive terms. It depends. We recommend, at minimum the following:
<ul>
<li>Do not expose <strong>mortimer</strong> to the public internet.</li>
<li>Run it over SSL (this is, in fact, required).</li>
<li>Use strong passwords, and limit access to the production environment.</li>
</ul>
<h3><strong>A work in progress</strong></h3>
<p><strong>mortimer</strong> should be considered alpha as it will remain under active development.  Expect improvement to the UI, along with security tweaks and cross-browser compatibility. Let us know if you find it useful.</p>
<p>
Contributions are welcome. Clone or fork us on <a href="http://github.com/aiaio/mortimer/tree/master">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderinteractive.com/blog/2009/02/mortimer-a-rails-password-manager/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching using apc
Object Caching 391/458 objects using apc
Content Delivery Network via cdn.at.ai

Served from: www.alexanderinteractive.com @ 2012-02-08 09:47:40 -->
