<?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>Flowz &#187; Development</title>
	<atom:link href="http://flowz.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://flowz.com</link>
	<description>Our brain goo cup overfloweth</description>
	<lastBuildDate>Thu, 28 Jul 2011 02:31:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>CSS Image Replacement for iPhone 4 High-DPI Retina Display</title>
		<link>http://flowz.com/2010/07/css-image-replacement-for-iphone-4-high-dpi-retina-display/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-image-replacement-for-iphone-4-high-dpi-retina-display</link>
		<comments>http://flowz.com/2010/07/css-image-replacement-for-iphone-4-high-dpi-retina-display/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 20:23:53 +0000</pubDate>
		<dc:creator>Mike Wille</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://flowz.com/?p=920</guid>
		<description><![CDATA[The new iPhone 4 is certainly a marvel of technology.  One of the surprising side effects it has is how bad it makes things look that weren&#8217;t designed for high-DPI displays.  For the most part, text is automatically beautiful on the iPhone 4 1.  However, images are a different story. What follows is my research...]]></description>
			<content:encoded><![CDATA[<p>The new iPhone 4 is certainly a marvel of technology.  One of the surprising side effects it has is how bad it makes things look that weren&#8217;t designed for high-DPI displays.  For the most part, text is automatically beautiful on the iPhone 4 <sup id="fnr-2010-07-highdpi"><a href="#fn-2010-07-highdpi">1</a></sup>.  However, images are a different story.  What follows is my research and then the technique I used to update images on flowz.com.  We use wordpress here and with this technique, image replacement is automatic.  All you have to do different is upload the second,  high-res file at the same time you insert the normal file in your post or page.  The first thing we need to do is pull in CSS specific to high-DPI device(s) in a standards compliant way.  Here is how you can do that:  <a href="http://thomasmaier.me/2010/06/css-for-iphone-4-retina-display/" target="_blank">http://thomasmaier.me/2010/06/css-for-iphone-4-retina-display/</a> The trick being to use a CSS3 media query to target high DPI devices (*not* just the iPhone 4!):  <code></p>
<pre>&lt;link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)"
	type="text/css" href="css/highdpi.css" /&gt;</pre>
<p></code> But that is only 1/3rd the story.  How do you make sure high resolution images are used when viewing with a High-DPI display?  Aral Balkan has the answer:  <a href="http://aralbalkan.com/3331" target="_blank">http://aralbalkan.com/3331</a> But what he illustrates only works for &#8220;sprites.&#8221;  That is, divs and other elements that use background-images where the src is specified in CSS.  In that special CSS file, we specify the size of the background and include high-res background images that override the normal CSS.  However, there is the problem of elements that specify their src in the HTML.  I.e., img, video, etc.  Aral, touches on what is required but leaves the implementation as an exercise.  I&#8217;ll dive into the details:</p>
<ol>
<li>Create double resolution copies of all your images.  Name these with a suffix of &#8220;@2x&#8221;.  So for <code>logo.png</code>, the double res would be <code>logo@2x.png</code>.  Make sure that all of your image tags have at least a width attribute specified.  (But, you are already doing that aren&#8217;t you?)   If you don&#8217;t, your image dimensions will be increased to the new high-DPI source by the browser.</li>
<li>Create a highdpi.css file.  Contents: <code>
<pre>.replace-2x {
	font-size: 1px;
}</pre>
<p></code> The sole class, <code>.replace-2x</code> contains an attribute that has no effect on img tags.  This is the flag that will tell our javascript it is okay to do image replacement.</li>
<li>In your source HTML, add the <code>replace-2x</code> class to all of your images that have a double resolution counterpart.</li>
<li>In your HTML head, add the link for your high-dpi stylesheet: <code>
<pre>&lt;link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)"
	href="/css/highdpi.css"/&gt;</pre>
<p></code></li>
<li>Create and include in your source, a highdpi.js file.  We are going to assume you are using jQuery for your site.  Contents: <code>
<pre>function highdpi_init() {
	if(jQuery('.replace-2x').css('font-size') == "1px") {
		var els = jQuery(".replace-2x").get();
		for(var i = 0; i < els.length; i++) {
			var src = els[i].src
			src = src.replace(".png", "@2x.png");
			els[i].src = src;
		}
	}
}
jQuery(document).ready(function() {
	highdpi_init();
});</pre>
<p></code></li>
</ol>
<p>The trick here is that we check to see if the font size for our special class is set to value declared in our high-DPI CSS file. (Our flag) It will only be set if the browser passed the media query. If the flag is set, grab every element in the DOM with the replace-2x class and change the src attribute to point to our high-res counterparts.  If you have access to one, pull up http://flowz.com on an iPhone 4 and take a look at our logos here (zoom in if it isn't immediately apparent to you):</p>
<div id="attachment_972" class="wp-caption alignleft" style="width: 224px"><img class="size-full wp-image-972 " title="logo-214" src="http://flowz.com/wp-content/uploads/2010/07/logo-2141.png" alt="" width="214" height="160" /><p class="wp-caption-text">Image without &quot;.replace-2x&quot;</p></div>
<div id="attachment_972" class="wp-caption alignleft" style="width: 224px"><img class="replace-2x size-full wp-image-972 " title="logo-214" src="http://flowz.com/wp-content/uploads/2010/07/logo-214.png" alt="" width="214" height="160" /><p class="wp-caption-text">Image with &quot;.replace-2x&quot;</p></div>
<div style="clear: both;"></div>
<p>(Under normal DPI monitors, the images will look identical.)</p>
<ol>
<li id="fn-2010-07-highdpi">Note: all text looks good, except text rendered using Cufón and sIFR. We hit that problem. A blog post will follow on that. <a class="footnoteBackLink" title="Jump back to footnote 1 in the text." href="#fnr-2010-07-highdpi">↩</a></li>
</ol>
<h3>Sidebar</h3>
<p>I really, really wanted to be able to do something different then what I described above.  I wanted to define a class: <code>.highdpi-supported</code> on the body tag of all the pages that support high-dpi.  I then wanted to add an uncommon attribute on that class to act as the flag to tell javascript to go ahead with image replacement.  Unfortunately, I could not find any such attribute that was relatively safe *and* didn't affect page layout.  So in the end, I'm stuck with adjusting the font-size attribute on the <code>.replace-2x</code> class.  Maybe someone else can come up with a better flag.</p>
]]></content:encoded>
			<wfw:commentRss>http://flowz.com/2010/07/css-image-replacement-for-iphone-4-high-dpi-retina-display/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Goldmember CSS</title>
		<link>http://flowz.com/2009/01/goldmember-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goldmember-css</link>
		<comments>http://flowz.com/2009/01/goldmember-css/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 15:22:58 +0000</pubDate>
		<dc:creator>Mike Wille</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://over.flowz.com/?p=231</guid>
		<description><![CDATA[I only wish I was this clever: Some CSS I just wrote: border: 1px solid gold;” — Justin Ouellette]]></description>
			<content:encoded><![CDATA[<p>I only wish I was this clever:</p>
<blockquote><p>Some CSS I just wrote:</p>
<p><code>border: 1px solid gold;</code>”</p>
<p><cite>— <a href="http://jstn.cc/post/68834911">Justin Ouellette</a></cite></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://flowz.com/2009/01/goldmember-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It’s not really AJAX.</title>
		<link>http://flowz.com/2008/12/its-not-really-ajax/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=its-not-really-ajax</link>
		<comments>http://flowz.com/2008/12/its-not-really-ajax/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 22:12:55 +0000</pubDate>
		<dc:creator>Mike Wille</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://over.flowz.com/?p=207</guid>
		<description><![CDATA[This post is years too late.  But seeing as how there wasn&#8217;t much of a peep in the past, I can&#8217;t let it go into 2009 without one last scream.  The coming month brings about the 10th anniversary of the creation of technology that made AJAX possible. I&#8217;ve been doing AJAX since before it was...]]></description>
			<content:encoded><![CDATA[<p>This post is years too late.  But seeing as how there wasn&#8217;t much of a peep in the past, I can&#8217;t let it go into 2009 without one last scream.  The coming month brings about the 10th anniversary of the creation of technology that made AJAX possible.</p>
<p>I&#8217;ve been doing AJAX since before it was AJAX.  I&#8217;m not nearly alone in this.  In fact, hundreds of thousands, if not millions of developers were already well into using XHR before it was big.  But somehow, <a href="http://developers.slashdot.org/article.pl?sid=05/02/23/1859222&amp;tid=189">some markitecture dewsh[sic] bags coined the term</a> and Web 2.0 neophytes and PHBs alike took hold and never let go.  In case you were wondering, the technology was around for almost six years beforehand.</p>
<p>The damn thing is, it is a terrible acronym that doesn&#8217;t even accurately describe the technology.  No one developing a scalable application who knows anything about performance would dare to use the XML of the X in AJAX to communicate between their remote (remember: LIGHTWEIGHT!) client and the server.</p>
<p>I have reason to believe through my masterful powers of LOGICAL reasoning that %99.999 of developers out there will actually be using either delimited text or JSON.  Of course, I tend to stay away from the Microsoft world that defies logic, so my numbers might be inflated.</p>
<p>I can see why the markitecture dewsh avoided the term AJAJ as it doesn&#8217;t have a catchy pop culture product to propel it into PHB minds.</p>
<p>I propose an alternative for &#8220;the enlightened&#8221; individuals that chose to skirt the masses of Web 2.0 hype:</p>
<p><strong>JAJA</strong></p>
<p>As in <strong>J</strong>SON <strong>A</strong>nd <strong>J</strong>avascript <strong>A</strong>synchronously.  Or for those severely irked:</p>
<p>JAJAWLD (With Less Dewshiness)</p>
<p>Imagine your client coming to you and asking, &#8220;Could you sprinkle some JAA JAA in with this project?&#8221;</p>
<p>Ahh, to live in an alternative universe even for just a few minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://flowz.com/2008/12/its-not-really-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The &#8220;Ad World&#8221; for Dummies</title>
		<link>http://flowz.com/2008/12/the-ad-world-for-dummies/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-ad-world-for-dummies</link>
		<comments>http://flowz.com/2008/12/the-ad-world-for-dummies/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 18:30:52 +0000</pubDate>
		<dc:creator>Mike Wille</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Over Complicated]]></category>

		<guid isPermaLink="false">http://over.flowz.com/?p=81</guid>
		<description><![CDATA[Both Scott and I met working for a very large advertising agency. He actually hired me and was my boss for about 6 years before I waved the white flag and surrendered to fact that things just weren&#8217;t going to change. (More of that &#8220;brick wall of illogic&#8221; again&#8230;) This wasn&#8217;t his doing of course....]]></description>
			<content:encoded><![CDATA[<p>Both Scott and I met working for a very large advertising agency.  He actually hired me and was my boss for about 6 years before I waved the white flag and surrendered to fact that things just weren&#8217;t going to change.  (More of that &#8220;brick wall of illogic&#8221; again&#8230;)  This wasn&#8217;t his doing of course.  It was the struggle with the rest of the company.  But that is another story.</p>
<p>In the beginning it was difficult to understand the difference between Advertising and Marketing.  In fact, I had thought they were one and the same.  Each time I asked an &#8220;expert,&#8221; I got back a litany of different definitions, all of them long and complex.</p>
<p style="text-align: left;">Not long after I left the company, I finally ran across a simple definition that boiled down a few of the different elements of marketing and advertising.  It certainly brought the bright light of realization shinning down from the heavens.  (The source is either Ad Week or Ad Age magazines<sup><a id="fnr1-2008-11-19" href="#fn1-2008-11-19">1</a></sup>)</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-82" title="zag1a_2" src="http://over.flowz.com/wp-content/uploads/2008/11/zag1a_2.jpg" alt="" width="300" height="223" /></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-83" title="zag1b" src="http://over.flowz.com/wp-content/uploads/2008/11/zag1b.jpg" alt="" width="300" height="214" /><a href="http://over.flowz.com/wp-content/uploads/2008/11/zag1c.jpg" rel="lightbox[81]"></a></p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-84" title="zag1c" src="http://over.flowz.com/wp-content/uploads/2008/11/zag1c.jpg" alt="" width="300" height="220" /></p>
<p style="text-align: center;"><a href="http://over.flowz.com/wp-content/uploads/2008/11/zag1c.jpg" rel="lightbox[81]"></a><img class="aligncenter size-full wp-image-85" title="zag1d" src="http://over.flowz.com/wp-content/uploads/2008/11/zag1d.jpg" alt="" width="300" height="214" /></p>
<p>It&#8217;s all starting to make sense now isn&#8217;t it?</p>
<div class="footnotes">
<hr />
<ol>
<li id="fn1-2008-11-19">If you happen to know the source of these images, please let me know.  The original mag these were scanned from is long gone.  I really wish I had written it down for proper attribution.<a href="#fnr1-2008-11-19">↩</a></li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://flowz.com/2008/12/the-ad-world-for-dummies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

