<?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>Parallactic Consulting</title>
	<atom:link href="http://www.parallactic.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.parallactic.com/blog</link>
	<description>Web design and development services</description>
	<lastBuildDate>Thu, 26 Aug 2010 15:18:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS3 and Graceful Degradation</title>
		<link>http://www.parallactic.com/blog/?p=46</link>
		<comments>http://www.parallactic.com/blog/?p=46#comments</comments>
		<pubDate>Fri, 20 Aug 2010 19:56:55 +0000</pubDate>
		<dc:creator>Clara</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[browser compatibility]]></category>
		<category><![CDATA[CSS hacks]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[custom fonts]]></category>
		<category><![CDATA[graceful degradation]]></category>

		<guid isPermaLink="false">http://www.parallactic.com/blog/?p=46</guid>
		<description><![CDATA[While we&#8217;ve previously discussed issues of browser compatibility in terms of trying to make websites look identical in all popular browsers, this isn&#8217;t the best strategy in 100% of cases. Web design is exciting partly because unlike print design, it&#8217;s not just a static image in a known medium &#8212; websites will be viewed from [...]]]></description>
			<content:encoded><![CDATA[<p>While we&#8217;ve <a href="http://www.parallactic.com/blog/?p=16">previously discussed issues of browser compatibility</a> in terms of trying to make websites look identical in all popular browsers, this isn&#8217;t the best strategy in 100% of cases. Web design is exciting partly because unlike print design, it&#8217;s not just a static image in a known medium &#8212; websites will be viewed from all kinds of browsers and devices, interacted with, resized, searched, downloaded, and printed. So rather than striving for pixel-perfect control over the display of every site, we sometimes work for a different but still positive experience with each browser instead of an identical experience.</p>
<p>One great example of this is features supported by <a href="http://css3.info">CSS3</a>. The CSS3 specification is still <a href="http://www.w3.org/Style/CSS/current-work">under development by the W3C</a>. But a lot of modern browsers support some or all of its features. We take advantage of this by writing code that creates fancy visual effects &#8212; like custom fonts, rounded corners, and drop shadows &#8212; for users whose browsers support these features, but degrades gracefully into a simpler display for users with older browsers. This enables us to create simple, search-engine-friendly markup for everyone and display these visual features to some without adding a lot of cruft to the code &#8212; and then, as users upgrade, more and more of them will be able to see our visual effects!</p>
<p>Here we show a few popular CSS3 features and how they display on different browsers. In some cases, the feature in its standard form doesn&#8217;t work in some browsers, but the browsers have implemented proprietary versions of the feature with the same functionality &#8212; in that case, we just list both the standard features (for browsers that support it, and browsers of the future that will support it) and the proprietary versions in our stylesheet.</p>
<p>For our sample here, we&#8217;re trying to display an <code>h2</code> heading in a custom font, with a drop shadow, and we want our text box to have rounded corners on just the top left and bottom right corners. We&#8217;ll use the text-shadow and border-radius properties for the drop shadow and rounded corners.</p>
<p>For a custom font, things are a little bit more complicated. Using the <code>@font-face</code> declaration, we&#8217;re able to embed our font in the webpage and then simply use the <code>font-family</code> property on our <code>h2</code> as usual. The drawbacks of this method are that the custom font won&#8217;t display for users of older browsers, and that the font&#8217;s licence has to allow embedding (in this case, we got it from <a href="http://www.fontsquirrel.com/fontface">FontSquirrel</a>, a great resource that publishes free fonts licensed for commercial use and keeps track of which licenses allow embedding and thus can be used with <code>@font-face</code>). When it&#8217;s important that the same font display even for users of older browsers, and the font&#8217;s license allows embedding, we like to use <a href="http://cufon.shoqolate.com/generate/">Cufon</a> (a JavaScript-based solution); when the font&#8217;s license doesn&#8217;t allow embedding, we use the Flash-based <a href="http://www.mikeindustries.com/blog/sifr">sIFR</a> solution.</p>
<p>Our HTML is simple:</p>
<pre class="brush: html">
&amp;lt;h2&amp;gt;Hello World&amp;lt;/h2&amp;gt;
&amp;lt;div class=&amp;quot;rounded-box&amp;quot;&amp;gt;
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
&amp;lt;/div&amp;gt;
</pre>
<p>And then with CSS, we load the embedded font with the initial <code>@font-face</code> declaration, and use both standard and proprietary attributes to describe the rounded corners to the browser:</p>
<pre class="brush: css">
h2, .rounded-box { font-family: sans-serif; }

@font-face {
font-family: &#039;HeavyDataRegular&#039;;
src: url(&#039;heavy_data-webfont.eot&#039;);
src: local(&#039;☺&#039;), url(&#039;heavy_data-webfont.woff&#039;) format(&#039;woff&#039;), url(&#039;heavy_data-webfont.ttf&#039;) format(&#039;truetype&#039;), url(&#039;heavy_data-webfont.svg#webfontPAbKscLj&#039;) fo\
rmat(&#039;svg&#039;);
font-weight: normal;
font-style: normal;
}

h2 { color: #00c; text-shadow: 2px 2px 2px #222; font-family: &#039;HeavyDataRegular&#039;; font-size: 50px; }
.rounded-box {
-moz-border-radius-topleft: 15px;
-moz-border-radius-bottomright: 15px;
-webkit-border-top-left-radius: 15px;
-webkit-border-bottom-right-radius: 15px;
border-top-left-radius: 15px;
border-bottom-right-radius: 15px;
-moz-box-shadow: 6px 6px 5px #222;
-webkit-box-shadow: 6px 6px 5px #222;
box-shadow: 10px 10px 5px #222;

background: #00cc00;
padding: 10px;
width: 500px;
}
</pre>
<p>The HTML and CSS don&#8217;t change at all between browsers, but how much of the visual effects a user can see depends on their browser.</p>
<ul>
<li>
Users with the oldest browsers don&#8217;t see any of the effects (shown: Opera 8):</p>
<p>
<img class="alignleft size-full wp-image-43" title="opera8" src="http://www.parallactic.com/blog/wp-content/uploads/2010/08/opera8.png" alt="opera8" width="387" height="141" /></li>
<li>In Firefox 2, users see the rounded corners, but not the drop shadow or custom font:
<p>
<img class="alignleft size-full wp-image-45" title="ff2" src="http://www.parallactic.com/blog/wp-content/uploads/2010/08/ff2.png" alt="ff2" width="500" height="171" /></li>
<li>In all recent versions of IE (shown: IE8), users see the custom font, but not the rounded corners or the drop shadow. (IE9 plans to support these attributes.)
<p>
<img class="alignleft size-full wp-image-44" title="ie8" src="http://www.parallactic.com/blog/wp-content/uploads/2010/08/ie8.png" alt="ie8" width="500" height="133" /></li>
<li>In the most recent versions of browsers like Firefox (shown: Firefox 3.6), Safari, Opera, and Safari derivatives like Chrome, users can see all the features &#8212; and as browsers continue to update, more and more users will see these effects without any changes to our code.
<p>
<img class="alignleft size-full wp-image-42" title="ff3.6" src="http://www.parallactic.com/blog/wp-content/uploads/2010/08/ff3.6.png" alt="ff3.6" width="511" height="170" /></li>
</ul>
<p>And, here&#8217;s what it looks like in <strong>your</strong> browser!<br />
<iframe style="width: 600px; height: 200px;" src="http://development.parallactic.com/demoforablogpost/"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallactic.com/blog/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common IE6 Bug Workarounds</title>
		<link>http://www.parallactic.com/blog/?p=16</link>
		<comments>http://www.parallactic.com/blog/?p=16#comments</comments>
		<pubDate>Fri, 27 Nov 2009 21:09:17 +0000</pubDate>
		<dc:creator>Jered</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[browser compatibility]]></category>
		<category><![CDATA[CSS hacks]]></category>
		<category><![CDATA[IE6]]></category>

		<guid isPermaLink="false">http://www.parallactic.com/blog/?p=16</guid>
		<description><![CDATA[Much as we hate it, Internet Explorer 6 still has between 10% and 23% of the browser market share, and some of our clients absolutely need to support it.  Here are a few quick tips for working around some of the more annoying IE6 &#8220;features&#8221;.

&#60;--[if IE comments: IE recognizes macros inside HTML comments that [...]]]></description>
			<content:encoded><![CDATA[<p>Much as we hate it, Internet Explorer 6 still has between 10% and 23% of the browser market share, and some of our clients absolutely need to support it.  Here are a few quick tips for working around some of the more annoying IE6 &#8220;features&#8221;.</p>
<ul>
<li><strong><code>&lt;--[if IE</code> comments</strong>: IE recognizes macros inside HTML comments that cause it to interpret the contents as part of the document.  You can use these macros to include a stylesheet just for old versions of IE:
<pre class="brush: html">
&lt;!--[if lt IE 7]&gt;
    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie6.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
</li>
<li><strong>Tranparent PNG images</strong>: IE6 and IE5.5 show PNGs with alpha as having a solid gray background instead of transparency.  To hack around this, you can use a Microsoft extension called <code>AlphaImageLoader</code>.  Instead of setting a <code>background-image</code> in your CSS, use the <code>filter</code> property:
<pre class="brush: css">
#elt-with-bg {
    width: 100px;
    height: 100px; /*set size explicitly or image may get crazy size*/
    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=&#039;img/thepng.png&#039;, sizingMethod=&#039;crop&#039;);
}
</pre>
<p>Replace <code>&lt;img&gt;</code> PNGs with a <code>&lt;span&gt;</code> having the <code>filter</code> property.</p>
<p>There's no way to tile a background with <code>AlphaImageLoader</code>, but you can set <code>sizingMethod='scale'</code> to stretch an image.  Often for simple drop shadows styled <code>repeat-y</code> or <code>repeat-x</code>, stretching works fine.  <code>sizingMethod='crop'</code> is faster when you don't need to tile an image.</p>
<p>You can use JavaScript to rewrite your document to use <code>AlphaImageLoader</code> dynamically.  We like this <a href="http://jquery.andreaseberhard.de/pngFix/">jQuery pngFix plugin</a>.</li>
<li><strong>min-width and max-width</strong>: IE6 and IE5.5 don't support CSS <code>min-width</code>, however you can use a Microsoft extension to include JavaScript expressions in your IE6 CSS.
<pre class="brush: css">
#menubar {
    /* width: 100% */
    /* min-width: 980px; */
    width: expression(document.body.clientWidth &lt; 980 ? &quot;980px&quot; : &quot;100%&quot;);
}
</pre>
</li>
<li><strong>min-height</strong>: IE6 doesn't support <code>min-height</code>, but you can emulate it with the following CSS hack:
<pre class="brush: css">
#content {
     /* min-height: 350px; */
     height: auto !important;
     height: 350px;
}
</pre>
</li>
<li><strong>Empty <code>&lt;div&gt;</code>s have height</strong>: IE6 treats empty <code>&lt;div&gt;</code>s as if they contain a line of text, so gives them a height.  To avoid this, style empty <code>&lt;div&gt;</code>s:
<pre class="brush: css">
div.empty {
    line-height: 0px;
    font-size: 0px;
}
</pre>
</li>
<li>
<p><strong><a href="http://hsivonen.iki.fi/doctype/">DOCTYPE switching</a></strong>: IE6 added "Quirks mode" which switches back to the IE5.5 rendering engine if you don't include a modern <code>DOCTYPE</code> in your (X)HTML.  Now all modern browsers dumb down their rendering in a similar way, so be sure to include the correct <code>DOCTYPE</code> unless you're targeting 10+ year old browsers!</p>
</li>
<li>
<p><strong>Percentage layout issues</strong>: IE6 has lots of <a href="http://www.positioniseverything.net/explorer/percentages.html">problems</a> with percentage widths in CSS, but the most glaring occur when you try to make a layout that adds up to 100%.  If you're not careful, you may find your sites' columns dancing around when you resize your window!</p>
<p>Suppose you put two <code>width:50%</code> <code>&lt;div&gt;</code>s, <code>A</code> and <code>B</code> next to each other floated <code>left</code> inside a <code>width:100%</code> parent.  If the parent's width is a multiple of 2 pixels, <code>A</code> and <code>B</code> will be side by side.  But if the parent's width is odd, IE6 will place <code>B</code> beneath <code>A</code>!</p>
<p>The issue is IE6 does layout on a 1-pixel grid, and rounds widths like 2.5px to 3px, so it will happily try to stuff two width 3px (2.5px) children into a width 5px parent and overflow the parent.  However, <a href="http://agilewebmasters.com/robert/percentage-rounding-and-sub-pixel-perfection/">precision issues</a> such as this are not unique to IE6.  Solutions: choose widths that add to less than 100% and include copious padding; use JavaScript to reflow your site dynamically (ick); or use a pixel-based layout.  Pixel-based layouts are still the easiest way to ensure your site looks watertight across a wide range of browsers.</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.parallactic.com/blog/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Searchlogic to Simplify Rails Search</title>
		<link>http://www.parallactic.com/blog/?p=9</link>
		<comments>http://www.parallactic.com/blog/?p=9#comments</comments>
		<pubDate>Mon, 23 Nov 2009 23:11:39 +0000</pubDate>
		<dc:creator>Clara</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[named_scope]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[searching]]></category>
		<category><![CDATA[searchlogic]]></category>

		<guid isPermaLink="false">http://www.parallactic.com/blog/?p=9</guid>
		<description><![CDATA[We&#8217;ve been working on a new social networking site, and I&#8217;ve been integrating Searchlogic for the first time to help make searching for users and posts easier. I saw Searchlogic&#8217;s creator give a presentation at a Boston Ruby meetup, and I was pretty psyched to learn about the existence of this simple way to keep [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been working on a new social networking site, and I&#8217;ve been integrating <a href="http://github.com/binarylogic/searchlogic">Searchlogic</a> for the first time to help make searching for users and posts easier. I saw Searchlogic&#8217;s creator give a presentation at a Boston Ruby meetup, and I was pretty psyched to learn about the existence of this simple way to keep the code for this common task clean and DRY.</p>
<p>First, we needed a way for visitors to search for user profiles simply by the fields that are in the database. Easy! Searchlogic has this built-in. </p>
<p>In the view:</p>
<pre class="brush: rails">
&lt;% form_for @search, :html =&gt; {:method =&gt; &#039;post&#039;} do |f| %&gt;
Username: &lt;%= f.text_field :login_like %&gt;
First Name: &lt;%= f.text_field :first_name_like %&gt;
Last Name: &lt;%= f.text_field :last_name_like %&gt;
Bio: &lt;%= f.text_field :bio_like %&gt;
Career: &lt;%= f.text_field :career_like %&gt;
Education: &lt;%= f.text_field :education_like %&gt;
&lt;%= submit_tag &#039;search&#039; %&gt;
&lt;% end %&gt;
</pre>
<p>And in the controller, where the real savings happens:</p>
<pre class="brush: rails">
if request.post?
 @search = User.search(params[:search])
 @users = @search.all
else
 @search = User.search
end
</pre>
<p>Searching on all the user&#8217;s fields, with just a couple lines of code!</p>
<p>In searching posts, we needed some slightly more complicated searches; we&#8217;re using <a href="http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids">acts_as_taggable_on_steroids</a> and wanted users to be able to search for posts with particular tags, and we also wanted a way to use the post&#8217;s belongs_to association to allow users to search for posts entered by a particular user. Since Searchlogic allows us to define our own named scopes, we just need to add a couple of lines to the model to be ready to use the same tricks we used searching on database fields:</p>
<pre class="brush: rails">
named_scope :has_tags, lambda {  |tags|
    Post.find_options_for_find_tagged_with(tags, :match_all =&gt; true)
  }
named_scope :poster_login_like, lambda { |c| { :joins =&gt; [&quot;LEFT OUTER JOIN users ON (users.id = posts.poster_id)&quot;], :conditions =&gt; [&#039;users.login LIKE ?&#039;, c]
  }}
</pre>
<p>We also wanted searching for post content to include a search of the post body. So the view looks like this:</p>
<pre class="brush: rails">
&lt;% form_for @search, :html =&gt; {:method =&gt; &#039;post&#039;} do |f| %&gt;
Containing:  &lt;%= f.text_field :content_like %&gt;&lt;/p&gt;
&lt;p&gt;Tagged with: &lt;%= f.text_field :has_tags %&gt;&lt;/p&gt;
&lt;p&gt;By Username: &lt;%= f.text_field :poster_login_like %&gt;&lt;/p&gt;
&lt;%= submit_tag &#039;search&#039; %&gt;
&lt;% end %&gt;
</pre>
<p>And the controller has the same super-simple:</p>
<pre class="brush: rails">
    if request.post?
      @search = Post.search(params[:search])
      @posts = @search.all
    else
      @search = Post.search
    end
</pre>
<p>This is one of the things I love about working with Rails &mdash; thanks to all the great gems and plugins out there, we can do complex stuff with just a few lines of code rather than re-inventing the wheel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallactic.com/blog/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallactic Site Gets a Facelift</title>
		<link>http://www.parallactic.com/blog/?p=1</link>
		<comments>http://www.parallactic.com/blog/?p=1#comments</comments>
		<pubDate>Mon, 02 Nov 2009 22:31:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[What We've Been Up To]]></category>

		<guid isPermaLink="false">http://192.168.1.4/parallactic/blog/?p=1</guid>
		<description><![CDATA[Welcome to our new website!  We hope you like it.  We&#8217;ve been busy lately, honing our design skills and polishing our our pages.  Now clients can more easily review our portfolio and see what we can do for them.
We&#8217;ve also added this blog, where we&#8217;ll be posting tips and tricks we discover or invent in [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to our new website!  We hope you like it.  We&#8217;ve been busy lately, honing our design skills and polishing our our pages.  Now clients can more easily review our portfolio and see what we can do for them.</p>
<p>We&#8217;ve also added this blog, where we&#8217;ll be posting tips and tricks we discover or invent in the course of our work, and keeping you updated on the projects we work on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallactic.com/blog/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
