<?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>Andrew Marconi &#187; Programming</title>
	<atom:link href="http://andrewmarconi.com/topic/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewmarconi.com</link>
	<description>Creative Technology Leader &#38; Development Professional</description>
	<lastBuildDate>Mon, 06 Feb 2012 04:09:21 +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>Getting Started with iOS Web Applications: &lt;head&gt; Block Best Practices</title>
		<link>http://andrewmarconi.com/2010/09/getting-started-iphone-ipad-web-apps-best-practices/</link>
		<comments>http://andrewmarconi.com/2010/09/getting-started-iphone-ipad-web-apps-best-practices/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 13:56:34 +0000</pubDate>
		<dc:creator>Andrew Marconi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Web apps]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://andrewmarconi.com/?p=295</guid>
		<description><![CDATA[Being relatively new to building Web applications for iPhone, iPad and other Webkit/iOS browsers, I’ve been spending more and more time searching through the Apple Developer Safari Reference Library.]]></description>
			<content:encoded><![CDATA[<p>Being relatively new to building Web applications for iPhone, iPad and other Webkit/iOS browsers, I&#8217;ve been spending more and more time searching through the Apple Developer <a href="http://developer.apple.com/library/safari/navigation/" target="_blank">Safari Reference Library</a>.<span id="more-295"></span></p>
<p>It&#8217;s a very complete resource, but so far, I&#8217;ve found it to be mildly frustrating for the beginner. For instance, constructing a basic &lt;head&gt; block requires referencing about 3-5 different pages in the Apple documentation (that don&#8217;t link together in a meaningful way), as well as a variety of third-party developers&#8217; sites.</p>
<p>So, I&#8217;ll step through what I typically do, explaining it line by line. Hopefully it will help someone who might otherwise go through the same problems I experienced when I was first getting started with Web app development for iOS mobiles and Webkit.  I&#8217;m not saying that this is the 100% best way to do it; it is the way that seems to work best for me. If you have any suggestions to improve it (or refute some of my thinking), please feel free to comment on this post or contact me directly.</p>
<h3>What Character Set?</h3>
<p>First up, the http-equiv meta tag. I <strong>always</strong> encode my pages for UTF-8 because I typically deal with users around the world who have Web browsers that may render local characters incorrectly. UTF-8 allows for a large character set. <a href="http://www.utf8.com/" target="_blank">Learn more about UTF-8 at UTF8.com</a>.</p>
<p><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;</code></p>
<h3>This Really is a Safari Web App</h3>
<p>Setting the <a href="http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safarihtmlref/articles/metatags.html" target="_blank">apple-mobile-web-app-capable</a> meta tag to <strong>yes</strong> means that the page can be added as a full-screen app, and run &#8220;outside&#8221; of Safari. I say outside in quotes, because really it is still running using the Webkit rendering engine, but the user isn&#8217;t presented with the URL bar, or other chrome that, while useful when browsing the Web, only gets in the way when he or she is using your Web app.</p>
<p><code>&lt;meta name="apple-mobile-web-app-capable" content="yes" /&gt;</code></p>
<h3>The Status Bar</h3>
<p>Next, we define how the top bar looks (the bit that has the carrier, time and other system-wide icons). By default, this value is <strong>default</strong>, meaning, a grey chrome finish and completely opaque. Lately, I&#8217;ve been going with setting this to <strong>black</strong> which is how it sounds. The other option available is <strong>translucent-black</strong>. This lets your app &#8220;bleed through,&#8221; which sounds like a good idea, and can look nice if you take this into consideration when you build your mobile Web app&#8230; but in practice can end up looking a little sloppy in my opinion.</p>
<p><code>&lt;meta name="apple-mobile-web-app-status-bar-style" content="black" /&gt;</code></p>
<h3>Viewport vs. Window</h3>
<p>The <a href="http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html#//apple_ref/doc/uid/TP40006509-SW1" target="_blank">viewport</a> is one of the tricker concepts to understand. By default, iOS Safari renders content in a window with a 1024 pixel width. It then scales things down using it&#8217;s own logic to fit what it can on your screen (the viewport). The basic idea is that the <strong>viewport</strong> is inside of the <strong>window</strong>. On the desktop version of Safari, the two are set to the exact same size.</p>
<p>What I&#8217;ve found to work best for the iOS devices is the following. Basically, I&#8217;m saying, set the scale to 1:1 (make the viewport the same size as the window); the width should be the device&#8217;s width (this is a constant that changes based on rotation of the device &#8212; better to set it to this than to give a static width); and don&#8217;t let the user scale anything (again, because I&#8217;ve designed this as a Web app, specifically for iOS, there should be no need to scale).</p>
<p><code>&lt;meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" /&gt;</code></p>
<h3>Auto-Detect Phone Numbers</h3>
<p>Many of the Web apps that I work with extend digital asset management systems, and so they include things like identification numbers for TV commercials, print job numbers, etc.; rarely do I use telephone numbers in my Web apps. So, I turn off automatic detection of telephone numbers to prevent bad links. Your Web app may be different, and you might want this behavior&#8230; if so, then by all means, skip over this line.</p>
<p>For me, I start with no phone number detection, and then flag items manually that should be sent to the phone (for instance, a technical support phone number in the footer). For this type of scenario, I&#8217;ll use a tag like <strong>&lt;a href=&#8221;tel:212-555-1212&#8243;&gt;Support by Phone&lt;/a&gt;</strong>. Using &#8220;tel:&#8221; as the first part of the href let&#8217;s Safari know that the link is be sent to the phone app rather than as a Web link.</p>
<p><code>&lt;meta name="format-detection" content="telephone=no" /&gt;</code></p>
<h3>Default Home Screen Icon</h3>
<p>By default when you click the &#8220;+&#8221; icon in Safari to add a Web app to your home page, Safari will take a screenshot and use it as the icon. Generally, this isn&#8217;t very pretty. You can supply a more user-friendly design by uploading a 57&#215;57 pixel PNG (<strong>not</strong> GIF or JPG), and pointing <a href="http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html" target="_blank">apple-touch-icon</a> to it. Don&#8217;t include any rounded corners, or the glass/glow art &#8212; Safari takes care of this for you. There is an alternate meta tag that allows you to supply a pre-composed image instead, but generally, I don&#8217;t go that route.</p>
<p><code>&lt;link rel="apple-touch-icon" href="/lib/media/apple/icon.png" /&gt;</code></p>
<h3>Startup Image</h3>
<p>Similarly, you can provide a &#8220;startup image&#8221; that displays before your Web app runs (actually, it displays while the device compares its cached version of your Web app to the live version on your server, and if there are differences it downloads them). This should be a 320&#215;460 pixels in size, again in PNG format. Remember, this will only appear when your Web app is running full-screen (i.e., when you click on it from your device&#8217;s home screen); it doesn&#8217;t display when browsing to it in  Safari.</p>
<p><code>&lt;link rel="apple-touch-startup-image" href="/lib/media/apple/splash.png" /&gt;</code></p>
<h3>Localized CSS</h3>
<p>Lastly, I link to my stylesheet that defines styles specific to the Web app. If you&#8217;ve used any third-party libraries to help with layout, they would appear before this link so that you can override any styles locally. Some examples of these libraries are <a href="http://code.google.com/p/iui/" target="_blank">iUI</a> and <a href="http://iwebkit.net/" target="_blank">iWebKit</a>.</p>
<p><code>&lt;link rel="stylesheet" type="text/css" href="/lib/css/ios-common.css" /&gt;</code></p>
<h3>Does Order Matter?</h3>
<p>I don&#8217;t really know. Typically, I organize my &lt;head&gt; block by placing any &lt;meta&gt; tags first, then &lt;link&gt; tags, and then the &lt;title&gt; tag. I really don&#8217;t think that this matters much, but I&#8217;m a fairly visual person, and having things grouped this way makes it easier for me to browse my source code.</p>
<h3>In Summary</h3>
<p>In summary, here is the completed &lt;head&gt; block:</p>
<div style="background: #ebebeb;"><code>&lt;head&gt;<br />
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;<br />
&lt;meta name="apple-mobile-web-app-capable" content="yes" /&gt;<br />
&lt;meta name="apple-mobile-web-app-status-bar-style" content="black" /&gt;<br />
&lt;meta name="viewport"<br />
content="initial-scale=1.0, width=device-width, user-scalable=no" /&gt;<br />
&lt;meta name="format-detection" content="telephone=no" /&gt;<br />
&lt;link rel="apple-touch-icon" href="/lib/media/apple/icon.png" /&gt;<br />
&lt;link rel="apple-touch-startup-image" href="/lib/media/apple/splash.png" /&gt;<br />
&lt;link rel="stylesheet" type="text/css" href="/lib/css/ios-common.css" /&gt;<br />
&lt;title&gt;Name of Your App Here&lt;/title&gt;<br />
&lt;/head&gt;</code></div>
]]></content:encoded>
			<wfw:commentRss>http://andrewmarconi.com/2010/09/getting-started-iphone-ipad-web-apps-best-practices/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enabling Flash Video (FLV) Playback on Windows IIS</title>
		<link>http://andrewmarconi.com/2009/06/enabling-flash-video-flv-playback-on-windows-iis/</link>
		<comments>http://andrewmarconi.com/2009/06/enabling-flash-video-flv-playback-on-windows-iis/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 14:11:21 +0000</pubDate>
		<dc:creator>Andrew Marconi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://andrewmarconi.com/?p=155</guid>
		<description><![CDATA[Here&#8217;s another &#8220;gotcha&#8221; courtesy of Microsoft: by default, IIS doesn&#8217;t include a MIME type for Flash Video (FLV) files, resulting in a 404 Not Found error whenever you try to access the file. One would think that they would deliver a 401 Unauthorized error, but hey&#8230; what do I know? Right click on either the [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another &#8220;gotcha&#8221; courtesy of Microsoft: by default, IIS doesn&#8217;t include a MIME type for Flash Video (FLV) files, resulting in a 404 Not Found error whenever you try to access the file. One would think that they would deliver a 401 Unauthorized error, but hey&#8230; what do I know?</p>
<p>Right click on either the individual site or the full server, and then click &#8220;Properties.&#8221;</p>
<p>1. Click on the &#8220;HTTP Headers&#8221; tab.<br />
2. Choose &#8220;File Types&#8221; and click &#8220;New Type.&#8221;<br />
3. Add &#8220;.flv&#8221; for the associated extension, and &#8220;video/x-flv&#8221; as the content-type.<br />
4. Click OK to save the addition, and close out.</p>
<ol></ol>
<p>Like everything with IIS, you may need to restart the service to see the change.</p>
<p>This is just one more reason to use Apache on Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmarconi.com/2009/06/enabling-flash-video-flv-playback-on-windows-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting jQuery in WordPress Themes</title>
		<link>http://andrewmarconi.com/2009/05/troubleshooting-jquery-in-wordpress-themes/</link>
		<comments>http://andrewmarconi.com/2009/05/troubleshooting-jquery-in-wordpress-themes/#comments</comments>
		<pubDate>Fri, 29 May 2009 04:29:03 +0000</pubDate>
		<dc:creator>Andrew Marconi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[troubleshoot]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://andrewmarconi.com/?p=128</guid>
		<description><![CDATA[Here&#8217;s another &#8220;oh yeah, I always forget about that&#8221; geek item. I spent a few hours today going nuts trying to figure out why the jQuery Cycle plug-in wasn&#8217;t working in a new theme I&#8217;m working on. The code ran great outside of WordPress, but the minute I placed it inside the theme, it broke. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jquery.com/" target="_blank"><img class="alignright size-full wp-image-130" title="jquery" src="http://andrewmarconi.com/wp-content/uploads/2009/05/jquery.jpg" alt="jquery" width="249" height="110" /></a></p>
<p>Here&#8217;s another &#8220;oh yeah, I always forget about that&#8221; geek item.</p>
<p>I spent a few hours today going nuts trying to figure out why the <a href="http://www.malsup.com/jquery/cycle/" target="_blank">jQuery Cycle plug-in</a> wasn&#8217;t working in a new theme I&#8217;m working on. The code ran great outside of WordPress, but the minute I placed it inside the theme, it broke.</p>
<p>Then I realized: when using <a href="http://jquery.com/" target="_blank">jQuery</a> in <a href="http://www.wordpress.org/" target="_blank">WordPress</a> you always have to remember to explicitly call it by name rather than use the handy-dandy $(&#8220;#identifier&#8221;) short-cut that every example and demo online uses. The long-winded reasoning (as I discovered thanks to <a href="http://techxplorer.com/2008/02/25/using-jquery-with-wordpress/" target="_blank">Techxplorer&#8217;s blog entry</a>) is that the bundled version of jQuery built into WordPress since version 2.2 is initialized with <a href="http://docs.jquery.com/Core/jQuery.noConflict" target="_blank">jQuery.noConflict</a>. The upside is that this keeps the jQuery library from crashing into other bundled libraries (like <a href="http://www.prototypejs.org/" target="_blank">Prototype</a>). The bad news is that it breaks support for the $ shortcut.</p>
<p>I came across an simple solution via <a href="http://chrismeller.com/2007/07/using-jquery-in-wordpress" target="_blank">Chris Mellon</a>:</p>
<blockquote><p>Instead, for interoperability, be sure to use <code>jQuery()</code> instead, which should accomplish the same thing.</p>
<p>A bad example:</p>
<pre class="javascript geshicode" style="font-family: monospace;"><span style="color: #003366; font-weight: bold;">var</span> username <span style="color: #339933;">=</span> $<span style="color: #009900;">(</span><span style="color: #3366cc;">'#username'</span><span style="color: #009900;">)</span>.<span style="color: #660066;">val</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre>
<p>If Prototype were to be loaded on the page this snippet of <acronym title="JavaScript"><span class="caps">JS</span></acronym> is running on, it would throw an error, since it uses a different pattern for selecting <acronym title="Document Object Model"><span class="caps">DOM</span></acronym> elements.</p>
<p>A good example:</p>
<pre class="javascript geshicode" style="font-family: monospace;"><span style="color: #003366; font-weight: bold;">var</span> username <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">(</span><span style="color: #3366cc;">'#username'</span><span style="color: #009900;">)</span>.<span style="color: #660066;">val</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre>
<p>This line should work on any page, regardless of library conflicts. It’s a couple extra characters to type, but in the end it’s really for the best &#8211; you get portability, and it’s more self-explanatory which library is being used when you go back to look at this code in 6 months.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewmarconi.com/2009/05/troubleshooting-jquery-in-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Theme Check List/Cheat Sheet</title>
		<link>http://andrewmarconi.com/2009/05/wordpress-theme-check-listcheat-sheet/</link>
		<comments>http://andrewmarconi.com/2009/05/wordpress-theme-check-listcheat-sheet/#comments</comments>
		<pubDate>Thu, 14 May 2009 16:06:12 +0000</pubDate>
		<dc:creator>Andrew Marconi</dc:creator>
				<category><![CDATA[Content Publishing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://andrewmarconi.com/?p=115</guid>
		<description><![CDATA[Stefan Vervoort over at WPToy.com has published a great cheat sheet for developing WordPress themes. It's available in PDF format, so as he suggests, if you build themes print it out and put it on your wall. When I'm building a WordPress theme, I always forget something along the line (when I go into "programmer mode" I get a little lazy sometimes, alright?) -- this makes sure I cover off on all the elements.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-120" title="wordpress-theme-development-checklist" src="http://andrewmarconi.com/wp-content/uploads/2009/05/wordpress-theme-development-checklist-300x197.jpg" alt="wordpress-theme-development-checklist" width="300" height="197" />Stefan Vervoort over at WPToy.com has published a great <a href="http://wptoy.com/resources/wordpress-theme-development-check-list-pdf-version/" target="_blank">cheat sheet for developing WordPress themes</a>. It&#8217;s available in PDF format, so as he suggests, if you build themes print it out and put it on your wall. When I&#8217;m building a WordPress theme, I always forget something along the line (when I go into &#8220;programmer mode&#8221; I get a little lazy sometimes, alright?) &#8212; this makes sure I cover off on all the elements.</p>
<blockquote><p>Back in 2008, I announced the WordPress Theme Development Checklist on DivitoDesign. The Checklist with many small tips, code snippets and checkpoints you usually forget about was a success.</p>
<p>Today it is time to release an improved official PDF version of the Checklist for the WordPress crowd. This PDF version is clean and easy to print, which makes it an excellent checklist when you are developing your new WordPress Theme.</p></blockquote>
<p>Great work, Stefan!</p>
<p>[Via <a href="http://wptoy.com/resources/wordpress-theme-development-check-list-pdf-version/" target="_blank">WPToy.com</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmarconi.com/2009/05/wordpress-theme-check-listcheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Normalize URLs &amp; Keep Google Happy</title>
		<link>http://andrewmarconi.com/2009/05/normalize-urls-for-google/</link>
		<comments>http://andrewmarconi.com/2009/05/normalize-urls-for-google/#comments</comments>
		<pubDate>Wed, 06 May 2009 19:47:53 +0000</pubDate>
		<dc:creator>Andrew Marconi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://andrewmarconi.com/?p=6</guid>
		<description><![CDATA[This is something I always (1) forget to do, and (2) forget how to do. Simply add this code (modified for your domain name, of course) to your .htaccess file. This is important to implement for your search engine ranking. Google, for example, thinks www.domain.com is a different site from domain.com, and this can seriously [...]]]></description>
			<content:encoded><![CDATA[<p>This is something I always (1) forget to do, and (2) forget how to do. Simply add this code (modified for your domain name, of course) to your .htaccess file.</p>
<blockquote><p>This is important to implement for your search engine ranking. Google, for example, thinks www.domain.com is a different site from domain.com, and this can seriously impact where you rank in Google. There are other ways of doing this, but the below is the only one that doesn&#8217;t spit back a 500 error on my server, for some reason.</p>
<p><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]<br />
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]</code></p></blockquote>
<p>If you want to force &#8216;www&#8217; on the front end of your URL, switch it up with:</p>
<p><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]<br />
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]</code></p>
<p>[Via <a href="http://snippets.dzone.com/posts/show/2264" target="_blank">DZone Snippets</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmarconi.com/2009/05/normalize-urls-for-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.563 seconds -->

