<?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>PINT Blog &#187; Technical</title>
	<atom:link href="http://blog.pint.com/category/technical/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.pint.com</link>
	<description>The company blog for Pint Inc.</description>
	<lastBuildDate>Wed, 03 Mar 2010 22:56:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE8 &#8211; Yes Compat Mode is Supposed to Do That</title>
		<link>http://blog.pint.com/2010/03/01/ie8-yes-compat-mode-is-supposed-to-do-that/</link>
		<comments>http://blog.pint.com/2010/03/01/ie8-yes-compat-mode-is-supposed-to-do-that/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 00:11:13 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=594</guid>
		<description><![CDATA[If you do any work with IE8 at all you are surely familiar with its various compatibility modes.  Basically the browser will flip into quirks mode or strict mode depending on the doctype and you can of course force the issue with &#60;meta&#62; tags or HTTP headers.  Now generally when people discuss these modes it tends to [...]]]></description>
			<content:encoded><![CDATA[<p>If you do any work with IE8 at all you are surely familiar with its <a href="http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx">various compatibility modes</a>.  Basically the browser will flip into quirks mode or strict mode depending on the doctype and you can of course force the issue with &lt;meta&gt; tags or HTTP headers.  Now generally when people discuss these modes it tends to be focused on the markup and CSS quirks that plague that browser.  Well dear readers, that just scratches the surface it would appear.</p>
<p>Consider a nice feature in IE8, the inclusion of <a href="http://msdn.microsoft.com/en-us/library/cc836458(VS.85).aspx">native JSON parsing</a>.  If you are dealing with any mass of JSON data returned via Ajax parsing natively is a speed godsend.  Most libraries like jquery try to get advantage of browser native JSON using detection to see if it can be used or if we should rely on a rolled version.   To safely use such features you likely might use a little object detection.  Here for example, is a simple test to see if JSON might be around to use.<br />
<tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 47px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">var nativeJSON;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 47px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">nativeJSON = window.JSON ? true : false;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 47px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">alert(nativeJSON);</div>
<p></tt></p>
<p><tt>var nativeJSON;<br />
nativeJSON = window.JSON ? true : false;<br />
document.write("Native JSON Support: "+nativeJSON);<br />
</tt></p>
<p>In the normal strict mode assuming you have a doctype properly set, the browser will display that indeed IE8 supports native JSON.</p>
<div id="attachment_595" class="wp-caption alignnone" style="width: 588px"><img class="size-full wp-image-595" title="yesjson" src="http://blog.pint.com/wp-content/uploads/yesjson.png" alt="JSON is available in IE8 by default" width="578" height="216" /><p class="wp-caption-text">JSON is available in IE8 by default</p></div>
<p>Of course if for some reason you find yourself in compat mode either by button press &#8211; you know that broken document button or because someone is monkeying with the doctype to see if they can coax IE into rendering some old layout right, well then you might be in trouble. <strong>You see in compat mode you aren&#8217;t just changing markup compatibility, you are changing scripting too!<span style="font-weight: normal;"> </span></strong> So bye bye native JSON, hello potential scripting errors.</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong></p>
<div id="attachment_596" class="wp-caption alignnone" style="width: 515px"><img class="size-full wp-image-596" title="nojson" src="http://blog.pint.com/wp-content/uploads/nojson.png" alt="Scripting features may be disabled in compat mode" width="505" height="209" /><p class="wp-caption-text">Scripting features may be disabled in compat mode</p></div>
<p></strong></p>
<p><span style="font-weight: normal;">So the morale of the story &#8211; when Microsoft says IE is emulating another version assume they don&#8217;t just mean markup they mean everything!</span></p>
<p><span style="font-weight: normal;">Oh interestingly we have seen some more havoc that gets played as IE  compat modes.  The browser will actually send other user-agent headers when you flip modes.  This makes perfect sense it should, you see you are trying to emulate.  However, it turns out you can be quite mischievous with such a feature and maybe inadvertently. Really strong Web security systems may bind your user-agent with your cookie and if you start flipping in and out of one user-agent string and another during a session you are going to potentially flag yourself or just get plain booted.  For extra credit try doing such things on your bank site and see if they like it!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2010/03/01/ie8-yes-compat-mode-is-supposed-to-do-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Skip to Nav&#8221; vs &#8220;Skip to Content&#8221;</title>
		<link>http://blog.pint.com/2010/02/26/skip-to-nav-vs-skip-to-content/</link>
		<comments>http://blog.pint.com/2010/02/26/skip-to-nav-vs-skip-to-content/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 00:36:44 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=584</guid>
		<description><![CDATA[When trying to build an accessible Web site it is often a good idea to put in a link for screen readers to jump over repetitive navigation elements on page and hit the content of the page.  It might look something like
&#60;div id="skip"&#62;&#60;a href="#content"&#62;Skip to content&#60;/a&#62;&#60;/div&#62;
Next using CSS you would set #skip {display: none;} and normal users [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to build an accessible Web site it is often a good idea to put in a link for screen readers to jump over repetitive navigation elements on page and hit the content of the page.  It might look something like</p>
<p><tt><span>&lt;div <span>id</span>="<span>skip</span>"&gt;</span><span>&lt;a <span>href</span>="#content"&gt;</span>Skip to content<span>&lt;/a&gt;</span><span>&lt;/div&gt;</span></tt></p>
<p><span>Next using CSS you would set <tt>#skip {display: none;}</tt> and normal users are happy while screen reading devices will skip hearing your logo and navigation menu. </span><strong>This is the common way most Web developers build accessible markup, but is it right?</strong></p>
<p>Thinking in an opt-in/opt-out kind of way, a person hearing such pages will be presented a skip to content link over and over and over again, very likely selecting it to get a sense of what is on the page before moving on.  <strong>It would seem to make more sense for the user to opt-in to the navigation and get the content by default rather than to opt-out of the navigation.</strong></p>
<p>An alternative idea we have been experimenting with here at PINT on a few recent sites is actually to <strong>change the logic to skip to navigation instead</strong>.</p>
<p><tt><span>&lt;div <span>id</span>="<span>skip</span>"&gt;</span><span>&lt;a <span>href</span>="#navigation"&gt;</span>Skip to navigation<span>&lt;/a&gt;</span><span>&lt;/div&gt;</span></tt></p>
<p>and then immediately show the <tt>&lt;h1&gt;</tt> heading of the page or content of note.  This seems to have dual benefit.  First it allows the screen reader to get to the page content quickly and only choose to deal with navigation when they want.  This makes the process more opt-in than opt-out.  Second, this small change allows us to put the content of the page higher up in terms of what a bot would see which likely would appeal to better indexing.  While we certainly don&#8217;t subscribe to the old wive&#8217;s tales of very restrictive bots only indexing a few things it does get to the content point a lot quicker which is what bots are at your site for in the first place.</p>
<p>A caveat here about the small change in approach.  The &#8220;skip to navigation&#8221; link makes sense on content page and the &#8220;skip to content&#8221; makes sense on navigation pages.  This would suggest the home page or primary section pages should probably be done as they traditionally are, but that other content rich pages use the logic we suggest.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2010/02/26/skip-to-nav-vs-skip-to-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A really simple trick to speed up WWW browsing</title>
		<link>http://blog.pint.com/2009/07/14/a-really-simple-trick-to-speed-up-www-browsing/</link>
		<comments>http://blog.pint.com/2009/07/14/a-really-simple-trick-to-speed-up-www-browsing/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 14:53:02 +0000</pubDate>
		<dc:creator>mschwartz</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=522</guid>
		<description><![CDATA[Linux
I notice that my system has /dev/shm mounted as tmpfs. Turns out you can write up to 4G (maybe more) of files to it like it were any other partition, and it&#8217;s basically a ramdisk that can also be partially written to swap. It doesn&#8217;t use 4G of RAM, it grows dynamically as you add [...]]]></description>
			<content:encoded><![CDATA[<h1>Linux</h1>
<p>I notice that my system has /dev/shm mounted as tmpfs. Turns out you can write up to 4G (maybe more) of files to it like it were any other partition, and it&#8217;s basically a ramdisk that can also be partially written to swap. It doesn&#8217;t use 4G of RAM, it grows dynamically as you add stuff to it.</p>
<p>For grins, I did the following:</p>
<p>1) in firefox, enter about:config in the address bar<br />
2) Find: browser.cache.disk.parent_directory<br />
3) If it exists, change it to /dev/shm, if not right click and add string browser.cache.disk.parent_directory, value /dev/shm<br />
4) close your browser and restart it</p>
<p>I noticed right away browsing was way faster. I&#8217;m getting &lt; 1 second loads of various sites. Your mileage may vary!</p>
<p>I verified the cache is indeed being managed in /dev/shm as well:</p>
<pre>$ du -sh /dev/shm/Cache/
1.6M /dev/shm/Cache/</pre>
<p>The downside?</p>
<p>You lose your cache when you reboot or shutdown then restart.</p>
<p>What&#8217;s nice about /dev/shm is you don&#8217;t have to muck with your startup/boot scripts to add a ramdisk, it&#8217;s already there.</p>
<p>I also did a meaningless benchmark. I copied a 350M file from hard drive to /dev/shm. First time it took 8 seconds, the second time (and 3rd thru nth) it took .5 seconds.  The 8 seconds was how long it took to read the 350M file into Linux&#8217; filesystem cache; the 2nd time it copied from RAM to RAM.</p>
<h1>Windows</h1>
<p>The Windows XP solution, and it&#8217;s really fast too!</p>
<p>http://www.romexsoftware.com/download/</p>
<p>Download the free ramdisk software from the above link and install it.</p>
<p>Run the program and set up a ramdisk. I set up R: and used the default 64M (or 69M, whatever).</p>
<p>Use the same instructions as in post #1, but use R:\ as the value for browser.cache.disk.parent_directory.</p>
<h1>Remarks</h1>
<p>I didn&#8217;t do any particular before/after benchmarks, but the speed improvement is quite noticeable.  Hitting http://apple.com takes about 3 seconds (Linux) after clearing my cache.  The 2nd thru nth time takes 1 second or less.  Hitting apple.com (Windows) takes about 2.5 seconds with a cleared cache, .9 seconds otherwise.</p>
<p>The difference in speed between Windows and Linux is dependent on the browser add-ons I have installed (Linux is generally faster than Windows).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/07/14/a-really-simple-trick-to-speed-up-www-browsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross Origin Ajax Requests Have Landed</title>
		<link>http://blog.pint.com/2009/07/06/cross-origin-ajax-requests-have-landed/</link>
		<comments>http://blog.pint.com/2009/07/06/cross-origin-ajax-requests-have-landed/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 01:24:53 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[Industry with Thomas]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web Security]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=514</guid>
		<description><![CDATA[A year ago I mentioned that cross origin Ajax requests were coming and then got backed out of the last version of Firefox Well they are back now and they do work in Firefox 3.5 IE 8 landed similiar functionality using something called an XDR (http://msdn.microsoft.com/en-us/library/dd573303(VS.85).aspx) Of course the big question is still, is this [...]]]></description>
			<content:encoded><![CDATA[<p>A year ago I mentioned that cross origin Ajax requests were coming and <a href="http://blog.pint.com/2008/06/26/ajax-advancement-vaporware/">then got backed out of the last version of Firefox</a> Well they are back now and <a href="http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/">they do work in Firefox 3.5</a> IE 8 landed similiar functionality using something called an XDR (<a href="http://msdn.microsoft.com/en-us/library/dd573303(VS.85).aspx">http://msdn.microsoft.com/en-us/library/dd573303(VS.85).aspx</a>) Of course the big question is still, is this a good thing?</p>
<p>Simplicity of communication rules, so I&#8217;ll just answer directly.  <strong>NO this really isn&#8217;t a good thing unless you are quite careful or you make some of your living as a security consultant.</strong></p>
<p>The bottom line with JavaScript based Web services is that <strong>if you include remote script in your page it can OWN you</strong>.  The very nature of JavaScript is that it can rewrite your objects as it likes.  That is it nature it isn&#8217;t a security flaw.  Futher it has quite a few ways of communicating and can leak information out quite easily from history and cookies and maybe more.</p>
<p>In the Ajax book we demonstrated the security concern with JavaScript being mistrusted over and over.  If you haven&#8217;t seen a demo <a href="http://ajaxref.com/ch7/xhrhijackfullprototype.html">here is a parasitic JavaScript binding on to your underlying XMLHttpRequest</a> object that powers everything and watching your data.   If you pull in remote script it can do these kind of things and worse.  <strong>This isn&#8217;t a tech flaw, this is a trust flaw on your part as a developer.</strong></p>
<p>Given the nature of JavaScript and how it is generally employed you should have extreme trust with any remote source be it linked script, retieved code or even fetched JSON packets.  Unfortunately that just isn&#8217;t the situation in most cases.   We talk all about the features in new Firefox but it takes until the very bottom this cold bucket of water is acknowledged.</p>
<blockquote><p><strong>A Note on Security</strong></p>
<p>In general, data requested from a remote site should be treated as untrusted. Executing JavaScript code retrieved from a third-party site without first determining its validity is NOT recommended. Server administrators should be careful about leaking private data, and should judiciously determine that resources can be called in a cross-site manner.</p></blockquote>
<p>So read that carefully you should determine validitiy before using script from 3rd-parties, but here is the rub, is that going to stay constant?  If you look once and then just use what&#8217;s to say that source doesn&#8217;t change or gets owned and then owns you?  Absolutely nothing unless you are monitoring the script for changes with some proxy.  Great idea, almost never done.</p>
<p>Don&#8217;t get me wrong.  I like new features and in fact am pro Web service, but the reality is that you are given implicit and significant trust here.  Even with just data pass back people have seen interesting hacks overriding the GETTER/SETTERS for array values.  In short even pure data responses have issues unless they are carefully wrapped.  Mix in the dynamic nature of JavaScript and it is a recipe for disaster.  <strong>Trust is the concern and you should not trust implicitly.  Further you should be minding your store lest you get owned by what Web service you link to or script you include.</strong></p>
<p>I am certainly not the only one who sees this and can&#8217;t say that this type of alarm ringing is novel.  In fact we have been down this path before.  Flash supports similiar technology using its CrossDomain.xml file and folks like Jeremiah Grossman clearly pointed out that out in the wild quite often it is <a href="http://jeremiahgrossman.blogspot.com/2008/05/crossdomainxml-invites-cross-site.html">done wrong</a> and in many cases quite wrong.  Now that Firefox and other browsers are supporting it natively I think we are going to see an explosion in cross-origin calls before there is a retreat as quality and security problems explode.  Though that isn&#8217;t all bad, you do usually have to exercise something to shake out the problems, just be careful!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/07/06/cross-origin-ajax-requests-have-landed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploring HTML Entities Again</title>
		<link>http://blog.pint.com/2009/06/02/exploring-html-entities-again/</link>
		<comments>http://blog.pint.com/2009/06/02/exploring-html-entities-again/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 22:24:42 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[Industry with Thomas]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=355</guid>
		<description><![CDATA[Right now I am knee deep in HTML 5, CSS 3 and all related topics to support the new edition of HTML: The Complete Reference.   Usually I don&#8217;t share too much about the sausage making that goes on during one of these massive efforts, but after hearing a few comments from students I [...]]]></description>
			<content:encoded><![CDATA[<p>Right now I am knee deep in HTML 5, CSS 3 and all related topics to support the new edition of <a href="http://htmlref.com">HTML: The Complete Reference</a>.   Usually I don&#8217;t share too much about the sausage making that goes on during one of these massive efforts, but after hearing a few comments from students I figure maybe I should share a bit more as I go along this time, so every once in a while a sneet peek so here is one &#8211; entities.</p>
<p>So if you have written any significant amount of (X)HTML you likely have had an occasion to insert a special character using a named entity like &amp;nbsp; or &amp;copy; or maybe even as a numeric entity like &amp;#160;   and &amp;#169; which are equivalent to the named entities presented.  Dealing with these entities isn&#8217;t fun but they are relatively predictable and looking them in a book or online with a chart or even a nicer tool isn&#8217;t that hard.  However, there is a bit more to know than you might think, you see writing a &#8220;Complete Reference&#8221; I get to look very closely at things and uncover lots of interesting little oddities.</p>
<h2>Entity Case Sensitivity?</h2>
<p>Question: Are character entities case sensitive?  Answer &#8211; mostly, er&#8230;kind of?</p>
<p>Don&#8217;t you hate such nebulous answers in something that should be well defined.  Test &amp;copy; and &amp;COPY; in most browsers it will will likely render exactly the same.  However, case insensitivity isn&#8217;t always the case. Consider &amp;Agrave; (À) and &amp;agrave; (à) really are two different things.  Even in the cases where there isn&#8217;t something similiar case will matter, for example, &amp;pound; will render as £ while &amp;POUND; will render as well &amp;POUND;</p>
<div id="attachment_442" class="wp-caption alignnone" style="width: 159px"><a href="http://blog.pint.com/wp-content/uploads/iappc-05.png"><img class="size-full wp-image-442" title="Pounds are not alike" src="http://blog.pint.com/wp-content/uploads/iappc-05.png" alt="Case sensitive!" width="149" height="44" /></a><p class="wp-caption-text">Case sensitive!</p></div>
<p>So we should assume case sensitivity, but what is going on, which entities are case sensitive and which aren&#8217;t?  Well roughly the pre-HTML 4 are not likely case sensitive while the post-HTML 4 entities are.   HTML 5 tries to formalize this whole mess and documents that &amp;AMP;  &amp;COPY; &amp;LT; &amp;GT; &amp;QUOT; &amp;REG; and &amp;TRADE; can be written either way but nothing else.  Roughly save the trademark these are as I said the pre-HTML 4 named entities and even that could be argued since it used to sit inappropriately in a charset no-mans land in ASCII 127-159.</p>
<p><strong>Victory</strong> &#8211; a small detail knocked down for HTML 5 and an important syntax point that a quick perusal of HTML books (mine included) has gone completely unnoticed for a decade.</p>
<h2>Entity Parse Problems</h2>
<p>So when we mess-up markup like forget a tag or don&#8217;t close a quote we see the browser parser &#8220;fixing&#8221; things for us, albeit sometimes wrongly.  Well it turns out that this also holds for entities.  For example, given this &amp;QUOTE; entity which is clearly a typo for &amp;QUOT; it will render in one browser as it gets fixed and not in most others.  No bonus points for guessing &#8211; yes IE blows it.</p>
<div id="attachment_436" class="wp-caption alignnone" style="width: 302px"><a href="http://blog.pint.com/wp-content/uploads/iappc-07.png"><img class="size-full wp-image-436" title="Entity Parse Fun" src="http://blog.pint.com/wp-content/uploads/iappc-07.png" alt="IE fixing entities for me?" width="292" height="168" /></a><p class="wp-caption-text">IE fixing entities for me?</p></div>
<p>Interesting they may actually be trying to be somewhat correct in their automatic insertion of the trailing ; in the entity.  If you read the specification there is some suggestion that problems be rectified.  However, the decision of how to fix an error in a predictable and consistent manner, well that isn&#8217;t agreed upon.  [ Take a peek at the HTML 5 spec chaos for more info]  On that note a very big change with HTML 5 will actually be to indicate what should happen in case of syntax errors.  I guess if you can&#8217;t beat syntax into the heads of the masses you might as well codify how their nasty &#8220;tag soup&#8221; should taste.</p>
<h2>Explorer Fully Gets Entities-Finally!</h2>
<div>A little known detail that has alluded many Web developers is that up until IE8 many entities actually didn&#8217;t work.  We learned this actually in the first edition of the HTML book over 10 years ago when we actually bothered to test the entities rather than just copying pasting the chart onto our site or book.  Every edition was the same, a few changes here and there but a bunch of nasty boxes in places of the appropriate symbol&#8217;s under the most popular browser.  Well it is time to report that things are a bit better now.</div>
<div>
<div id="attachment_437" class="wp-caption alignnone" style="width: 411px"><a href="http://blog.pint.com/wp-content/uploads/iappc-09.png"><img class="size-full wp-image-437" title="IE8 gets entities right!" src="http://blog.pint.com/wp-content/uploads/iappc-09.png" alt="Finally Internet Explorer supports all the common entities" width="401" height="306" /></a><p class="wp-caption-text">Finally Internet Explorer supports all the common entities</p></div>
<h2>It Ain&#8217;t Over Yet</h2>
<p>Year after year I seem to meet Web developers and students who think that just over the hill the green grass and blue skies of standards land awaits.  Well kind readers such optimistic thinking may help you sleep at night but after doing this for quite some time it is clear to me that even with specs there are simply implementation mistakes and well market forces that will make this unlikely any time soon&#8211;if ever.  Need some proof?  Well even in entities which are much improved in browsers lots of little quirks exist, especially when we consider that Unicode is and has been here.</p>
<p>How about a unicode entity?  Do those work?  Maybe sort of, well not really, gotta go numeric otherwise it just spells out.</p>
<div id="attachment_438" class="wp-caption alignnone" style="width: 287px"><a href="http://blog.pint.com/wp-content/uploads/iappc-10.png"><img class="size-full wp-image-438" title="Try numeric entities with unicode" src="http://blog.pint.com/wp-content/uploads/iappc-10.png" alt="The fun continues with entities in Unicode!" width="277" height="71" /></a><p class="wp-caption-text">The fun continues with entities in Unicode!</p></div>
<div>Even then once you insert the entities you might wonder what they are going to look like.  Consider the friendly snowman dingbat here in a variety of browsers.</div>
<div>
<div id="attachment_439" class="wp-caption alignnone" style="width: 415px"><a href="http://blog.pint.com/wp-content/uploads/i04-31.png"><img class="size-full wp-image-439" title="Snowman glyphs across browsers" src="http://blog.pint.com/wp-content/uploads/i04-31.png" alt="The Unicode snowman revealing the differences in browser entities" width="405" height="205" /></a><p class="wp-caption-text">The Unicode snowman revealing the differences in browser entities</p></div>
</div>
<div>Happy or sad, with hat or not, buttons, or snow our little dingbat shows that making little details the same across all browsers is about as likely as building a June snowman in San Diego.  Not to spoil the ending of the book, but every chapter and appendix keeps showing the more things change, the more they really do stay the same.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/06/02/exploring-html-entities-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bookmark that Site, Save the Cache and Cookies?</title>
		<link>http://blog.pint.com/2009/05/11/bookmark-that-site-save-the-cache-and-cookies/</link>
		<comments>http://blog.pint.com/2009/05/11/bookmark-that-site-save-the-cache-and-cookies/#comments</comments>
		<pubDate>Mon, 11 May 2009 16:38:47 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[Industry with Thomas]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[Internet Explorer 8]]></category>
		<category><![CDATA[Privacy]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=429</guid>
		<description><![CDATA[Many users are quite concerned by the amount of tracking performed online so they dump their browser&#8217;s cache and cookies quite regularly. Effective privacy perserving strategy or not, all browsers thus have a commonly used setting to dump various browsing droppings like cookies, browser history, and cached files when the browser is closed. When looking [...]]]></description>
			<content:encoded><![CDATA[<p>Many users are quite concerned by the amount of tracking performed online so they dump their browser&#8217;s cache and cookies quite regularly. Effective privacy perserving strategy or not, all browsers thus have a commonly used setting to dump various browsing droppings like cookies, browser history, and cached files when the browser is closed. When looking at Internet Explorer 8 version of this recently we noticed that a subtle and likely overlooked aspect of the dialog &#8211; a privacy purge exception for favorited sites.</p>
<div id="attachment_430" class="wp-caption aligncenter" style="width: 420px"><a href="http://blog.pint.com/wp-content/uploads/dont-forget-your-cookies-ie8.png"><img class="size-full wp-image-430" title="dont-forget-your-cookies-ie8" src="http://blog.pint.com/wp-content/uploads/dont-forget-your-cookies-ie8.png" alt="IE8 retains data for some sites" width="410" height="527" /></a><p class="wp-caption-text">IE8 retains data for some sites</p></div>
<p>It appears that Microsoft has made an interesting assumption, <strong>end users are ok with preserving their tracks with bookmarked &#8220;friends,&#8221; but certainly not various sites they may occasionally visit.</strong> I guess the idea here is that because you have favorited the site you have committed to a more long term relationship and thus saving a cookie for easy login or cached files for fast render is ok? Seems a bit suspect to us, at least Redmond could have started with an opt-in for this rather an than opt-out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/05/11/bookmark-that-site-save-the-cache-and-cookies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Few Observations About Short URL Services</title>
		<link>http://blog.pint.com/2009/03/31/a-few-observations-about-short-url-services/</link>
		<comments>http://blog.pint.com/2009/03/31/a-few-observations-about-short-url-services/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 22:08:19 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[Industry with Thomas]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[TinyURL]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[URLs]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=402</guid>
		<description><![CDATA[A back water infrastructure service of the Internet for many years URL shorteners allow you to take a long nasty long URL like http://blog.pint.com/2009/03/31/a-few-observations-about-short-url-services into something like http://tinyurl.com/cc2o48 Try it you just bounce here.
While we use these shortening services in some Internet mediums because we must it is questionable the value of the keyboard character [...]]]></description>
			<content:encoded><![CDATA[<p>A back water infrastructure service of the Internet for many years URL shorteners allow you to take a long nasty long URL like http://blog.pint.com/2009/03/31/a-few-observations-about-short-url-services into something like <a href="http://tinyurl.com/cc2o48" target="_self">http://tinyurl.com/cc2o48</a> Try it you just bounce here.</p>
<p>While we use these shortening services in some Internet mediums because we must it is questionable the value of the keyboard character conservation services when you really consider their motivation and overall costs.</p>
<h2>Twitter Revives URL Shorteners</h2>
<p><strong>URL shortening services simply didn&#8217;t matter much until recently. </strong> Just helping people deal with email messages that had URLs that didn&#8217;t wrap lines or similar occurrences in message board posts wasn&#8217;t much of a motivator. However, add Twitter to the mix and what is old well becomes new again.</p>
<p><strong>Twitter&#8217;s 140 character limitation in today&#8217;s semantic SEO focused linked naming world is too restrictive.</strong> Your tweet can say &#8220;Here is a cool URL: http://big.old.url.here/that/goes/on/and/on/and/on&#8221; and then you are out of space. URL shorteners save us!</p>
<p>&lt;SNARK&gt;<br />
<tt>Why build around a 140character limitation? Are we trying to communicate by fortune cookie message!?! <em>A tweet with a long URL brings shame to your family!</em></tt><br />
&lt;/SNARK&gt;</p>
<p>Beyond snark we do use <a href="http://bit.ly/">bit.ly</a>, <a href="http://tinyurl.com" target="_blank">tinyurl.com</a> and others URL shorteners is a pure function of the limitations of Twitter. Take that limitation away (which should hopefully happen sooner than later) and the relevance of these services goes bye-bye.</p>
<p>Some may argue that the succinct nature of the 140 character thought bursts is good to ensure focus, but regardless of your stance on the limit why Twitter doesn&#8217;t add this feature itself as it is obviously needed and it doesn&#8217;t force users to use third parties is curious.  Probably Twitter is more focused on finding a good business model, so this is farther down on the list.  Regardless of who provides the service there are a number of interesting observations that can be made about shortened URL and their providers.</p>
<h2>Keywords and Hashes</h2>
<p>So the URL shortener takes our URL and makes it something like http://tinyurl.com/d4xd2u.  Cryptic yes-<strong> hash values like d4xd2u aren&#8217;t meaningful, they&#8217;re just short.</strong> If a shortened URL was http://tinyurl.com/shorturls then you might have value in balancing path length with meaning.  However, won&#8217;t a lot of other people want that URL then too?</p>
<p>Well in some cases we can actually make our keywords if it hasn&#8217;t been already taken.  For example, for this article I got <a href="http://tinyurl.com/shorturlpost" target="_self">http://tinyurl.com/shorturlpost<br />
</a></p>
<p>Of course this custom keyword is now taken, too bad anyone else who might want this.  So now we&#8217;ve just reinvented the idea of AOL Keywords.  We want a special &#8220;Go&#8221; word that is used in the URL or browser that gets us right to the object of interest rather than a nasty long URL.  It is a good idea, but it is not a new idea.</p>
<p>Networds, URNs, and a multitude of other name ideas that would aim to make the URL a short keyword system.  The current crop of shorten the URL services doesn&#8217;t do this (YET) nor does it even get the basics right. First consider if you are going to shorten or keyword URLs you really need a better domain name for the service.  TinyURL.com really isn&#8217;t that tiny and Bit.ly really isn&#8217;t a good obvious name.  Better candidates:</p>
<ul>
<li>http://go.com &#8211; ABC owned portal that isn&#8217;t doing much</li>
<li>http://go.to &#8211; already doing something kind of like this but not right</li>
</ul>
<p>Here we are 5 and 4 chars with some semantics in play.</p>
<p>Take the same idea and keep going and we get our second idea, a new TLD (top level domain) just for this duty.</p>
<ul>
<li>http://go/KEYWORD</li>
<li>http://keyword/KEYWORD-HERE</li>
</ul>
<p>Challenge with this is getting new top-level domain names going is a long process and frankly why do we need this?</p>
<p>The best idea really is to get the browser vendors to put this concept in a browser directly.  DNS would be to IP addresses as the keyword system would be to URLs.  Look up the special keyword resolve to the site.  Problem &#8211; we&#8217;ve tried this before.  Everyone wants to own this because it is a potential money minting business to sell keywords off it rather than cryptic hashes.  Do a Web history search lots of failed attempts here.  This is a hard problem, not technically &#8211; socially.  Everyone must accept this is the new way.</p>
<h2>Watch Where You Are Going</h2>
<p>Well putting aside the possibility for more meaningful shortened URLs, let&#8217;s discuss the simple problem of getting dumped to something <a href="http://tinyurl.com/2w4apm">unexpected </a>(http://tinyurl.com/2w4apm).  Yes if you typed or clicked that you got <a href="http://en.wikipedia.org/wiki/Rickroll">Rickrolled</a>.  Of course getting some poppy 80s video in your face is hardly a worry, you might find yourself following a Tweet to a Viagra ad or worse yet a drive-by malware site.  <strong>So with short URLs you can&#8217;t tell where you are going so now we need a preview URL</strong>.</p>
<p>A preview URL like <a href="http://preview.tinyurl.com/2w4apm"><strong>http://preview.tinyurl.com/2w4apm</strong> </a>now takes us to a page that reveals what the actual URL we are going to go to is.  Try it in another window and take a look.  Of course that doesn&#8217;t help too much but at least you know you are going to YouTube now so maybe your guard is up.  So now we have saved some characters and added some clicks to got to the verify page and verify the URL by providing what the real URL actually is!?</p>
<p>The concept of needing a preview URL really is kind of odd because <strong>no URL <em>really </em>can tell you what you are about to go</strong> tp.  Even if you see a URL like http://IamASafeSite.com/intendedPage/ what&#8217;s to keep that from being redirected to something just as bad as what a shortened URL?   The answer &#8211; absolutely nothing.  Every time you click any link you are taking that chance but likely it seems getting to know what the site as the shown destination you trust it is safe.  This hiding of destination is of course the same scheme phising uses.  What makes the cryptic short URLs bad is that you have no clues of good versus bad links at all, thus the preview URL introduction.</p>
<h2>They&#8217;re Watching Where You Are Goi<strong>ng</strong></h2>
<p><strong>When you shorten a URL to save a few bytes you generally give away data about your readers and their interests.</strong> Most 3rd party short URL services track traffic to various URLs that are shortened or use advertising which similar may track as a way to offset the cost of the provided service.  Via link redirection the URL shortener obtains insight into a volume of Internet traffic but at the same time they become a critical link of Internet linking as well.</p>
<p>If a URL shortener service has problems lots of Internet links particularly in the Tweet-o-sphere have problems.  Link consolidation to bounce off someone allows for observation and creates points of failure that don&#8217;t need to exist on the Web.  In short links on the whole are more reliable when dispersed not aggregated.</p>
<p>Certainly one might argue that it is nice to get some statistics on what people click on.  Some of the newer redirecting services provide this openly, but the question is should they and do you need them to get this data.  The answer is it depends on where and why you use short URLs.  In Twitter you needs these folks, outside Twitter you can easily do this yourself with a little JavaScript.</p>
<p>A simple JavaScript can be written to attach to outbound links and send a little request to your server when the link is clicked.  Simply attach an <tt>onmousedown</tt> or <tt>onclick</tt> handler to monitored links.  With this scheme you can fairly predictably watch people bounce away from you without a &#8220;site in the middle.&#8221;  For a demo and example source take a look at <a href="http://ajaxref.com/ch2/recordlink.html" target="_blank">http://ajaxref.com/ch2/recordlink.html</a>.  The demo is quite basic and the scheme it employs is fairly widely used, check out the Google link result page with an HTTP monitor and you will see it employed.  The point being is that don&#8217;t assume you have to give away traffic data to a 3rd party to gain insight, you just don&#8217;t.  Then again most of us do so massively with Google Analytics, Google Toolbar, etc. willingly so what&#8217;s a little more info disclosure between Web 2.0 friends?</p>
<h2>Summary</h2>
<p>You probably have to use URL shorteners if you Twitter because of the 140 character limit in play but we should understand the following:</p>
<ul>
<li>These shortened URLs are currently not meaningful or SEO benefiting because of cryptic hashes</li>
</ul>
<ul>
<li> These shortened URLs are worse for security because of easy destination masking</li>
</ul>
<ul>
<li> These shortened URLs have privacy concerns as we share user traffic with a 3rd party</li>
</ul>
<ul>
<li>These shortened URLs are less resilient than standard Web links because it consolidates and 2 parties the link</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/03/31/a-few-observations-about-short-url-services/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>On Server-side Javascript</title>
		<link>http://blog.pint.com/2009/03/09/on-server-side-javascript/</link>
		<comments>http://blog.pint.com/2009/03/09/on-server-side-javascript/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 15:55:23 +0000</pubDate>
		<dc:creator>mschwartz</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=348</guid>
		<description><![CDATA[Javascript has been utilized in the browser for a few years now, but server-side Javascript seems to be something that&#8217;s talked about a lot but there still is no viable solution to date.  Right?
There are three real issues with server-side Javascript in general. These are the things I would be looking at before pronouncing that [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript has been utilized in the browser for a few years now, but server-side Javascript seems to be something that&#8217;s talked about a lot but there still is no viable solution to date.  Right?</p>
<p>There are three real issues with server-side Javascript in general. These are the things I would be looking at before pronouncing that server-side Javascript is real enough to take off.</p>
<p>First, to DOM or not to DOM?  That is, it is debatable whether the Javascript engine on the server actually model the DOM.  My position is a resounding &#8220;NO!&#8221; as too much of the Internet has been about modelling the DOM on the server for far too long; it&#8217;s so Web 1.0, a 1990s way of thinking.  Modelling the DOM on the server has one advantage: you can use existing toolkits like Dojo or jQuery on the server side to manipulate HTML documents before sending them to the client.  The disadvantage is the cost of doing so; the startup time for instantiating a DOM and then processing it is quite costly, not to mention the amount of memory it consumes.  Think about how fast/slow your browser works and you realize that minus any rendering, this is the burden put on your servers. Aptana&#8217;s Jaxer is a well-known server-side Javascript solution that models the DOM, and may be the only such solution.</p>
<p>Second, standardization part one.  Javascript was designed to run in the browser, and with a DOM present.  Figuring out the order your scripts will be loaded and executed is trivial &#8211; it&#8217;s the order of the script tags you put in your HTML.  Server-side has no DOM and thus no script tags, so it&#8217;s rather nebulous how any script would get loaded at all, let alone multiple ones or the order.  Each implementation of server-side Javascript I&#8217;ve looked at have different philosophies that are not compatible with one another.  JsExt, for example, uses a subdirectory structure where a top level directory defines an object and the Javascript files inside define methods for that object; functions are often anonymous and the filename is the actual name of the function.  There are other obvious schemes, but all this leads to my next point.</p>
<p>Third, standardization part two.  Javascript is a very lightweight language once you take out the events and methods that are DOM oriented.  You have a few objects with a few prototypes and that is it (Strings, Arrays, Date, and so on).  The established server-side languages all have much richer and <strong>standard</strong> APIs; PHP has hundreds of functions and dozens of objects, for example.  There is no standards document that I know of that describes a similar set of functions and objects (and prototypes) that would enable server-side Javascript programs to be portable between server environments.  I&#8217;m talking about the server-side equivalent of jQuery or Dojo, and from my second point above you can see that the incompatibilities I described make this near impossible at this point.</p>
<p>It&#8217;s one thing for PHP to have it&#8217;s mysqli class and functions and Java to have JDBC.  These are language specific ways to access a MySQL database and you have to use what the language provides.  With server-side Javascript, you are using ONE language but might have to call Jaxer.db methods to access a MySQL database from Jaxer and JSEXT1.MySQL methods from JsExt.  One language, two radically different ways to access a database.</p>
<p>For the past year, I&#8217;ve been googling and watching out for viable server-side Javascript solutions but  I kept glossing over the ones that involved the Mozilla Rhino engine, thinking that we really want to be using whatever Firefox is using since we all benefit when Firefox is improved.  I found JsExt (http://jsext.sourceforge.net) to be about the best implementation of the bunch, but I really only ended up using it for its ability to run javascripts from the command line (in lieu of batch files or shell scripts).</p>
<p>Then I read this brilliant blog post by Steve Yegge of Google:</p>
<pre><a class="moz-txt-link-freetext" href="http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html">http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html</a></pre>
<p>While the post and lecture is amusing and highly entertaining throughout, the gist is that the JVM (or .NET&#8217;s CLI) has a huge role in the future of computing.  These things are language agnostic; the goal is to turn source code into the virtual machine&#8217;s (VM) byte codes and let the VM implementors do their thing.  More specifically, you can compile Javascript into JVM byte codes and the resulting program not only runs in the JVM, but it also gets the benefit of Just In Time (JIT) compiling and optimization done by the VM.</p>
<p>I stumbled upon one of these JVM based projects, the Helma project, late last week and spent a few days over the weekend with it and came away quite impressed.  Turns out server-side Javascript has been here since 1998 when Helma first started up.</p>
<p>What is Helma?  It&#8217;s a full blown application server, built on top of the Jetty WWW server with the Rhino javascript engine.  It comes with a robust MVC framework written in Javascript, including an object persistence engine/database backend, and theme/skin/templating engine for the front end.</p>
<p>Helma can be downloaded at http://helma.org.  The download is under 5 megabytes.  The install took me about 1 minute to unzip.  To get started, all I had to do was run start.sh (or start.bat under windows).</p>
<p>The Helma configuration file is just a few lines, yet is rather powerful for defining the various applications you might serve with it.  It comes with two applications: welcome and manage.  Welcome is a small WWW site, a starting point for understanding what Helma is and how to get started using it.  Manage is a server administration back end that shows you the status of your applications, allows you to restart them or disable them, and so forth.</p>
<p>I highly recommend taking a look at Helma if you&#8217;re looking for a Javascript solution for the server-side of things.  I&#8217;ll mention a few of the highlights I found over the weekend, aside from how small it is and easy it was to set up.</p>
<p>The server comes with at least Rhino 1.7 which features a windowed debugger for Firebug style debugging of server-side code.</p>
<p>Javascript can trivially call any Java classes/methods on your classpath.  Seems easier to me to write a little bit of Java to extend your environment in a &#8220;native&#8221; code sort of way than writing C or C++ to extend a language like PHP or Perl.  This really puts a lot of power at your fingertips, like the ability to do image manipulation at Java speeds in your Javascript application.  Calling Javascript from Java is doable, too, but not as seemlessly.</p>
<p>The Helma server-side javascript library is quite rich, including Javascript classes/source code to implement FTP, SSH, SMTP, and several other Internet communication standards.</p>
<p>You can write text (HTML) to the browser or to the console (where you ran start.sh or start.bat).</p>
<p>There&#8217;s little overhead for defining a URL that runs a specific Javascript function to handle that URL.  It&#8217;s as simple as defining &#8220;function foo_handler() {  &#8230;}&#8221; to handle the URL /&lt;appname&gt;/foo.</p>
<p>You can use Jetty to serve static content, or you can serve static content through a trivial URL handler.  The extra overhead is almost zero!  So you can check to see if a user is logged in before serving a client-based .js file or you can check to see if the HTTP_REFERER for an image request is from your site before serving it (avoid bandwidth leaching).</p>
<p>I noticed two or three speeds when viewing the sample application I implemented to test things out.  There seemed to be a rather long page load time right after restarting the server (start.sh/start.bat) for the first page or so.  After editing a script and reloading the page, it seemed a lot faster, but still a tad slow.  But reloading that same page was just about as fast as I can expect a page to be served.  I assume this is due to the whole application being compiled into byte code upon restart, the incremental compiles as I change / edit source files, and the true production speed of JIT.</p>
<p>As far as performance goes, I would expect Helma Javascript code to be about the same as Java in this chart, due to it being compiled to JVM byte codes and JIT kicking in:</p>
<p><a href="http://shootout.alioth.debian.org/u32/benchmark.php?test=all&amp;lang=all&amp;d=data&amp;gpp=on&amp;java=on&amp;ghc=on&amp;csharp=on&amp;sbcl=on&amp;hipe=on&amp;mzscheme=on&amp;vw=on&amp;lua=on&amp;python=on&amp;tracemonkey=on&amp;perl=on&amp;ruby=on&amp;php=on&amp;calc=calculate&amp;box=1">http://shootout.alioth.debian.org/u32/benchmark.php?test=all&amp;lang=all&amp;d=data&amp;gpp=on&amp;java=on&amp;ghc=on&amp;csharp=on&amp;sbcl=on&amp;hipe=on&amp;mzscheme=on&amp;vw=on&amp;lua=on&amp;python=on&amp;tracemonkey=on&amp;perl=on&amp;ruby=on&amp;php=on&amp;calc=calculate&amp;box=1</a></p>
<p>Thumbs up from me for Helma!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/03/09/on-server-side-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PINT iPhone Site is Launched!</title>
		<link>http://blog.pint.com/2009/03/05/pint-iphone-site-is-launched/</link>
		<comments>http://blog.pint.com/2009/03/05/pint-iphone-site-is-launched/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 21:47:48 +0000</pubDate>
		<dc:creator>Dylan Butler</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=325</guid>
		<description><![CDATA[After weeks of development, PINT is proud to announce the launch of our company web site custom made for the iPhone! You may be asking yourself, &#8220;aren&#8217;t all PINT sites iPhone compatible?&#8221; The answer is absolutely! The difference here is that we&#8217;ve developed a site custom-tailored to the iPhone that offers advanced functionality and usability [...]]]></description>
			<content:encoded><![CDATA[<p>After weeks of development, PINT is proud to announce the launch of our company web site custom made for the iPhone! You may be asking yourself, &#8220;<em>aren&#8217;t all PINT sites iPhone compatible?</em>&#8221; The answer is <strong>absolutely!</strong> The difference here is that we&#8217;ve developed a site custom-tailored to the iPhone that offers advanced functionality and usability beyond what a regular site can provide.</p>
<p>A brief overview of some of the key features:</p>
<ul>
<li>Easy-to-read interface eliminates the need to pan and zoom.</li>
<li>Well-designed sliding menu allows visitors to get the information they need faster.</li>
<li>Scrollable galleries have a very natural, Apple-esque feel to them. Visitors think they are using an iPhone app!</li>
<li>Google Maps integration</li>
<li>Improved form validation, enhanced specifically for the iPhone.</li>
<li>Fading and rotating graphics make smarter use of precious screen space.</li>
</ul>
<p>See it for yourself by visiting <a href="http://www.pint.com/">www.pint.com</a> from your iPhone browser, or <a href="http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/#screenshots">see the screenshots</a>. </p>
<p class="aligncenter"><a href="http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/#screenshots"><img alt="" src="http://blog.pint.com/wp-content/uploads/blog_1.jpg" title="PINT iPhone homepage" class="aligncenter" width="300" height="561" /></a><br />
<a href="http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/#screenshots">See more screenshots.</a></p>
<p>If you want to read more about the technical aspect of the development, please see <a href="http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/03/05/pint-iphone-site-is-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lessons Learned While Making an iPhone Web Site</title>
		<link>http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/</link>
		<comments>http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 20:56:53 +0000</pubDate>
		<dc:creator>Dylan Butler</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[optmization]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://blog.pint.com/?p=273</guid>
		<description><![CDATA[I am pleased to announce PINT has recently launched a version of our corporate web site custom tailored to the iPhone. Having watched this project play out from it&#8217;s inception, I can attest to the differences encountered when developing specifically for iPhone Safari, as opposed to coding in support of more traditional (although often quirkier) [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce PINT has recently launched a version of our corporate web site custom tailored to the iPhone. Having watched this project play out from it&#8217;s inception, I can attest to the differences encountered when developing specifically for iPhone Safari, as opposed to coding in support of more traditional (although often quirkier) browsers.</p>
<p>Designing for mobile aside, I will discuss the lessons learned from developing a minified version of a corporate web site for the iPhone. We wanted to include as many features as possible, to showcase the iPhone&#8217;s wide range of features available to Safari. What we discovered, however, is that it doesn&#8217;t offer several basic things that would be valuable to a corporate entity such as an &#8216;Add to Contacts&#8217; option (perhaps available via hcard or vcard microformat?), &#8216;Download to calendar&#8217; option (We can&#8217;t get some iCal love?), <a href="http://developer.apple.com/safari/mobile.php" target="_blank">and easily findable documentation</a> &#8211; hint: make sure you register at the Apple site. Below you will find some of the things that made developing a miniature version of our company site for the iPhone a challenge.</p>
<h2>1. Animation &#8211; Leave it up to the browser</h2>
<p><strong>Webkit Transitions / Webkit Animation</strong><br />
When looking to do animation on the iPhone, CSS <a href="http://webkit.org/specs/CSSVisualEffects/CSSTransitions.html" target="_blank">webkit transitions</a> are the smoothest, if you can get them to work. There are many quirks in the implementation that make this method more difficult than expected, and there is a lack of documentation. We had trouble animating the height and opacity attribute, so in the interest of time, we moved on to something more familiar. We also were unsure how to simulate &#8216;before&#8217; and &#8216;after&#8217; handlers within the animation timeline, so we left those to JavaScript for now.</p>
<p><strong>YUI Animation</strong><br />
We used <a href="http://developer.yahoo.com/yui/animation/" target="_blank">YUI</a> as our JavaScript library and for our animations. YUI was the best fit as a JavaScript library for several reasons:</p>
<ol>
<li>It is the library PINT has chosen for regular web site projects, so our developers are all familiar with it.</li>
<li>When served by Yahoo!, the minified files are under 25KB and on a CDN, so they load quickly and get <a href="http://yuiblog.com/blog/2008/02/06/iphone-cacheability/" target="_blank">cached on the iPhone</a> (See screenshots below). <a href="http://stevesouders.com/hpws/" target="_blank">Souder&#8217;s rules</a> suggest bundling objects for improved load time, but in this case we&#8217;ll take the cache benefit over a few less HTTP requests.<br />
<h4>Files under 25KB get cached</h4>
<p>When each file is <a href="http://developer.yahoo.com/yui/articles/hosting/" target="_blank">served by YUI</a>, the files are cached and loaded quite fast because on a CDN.</p>
<p><img class="aligncenter size-full wp-image-282" title="cached" src="http://blog.pint.com/wp-content/uploads/cached.gif" alt="" width="500" height="145" /></p>
<h4>Files over 25KB do not get cached</h4>
<p>When files are consolidated, filesize may become too large.</p>
<p><img class="aligncenter size-full wp-image-283" title="notcached" src="http://blog.pint.com/wp-content/uploads/notcached.gif" alt="" width="500" height="145" /></li>
<li>We were able to use existing in-house widgets to quickly create effects.</li>
</ol>
<p><strong><a href="http://code.google.com/p/iui/" target="_blank">IUI Library</a></strong><br />
IUI Library is a well written library by Joe Hewitt that has built-in support for most of the UI effects one would want to do with a web app on the iPhone. Although we used some of <a href="http://joehewitt.com/files/iphone/navigation.html#_albums" target="_blank">Joe&#8217;s code</a> in our own implementation, we still probably could have saved time and smoothness by starting out with IUI rather than mixing and matching YUI as we did.</p>
<h2>2. Gestures / Touch Events &#8211; Take Advantage</h2>
<p>Apple has given the iPhone Safari some new <a href="https://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/chapter_7_section_10.html#//apple_ref/doc/uid/TP40006511-SW5">events</a> to handle touches and gestures.</p>
<p>We used the <em>touch</em> events and their clientY values to determine if you slid your finger from the left to the right or vice versa. By doing some digging around, we found <a href="http://ajaxian.com/archives/iphone-safari-flick-navigation-by-example" target="_blank">Matthew Congrove&#8217;s flick code</a>. With a little work, we were able to get that talking with <a href="http://joehewitt.com/files/iphone/navigation.html#_albums" target="_blank">Joe Hewitt&#8217;s animation code</a>, which allowed our menus to use the same slide code as our galleries. In the next version of our site, we&#8217;ll convert all javascript animations to webkit transitions and/or animations.</p>
<p>One problem we had with Matthew&#8217;s code is that up/down scrolling functionality is lost with his small example there, but it can be easily added back in with some clientX before and after comparisons.</p>
<h2>3. Orientation &#8211; Let CSS do the work, not JavaScript</h2>
<p>The iPhone supports two orientation modes: portrait and landscape. Some authors have recommended devising show/hide functionality to hide entire sections from one orientation or the other. What we noticed in our designs, however, is that our pages look pretty similar in both modes with the exception of images, which often become wider when in landscape mode. We decided to make the layout a flexible width of 100% with CSS, that way the page content looks and feels like it should at any orientation. To hide anything that shouldn&#8217;t be visible for that current orientation, we introduced an orient attribute to the body tag, updated that value when the &#8216;onorientationchange&#8217; event was fired, and used a CSS selector to hide the content.</p>
<table class="aligncenter" border="0">
<tbody>
<tr>
<td class="aligncenter" width="50%"><img src="/wp-content/uploads/flex_1.gif" alt="Our site at regular width" /></td>
<td class="aligncenter"><img src="/wp-content/uploads/flex_2.gif" alt="Our site at full width" /></td>
</tr>
</tbody>
</table>
<p>One of the things we noticed when switching across orientations was that common left/right slider mechanisms had adverse effects on portrait mode when coming from landscape mode. Some more prodding is needed here, but just be sure to check any pages that use relative or absolute positioning for slide effects in both orientations (if you are supporting both).</p>
<p>All troubles aside, it was a pleasure developing solely for Safari on the iPhone and I wish every project could be as creatively groundbreaking as this one. And boy was it good to drop IE6 support for once.</p>
<p>In case you don&#8217;t have an iPhone, here is a slideshow of some of the pages from the site:<br />
<a name="screenshots" id="screenshots"></a></p>
<div id="spotlight">&nbsp;</div>
<div id="container">
<ol id="carousel">
<li><img src="http://blog.pint.com/wp-content/uploads/blog_1_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_2_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_3_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_4_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_5_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_6_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_7_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_8_th.jpg" alt="" /></li>
<li><img src="http://blog.pint.com/wp-content/uploads/blog_9_th.jpg" alt="" /></li>
</ol>
</div>
<p><strong>Ultimate Lesson</strong>: iPhone Safari <em>is</em> Safari, but web site development for iPhone is different. Don&#8217;t do as normal web developers do.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pint.com/2009/02/26/iphone-site-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
