<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>techno.blog("Dion") &#187; Tech</title>
	<link>http://almaer.com/blog</link>
	<description>blogging about life, the universe, and everything tech</description>
	<pubDate>Sun, 06 Jul 2008 20:10:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Passpack: Gears? AIR? Why choose!</title>
		<link>http://almaer.com/blog/passpack-gears-air-why-choose</link>
		<comments>http://almaer.com/blog/passpack-gears-air-why-choose#comments</comments>
		<pubDate>Sun, 06 Jul 2008 19:40:23 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Gears]]></category>

		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/passpack-gears-air-why-choose</guid>
		<description><![CDATA[Passpack is an online password organizer that provided offline access early in its life via Gears.
Last week they announced an Adobe AIR version, and Ryan quickly commented saying:

For a while they were using Gears as a way to store those passwords on the client but they’ve just recently switched over to using Adobe AIR.

One of [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Passpack: Gears? AIR? Why choose!", url: "http://almaer.com/blog/passpack-gears-air-why-choose" });</script>]]></description>
			<content:encoded><![CDATA[<p>Passpack is an online password organizer that provided offline access early in its life via Gears.</p>
<p>Last week they announced an Adobe AIR version, and Ryan quickly <a href="http://blog.digitalbackcountry.com/?p=1475">commented</a> saying:</p>
<blockquote><p>
For a while they were using Gears as a way to store those passwords on the client but they’ve just recently switched over to using Adobe AIR.
</p></blockquote>
<p>One of the reasons given was Safari support for Gears. You have to do a build for Safari which is not what we want, and we are working with the Apple team to clean things up and have a really nice Safari plugin. Unfortunately, Safari doesn&#8217;t have a plugin model, so you always feel like you are doing some hack using unsupported mechanisms like Input Managers. Grr, come on Apple, play nice with others! :)</p>
<p>At the same time, Air support for the Encrypted File store (a very nice feature!) doesn&#8217;t work on Linux yet (I am sure that will be fixed soon too).</p>
<p>Of course, the solution isn&#8217;t Gears vs. AIR. They aren&#8217;t really competing here! The Gears users of the product started to get vocal and we quickly saw <a href="http://passpack.wordpress.com/2008/07/03/google-gears-returns/">Gears support added again</a>.</p>
<p>There are two very different use cases:</p>
<ul>
<li>Users who want to be using Passpack in the browser, who happen to want to use functionality such as offline, or any other Gears component</li>
<li>Users who want a desktop-like application, outside of the browser. This is where the AIR application fits in.</li>
</ul>
<p>So, <em>both</em> can make sense for Passpack. In other cases, one of the choices could make sense.</p>
<p>I also expect to see more joint applications. Gears functionality is working into HTML5 the standard, which will end up in WebKit (as Apple is great in that regard), and AIR uses&#8230;. WebKit as its renderer!</p>
<p>I really hope that AIR will be able to bridge to those APIs, and you get the best of all worlds. I would love to use the Workerpool API from within an AIR application that is doing a lot of JavaScript work for example.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Passpack%3A+Gears%3F+AIR%3F+Why+choose%21&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fpasspack-gears-air-why-choose">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/passpack-gears-air-why-choose/feed</wfw:commentRss>
		</item>
		<item>
		<title>Dealing with W3C Events; A story of running around in circles</title>
		<link>http://almaer.com/blog/dealing-with-w3c-events-a-story-of-running-around-in-circles</link>
		<comments>http://almaer.com/blog/dealing-with-w3c-events-a-story-of-running-around-in-circles#comments</comments>
		<pubDate>Fri, 04 Jul 2008 16:34:52 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[tip]]></category>

		<category><![CDATA[w3c events]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/dealing-with-w3c-events-a-story-of-running-around-in-circles</guid>
		<description><![CDATA[I am working on an interesting pet project that has a fairly rich UI. A rich UI means dealing with events, and I had a wake up call on what a pain it can be to deal with in the browser world.
I ended up on a wild goose chase that ended up having a simple [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Dealing with W3C Events; A story of running around in circles", url: "http://almaer.com/blog/dealing-with-w3c-events-a-story-of-running-around-in-circles" });</script>]]></description>
			<content:encoded><![CDATA[<p>I am working on an interesting pet project that has a fairly rich UI. A rich UI means dealing with events, and I had a wake up call on what a pain it can be to deal with in the browser world.</p>
<p>I ended up on a wild goose chase that ended up having a simple solution.</p>
<p>Imagine one section of an application that is a canvas element, and another piece that is a <code>input type="text"</code>. I wanted a way to jump between the two with a keystroke, e.g. Ctrl-J for jump.</p>
<p>Jumping from the canvas element to textbox was fine, but it wouldn&#8217;t work on the way back. I was trying to <code>$('canvas').focus()</code> but it wouldn&#8217;t work.</p>
<p><b>initMouseEvent</b></p>
<p>I stupidly thought that I should just simulate the click on the canvas element, since that was working just fine for me.</p>
<p>We are pretty fortunate that the ability to kick off true events programatically is bound into the event model itself.</p>
<p>This means that I could:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">createEvent</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> evt = document.<span style="color: #006600;">createEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'MouseEvents'</span><span style="color: #66cc66;">&#41;</span>;
   evt.<span style="color: #006600;">initMouseEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'click'</span>,
            <span style="color: #003366; font-weight: bold;">true</span>,     <span style="color: #009900; font-style: italic;">// Click events bubble</span>
            <span style="color: #003366; font-weight: bold;">true</span>,     <span style="color: #009900; font-style: italic;">// and they can be cancelled</span>
            document.<span style="color: #006600;">defaultView</span>,  <span style="color: #009900; font-style: italic;">// Use the default view</span>
            <span style="color: #CC0000;">1</span>,        <span style="color: #009900; font-style: italic;">// Just a single click</span>
            <span style="color: #CC0000;">0</span>,        <span style="color: #009900; font-style: italic;">// Don't bother with coordinates</span>
            <span style="color: #CC0000;">0</span>,
            <span style="color: #CC0000;">0</span>,
            <span style="color: #CC0000;">0</span>,
            <span style="color: #003366; font-weight: bold;">false</span>,    <span style="color: #009900; font-style: italic;">// Don't apply any key modifiers</span>
            <span style="color: #003366; font-weight: bold;">false</span>,
            <span style="color: #003366; font-weight: bold;">false</span>,
            <span style="color: #003366; font-weight: bold;">false</span>,
            <span style="color: #CC0000;">0</span>,        <span style="color: #009900; font-style: italic;">// 0 - left, 1 - middle, 2 - right</span>
            <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>;    <span style="color: #009900; font-style: italic;">// Click events don't have any targets other than</span>
                      <span style="color: #009900; font-style: italic;">// the recipient of the click</span>
 $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'canvas'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span>evt<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>This only slightly worked. I could test that the click was going through. I would add an <code>onclick</code> handler to <code>canvas</code> and it would fire just fine. However, something weird was happening. The focus was still in the textbox even with this click happening (which didn&#8217;t happen when I actually clicked on the darn thing).</p>
<p><b>Events from within events</b></p>
<p>Since the click was working, why not just force the blur on the textbox?</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> events = document.<span style="color: #006600;">createEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'HTMLEvents'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">blur</span> = events.<span style="color: #006600;">initEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'blur'</span>, <span style="color: #003366; font-weight: bold;">false</span>, <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
his.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">blur</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>But that got me:</p>
<blockquote><p>
Component returned failure code: 0&#215;80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMEventTarget.dispatchEvent&#8230;..]
</p></blockquote>
<p>Hmm, on wait. This was happening from within an <code>onkeypress</code> handler and it appears that you can&#8217;t do this in a nested way. A <code>setTimeout(..)</code> to push it off until later didn&#8217;t make it any happier either.</p>
<p><b>tabindex=0</b></p>
<p>As I looked at this mess, I quickly realised that I had been unravelling a string, and I should take a step back.</p>
<p>I talked to Alex Russell, and he immediately said &#8220;erm, and you made sure that tabindex was set on the canvas element?&#8221;</p>
<p>Doh, it wasn&#8217;t. This is why the focus method (which did exist) didn&#8217;t do anything. I quickly added <code>tabindex=-1</code> and now I could simply <code>$('canvas').focus()</code> and lo-and-behold it would focus!</p>
<p><b>Event.stop(e)</b></p>
<p>Great, the home stretch. I took the test and put it on the live code and it&#8230; still didn&#8217;t quite work. God damn it.</p>
<p>I took another step back.</p>
<p>A global key handler was set via <code>document.onkeydown</code> that was handling the world. When it saw a Ctrl-J it would short circuit and give focus to the textbox. The textbox has its own <code>onkeydown</code> that would do the opposite. A global flag held the state of global/textbox.</p>
<p>This is the problem. I had mucked up the event propogation, so in the case of jumping from textbox to canvas it would first go through the textbox handler, but after it was done it would STILL run the global handler which would kick it right back!</p>
<p>I just needed to <code>e.stopProgagation()</code>, or even better <a href="http://www.prototypejs.org/api/event/stop">Event.stop(e)</a> to stop any default action too.</p>
<p>Phew, all that running around to get back to square one. Now it works, and it reminded me of how the simplest things can be tricky.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Dealing+with+W3C+Events%3B+A+story+of+running+around+in+circles&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fdealing-with-w3c-events-a-story-of-running-around-in-circles">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/dealing-with-w3c-events-a-story-of-running-around-in-circles/feed</wfw:commentRss>
		</item>
		<item>
		<title>Developer Advocate versus Technical Evangelist; When names change the tone</title>
		<link>http://almaer.com/blog/developer-advocate-versus-technical-evangelist-when-names-change-the-tone</link>
		<comments>http://almaer.com/blog/developer-advocate-versus-technical-evangelist-when-names-change-the-tone#comments</comments>
		<pubDate>Thu, 03 Jul 2008 22:05:58 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Google]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[advocate]]></category>

		<category><![CDATA[developer]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/developer-advocate-versus-technical-evangelist-when-names-change-the-tone</guid>
		<description><![CDATA[
There is a role in the developer team at Google called Developer Advocate, and I consider myself an honorary one of those.
What is interesting, is how the name has had an effect. When the group kicked off, we really didn&#8217;t like the term &#8216;evangelist&#8217;. The religious connotation is so strong isn&#8217;t it? It also feels [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Developer Advocate versus Technical Evangelist; When names change the tone", url: "http://almaer.com/blog/developer-advocate-versus-technical-evangelist-when-names-change-the-tone" });</script>]]></description>
			<content:encoded><![CDATA[<p><img src='http://almaer.com/blog/uploads/stjohnevangelist.jpg' alt='St. John the Evangelist' border='0' style='float: right; padding: 8px;'/></p>
<p>There is a role in the developer team at Google called <a href="http://www.google.com/support/jobs/bin/answer.py?answer=97895&#038;query=Developer+Advocate&#038;topic=&#038;type=Developer+Advocate">Developer Advocate</a>, and I consider myself an honorary one of those.</p>
<p>What is interesting, is how the name has had an effect. When the group kicked off, we really didn&#8217;t like the term &#8216;evangelist&#8217;. The religious connotation is so strong isn&#8217;t it? It also feels like an evangelist is going to run around with his particular religion, and will be trying to persuade you to join, without really listening.</p>
<p>An advocate on the other hand sounds just a touch different. I can advocate something, and part of that will hopefully be heavily listening, and participating in the open community. Of course, these are just words, and you have to make this happen. We could call ourselves evangelists and do a lot of listening, or become advocates and do none. The word choice though does make you think about what you should be doing.</p>
<p>More importantly, in my opinion, is the word <em>developer</em>. Rather than talking just about technology, we are talking about humans who use it. This again makes you feel like you need to be more part of the community, working with developers on their level.</p>
<p>Then you put it together: <em>Developer Advocate</em> and a funny thing happens. What does that mean? At first people think that you are advocating <em>to</em> developers, but it is also very important to think about the other connotation. You think about being an advocate <em>of</em> the developer.</p>
<p>What does this mean? It means that when you are in a meeting with your product group, you are their mouth piece. What do they think of the products? the APIs? What are they asking for? You get to almost be an outsider on the inside.</p>
<p>That is the power of the developer advocate role, and why it can be such a fun one at companies.</p>
<p>Of course, I don&#8217;t even need to tell you that <a href="http://google.com/jobs">we are hiring for this position in the US and elsewhere in the world</a> :)</p>
<p><em>NOTE: Right after I posted this I saw that Jeremy Z had a post titled <a href="http://jeremy.zawodny.com/blog/archives/010405.html">Two Tech Jobs: Technology Evangelist and Network Operations</a></em></p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Developer+Advocate+versus+Technical+Evangelist%3B+When+names+change+the+tone&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fdeveloper-advocate-versus-technical-evangelist-when-names-change-the-tone">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/developer-advocate-versus-technical-evangelist-when-names-change-the-tone/feed</wfw:commentRss>
		</item>
		<item>
		<title>Google Microsoft and Yahoo!; Dare can&#8217;t see straight</title>
		<link>http://almaer.com/blog/google-microsoft-and-yahoo-dare-cant-see-straight</link>
		<comments>http://almaer.com/blog/google-microsoft-and-yahoo-dare-cant-see-straight#comments</comments>
		<pubDate>Sun, 29 Jun 2008 21:16:02 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Google]]></category>

		<category><![CDATA[Microsort]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/google-microsoft-and-yahoo-dare-cant-see-straight</guid>
		<description><![CDATA[
Dare is back to blogging, which I like to see. His latest piece though is about a so-called exodus of Googlers going to Microsoft.
NOTE: An exodus is:

a departure or emigration, usually of a large number of people

He notes a couple of blogs talking about a move, including Danny Thorpe and Sergey Solyanik. I am sure [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Google Microsoft and Yahoo!; Dare can&#8217;t see straight", url: "http://almaer.com/blog/google-microsoft-and-yahoo-dare-cant-see-straight" });</script>]]></description>
			<content:encoded><![CDATA[<p><img src='http://almaer.com/blog/uploads/musicalchairs.png' alt='Musical Chairs' border='0'/></p>
<p>Dare is back to blogging, which I like to see. His latest piece though is about <a href="http://www.25hoursaday.com/weblog/2008/06/29/TheGOOGMSFTExodusWorkingAtGoogleVsWorkingAtMicrosoft.aspx">a so-called exodus of Googlers going to Microsoft</a>.</p>
<p>NOTE: An exodus is:</p>
<blockquote><p>
a departure or emigration, usually of a <em>large number of people</em>
</p></blockquote>
<p>He notes a couple of blogs talking about a move, including Danny Thorpe and Sergey Solyanik. I am sure there are more, but an exodus is a bit rough. However, I could quite as easily discuss the number of Microsoft, Yahoo!, Apple (insert other companies) folks that I get to work with at Google. The problem is that this is meaningless. We are looking at the micro-level, through our lens working in our areas at our companies.</p>
<p>I am sure that in the coming week, there we will be some musical chairs at companies as large as ours. That is the way the world turns. Many people move on, they try new things, they want to work on something else etc. Especially in this day and age.</p>
<p>How about we get back to technology again, and look at the great work that all of these companies are doing. All the industry wants to talk about with respect to Yahoo! is some executives leaving. However, I have met with a lot of Yahoo! engineers in the last few weeks and they are working on exciting projects. Yahoo! has a LOT of users. They are a great company, born of the Web, and they never seem to get the credit their deserve. How many websites have you created with that many users? Phenomenal.</p>
<p>Dare, your company is doing great things too. I would be much more excited to hear more about that side of things, than employee counting. I would be much more excited to see our companies work together to progress the Web, as well as competing in various industries.</p>
<p>Enough SOAP opera, let&#8217;s give it a REST (sorry&#8230;.). I normally don&#8217;t get into these kind of topics, but the general talk has been grating me recently, and I want to hear something fresh and new.</p>
<p>I have been playing with some Web technology and have been astonished at how far it has come in many ways. There is still a long way to go, and much we can all improve, but I am pretty jazzed about the technology whilst at the same time frustrated with the non-tech talk.</p>
<p>Maybe it is a time to get a bunch of engineers together and talk tech&#8230; maybe in Hawaii? Anyone in? :)</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Google+Microsoft+and+Yahoo%21%3B+Dare+can%26%238217%3Bt+see+straight&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fgoogle-microsoft-and-yahoo-dare-cant-see-straight">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/google-microsoft-and-yahoo-dare-cant-see-straight/feed</wfw:commentRss>
		</item>
		<item>
		<title>Endpoint Resolver: Getting tinyurl out of the Twitter stream</title>
		<link>http://almaer.com/blog/endpoint-resolver-getting-tinyurl-out-of-the-twitter-stream</link>
		<comments>http://almaer.com/blog/endpoint-resolver-getting-tinyurl-out-of-the-twitter-stream#comments</comments>
		<pubDate>Sun, 22 Jun 2008 14:42:44 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[Web Services]]></category>

		<category><![CDATA[endpoint]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/endpoint-resolver-getting-tinyurl-out-of-the-twitter-stream</guid>
		<description><![CDATA[Sometimes you can get in the zone just enough to be productive on a plane. On my flight to Mexico City yesterday, I created Endpoint a project that contains a server proxy, JavaScript client, and Greasemonkey Script with a mission. The mission is to take a URL, work out if it is a redirect (via [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Endpoint Resolver: Getting tinyurl out of the Twitter stream", url: "http://almaer.com/blog/endpoint-resolver-getting-tinyurl-out-of-the-twitter-stream" });</script>]]></description>
			<content:encoded><![CDATA[<p>Sometimes you can get in the zone just enough to be productive on a plane. On my flight to Mexico City yesterday, I created <a href="http://almaer.com/endpoint">Endpoint</a> a project that contains a <a href="http://endpoint-resolver.googlecode.com/svn/trunk/resolver.php">server proxy</a>, <a href="http://almaer.com/endpoint/twitter-resolveurl.user.js">JavaScript client</a>, and <a href="http://almaer.com/endpoint/twitter-resolveurl.user.js">Greasemonkey Script</a> with a mission. The mission is to take a URL, work out if it is a redirect (via a <code>Location:</code> header), and then return the final endpoint for it.</p>
<p><b>Why did I do this?</b></p>
<p>I was brainstorming functionality for a Twitter client with James Strachan (he is working on <a href="http://gtwit.com/">gtwit</a>) and we talked about how annoying tinyurl / is.gd / snurl / you name it URLs are. They don&#8217;t tell you where you are going, and you could get Rick Rolled (if you are lucky) or much much worse.</p>
<p>So, I wanted to create a library, and one client (Greasemonkey) to test it out. Then anyone else could use it too to resolve directly from their Web pages.</p>
<p><b>How does it work</b></p>
<p>You load up the JavaScript via <code>script src</code> and then you can call resolve, passing the URL and a callback that will get the result. A few examples:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #009900; font-style: italic;">// Simple version</span>
Endpoint.<span style="color: #006600;">resolve</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'http://snurl.com/2luj3'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 
  <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span>; 
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// Using the original URL to work out if it has changed</span>
Endpoint.<span style="color: #006600;">resolve</span><span style="color: #66cc66;">&#40;</span>
  document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'testurl'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">value</span>, 
  <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>url, orig<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 
    <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span>; 
    <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>Endpoint.<span style="color: #006600;">isRedirecting</span><span style="color: #66cc66;">&#40;</span>url, orig<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #009900; font-style: italic;">// How it is used in the Twitter Endpoint Resolver</span>
Endpoint.<span style="color: #006600;">resolve</span><span style="color: #66cc66;">&#40;</span>url, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>resulturl, originalurl<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>!Endpoint.<span style="color: #006600;">isRedirecting</span><span style="color: #66cc66;">&#40;</span>resulturl, originalurl<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span>;
&nbsp;
  newtext = newtext.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>originalurl, resulturl, <span style="color: #3366CC;">&quot;g&quot;</span><span style="color: #66cc66;">&#41;</span>;
  jQuery<span style="color: #66cc66;">&#40;</span>el<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span>newtext<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Under the hood, a bunch of stuff is happening. I would love to be able to just use <code>XMLHttpRequest</code> to dynamically hit the URL and look at the headers, but the same-origin policy stops me.</p>
<p>This is why I have the server proxy, which returns a JSONP callback.</p>
<p>When you call <code>resolve(url, callback)</code> the <code>script</code> tag is created on the fly and added to the DOM. The callback function is all handled to allow multiple calls, and then the chain unravels.</p>
<p>Here you can see it all in action, showing how my Twitter stream will go through and the URLs will dynamically change from their tinyurl versions to whereyouaregoing.com:</p>
<p><object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/fxuUNEhOQwk"></param><embed src="http://www.youtube.com/v/fxuUNEhOQwk" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p>I wanted to use App Engine to host the server proxy, but unfortunately I can&#8217;t work out how to do that yet. You have access to the <a href="http://code.google.com/appengine/docs/urlfetch/">URLFetch</a> API to access resources from App Engine. Unfortunately for me, one of the features is that it understands redirects and just goes on through to the full resource itself, with no way to get the endpoint from the <code>headers</code> in the response.</p>
<p>It was also interesting to read <a href="http://www.techcrunch.com/2008/06/21/surviving-the-net/">Steve Gilmor talk about these services</a> all be it in a post that is hard to actually understand ;)</p>
<p>Also, Simon Willison just put up a simple service on App Engine, <a href="http://json-time.appspot.com/">json-time</a>, that &#8220;exposes Python’s pytz timezone library over JSON.&#8221; I think that we will see a lot of these types of mini-Web services hosted on App Engine. Taking Python utility and making services from its goodness is an obvious choice.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Endpoint+Resolver%3A+Getting+tinyurl+out+of+the+Twitter+stream&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fendpoint-resolver-getting-tinyurl-out-of-the-twitter-stream">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/endpoint-resolver-getting-tinyurl-out-of-the-twitter-stream/feed</wfw:commentRss>
		</item>
		<item>
		<title>Movement in the death of old browsers and IE 6</title>
		<link>http://almaer.com/blog/movement-in-the-death-of-old-browsers-and-ie-6</link>
		<comments>http://almaer.com/blog/movement-in-the-death-of-old-browsers-and-ie-6#comments</comments>
		<pubDate>Thu, 19 Jun 2008 22:22:59 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[Web Browsing]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/movement-in-the-death-of-old-browsers-and-ie-6</guid>
		<description><![CDATA[I talked about having a best viewed in [insert new browser here] day where prominent web sites (and anyone who cares too) display some kind of sign, maybe on the first Monday of the month, that says:

If you like this application now, you will love how it runs if you were using a modern browser

This [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Movement in the death of old browsers and IE 6", url: "http://almaer.com/blog/movement-in-the-death-of-old-browsers-and-ie-6" });</script>]]></description>
			<content:encoded><![CDATA[<p>I talked about having a <a href="http://almaer.com/blog/ie-wishes-time-for-a-best-viewed-in-any-of-these-day">best viewed in [insert new browser here]</a> day where prominent web sites (and anyone who cares too) display some kind of sign, maybe on the first Monday of the month, that says:</p>
<blockquote><p>
If you like this application now, you will love how it runs if you were using a modern browser
</p></blockquote>
<p>This happens if a non-Grade A browser is detected. We can even go further and push a new version of the browser the person is using. For example, if someone comes in with IE 6, we prominently show IE 7, and then also offer Firefox 3, Opera 9.5, Safari 3.1 for Windows.</p>
<p>As Web developers we have put in so much time just to make sure that IE 6 runs our application well. This is like writing desktop software that runs well on an 8 year old machine!</p>
<p>It hasn&#8217;t mattered all that much until the last year or so, as now we are developing richer and richer Web applications.</p>
<p>As I look at apps like Gmail, Mobile Me, 280 Slides, Yahoo! Mail, etc etc&#8230;. I say screw it. People upgrade their computers when they want to run things faster, why can&#8217;t we ask them to upgrade their browsers.</p>
<p>If you have a simple content site, then it is fine to support everyone, but as you build rich apps, maybe it is time NOT to be a crutch and support these browsers.</p>
<p>It is interesting to note that <a href="http://me.com/">Mobile Me</a> doesn&#8217;t support IE 6. People have shouted at the SproutCore chaps, but SproutCore actually DOES support IE 6. Interesting huh?</p>
<p>If Apple can do it&#8230; who next?</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Movement+in+the+death+of+old+browsers+and+IE+6&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fmovement-in-the-death-of-old-browsers-and-ie-6">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/movement-in-the-death-of-old-browsers-and-ie-6/feed</wfw:commentRss>
		</item>
		<item>
		<title>Keeping Google honest; The power of not being defensive</title>
		<link>http://almaer.com/blog/keeping-google-honest-the-power-of-not-being-defensive</link>
		<comments>http://almaer.com/blog/keeping-google-honest-the-power-of-not-being-defensive#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:42:05 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Google]]></category>

		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/keeping-google-honest-the-power-of-not-being-defensive</guid>
		<description><![CDATA[
I may, or may not, agree with the opinions of Steve Yegge
Being an employee of a large company is interesting. If you work for companies like Apple, Microsoft, Yahoo!, and many others, you will have some of the same experiences. You represent the company. You hang out at a wedding and someone finds out &#8220;oh, [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Keeping Google honest; The power of not being defensive", url: "http://almaer.com/blog/keeping-google-honest-the-power-of-not-being-defensive" });</script>]]></description>
			<content:encoded><![CDATA[<p><img src='http://almaer.com/blog/uploads/shakehands.jpg' alt='Shake Hands' border='0'/></p>
<p><em>I may, or may not, <a href="http://steve-yegge.blogspot.com/2008/06/done-and-gets-things-smart.html">agree with the opinions of Steve Yegge</a></em></p>
<p>Being an employee of a large company is interesting. If you work for companies like Apple, Microsoft, Yahoo!, and many others, you will have some of the same experiences. You represent the company. You hang out at a wedding and someone finds out &#8220;oh, you work for Google.&#8221; You wonder what is coming next. Should I have remembered me t-shirt that says &#8220;Just because I work for Google doesn&#8217;t mean I will fix your computer&#8221;? Will you get the &#8220;can you fix this one issue with my Gmail&#8221; thought? Or, the &#8220;man your search ruuuuules&#8221;, or the &#8220;Are you big brother?&#8221;</p>
<p>I have learned not to be at all defensive if I get asked questions about privacy and data. In fact, just last week, one of the nice chaps who created <a href="http://masterplanthemovie.com/">Masterplan The Movie</a> showed up to an event in Munich. He kindly said hello and we started to talk about some of the issues. I think that he may have expected me to get defensive.</p>
<p>The problem is that I can&#8217;t &#8220;prove&#8221; that Google believes in its &#8220;Don&#8217;t be evil&#8221; mantra. I personally believe in it, and have seen it in action on a daily basis, but you may not have. How could you just take my word? What I <em>can</em> do is ask you to look at our actions, both in the past, and in the future. Google&#8217;s entire business model requires trust. You could switch from google.com to another search engine very easily indeed. There is no lockin there. So, we need to provide you the best search results available, and we need you to trust us that this is the case.</p>
<p>Trust came up the other day when someone blogged about the <a href="http://code.google.com/apis/ajaxlibs/">Ajax Libraries API</a> launch. As you know, the launch was all about how we are hosting popular open source JavaScript libraries, and the skeptics quickly wondered why Google would do that. &#8220;What is their business motive.&#8221; One chap pondered on the fact that if we were delivering jquery.js to him, we could put any old JavaScript in there to do anything we wanted. Maybe we would add some kind of tracking to help us target ads.</p>
<p>Again, rather than arguing &#8220;hey we are good guys&#8221;, it was easier to talk about reasons why that may not make sense.</p>
<p>For example, a lot of sites use Google Analytics, and embed urchin.js in their pages. A <em>lot</em> of sites. We could do anything we want there too, but why would we. If we got caught out can you imagine the blogosphere. Arrington would be shouting bloody murder about Google. We would lose trust, and that would hurt.</p>
<p>Some may grow frustrated with the skeptics, but I applaud it. There are a lot of people from within that are pushing boundaries. Internal Googlers are not shy about calling fowl if they see it happen. With people watching every move of Google, especially with the high bar that we set with the motto, we are more likely to truly do the right thing. If we step over the line, people are there to shout back and us, and that keeps us honest.</p>
<p>So, thanks for the skeptics. I won&#8217;t try to persuade you how good we are at Google, just keep on watching.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Keeping+Google+honest%3B+The+power+of+not+being+defensive&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fkeeping-google-honest-the-power-of-not-being-defensive">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/keeping-google-honest-the-power-of-not-being-defensive/feed</wfw:commentRss>
		</item>
		<item>
		<title>Addressbook History goes into the cloud with App Engine</title>
		<link>http://almaer.com/blog/addressbook-history-goes-into-the-cloud-with-app-engine</link>
		<comments>http://almaer.com/blog/addressbook-history-goes-into-the-cloud-with-app-engine#comments</comments>
		<pubDate>Tue, 17 Jun 2008 18:08:38 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[appengine]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/addressbook-history-goes-into-the-cloud-with-app-engine</guid>
		<description><![CDATA[I recently built an example of the Form History Pattern using an Addressbook case study.
I found myself talking about App Engine on the On Air tour, so I decided to change the example to not store the data locally with Gears, but instead to save it away into the cloud via App Engine.

Why did people [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Addressbook History goes into the cloud with App Engine", url: "http://almaer.com/blog/addressbook-history-goes-into-the-cloud-with-app-engine" });</script>]]></description>
			<content:encoded><![CDATA[<p>I recently built an example of the Form History Pattern using an <a href="http://ajaxian.com/archives/addressbook-an-example-of-the-form-history-pattern">Addressbook</a> case study.</p>
<p>I found myself talking about App Engine on the <a href="http://onair.adobe.com/">On Air</a> tour, so I decided to change the example to not store the data locally with Gears, but instead to save it away into the cloud via App Engine.</p>
<p><img src='http://almaer.com/blog/uploads/app-engine-on-air-munich006-002.jpg' alt='RIBs' border='0'/></p>
<p>Why did people want to hear about App Engine at an Adobe conference? I think that Jonathan Schwartz got it when he mentioned <a href="http://blogs.sun.com/jonathan/entry/rocking_the_free_world">rich internet back-ends</a>. As you build rich clients, you suddenly realise that the promised benefits of web services can kick into gear nicely.</p>
<p><img src='http://almaer.com/blog/uploads/app-engine-on-air-munich021-001.jpg' alt='Addressbook Services' border='0'/></p>
<p>Back to the sample. The architecture change was quite simple. Where I was doing a local DB save, I would call a back-end service such as <code>/loadcontacts</code> or <code>/savecontact</code> depending on the task.</p>
<p>You can view and download the <a href="http://code.google.com/p/google-ajax-examples/source/browse/trunk/addressbook/appengine/">full App Engine project code</a> for this sample, and you can <a href="http://addressbookhistory.appspot.com/">see it running live on App Engine</a></p>
<p>Check out the video below, <a href="http://www.youtube.com/watch?v=nwn3YY6cyEQ&#038;fmt=6">or view the high quality version (recommended)</a> to see the code walk through, and the various tools that App Engine gives you to develop, debug, and monitor your application running at a few thousand feet. </p>
<p><object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/nwn3YY6cyEQ&#038;hl=en"></param><embed src="http://www.youtube.com/v/nwn3YY6cyEQ&#038;hl=en" type="application/x-shockwave-flash" width="425" height="344"></embed></object></p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Addressbook+History+goes+into+the+cloud+with+App+Engine&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Faddressbook-history-goes-into-the-cloud-with-app-engine">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/addressbook-history-goes-into-the-cloud-with-app-engine/feed</wfw:commentRss>
		</item>
		<item>
		<title>From Beer to Wine; Flying App Engine from Europe to Napa</title>
		<link>http://almaer.com/blog/from-beer-to-wine-flying-app-engine-from-europe-to-napa</link>
		<comments>http://almaer.com/blog/from-beer-to-wine-flying-app-engine-from-europe-to-napa#comments</comments>
		<pubDate>Mon, 16 Jun 2008 17:21:37 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/from-beer-to-wine-flying-app-engine-from-europe-to-napa</guid>
		<description><![CDATA[I have had an interesting week to say the least. I had the pleasure of joining the Adobe On Air tour of Europe in Prague. It was my first time to the city, which is a beautiful blend of east and west Europe.
The Adobe mini-conference was held at a great brewery, and we got the [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "From Beer to Wine; Flying App Engine from Europe to Napa", url: "http://almaer.com/blog/from-beer-to-wine-flying-app-engine-from-europe-to-napa" });</script>]]></description>
			<content:encoded><![CDATA[<p>I have had an interesting week to say the least. I had the pleasure of joining the Adobe <a href="http://onair.adobe.com/">On Air tour</a> of Europe in Prague. It was my first time to the city, which is a beautiful blend of east and west Europe.</p>
<p>The Adobe mini-conference was held at a great brewery, and we got the tour the night before. The Czech folks take their beer seriously, and they are the inventors of Budweiser, but don&#8217;t hold that against them&#8230;. their Budvar is actually good (and not like having sex in a canoe!)</p>
<p><img src='http://almaer.com/blog/uploads/beertaps1.jpg' alt='Beer Taps' border='0'/></p>
<p>After checking out the taps, we got to taste the beer, which ran smooth. Holding the actual event at a brewery also means that you open up the taps in the afternoon, which gets the crowd in a good mood indeed.</p>
<p>After train rides shared with women and their pets, I got to another place known for beer. Sitting in the Biergartens of Munich, with full Litre jugs to wash down the Currywurst. It was bitter sweat to soak up the Euro 2008 footy action, what with our lads not being there at all.</p>
<p>The event was fun again, as I got to talk more about App Engine to the crowd:</p>
<p><object style="margin:0px" width="425" height="355">
<param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=app-engine-on-air-munich-1213195520155418-8"/>
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=app-engine-on-air-munich-1213195520155418-8" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>
<p><img src='http://almaer.com/blog/uploads/deldotto.png' alt='Del Dotto' border='0'/></p>
<p>After a week of beer, I found myself back state-side and on a bus full of Googlers to Napa for an offsite. We ended up at <a href="http://www.deldottovineyards.com/">Del Dotto Vineyards</a> where the owner took us on a wild ride of fine wine.</p>
<p>Right at the beginning you will hear him say:</p>
<blockquote><p>
&#8220;You guys here do software and that kind of stuff? This is going to blow your mind&#8221;
</p></blockquote>
<p><object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/J7LF1QqYLIw"> </param> <embed src="http://www.youtube.com/v/J7LF1QqYLIw" type="application/x-shockwave-flash" width="425" height="350"> </embed> </object></p>
<p>This was one of the finest meals and wine tastings that I have ever had. I can&#8217;t recommend it enough! Now, I am ready for some water for the coming week&#8230;. until I head to Mexico and Sao Paulo, which will mean Margs and Caipirinha?</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=From+Beer+to+Wine%3B+Flying+App+Engine+from+Europe+to+Napa&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Ffrom-beer-to-wine-flying-app-engine-from-europe-to-napa">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/from-beer-to-wine-flying-app-engine-from-europe-to-napa/feed</wfw:commentRss>
		</item>
		<item>
		<title>Why we need Skype on the iPhone</title>
		<link>http://almaer.com/blog/why-we-need-skype-on-the-iphone</link>
		<comments>http://almaer.com/blog/why-we-need-skype-on-the-iphone#comments</comments>
		<pubDate>Mon, 16 Jun 2008 15:07:42 +0000</pubDate>
		<dc:creator>dion</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/why-we-need-skype-on-the-iphone</guid>
		<description><![CDATA[
Above is a picture of my iPhone at my house right now. It is infuriating to have ridiculously poor coverage living in Palo Alto. I have had full bars at the top of mountains, but in the center of Silicon Valley I have one? Are you freaking kidding me?
This is why I can&#8217;t wait for [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Why we need Skype on the iPhone", url: "http://almaer.com/blog/why-we-need-skype-on-the-iphone" });</script>]]></description>
			<content:encoded><![CDATA[<p><img src='http://almaer.com/blog/uploads/iphonewifiphone.png' alt='iPhone Wifi and Cell Coverage' border='0'/></p>
<p>Above is a picture of my iPhone at my house right now. It is infuriating to have ridiculously poor coverage living in Palo Alto. I have had full bars at the top of mountains, but in the center of Silicon Valley I have one? Are you freaking kidding me?</p>
<p>This is why I can&#8217;t wait for VoIP on iPhone 2.0, so I can stick my nose at AT&#038;T as I make decent quality calls from home.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=354f179b-e7f8-4987-9627-826c786092ce&amp;title=Why+we+need+Skype+on+the+iPhone&amp;url=http%3A%2F%2Falmaer.com%2Fblog%2Fwhy-we-need-skype-on-the-iphone">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/why-we-need-skype-on-the-iphone/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
