<?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>Blogs &#187; Andy Idsinga (Intel)</title>
	<atom:link href="http://software.intel.com/en-us/blogs/author/andy-idsinga/feed/" rel="self" type="application/rss+xml" />
	<link>http://software.intel.com/en-us/blogs</link>
	<description></description>
	<lastBuildDate>Fri, 25 May 2012 22:49:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Dynamically load javascript with load completion notification</title>
		<link>http://software.intel.com/en-us/blogs/2010/05/22/dynamically-load-javascript-with-load-completion-notification/</link>
		<comments>http://software.intel.com/en-us/blogs/2010/05/22/dynamically-load-javascript-with-load-completion-notification/#comments</comments>
		<pubDate>Sat, 22 May 2010 22:29:46 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web apps]]></category>
		<category><![CDATA[What If]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2010/05/22/dynamically-load-javascript-with-load-completion-notification/</guid>
		<description><![CDATA[A javascript function to dynamically load a script node into a page and then notify the caller when script load is complete.]]></description>
			<content:encoded><![CDATA[<p>Here's a javascript function to dynamically load javascript into a page and get a notification (callback) when the script is done loading.</p>
<p>I used to use the good 'ol window.onload handler - but I've found that this way is better as the <a href="http://software.intel.com/sites/whatif/webapis/">Web APIs</a> we're building need to dynamically add scripts to the page that is embedding them and know when the script is done loading!</p>
<p><strong>The main advantage : </strong><br />
This function loads the specified script and calls the javascript function you specify <span style="color:#ff0000">when the script has finished loading</span>.<br />
Your code can call this at any time during the life of your app - even based on user interaction! (see HTML test code below below).</p>
<p><strong>This "lazy script loading" has other advantages:</strong><br />
- reducing the initial page / app load time<br />
- allows for loading scripts based on user input / feature requirements</p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
The add_script function
</div>
<div style="border:1px dotted #cccccc;">
<pre style="font-family: bogus,monospace;font-size:100%;">
    <span style="font-family: bogus,monospace;font-size:100%;color:#6666FF">/* utility to add a script node to the current document
       and call the callback function when it is loaded.
       Should allow scripts to be loaded at any time during document
       life..and have code be kicked off after they are loaded.

       Browsers tested:
       FF 3.6.x     - WORKS
       Chrome 5.x   - WORKS
       Safari 4.x   - WORKS
       MS IE 8      - WORKS
       Opera 10.x   - WORKS
    */</span>
    <span style="font-family: bogus,monospace;font-size:100%;font-weight:bold;">function</span> <span style="font-family: bogus,monospace;font-size:100%;color: #cc0000">add_script(scriptURL, onloadCB)</span> {
      var scriptEl    = document.createElement("script");
      scriptEl.type   = "text/javascript";
      scriptEl.src    = scriptURL;

      function calltheCBcmn() {
        onloadCB(scriptURL);
      }

      if(typeof(scriptEl.addEventListener) != 'undefined') {
        /* The FF, Chrome, Safari, Opera way */
        scriptEl.addEventListener('load',calltheCBcmn,false);
      }
      else {
        /* The MS IE 8+ way (may work with others - I dunno)*/
        function handleIeState() {
          if(scriptEl.readyState == 'loaded'){
            calltheCBcmn(scriptURL);
          }
        }
        var ret = scriptEl.attachEvent('onreadystatechange',handleIeState);
      }
      document.getElementsByTagName("head")[0].appendChild(scriptEl);
    }
</pre>
</div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
The HTML used to test loading two scripts based on user input
</div>
<div style="border:1px dotted #cccccc;">
<pre style="font-family: bogus,monospace;font-size:100%;">

&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;TITLE&gt; Script load testing&lt;/TITLE&gt;
  &lt;/head&gt;
  &lt;body&gt; 

    &lt;div id="control_area" style="width:100%;height:100%;border:solid red 1px"&gt;
      <span style="background-color:#ffff99;">Select the script to load:</span>
      &lt;select id="script_selector" size="1"&gt;
        &lt;option&gt; ./gen_include2.js&lt;/option&gt;
        &lt;option&gt; ./gen_include.js&lt;/option&gt;
      &lt;/select&gt;
      &lt;ul&gt;
        &lt;li&gt; &lt;a href="javascript:void(0);" onclick="load_selected();"&gt; Load selected script&lt;/a&gt; &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div id="output_area"
      style="position:relative;width:100%;height:200px;overflow:auto;
      border: dotted 1px #ff0000;"&gt;
    &lt;/div&gt; 

    &lt;script type="text/javascript"&gt; 

    /* clear the scratch area */
    document.getElementById("output_area").value = "";

    function load_selected() {
      output_str("+load_selected");
      var ssel = document.getElementById("script_selector");
      var sselURL = ssel.options[parseInt(ssel.selectedIndex)].text;

      <span style="background-color:#ffff99;">function myOnloadCB</span>(loadedScriptURL) {
        output_str("myOnloadCB,script loaded: " + loadedScriptURL);
        if(typeof(window.gen_include_js) != 'undefined'){
          output_str("window.gen_include_js exists in DOM");
        }
        if(typeof(window.gen_include_js2) != 'undefined'){
          output_str("window.gen_include_js2 exists in DOM");
        }
      }
      <span style="font-family: bogus,monospace;font-size:100%;background-color:#ffff99;">add_script(sselURL, myOnloadCB)</span>;
    }

    /* utility to add a script node to the current document
       and call the callback function when it is loaded.
       Should allow scripts to be loaded at any time during document
       life..and have code be kicked off after they are loaded.

       Browsers tested:
       FF 3.6.x     - WORKS
       Chrome 5.x   - WORKS
       Safari 4.x   - WORKS
       MS IE 8      - WORKS
       Opera 10.x   - WORKS
    */
    <span style="font-family: bogus,monospace;font-size:100%;background-color:#ffff99;">function add_script(scriptURL, onloadCB) {</span>
      output_str("+add_script");
      var scriptEl    = document.createElement("script");
      scriptEl.type   = "text/javascript";
      scriptEl.src    = scriptURL;

      function calltheCBcmn() {
        onloadCB(scriptURL);
      }

      if(typeof(scriptEl.addEventListener) != 'undefined') {
        /* FF, Chrome, Safari way */
        scriptEl.addEventListener('load',calltheCBcmn,false);
      }
      else {
        /* MS IE way */
        function handleIeState() {
          output_str("+handleIeState,scriptEl.readyState=" + scriptEl.readyState);
          if(scriptEl.readyState == 'loaded'){
            calltheCBcmn(scriptURL);
          }
        }
        var ret = scriptEl.attachEvent('onreadystatechange',handleIeState);
        output_str("attachEvent ret = " + ret);
      }
      document.getElementsByTagName("head")[0].appendChild(scriptEl);
    <span style="font-family: bogus,monospace;font-size:100%;background-color:#ffff99;">}</span>

    /* function to print to the the output_area div */
    function output_str(str){
      var da = document.getElementById("output_area");
      da.innerHTML += str + "&lt;br/&gt; ";
      da.scrollTop = da.scrollHeight;
    }
    &lt;/script&gt; 

  &lt;/body&gt;
&lt;/html&gt; 
</pre>
</div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
The contents of the 2 .js files dynamically loaded in the HTML above.
</div>
<div style="border:1px dotted #cccccc;">
<pre style="font-family: bogus,monospace;font-size:100%;">
/* gen_include.js */
(function()
{
  window.gen_include_js = {};
  window.gen_include_js.loaded = true;
}
)();

/* gen_include2.js */
(function()
{
  window.gen_include_js2 = {};
  window.gen_include_js2.loaded = true;
}
)();
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2010/05/22/dynamically-load-javascript-with-load-completion-notification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some web apis for the webs and the apps</title>
		<link>http://software.intel.com/en-us/blogs/2010/04/12/some-web-apis-for-the-webs-and-the-apps/</link>
		<comments>http://software.intel.com/en-us/blogs/2010/04/12/some-web-apis-for-the-webs-and-the-apps/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 16:55:30 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[embed code]]></category>
		<category><![CDATA[web apis]]></category>
		<category><![CDATA[What If]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2010/04/12/some-web-apis-for-the-webs-and-the-apps/</guid>
		<description><![CDATA[Andy shares the first release of Intel Web APIs with some widget embed code and a look to the future.]]></description>
			<content:encoded><![CDATA[<p>Late last week we released to the webs our project's first set of <a href="http://software.intel.com/sites/whatif/webapis/">web apis</a>.</p>
<p>This first set of APIs are simple, and meant to provide the app developer with a bit more device side contextual information so they might use it to provide a better experience for their user. </p>
<p>Here's some code you can embed to play around with our CPU / Power / Connection Indicator widget: <br/><br/></p>
<div style="border:1px dotted #444444;background-color:#eeeeee;position:relative;width:70%;margin-left:auto;margin-right:auto;font-family: bogus,monospace;font-size:100%;color:#009999;">
&lt;div id="cpci_div"&gt;&lt;/div&gt;<br />
&lt;script type="text/javascript"<br />
src="http://software.intel.com/sites/whatif/webapis/intelwebapis.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"<br />
src="http://software.intel.com/sites/whatif/webapis/widget/cpc/IntelCPCIWidget.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
(function() {<br />
//modified update interval - updates every 1 second instead of default 5<br />
var theIntelCpciInst = new IntelCPCIWidget('cpci_div',{'updateInt':1});<br />
})();<br />
&lt;/script&gt;
</div>
<div style="position:relative;width:70%;margin-left:auto;margin-right:auto;text-align:center">
<a href="http://software.intel.com/sites/whatif/webapis/widget/cpc/">compatibility notes and docs here</a>
</div>
<p><br/><br />
Our next APIs will be building blocks that help with more compute intensive problems - such as image and video processing.<br/></p>
<p>If you're already coding in C/C++ you should check out our <a href="http://software.intel.com/en-us/forums/intel-media-sdk/">Media SDK forum</a> and my coworker <a href="http://software.intel.com/en-us/blogs/author/eric-sardella/">Eric Sardella's blog</a>.<br/></p>
<p>If you're strictly a web app developer - stay tuned baby! :). <br/></p>
<p>If you want to tell us what compute intensive APIs would help your web app development - <a href="http://software.intel.com/en-us/forums/intel-web-apis/">we've got a forum for that</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2010/04/12/some-web-apis-for-the-webs-and-the-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Bubbles may blow your mind</title>
		<link>http://software.intel.com/en-us/blogs/2010/03/12/code-bubbles-may-blow-your-mind/</link>
		<comments>http://software.intel.com/en-us/blogs/2010/03/12/code-bubbles-may-blow-your-mind/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 18:30:03 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[code bubbles]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2010/03/12/code-bubbles-may-blow-your-mind/</guid>
		<description><![CDATA[Andy loves the concepts demonstrated in the Code Bubbles demo.]]></description>
			<content:encoded><![CDATA[<p>This morning I took at look at <a href="http://www.cs.brown.edu/people/acb/codebubbles_site.htm">Code Bubbles - a project by Andrew Bragdon</a></p>
<p>This demo really blew my mind - and I felt I needed to put up a post about it. Good work like this deserves attention.</p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/PsPX0nElJ0k&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PsPX0nElJ0k&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p>I haven't seen many development tools that are as fresh and seem so useful in making code maintenance and bug fixing more efficient.<br />
I really like how Code Bubbles connects functional blocks of codes and uses color to differentiate different links of bubbles in a 2d space.</p>
<p>I spend a lot of time looking at a lot of code in different files and tabs in my editor. The bubbles and 2d space is a brilliant way of connecting things together to create a context that is specific to the thing I'm doing right now.<br />
This is in stark contrast to code parsers creating ginormous lists of class and function references or opening 6000 tabs in my editor ...or opening up giant graphical trees that extend back to the root object.</p>
<p>I hope the implementation is as good as the presentation!</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2010/03/12/code-bubbles-may-blow-your-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 offline web apps - code experiments with several browsers</title>
		<link>http://software.intel.com/en-us/blogs/2009/12/11/html5-offline-web-apps-code-experiments-with-several-browsers/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/12/11/html5-offline-web-apps-code-experiments-with-several-browsers/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 19:03:33 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[internet explorer 8]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[offline web apps]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[web apis]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/12/11/html5-offline-web-apps-code-experiments-with-several-browsers/</guid>
		<description><![CDATA[Andy shares some HTML5 offline app reading links and code experiments. He also figures out how to integrate the phrase "big ol can o whup'code" into his post, and, ever so slyly, this excerpt.]]></description>
			<content:encoded><![CDATA[<p>Last week I was discussing HTML5 offline web app features with some coworkers and I realized it was time to play around with a bit of code.<br />
You can always support your points in a geek discussion by pop'n open a big ol can o whup'code right? Until someone brings out the newclear option! Thank you, I'm here all week ;)</p>
<p>Okay -  my goal was to get a some first hand experience with the code and then run it in several different browsers. I chose the browsers listed below because they are available on a variety of client device types and operating systems.<br />
<span style="color:#ff0000">UPDATE 09/11/09 7.44pm:</span>Added results below for iPhone Safari browser!</p>
<p>Feel free to make a case to to run the code in some other browser - I'll add the info to the results too.</p>
<p>I'm by no means and expert here. I've done a little reading and a little coding and I'm hoping you readers will share your experiences and advice. I'll update the post with the good stuff.</p>
<div style="border:1px dotted #cccccc;background-color:#3366ff;color:#ffffff">Heavy opinion section</div>
<p>There is no such thing as "offline web apps". The words "offline web apps" IMHO are misleading because for some folks it brings to mind "stand alone apps" such as native apps, or runtime based apps written for a java vm or adobe air.<br />
In my opinion there are only "web apps". Some of them can work offline.<br />
Web apps must be able to take full advantage of the client device, the cloud and work when a network connection is not available.</p>
<div style="border:1px dotted #cccccc;background-color:#3366ff;color:#ffffff">Reference materials and background reading</div>
<p>*) <a href="http://dev.w3.org/html5/spec/offline.html">Offline app section</a> of HTML5 spec.<br />
*) <a href="http://dev.w3.org/html5/webstorage/">W3C Web Storage</a> technical docs<br />
*) <a href="http://dev.w3.org/html5/spec/iana.html#text-cache-manifest">text/cache-manifest</a> mime type details and file format.<br />
*) <a href="http://starkravingfinkle.org/blog/2007/02/firefox-3-offline-app-demo/">Mark Finkle's post</a> about the Firefox 3 implementation with a sample app.<br />
*) <a href="http://ejohn.org/blog/offline-events/">John Resig's post</a> about online / offline events</p>
<div style="border:1px dotted #cccccc;background-color:#3366ff;color:#ffffff">The code</div>
<p>The goal for this code was to experiment with the three main areas of functionality that allow web apps to work offline.<br />
*) Online/Offline state: the ability to detect when the client device is online vs offline<br />
*) Application cache: the ability of the web app to instruct the browser to cache the web app's resources (html, scripts, images, arbitrary data) for offline use.<br />
*) Local storage: the ability to store application runtime data on the client device and retrieve it after browser shutdown/startup.</p>
<p><span style="color: #dd0000">Note:</span> when I ran this code in the various browsers I was also tailing my apache access log to watch how they were requesting content. This was helpful in observing caching behaviors and checking that when a browser thought it was offline it wasn't connecting to the web server to get content ;)</p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
How to instruct the browser to use an application cache.
</div>
<div style="border:1px dotted #cccccc;">
<pre>
  < <span style="font-weight:bold;">!DOCTYPE</span> HTML >
  < <span style="font-weight:bold;">HTML</span> <span style="font-weight:bold;color:#ff0000">manifest</span>="./cache.manifest" >
    ...the rest of your HTML5 markup.
  < <span style="font-weight:bold;">/HTML</span> >
</pre>
</div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
Here is my app's cache.manifest file. This must be served as Content-Type: text/cache-manifest
</div>
<div style="border:1px dotted #cccccc;">
<pre>
  CACHE MANIFEST
  # comment with version string to tweak v 6
  theapp.html
  blank.png
  bug.png
  heart.png
  arb_bin_data.php

  NETWORK:
  noncached.html

  FALLBACK:
  / ./offline.html
</pre>
</div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
The javascript I wrote to experiment with HTML5 offline app features
</div>
<div style="border:1px dotted #cccccc;">
<pre>
  <span style="color:#6666FF">/* print out some information about offline features */</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">print_offline_support()</span>{
    debug_out("navigator.onLine defined: " +
      (typeof(navigator.onLine) == 'undefined' ? "no" : "yes"));

    debug_out("window.localStorage defined: " +
      (typeof(window.localStorage) == 'undefined' ? "no" : "yes"));

    debug_out("window.applicationCache defined: " +
      (typeof(window.applicationCache) == 'undefined' ? "no" : "yes"));

    try{
      document.body.addEventListener("online", <span style="font-weight:bold;">function</span>(){
        debug_out("got event: document.body.online");
      }, false);

      document.body.addEventListener("offline", <span style="font-weight:bold;">function</span>(){
        debug_out("got event: document.body.offline");
      }, false);

      debug_out("document.body.online and document.body.offline events: yes");
    }
    catch(err){
      debug_out("document.body.online and document.body.offline events: no");
      debug_out(" event reg debug: " + err);
      if(typeof(navigator.onLine) != 'undefined')
      {
        debug_out(" using cheezy_online_events...");
        cheezy_online_events();
      }
    }

    if(typeof(navigator.onLine) != 'undefined'){
      debug_out("online state:" + (navigator.onLine == true ? "online" : "offline"));
    }
    else{
      debug_out("online state: undefined");
    }
  }

  <span style="color:#6666FF">/* cheezy way to check online status ..and possibly generate
     an event in the app */</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">cheezy_online_events()</span>{
    debug_out("online state:" + (navigator.onLine == true ? "online" : "offline"));
    setTimeout(cheezy_online_events, 5000);
  }

  <span style="color:#6666FF">/* store some string data to local storage
     This is using some text input elements on the page
     for input.*/</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">store_local</span>(domid_prefix){
    debug_out("+,store_local()");
    var keyinput = document.getElementById(domid_prefix + "key").value;
    var valinput = document.getElementById(domid_prefix + "val").value;
    try{
      if(typeof(window.localStorage) != 'undefined'){
        window.localStorage.setItem(keyinput,valinput);
      }
      else{
        throw "window.localStorage, not defined";
      }
    }
    catch(err){
      debug_out("store_local,error," + err);
    }
    debug_out("-,store_local()");
  }

  <span style="color:#6666FF">/* load some string data from local storage
     This is using some text input elements on the page
     for the key name input and value output.*/</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">load_local</span>(domid_prefix){
    debug_out("+,load_local()");
    var keyinput = document.getElementById(domid_prefix + "key").value;
    var valoutput = document.getElementById(domid_prefix + "val");
    try{
      if(typeof(window.localStorage) != 'undefined'){
        valoutput.value = window.localStorage.getItem(keyinput);
      }
      else{
        throw "window.localStorage, not defined";
      }
    }
    catch(err){
      debug_out("store_local,error," + err);
    }
    debug_out("-,load_local()");
  }

  <span style="color:#6666FF">/* see http://dev.w3.org/html5/spec/offline.html#dom-appcache-update*/</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">update_app_cache()</span>{
    debug_out("+,update_app_cache()");
    try{
      if(typeof(window.applicationCache) != 'undefined') {
        window.applicationCache.update();
      }
      else{
        throw "window.applicationCache, not defined";
      }
    }
    catch(err){
      debug_out("update failed,error," + err);
    }
    debug_out("-,update_app_cache()");
  }

  <span style="color:#6666FF">/* see http://dev.w3.org/html5/spec/offline.html#dom-appcache-swapcache*/</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">swap_app_cache()</span>{
    debug_out("+,swap_app_cache()");
    try{
      if(typeof(window.applicationCache) != 'undefined') {
        window.applicationCache.swapCache();
      }
      else{
        throw "window.applicationCache, not defined";
      }
    }
    catch(err){
      debug_out("swap failed,error," + err);
    }
    debug_out("-,swap_app_cache()");
  }

  <span style="color:#6666FF">/* function to print to the text area element with the id="debug_area" */</span>
  <span style="font-weight:bold;">function</span> <span style="color: #cc0000">debug_out(str)</span>{
    document.getElementById("debug_area").value += str + "\n";
  }
</pre>
</div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#3366ff;color:#ffffff">Results</div>
<div>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
  Firefox v 3.5.5, Windows PC
  </div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<pre>
navigator.onLine defined: yes
window.localStorage defined: yes
window.applicationCache defined: yes
document.body.online and document.body.offline events: yes
online state:online
</pre>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
      Yes.<br/><br />
      If you have multiple versions of firefox installed be prepared for headaches. I<br />
      had 3.5.5 and 3.6b4 installed and just about went crazy trying to figure out why they<br />
      wouldn't request the cache.manifest and the entries inside. I finally uninstalled both,<br />
      reinstalled 3.5.5 and starting using different profiles. Just a guess: they were both sharing the same<br />
      profile directory and confusing each other because of that. I'm now using separate "developer"<br />
      profile directories for each version and things are working more or less as expected.<br />
      See <a href="http://support.mozilla.com/en-US/kb/Profiles">this page about profiles </a> at Mozilla.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
      Yes, go to the File menu and select the "work offline" menu item.<br/><br />
      I use this feature to to cause the online / offline events to be fired through<br />
      document.body.online and document.body.offline handlers. NICE!
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
      Yes.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
      Browser requests cache.manifest and, if modified also requests entries in the<br />
      manifest.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
      An exception is thrown.<br />
      <a href="https://developer.mozilla.org/en/nsIDOMOfflineResourceList">This page</a> at Mozilla says swapCache() not yet supported.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
      Yes! But ... navigator.onLine was still == true.<br/><br />
      The online / offline events seem a little flakey to me. It seems as thought the browser really wants<br />
      to to think it is online. Even when I've explicitly disabled all the network adapters, disconnected<br />
      networks, turned off the web server :).
    </div>
</p></div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
  Firefox v 3.6b4, Windows PC
  </div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<pre>
navigator.onLine defined: yes
window.localStorage defined: yes
window.applicationCache defined: yes
document.body.online and document.body.offline events: yes
online state:online
</pre>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
      Yes.<br/><br />
      Seemed to work the same as FF 3.5.5. FYI - recommend two different profiles if using<br />
      two diff versions of the browser. See <a href="http://support.mozilla.com/en-US/kb/Profiles"> this page</a> at Mozilla.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
      Yes, go to the File menu and select the "work offline" menu item.<br/><br />
      Seems to work like FF 3.5.5 and sent events to document.body.online and document.body.offline event listeners.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
      Yes.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
      Seemed to work the same as FF 3.5.5. (see comment above)
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
    Seemed to work the same as FF 3.5.5. (see comment above)
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
      Yes! ...and it seemed to track offline / online state better than FF 3.5.5. Online/offline events<br />
      seemed to be consistent with disabling my network adapters whereas they weren't in FF 3.5.5.
    </div>
</p></div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
  Chrome v 4.0.223.16, Windows PC
  </div>
<div style="border:1px dotted #cccccc;">
  Note: Chrome does have offline support through Gears and even through the results below aren't as good as Firefox and Safari, I fully expect Chrome to catch up <a href="http://latimesblogs.latimes.com/technology/2009/11/google-gears.html">based on this article</a>.
 </div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<pre>
navigator.onLine defined: yes
window.localStorage defined: yes
window.applicationCache defined: no
document.body.online and document.body.offline events: yes
online state:online
</pre>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
      No.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
      I haven't found one.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
      Yes.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
      n/a. window.applicationCache not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
      n/a. no window.applicationCache not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
      n/a. I wouldn't expect this to work becuase the application cache wasn't available.
    </div>
</p></div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
  Safari v 4.0.3 (531.9.1), Windows PC
  </div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<div>
<div>navigator.onLine defined: yes</div>
<div>window.localStorage defined: yes</div>
<div>window.applicationCache defined: yes</div>
<div>document.body.online and document.body.offline events: yes</div>
</p></div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
      Yes.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
      I haven't found one.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
      Yes.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
      Browser requests cache.manifest, and if modified, the entries declared inside.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
      I'm not really sure how to use swapCache() yet even after looking at the spec section a few<br />
      times.<br/><br />
      Seems to do something on first call after window.applicationCache.update(). On second call throws<br />
      INVALID_STATE_ERR exception.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
      Yes!<br/><br />
      Note that Safari, similar to FF 3.5.5, did not seem to track online / offline state as I enabled/disabled<br />
      my network adapters. However, when I closed and reopened the browser the app did work and<br />
      navigator.onLine was set == false.
    </div>
</p></div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
Safari v 4.0 (526.16), iPhone OS 3_1_2
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<pre>
navigator.onLine defined: yes
window.localStorage defined: yes
window.applicationCache defined: yes
document.body.online and document.body.offline events: yes
online state:online
</pre>
</div>
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
    Yes.
  </div>
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
    Sort of: on the iPhone I just used "airplane mode" to test offline functionality. It worked great!
  </div>
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
    Yes.
  </div>
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
    Browser requests cache.manifest, and if modified, the entries declared inside. Good!
  </div>
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
    Same as Windows PC Safari (see comments above)
  </div>
</div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
    Yes!<br/><br />
    On the iPhone I just turned on airplane mode to test this. It totally worked! Kudos to Apple!.
  </div>
</div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
  Internet Explorer v 8.0.6001.18702, Windows PC
  </div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<pre>
navigator.onLine defined: yes
window.localStorage defined: yes
window.applicationCache defined: no
document.body.online and document.body.offline events: no
 event reg debug: TypeError: Object doesn't support this property or method
 using cheezy_online_events...
online state:online
      </pre>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
      No.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
      Yes. Go to the File menu, select the "Work Offline" menu item.<br/><br />
      Using this menu did cause navigator.onLine to be set to true / false. This allowed<br />
      my cheezy_online_events() function (in code above) to pick this up. This is good!
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
      Yes.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
      n/a. window.applicatoinCache not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
    n/a. window.applicatoinCache not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
      n/a. I wouldn't expect this to work becuase the application cache wasn't available.<br/><br />
      Note: Internet Explorer 8 did track the online / offline state as I enabled / disabled network adapters. (as seen via cheezy_online_events()).
    </div>
</p></div>
<p><br/></p>
<div style="border:1px dotted #cccccc;background-color:#ccffcc">
  Opera v 10.10 build 1893, Windows PC
  </div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Output of print_offline_support() function from above:</div>
<div>
<pre>
navigator.onLine defined: yes
window.localStorage defined: no
window.applicationCache defined: no
document.body.online and document.body.offline events: yes
online state:offline
</pre>
</p></div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does the browser request manifest.cache and its entries?</div>
<div>
      No.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Can "offline mode" can be invoked by app developer for testing?</div>
<div>
      Yes. Go to the File menu, select the "Work Offline" menu item.<br/><br />
      Note: using this menu did not cause offline / onlines events to be sent to<br />
      document.body.offline and document.body.online listeners.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Does window.localStorage.getItem() / setItem() work after browser shutdown / restart?</div>
<div>
      n/a. window.localStorage not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some window.applicationCache.update() observations.</div>
<div>
      n/a. window.applicatoinCache not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Some observations window.applicationCache.swapCache() observations.</div>
<div>
    n/a. window.applicatoinCache not defined.
    </div>
</p></div>
<div style="border:1px dotted #cccccc;">
<div style="color: #cc0000">Disconnect and disable network adapters. Does app work when going to url in browser?</div>
<div>
      n/a. I wouldn't expect this to work becuase the application cache wasn't available.<br/><br />
      Note: Opera did not seem to track online / offline state as I enabled / disabled network adapters.
    </div>
</p></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/12/11/html5-offline-web-apps-code-experiments-with-several-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: javascript objects with public and private data and functions</title>
		<link>http://software.intel.com/en-us/blogs/2009/11/25/howto-javascript-objects-with-public-and-private-data-and-functions/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/11/25/howto-javascript-objects-with-public-and-private-data-and-functions/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 00:18:15 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[example code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[private data]]></category>
		<category><![CDATA[private functions]]></category>
		<category><![CDATA[private methods]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/11/25/howto-javascript-objects-with-public-and-private-data-and-functions/</guid>
		<description><![CDATA[Andy shares some of his learnings about how to create javascript objects with private data and functions. Its easy, but non-obvious!]]></description>
			<content:encoded><![CDATA[<p>I've been coding like mad lately - pulling together code in Javascript, HTML and C++ for the web APIs that we're working on.<br />
See my other posts: <a href="http://software.intel.com/en-us/blogs/2009/10/22/api-drafts-posted-at-w3c-web-developer-comments-welcome/">here </a>and <a href="http://software.intel.com/en-us/blogs/2009/10/28/api-and-widget-demo-cpu-power-connection-mashed-with-video/">here </a> for more context.</p>
<p>One thing that had been nagging me about my own practice coding in javascript is that I still hadn't started implementing javascript objects with private data and functions. I knew it was possible but since the actual code layout was not obvious (at least as obvious as in C++) I procrastinated.</p>
<p>I'm happy to say I'm now creating my objects with private data and functions. I learned how to do this by reading <a href="http://www.crockford.com/javascript/private.html">this page by Douglas Crockford</a> and by practicing the technique in a real project I'm working on.</p>
<p>Why do I want private data and methods in javascript?<br />
I want them because I want to hide internal data and functions that implement the core functionality of my object behind a clean public interface. I want to disallow other code from changing my object's internal implementation except for the cases that have been explicitly allowed *through a public interface*.</p>
<p>I believe this also helps improve security because although a malicious script can change a public function of an object by assigning a different one to the same name; it can't change private functions and the private data and private function references they use.</p>
<p>I can always learn more about both javascript and security, so please feel free to help me along - especially with tips and tricks about defensive programming in javascript and web apps.</p>
<p>So, without further ado, here is some example code. This is a javascript object that includes both public functions and private functions and data:</p>
<p><span style="color:#ff0000">FYI - I've updated this code based on Ruud's comment below and the link with Chris Heilmann's solution.</span></p>
<pre>
<span style="color:#6666FF">
/* CODE START - spell checker off :) ---------------------------------------*/
</span><span style="color:#6666FF">
/*  ObjectWithPrivates
    A javascript object with public and private data and functions */</span>
<span style="font-weight:bold;">function</span> ObjectWithPrivates(){

<span style="color:#6666FF">  /* assign 'this' to 'that' so private functions can access this as that.
     Confusing? just remember: "this, that it's all the same!" :)
     From Doug Crockford's page:
     This is a workaround for an error in the ECMAScript Language
     Specification which causes this to be set incorrectly for inner
     functions.
     Note that I don't actually use the 'that' variable in
     the code below because my private functions use the privfuncs, privdata
     and pubfuncs containers to get at stuff. In any case, its a good
     convention to follow so that private functions can access 'this'
     through 'that' */</span>
  <span style="font-weight:bold;">var</span> that = this;

<span style="color:#6666FF">  /* container for private data - organizational thing -
     remember, since variables are scoped to the function block in
     javascript all inner functions inside this function, our object's
     constructor, have access to it. the outside world does not.
     tada private data! */</span>
  <span style="font-weight:bold;">var</span> privdata = {
    'data1':'this is some private data - data1',
    'data2':'some more private data - data2'
  };

<span style="color:#6666FF">  /* private function container
     mainly for code organization and readability */</span>
  <span style="font-weight:bold;">var</span> privfuncs = {};

<span style="color:#6666FF">  /* public function container
     we want private functions to be able to call public
     functions, but they should only do this through this container
     because the container can't be modified by the outside world directly!

     Note below we can pick and choose which funcs from pubfuncs we
     reveal through the array that we return.
  */</span>
  <span style="font-weight:bold;">var</span> pubfuncs = {};

<span style="color:#6666FF">  /* public shared data container.
    This seems to be needed so that both internal and external code can modify shared
    data and see each other's changes. I've found that just using non array/object
    types doesn't work. This is sort of redundant becuase all of this data could
    just be revealed through this, but returning it through the array below
    makes it much more clear what the public interface is ..and that is a good thing*/</span>
  <span style="font-weight:bold;">var</span> pubdata = {};

<span style="color:#6666FF">  /* a private function - just displays a message */</span>
  privfuncs.priv_func_1 = <span style="font-weight:bold;">function</span>(){
    alert("look everyone, this object has privates! - priv_func_1");
  }

<span style="color:#6666FF">  /* another private function - calls a public function
     through the pubfuncs container.
     This will call the correct pub_func_2() even if some other code
     changes this.pub_func_2 from outside. Cool eh? */</span>
  privfuncs.priv_func_2 = <span style="font-weight:bold;">function</span>(){
<span style="color:#6666FF">
    /* always call the correct pub_func_2() */</span>
    pubfuncs.pub_func_2();
  }

<span style="color:#6666FF">  /* a public function - just calls some private functions */</span>
  pubfuncs.pub_func_1 = <span style="font-weight:bold;">function</span>(){
    privfuncs.priv_func_1();
    privfuncs.priv_func_2();
  }

<span style="color:#6666FF">  /* second public function - displays a message */</span>
  pubfuncs.pub_func_2 = <span style="font-weight:bold;">function</span>(){
    alert("I'm the original pub_func_2() - private data: " + privdata['data1']);
  }

<span style="color:#6666FF">  /* Now for the public interface.
     Return an array that reveals the public interface - nice and obvious what is public*/</span>
  return {
    pub_func_1:pubfuncs.pub_func_1,
    pub_func_2:pubfuncs.pub_func_2,
    shdata:pubdata
  }
}

<span style="color:#6666FF">/* Lets play with our object and its privates...
   Be sure to look at 'obWithPrivs' in a dom inspector tool like the
   one that comes with firebug. Wow, no public data members, just the
   public functions! */</span>
<span style="font-weight:bold;">var</span> obWithPrivs = <span style="font-weight:bold;">new</span> ObjectWithPrivates();

<span style="color:#6666FF">/* cheezy way to inspect the members of the object without
   a proper dom inspector tool*/</span>
for (var membr in obWithPrivs){
  alert("found: obWithPriv." + membr);
}

<span style="color:#6666FF">/* call a public function */</span>
obWithPrivs.pub_func_1();

<span style="color:#6666FF">/* okay - be evil and and install a new pub_func_2 from the outside
   then call pub_func_1() again ...becuase we know it calls private code
   that calls pub_func_2 internally */</span>
obWithPrivs.pub_func_2 = function(){
  alert("I'm the evil pub_func_2");
}

<span style="color:#6666FF">/* the new, evil, pub_func_2() will NOT be called from
   the private code becuase the private code still references
   the original pub_func_2()*/</span>
obWithPrivs.pub_func_1();

<span style="color:#6666FF">/* the new, evil, pub_func_2() can still be called from the outside - but
   it wasn't able to chain itself to the private functionality ! */</span>
//alert("calling pub_func_2 directly...");
//obWithPrivs.pub_func_2();

<span style="color:#6666FF">/* CODE END ------------------------------------------------------------*/</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/11/25/howto-javascript-objects-with-public-and-private-data-and-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little list of portland tech event links</title>
		<link>http://software.intel.com/en-us/blogs/2009/11/03/a-little-list-of-portland-tech-event-links/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/11/03/a-little-list-of-portland-tech-event-links/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:08:47 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[portland]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/11/03/a-little-list-of-portland-tech-event-links/</guid>
		<description><![CDATA[Andy shares some event links he uses to keep track of events in the Portland tech community.]]></description>
			<content:encoded><![CDATA[<p>This afternoon I needed to provide a coworker with a list of links for local (<a href="http://en.wikipedia.org/wiki/Portland,_Oregon">Portland Oregon</a>) events. </p>
<p>I thought it would be something valuable to share with you too. </p>
<p>The links actually cover tech, blogging and entrepreneur oriented events. Many of the events found at these sites are free or very low cost. All of them provide a great opportunity to meet people and learn a little about the subject at hand.</p>
<p>While attending one of these events myself I had a little epiphany: in the age of digitally connected everything - the face to face and handshake connection is still very very important ...and fun!</p>
<p>Here's the list:</p>
<ul>
<li><a href="http://upcoming.yahoo.com/group/4070/">Silicon Florist</a> (this is awesome)</li>
<li><a href="http://calagator.org/">Calagator </a>(this is awesome)</li>
<li><a href="http://upcoming.yahoo.com/group/1423/">Portland Web Innovators</a></li>
<li><a href="http://upcoming.yahoo.com/group/3861/">Portland Web Tech Events</a></li>
<li><a href="http://oregon.tie.org/">TIE Oregon</a></li>
<li><a href="http://www.oen.org/">Oregon Entrepreneur Network (OEN)</a></li>
<li><a href="http://refreshpdx.org/">Refresh Portland</a></li>
<li><a href="http://oakhazelnut.makerlab.com/">Hazelnut Tech Talk</a></li>
<li><a href="http://www.beerandblog.com/">Beer and Blog</a></li>
<li><a href="http://www.igniteportland.com/">Ignite Portland</a> (ideas, inspiration not just tech!)</li>
</ul>
<p>Oh - and I'll be attending the <a href="http://upcoming.yahoo.com/event/4809409/">Portland Web Innovators event</a> tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/11/03/a-little-list-of-portland-tech-event-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>api and widget demo: cpu power connection mashed with video</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/28/api-and-widget-demo-cpu-power-connection-mashed-with-video/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/28/api-and-widget-demo-cpu-power-connection-mashed-with-video/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 23:49:38 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Mashup]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web api]]></category>
		<category><![CDATA[web developer]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/28/api-and-widget-demo-cpu-power-connection-mashed-with-video/</guid>
		<description><![CDATA[Andy shares video versions of web API presentations he been making to web developers.]]></description>
			<content:encoded><![CDATA[<p>Here are a couple of presentations I've been making a lot lately - about our work to expose platform/device capabilities to web developers.</p>
<p>After you look at the technology, think about the kinds of device capabilities, hardware and software, that would make your web application better. Then share them with us - we're listening.<br />
If you need some food for thought <a href="http://software.intel.com/en-us/blogs/2009/10/22/api-drafts-posted-at-w3c-web-developer-comments-welcome/">take a look at this blog post</a> - where I list several API drafts we recently submitted to the <a href="http://www.w3.org/2009/dap/">W3C Device API working group</a>.</p>
<p>"The story" gives you the context. "The Technology" dives a little deeper into the details.</p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/l05oJqo4C-A&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/l05oJqo4C-A&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/E-aFxj1MnKM&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/E-aFxj1MnKM&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/28/api-and-widget-demo-cpu-power-connection-mashed-with-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>API drafts posted at W3C - web developer comments welcome!</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/22/api-drafts-posted-at-w3c-web-developer-comments-welcome/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/22/api-drafts-posted-at-w3c-web-developer-comments-welcome/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:16:06 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web api]]></category>
		<category><![CDATA[web developer]]></category>
		<category><![CDATA[What If]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/22/api-drafts-posted-at-w3c-web-developer-comments-welcome/</guid>
		<description><![CDATA[Andy lists a set of device capability APIs that were posted at the WC3's Device API and Policy Working Group. These APIs are all about bringing better access to device hardware capabilities to web developers.]]></description>
			<content:encoded><![CDATA[<p>The other day ago our team, including <a href="http://software.intel.com/en-us/blogs/author/clayne-robison/">Clayne Robison</a> who also has a blog here on ISN, posted some <a href="http://dev.w3.org/2009/dap/system-info/Overview.html">API drafts</a> to the W3C's <a href="http://www.w3.org/2009/dap/">Device API and Policy Working Group</a>.</p>
<p>In a <a href="http://software.intel.com/en-us/blogs/2009/10/07/conversationstart-enabling-web-developers/">previous post</a> I kicked off a conversation with web developers about exposing device capabilities as javascript APIs and widgets in the browser.</p>
<p>Here's your chance to comment and help inform our web developer enabling activities. Tell us about how having better access to the device's hardware capabilities would make your web app implementation easier. Maybe you have a use case you would like to share?</p>
<p>Here is a list of APIs for device capabilities we proposed.</p>
<table style="text-align: left; width: 95%;" cellpadding="1" rules="rows">
<tbody>
<tr style="border: 1px dotted #cccccc;">
<th style="width: 15%;">API</th>
<th style="width: 85%;">Description</th>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Compass</td>
<td>Allows web apps to make use of a device's compass. The app can detect the<br />
current orientation and receive asynchronous updates when the<br />
orientation changes.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Power</td>
<td>Allows web apps to learn about the device's power state.<br />
The app can detect the current power level, time remaining and receive<br />
asynchronous updates about power level changes.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>CPU</td>
<td>Allows web apps to learn about the device's CPU - number of processors,<br />
frequency, cpu usage levels.<br />
The app can detect the current cpu usage and receive asynchronous<br />
updates about cpu usage.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Display</td>
<td>Allows web apps to learn about the device's display capabilities - dots per inch,<br />
supported orientations, brightness etc.<br />
The app can detect the current orientation and brightness and receive<br />
asynchronous updates about display orientation and brightness changes.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Connection</td>
<td>Allows web apps to learn about the device's network status and ability to<br />
connect to services over the current network.<br />
The app can detect check if an URL is reachable and check the latency<br />
to and URL.<br />
The app can receive asynchronous updates about network and service changes.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Thermal</td>
<td>Allows web apps to learn about thermometers connected to the device.<br />
The app can detect the current temperature and receive asynchronous updates<br />
about temperature changes.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Audio</td>
<td>Allows web apps to learn about the device's audio capabilities.<br />
The app can determine which audio codecs are installed. The app can<br />
also learn about speakers, microphones, lines in and lines out.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Video</td>
<td>Allows web apps to learn about the device's video capabilities.<br />
The app can determine which video codecs are installed and what formats<br />
and profiles they support. The app can also determine if codecs support<br />
hardware acceleration.</td>
</tr>
<tr style="border: 1px dotted #cccccc;">
<td>Input</td>
<td>Allows web apps to learn about the device's user input capabilities.<br />
The app can determine if the device has a touch screen, if it<br />
has multi-touch support, if a physical keyboard is present or if a software<br />
keyboard is visible. The app can receive asynchronous updates about<br />
physical keyboard attach / detach. The app can receive asynchronous updates<br />
about physical pointer attach / detach.</td>
</tr>
</tbody>
</table>
<p>You can see the detailed API specs and example use cases at the <a href="http://dev.w3.org/2009/dap/system-info/Overview.html">WC3's site</a>.<br />
<strong>This is only the beginning</strong>. Stay tuned to the blog, or <a href="http://twitter.com/andyidsinga">my tweets</a>, for more API, widget and mashup proposals coming in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/22/api-drafts-posted-at-w3c-web-developer-comments-welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Take your knowledge of javascript to the nerd level</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/15/take-your-knowledge-of-javascript-to-the-nerd-level/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/15/take-your-knowledge-of-javascript-to-the-nerd-level/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 20:35:23 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/15/take-your-knowledge-of-javascript-to-the-nerd-level/</guid>
		<description><![CDATA[Andy stumbles upon an excellent video presentation by Douglas Crockford on JavaScript and points you to the site that will take your knowledge of javascript to the nerd level. You'll also learn how to pronounce JSON.]]></description>
			<content:encoded><![CDATA[<p>Today I stumbled upon a really good presentation by Douglas Crocford about JavaScript.<br />
When I started I was just looking for the correct pronunciation for <a href="http://json.org/">JSON (javascript object notation)</a>. When I finished I had learned a few mind blowing things about JavaScript.</p>
<p>Here is a teaser to encourage you to watch the video.<br />
Curly brace style REALLY IS MEANINGFUL in JavaScript.<br />
Look at the following two snippets (from the video):</p>
<div style="background-color:#ff6666">
This might work well in other languages:</p>
<pre>
   block

   {
      ...
   }
</pre>
</div>
<p><br/></p>
<div style="background-color:#66cc66">
This works well in JavaScript:</p>
<pre>
   block {
      ...
   }
</pre>
</div>
<p>Enjoy! (<a href="http://www.youtube.com/watch?v=hQVTIJBZook&#038;feature=player_embedded">video link</a> )<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/hQVTIJBZook&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/hQVTIJBZook&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>The downside to all this: I have a lot of curly braces to go change - uggg.</p>
<p><a href="http://www.crockford.com/javascript/">Here </a>is where you go to take your JavaScript knowledge to the nerd level.</p>
<p>Oh, if you didn't watch the video, Doug Crockford pronounces JSON the same as the name "jason".</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/15/take-your-knowledge-of-javascript-to-the-nerd-level/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Along for the ride</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/09/along-for-the-ride/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/09/along-for-the-ride/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 19:26:52 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[philosophy]]></category>
		<category><![CDATA[sharing]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/09/along-for-the-ride/</guid>
		<description><![CDATA[Why inviting someone along for the ride is so important.]]></description>
			<content:encoded><![CDATA[<p>Some of my most memorable and influential experiences happened because someone invited me <a href="http://en.wiktionary.org/wiki/go_along_for_the_ride">along for the ride</a>.</p>
<p>When I was a kid my dad frequently took me with him under the car when he was changing out an engine. He let me hang and watch when he was building something out of wood and when he used his volt meter and oscilloscope to fix our Atari 400 (that still blows my mind). My mom would frequently take me along to her office. Later she even hired me to clean bathrooms and take out garbage on the weekends - and then fired me for not showing up or doing a crappy job :)</p>
<p>As an adult, invitations to come along for a ride are more subtle but they are still there: a neighborhood event, user group gathering, "getting coffee", or "check out the new cedar bench I built".<br />
I see these invitations to ride come from email, twitter, facebook and right there on my street (just gotta walk outside).</p>
<p>As adults, how many of these invites do we accept?</p>
<p>More importantly, how many invites are we putting out there: to our kids, our neighbors, our coworkers and our followers on twitter?<br />
Many things we do may seem mundane but what occurs when we invite someone along for the ride can be quite influential.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/09/along-for-the-ride/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>social media -&gt; web apis -&gt; mobile device -&gt; web apis -&gt; social media</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/08/social-media-gt-web-apis-gt-mobile-device-gt-web-apis-gt-social-media/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/08/social-media-gt-web-apis-gt-mobile-device-gt-web-apis-gt-social-media/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 21:51:56 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[web apis]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/08/social-media-gt-web-apis-gt-mobile-device-gt-web-apis-gt-social-media/</guid>
		<description><![CDATA[Andy blathers about a cool app he saw at a Portland demo event and how web developers are actively finding ways to connect web apps to the devices we use all the time.]]></description>
			<content:encoded><![CDATA[<p>Last night I attended the local "demolicious" event to present a web developer enabling demo I've been working on with my coworkers <a href="http://software.intel.com/en-us/blogs/author/clayne-robison/">Clayne </a>and Rich here in SSG.<br />
Many thanks to <a href="http://www.pdxwi.com">PDX web innovator group</a> for organizing and to <a href="http://piepdx.com/">Portland Incubator Experiment (PIE)</a> for hosting in their sweet NW Portland space.</p>
<p>One of the demos I saw, which really made an impression on me, was an app that used twitter to make phone call with some text to speech tech, and then allowed the person who answered to say/record something that was then posted back to twitter as an audio file.<br />
During the demo, Travis Spencer (<a href="http://travisspencer.com/blog/2009/10/presentation-to-portland-web-i.html">his blog post here</a>), had his app call his cell phone, he left a message, and then played it back to the audience when it showed up on twitter (<a href="http://twitter.com/tweetybot">here</a>).</p>
<p>Aside from the fact that it all just worked (and we all know how demos can go wrong), this was cool to me because of the connection between social media, the <a href="http://www.twilio.com/">twillio APIs</a> and the *mobile device*.</p>
<p>Smart people are spending time making the web - the social web - do really cool things with our devices.<br />
Exposing capabilities of the device to web developers will help that kind of innovation flourish.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/08/social-media-gt-web-apis-gt-mobile-device-gt-web-apis-gt-social-media/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>conversation.start( enabling web developers)</title>
		<link>http://software.intel.com/en-us/blogs/2009/10/07/conversationstart-enabling-web-developers/</link>
		<comments>http://software.intel.com/en-us/blogs/2009/10/07/conversationstart-enabling-web-developers/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 22:02:43 +0000</pubDate>
		<dc:creator>Andy Idsinga (Intel)</dc:creator>
				<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[web apis]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://software.intel.com/en-us/blogs/2009/10/07/conversationstart-enabling-web-developers/</guid>
		<description><![CDATA[A conversation with web developers about providing access to device capabilities through the web browser and current web technologies such as javascript and html.]]></description>
			<content:encoded><![CDATA[<p>This month I’m starting a new conversation with web developers, about, you read it right: enabling web developers. If you’re not a web developer, stay tuned - didn’t you know everyone’s a web developer now? ;)</p>
<p>It starts here and now on the blog and this evening face to face when I attend this month’s <a href="http://upcoming.yahoo.com/event/4424087/OR/Portland/Demolicious-Portland-Web-Innovators/">PDX Web Innovators Demolicious event</a>.<br />
Props to <a href="http://oregon.tie.org/">TIE Oregon</a> for hosting a “Cloud Computing” event last month that turned me on to <a href="http://www.pdxwi.com/">PDX web innovators</a> in the first place.</p>
<p>Okay, “web apps” a big subject area, so let’s narrow it down a little.</p>
<p>I’m very interested [read: my day job] in finding ways to provide web developers with *web browser access* to the kinds of cutting edge capabilities that exist on modern, web connected devices like netbooks, smart phones, mobile internet and gaming devices.</p>
<p>Almost all of our devices connect to different types of networks – cell networks, wifi networks, bluetooth device networks. We frequently use GPS / location awareness to find things. We share our lives with cameras on our phones and laptops! More and more devices are including 3d acceleration and support user input from accelerometers.</p>
<p>OK, deep breath. The point is that these kinds of capabilities are not simply available to web developers through the browser. The key word there was “simply”. Some software teams could certainly write a whole software stack with native plugins and all – but that’s a pretty high bar for many projects.</p>
<p>So, my sense is that better access to device capabilities, done in a way that caters to web developers (i.e. javascript and html embedding) would be great for web developers.</p>
<p>What do you think?<br />
Is there a particular device capability that you could have made use of in your web app?<br />
Are you trying to figure out how to access some capability in a project currently under development?</p>
<p>In my next post I’ll share some technology and thoughts about bite sized APIs, widgets and mashup demos that expose more platform goodness to the web developer. Just as important, I'll be asking for your thoughts.</p>
]]></content:encoded>
			<wfw:commentRss>http://software.intel.com/en-us/blogs/2009/10/07/conversationstart-enabling-web-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

