<?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"
	>

<channel>
	<title>Intel® Software Network Blogs &#187; Kevin Pirkl (Intel)</title>
	<atom:link href="http://softwareblogs.intel.com/author/kevin-pirkl/feed/" rel="self" type="application/rss+xml" />
	<link>http://softwareblogs.intel.com</link>
	<description></description>
	<pubDate>Sun, 20 Jul 2008 16:43:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>JavaScript Paths,Querystrings and Encoding</title>
		<link>http://softwareblogs.intel.com/2008/07/02/javascript-pathsquerystrings-and-encoding/</link>
		<comments>http://softwareblogs.intel.com/2008/07/02/javascript-pathsquerystrings-and-encoding/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 16:17:22 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Intel® Software Network 2.0]]></category>

		<category><![CDATA[Open Source]]></category>

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

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

		<guid isPermaLink="false">http://softwareblogs.intel.com/2008/07/02/javascript-pathsquerystrings-and-encoding/</guid>
		<description><![CDATA[Rick Strahl's "Making sense of ASP.Net Paths" has been inspiring to me since I have visited the page quite often so I thought I might do a quick similar post for Client Side JavaScript code and some How To's with some AJAX know-how sprinkled in.
Firefox and Firebug add-on developer tool make undestanding JavaScript's document.location much [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Rick Strahl" href="http://www.west-wind.com/WebLog/default.aspx" target="_blank">Rick Strahl's</a> "<a title="Making sense of ASP.Net Paths" href="http://www.west-wind.com/weblog/posts/269.aspx" target="_blank">Making sense of ASP.Net Paths</a>" has been inspiring to me since I have visited the page quite often so I thought I might do a quick similar post for Client Side JavaScript code and some How To's with some AJAX know-how sprinkled in.</p>
<p><a title="Firfox" href="http://www.mozilla.com/en-US/firefox/" target="_blank">Firefox</a> and <a title="Firebug" href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=https%3A%2F%2Faddons.mozilla.org%2Ffirefox%2Faddon%2F1843&amp;ei=9aBrSLbKEoeuoQTfvLHjCA&amp;usg=AFQjCNFeeiIXBngB6nyWDODclEE-XJPNfQ&amp;sig2=U-f8JXO3iidzYP3hV56lTw" target="_blank">Firebug</a> add-on developer tool make undestanding JavaScript's document.location much easier.</p>
<p>Here at the <a title="ISN" href="http://softwarecommunity.intel.com/" target="_blank">Intel Software Network</a> (ISN) we have quite a few AJAX based services (Feedback, Email A Friend, Login/Logout, Polling, Rating, Commenting) that can be dropped into any and all of our 40-50 web sites by placement HTML elements with specific ID's.  Each common service is also written to support localization.  You can check out some of these functions in the button bar of the following pages <a href="http://softwarecommunity.intel.com/" target="_blank">US</a>, <a title="China" href="http://softwarecommunity-cn.intel.com/" target="_blank">China</a> and <a title="Russia" href="http://softwarecommunity-ru.intel.com/" target="_blank">Russia</a> ISN Landing Pages.  Just load the pages and look for the icon bar at the top right of the page.</p>
<p>Most of thes services require that we pass the URL back to the server to gets back data.  When passing a URL as a querystring parameter encoding it correctly is important to prevent unwanted side effects.  For instance some of our fist passes at adding a Comment Service to pages resulted in differnet sets of comments getting returned when the querystring varied.</p>
<p>So lets take a peek into the Firebug DOM tab and see what document.location brings.</p>
<p><img src="http://softwarecommunity.intel.com/media/kevin/querystring.png" alt="QueryStringFireBugDisplay" width="707" height="717" /></p>
<p>As you can see everything is nice and easy to get at here.</p>
<p>Here is some sample HTML code that you can save and run on your own local machine and see each of these variables at work. Try adding QueryString parameters (and/or even add a full properly encoded URL on the end.)  My most complex resulting output was http://localhost/locationtest.htm?a=1&amp;b=2&amp;target=http%3A%2F%2Flocalhost%2Flocationtest.htm%3Fa%3D1%26b%3D2</p>
<pre>[
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Document Location and encodeURIComponent()&lt;/title&gt;
	&lt;script&gt;
		var thisURL = document.location.protocol
+ "//" + document.location.host
+ (document.location.port.length &gt;0 ? ":"+document.location.port : "")
+ document.location.pathname;
		var thisFull = document.location.protocol
+ "//" + document.location.host
+ (document.location.port.length &gt;0 ? ":"+document.location.port : "")
+ document.location.pathname
+ document.location.search;
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;pre&gt;

Tools - Firefox and Firebug

document.location = &lt;script&gt;document.write(document.location);&lt;/script&gt;
document.location.href = &lt;script&gt;document.write(document.location.href);&lt;/script&gt;
document.protocol = &lt;script&gt;document.write(document.location.protocol);&lt;/script&gt;
document.location.host = &lt;script&gt;document.write(document.location.host);&lt;/script&gt;
document.location.port = &lt;script&gt;document.write(document.location.port);&lt;/script&gt;
document.location.pathname = &lt;script&gt;document.write(document.location.pathname);&lt;/script&gt;
document.location.search = &lt;script&gt;document.write(document.location.search);&lt;/script&gt;
document.location.hash = &lt;script&gt;document.write(document.location.hash);&lt;/script&gt;

This is not the base URL for this page.
var notBaseURL = "&lt;script&gt;document.write(document.location);&lt;/script&gt;";

The base URL is -
var thisURL = "&lt;script&gt;document.write(thisURL);&lt;/script&gt;";

The base URL plus parameters -
var thisFull = "&lt;script&gt;document.write(thisFull);&lt;/script&gt;";

Say you want to call an AJAX service and you want to pass this URL correctly.
I would consider that for a service call in most instance like getting Tags for this page
Or getting Comments for this page you would only way the base URL.
"&lt;script&gt;document.write(thisURL);&lt;/script&gt;";

To make an HTML call and pass another URL you need to use the JavaScript method
encodeURIComponent() = "&lt;script&gt;document.write(encodeURIComponent(thisURL));&lt;/script&gt;";

So your final call to your service URL for passing thisURL would be something like this example.
&lt;script&gt;document.write(thisURL + "?target=" + encodeURIComponent(thisURL));&lt;/script&gt;

Or with your querystring parameters it would be like so.
&lt;script&gt;document.write(thisFull + "&amp;target=" + encodeURIComponent(thisFull));&lt;/script&gt;

Dont include document.location.hash in your call to your service as it can cause issues down the road.

&lt;/pre&gt;
&lt;/body&gt;

&lt;/html&gt;
]</pre>
<p>Here is the output from the above HTML</p>
<p><img src="http://softwarecommunity.intel.com/media/kevin/results.png" alt="HTMLRunResults" /></p>
<p>It might seem very simple and you might say why bother but the end result are cool.  Take for example out Coment Service.  For this we need only the base url and not all the extra parameters.  If you were to take the extra search parameters for Comment retrieval then you would get one set of results and without the search parameters another set of data.  All our Content Deliver pages allow for Comments, take <a href="http://softwarecommunity.intel.com/articles/eng/3816.htm" target="_blank">A Library Based Approach to Threading for Performance</a> for example (drive to the bottom of the page to see the add a comment option.)  The resulting call that populates the return data set comes from this page call (post page load)</p>
<p>http://softwarecommunity.intel.com/isn/home/CommonServices.ashx?F=GetCommentsJSON&amp;P1=http%3A%2F%2Fsoftwarecommunity.intel.com%2Farticles%2Feng%2F3816.htm&amp;P2=&amp;_=1215014917424</p>
<p>The packaged <a href="http://www.json.org/" target="_blank">JSON</a> data set uses <a href="http://remysharp.com/2007/10/08/what-is-jsonp/" target="_blank">JSONP</a> for the callback pattern and thus to populate the page data.</p>
<p>Simple but very cool!</p>
<p>Cheers</p>
<p>Kevin Pirkl</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2008/07/02/javascript-pathsquerystrings-and-encoding/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google IO Conference - Day 2</title>
		<link>http://softwareblogs.intel.com/2008/05/29/google-io-conference-day-2/</link>
		<comments>http://softwareblogs.intel.com/2008/05/29/google-io-conference-day-2/#comments</comments>
		<pubDate>Thu, 29 May 2008 23:45:45 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2008/05/29/google-io-conference-day-2/</guid>
		<description><![CDATA[From day 1 registration - Oh the panic in the crowd at Google IO 2008 #io2008
Summize #io2008
Twemes #io2008

I'm going to let this one ride all the way as it (I'm not big on spelling corrections, etc..)  I've typed enough notes today and I'll have to take another look at it tomorrow and perhaps then [...]]]></description>
			<content:encoded><![CDATA[<p>From day 1 registration - Oh the panic in the crowd at Google IO 2008 #io2008</p>
<p><a href="http://summize.com/search?q=%23io2008" title="Summize #io2008" target="_blank">Summize #io2008</a><br />
<a href="http://twemes.com/io2008" title="Twems #io2008" target="_blank">Twemes #io2008</a></p>
<p><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image15.png" alt="image15.png" /></p>
<p>I'm going to let this one ride all the way as it (I'm not big on spelling corrections, etc..)  I've typed enough notes today and I'll have to take another look at it tomorrow and perhaps then make additions and/or corrections.</p>
<p>Enjoy, KP</p>
<p>Day 2 begins with Keynote speaker Marissa Mayer, Vice President of Search and User Experience talking about "Imagination, Immediacy and Innovation... plus a little glimpse under the hood at Google"</p>
<p>Blah, blah, blah, laughter, blah, blah blah nothing we have not heard before for those that have seen the TV documentary.</p>
<p>Here's a cool fact I noticed..  The main stage has the Google IO logo and the left and right are top and bottom like so</p>
<pre><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image12.png" alt="image12.png" /></pre>
<pre>
<font face="Courier New">            1  1111

<u>            1  1  1

</u>01001001    1  1  1   01001001

01001111    1  1111   01001111</font></pre>
<p>The bottom left and right are displayed as black dots and white dots in a set of eight or Binary to ASCII that is "IO" which is a nice little play on the whole Google IO thing.  (??Hint: Times Squaring the Circle???)</p>
<p>Ok back to the keynote: This story Marissa is telling is the one about Google Home Page A/B testing and returning more than 20 results with the end result being "It's not about the number of results but it's about the speed at which those results are delivered."  Nothing that I didn't already know.  What crazes me about this is that they cite a falloff based on speed when it is a know fact that user percentages that go beyond page two of  a search fall off considerably.  With today's faster net speeds there is no way you will convince me that this is not about advertising $$ based on this logic.</p>
<p>I didn't know about the Swedish Chef Easter Egg. (<a href="http://en.wikipedia.org/wiki/Google%27s_hoaxes" target="_blank">Egg's and Hoaxes</a>)</p>
<p>--</p>
<p>Note: There are more laptops here that I have ever seen before at a conference.  It looks like 90% of the people here are wired in.</p>
<p>Note2: The provided WiFi is not keeping up with demand so I am glad I am putting these notes together in Windows Live Writer.</p>
<p>Note3: The told us that all the sessions will be online next week (I guess that means videos will be online.)</p>
<p>Note 4: Open Social API gadgets.util.sanitizeHtml() for HTML cleanup and protection.  Funny thing is that you can find this in the <a href="http://code.google.com/apis/opensocial/docs/releasenotes.html" target="_blank">version .8 release</a> notes but not in the API reference.</p>
<p>Note 5: Need power strips everywhere considering the number of laptops here.  The future is having a good laptop and conferences will continue to have more and more laptop percentages.</p>
<p>Note 6: I hear there are around/over 3000 persons here.  I think 2/3rds of the group are using Mac's and the rest a mix of PC's, Mids,iPhones, other mobile types.</p>
<p>Note 7: I need to get a <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=40318&amp;hl=en" target="_blank">sitemap</a> so sites like Google can better find out content.</p>
<p>Note 8: <a href="http://www.flickr.com/photos/tags/io2008" target="_blank">Images from Google IO 2008</a> (tagged with the io2008 tag)</p>
<p>Note 9: I keep seeing something called <a href="http://hi5.com/" target="_blank">hi5</a> mentioned with this logo</p>
<p><img src="http://images.hi5.com/images/header_logo2.gif" />  and along with that and a <a href="http://code.google.com/apis/opensocial/gettingstarted.html" target="_blank">few other OpenSocial containers</a>.</p>
<p>Note 10: Tons of people taking pictures of slides in lectures and even saw a few webcams recording or broadcasting perhaps...  Hmm I wonder if I would blue-screen my T61 if I try a Yahoo Broadcast. I better save this document first.</p>
<p>For my session lineup today:</p>
<p>Session 1: I picked "HTML5, Brought to You by Gears" - Speaker Aaron Boodman - (Room 1)</p>
<p>One other interesting note is that I think most of yesterday's sessions I picked were in smaller rooms that did not fill.  This session is in a double size room and packed tight onto the floors as well.</p>
<p>Gears and <a href="http://www.w3.org/html/wg/html5/" target="_blank">HTML5</a> web standards - Gears is incrementally implementing HTML5 standards as they release new and exciting features.  They consider themselves ahead of the curve on this because they are doing things that are being set as standards later on.  This means they have to come back and the adhere to the accepted approach that gets put forts by bodies like the W3C.</p>
<p>Gears core functions are is typically wrapped in their own JavaScript Namespaces so they can later fix the underpinnings to be HTML5 compliant.</p>
<p>The DB demo that they were going to show didn't work which was kind of annoying IMHO. Ok with some help from the crowd they did get it finally working.  Basically it was a demo of native implementation of the new HTML5 DB API using Safari 3.n and then switched to using Gears which in essence makes it backwards compatible with older browsers not yet supporting HTML5 DB.</p>
<p>Session 2: OpenSocial, OpenID, and OAuth: Oh, My! (Room 4) - Joseph Smarr -</p>
<p>I was going to go to "A World Beyond AJAX: Accessing Google's API's from Flash and other Non-JavaScript Environments - Speaker Vadim Spivak - (Room 9)" but I think those are things I could learn for myself so I picked the OpenSocial,OpenId track in hope of getting a future Intel integration up and running.</p>
<p>OpenID enables one place storage of Personal Profile information and allowing sharing that information with websites that you trust.  (Note: I don't honestly understand what this speaker is suggesting here using the Google offerings.)</p>
<p>My interest in the OpenSocial side of this talk is honestly nill and I am more interested in knowing more about the OpenID and OAuth integration points.</p>
<p>Joseph mentions that all social apps are broken or act like silos.  I tend to agree with that.  OpenID would be a good thing for Intel.com to work out.  Hell for that matter working with Google Auth would make Intel.com about 1000x better.</p>
<p>Crumb I think this whole Social web talk was an excuse to show us <a href="http://www.plaxo.com/" target="_blank">Plaxo</a> (From their site <a href="http://blog.plaxo.com/archives/2008/05/post.html" target="_blank">Plaxo is about the be bought by Comcast</a>.) I have heard all I care to hear about OpenSocial and what it is and I thought this talk was going to be about OpenID integration process steps etc..  When the frick is Joseph going to dive into OpenID and OAuth?</p>
<p>I'm personally not very excited about ever allowing third parties to access my online address book or personal details beyond the information I wish to give.  The thought putting all my interconnections in one place thinks that it creates a ripe place for thievery or scam.</p>
<p>Finally a two second mention about XRDS but so far that was it.</p>
<p>This was not really a session for developers.</p>
<p>Lunch</p>
<p>Session 3: Inside the Android Application Framework<br />
(Room 3) - Android Engineering Team -</p>
<p><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image18.png" alt="image18.png" /></p>
<p>APK Runs on a single process</p>
<p>Activities - Concrete API</p>
<p>Task - are a Runtime Sequence of Activities - Tasks can span Activities</p>
<p>Process Basics - One per APK - By default one thread per process and all APK run within that thread. Process is started for a given UserId</p>
<p>Activities Lifecycle -</p>
<ol>
<li>Starting Up (Created(), onStart(), onRestart(),onResume())</li>
<li>Normal Execution (onFreeze(),onPause())</li>
<li>Shutdown (onStop(),onDestroy())</li>
</ol>
<p>Example Lifecycle -When a child Activity is launched</p>
<p>Live sucker...</p>
<p><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image22.png" alt="image22.png" /></p>
<p>Die sucker</p>
<p><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image26.png" alt="image26.png" /></p>
<p>Threads and Loops - Loopers Assume they are associated with a single process and are not intended to be thread safe. Loopers cannot tolerate multi-threaded access and must use message passing/handlers instead.</p>
<p>The thread handling was quite interesting</p>
<p><a href="http://lh3.ggpht.com/pirklk/SD8-06_E1wI/AAAAAAAACN4/qe7zqqfbXgc/image18.png?"><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image18.png" alt="image18.png" /></a></p>
<p>Process Resource Management</p>
<p>Only three process run as root</p>
<ol>
<li>init</li>
<li>Zygote</li>
<li>main runtime</li>
</ol>
<p>To connect distinct process's, for that process you have explicitly expose it via Services API and Inter-process communication bridges.</p>
<p>Dalvik VM - The Virtual Machine that hosts a running Android Application instance running in a single process.</p>
<p>Session (Long break): I plan to take a break now instead of a session to see all the offerings on the main display floor..  I will tell what I see and what piqued me here later...</p>
<p><a href="http://code.google.com/apis/health/" target="_blank"><img src="https://www.google.com/health/html/images/logo_beta.gif" align="right" /> Google Health API</a> - <a href="http://www.google.com/health/" target="_blank">Google Health TOS</a> gets around normal HIPAA requirements (If you create, transmit, or display health or other information while using Google Health, you may provide only information that you own or have the right to use. When you provide your information through Google Health, you give Google a license to use and distribute it in connection with Google Health and other Google services. However, Google may only use health information you provide as permitted by the Google Health Privacy Policy, your Sharing Authorization, and applicable law. Google is not a "covered entity" under the Health Insurance Portability and Accountability Act of 1996 and the regulations promulgated thereunder ("HIPAA"). As a result, HIPAA does not apply to the transmission of health information by Google to any third party.)</p>
<p><a href="http://code.google.com/apis/ajaxlibs/" target="_blank">Google AJAX Libraries API</a> - Provides hosting and loader for various JavaScript Libraries and a <a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery" target="_blank">loader for my favorite jQuery</a> -</p>
<p><img src="http://softwareblogs.intel.com/wordpress/wp-content/uploads/2008/05/image31.png" alt="image31.png" /></p>
<p>I met Vadim Spivak the person who put together the hosting of all these various OpenSource JavaScript libraries and gained a few insights into the loader mechanisms.  You can now reference your favorite JS library directly from Google CDN but for even better loading speed Vadim recommends you use the .load() API in the HEAD section with explicit versioning (actually does a document.write) which will get you the file from cache servers much faster than direct linking.  Cool detail to know.</p>
<p>Session: Creating a Client Side Search Engine with Gears - Brad Neuberg -</p>
<p>What would be very cool to get out of this session would be the ability to take our Intel CD system (internally called Redfort at Intel) offline for and make it searchable.  Imagine thousands of Intel.com technical documents at your fingertips for easy reference.</p>
<p>Demo was awesome..  Brad showed a web app that loaded a text document containing URI's of E-Books.  This app parsed and pulled all those E-Books local and then provided a search interface that used FTS2 (Full Text Search2) Gears API function to search the entire database and return results.  Wow!!!</p>
<p>Sample used Gears threads to do all the work making the app run without stuttering.  Brad's explanations were excellent and he showed a lot of code which was very cool.  I'm not a Dojo fan but between Dojo,Google style code and jQuery, I think I will learn more about those first two.  Different style and approaches teach a person more than just knowing one style of coding.</p>
<p>The project is not available for download as it is not completed but I did find a Google reference that led me to <a href="http://code.google.com/p/gears-pubtools/" target="_blank">gears-pubtools</a> (confirmed, it will be there when it is completed.)</p>
<p>Kick Azz demo for sure and I will look forward to see it.<br />
Kevin Pirkl</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2008/05/29/google-io-conference-day-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google IO Day 1 - Twitter #io2008</title>
		<link>http://softwareblogs.intel.com/2008/05/28/google-io-day-1-twitter-io2008-2/</link>
		<comments>http://softwareblogs.intel.com/2008/05/28/google-io-day-1-twitter-io2008-2/#comments</comments>
		<pubDate>Thu, 29 May 2008 03:46:46 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2008/05/28/google-io-day-1-twitter-io2008-2/</guid>
		<description><![CDATA[If your curious about what's going on at Google IO conference you can follow the converstation via the following two links.
http://summize.com/search?q=%23io2008
http://twemes.com/io2008
I'm sure there are more ways and other tags people are using but the two above are simple to follow.
....
Note: I wont vouch for 100% accuracy on the details below and much of this is [...]]]></description>
			<content:encoded><![CDATA[<p>If your curious about what's going on at Google IO conference you can follow the converstation via the following two links.</p>
<p><a _fcksavedurl="http://summize.com/search?q=%23io2008" href="http://summize.com/search?q=%23io2008">http://summize.com/search?q=%23io2008</a><br />
<a _fcksavedurl="http://twemes.com/io2008" href="http://twemes.com/io2008">http://twemes.com/io2008</a></p>
<p>I'm sure there are more ways and other tags people are using but the two above are simple to follow.<br />
....</p>
<p>Note: I wont vouch for 100% accuracy on the details below and much of this is just notes but here goes anyway...</p>
<p>Well I'm <a _fcksavedurl="http://code.google.com/events/io/location.html" target="_blank" href="http://code.google.com/events/io/location.html"><font color="#99aadd">here</font></a> at the <a _fcksavedurl="http://code.google.com/events/io/index.html" target="_blank" href="http://code.google.com/events/io/index.html"><font color="#99aadd">Google IO Conference 2008</font></a> and the check-in lines are long and they are getting a late start due to very long lines still waiting to get checked in. (10 Minutes late so far.)</p>
<p>Quick Thoughts: 15 minutes late now, this place is packed, great round style layout for the keynote address, they finally caved in and just let everyone upstairs (without badges or checking if they have paid.)</p>
<p>They are starting the event now...</p>
<p>The <a _fcksavedurl="http://code.google.com/events/io/sessions.html" target="_blank" href="http://code.google.com/events/io/sessions.html"><font color="#aa77aa">sessions</font></a> lineup looks great for me today..</p>
<ol>
<li>Keynote: Client, Connectivity, and the Cloud - Vic Gundotra, Vice President, Engineering</li>
<li>Extend the Reach of your Google Apps Environment with Google APIs<br />
(Room 9)</li>
<li>Lunch</li>
<li>Rapid Development with Python, Django and Google App Engine (Room 1)  (Skipped this for Building an Android Application 101 (Room 3))</li>
<li>Can We Get There From Here?<br />
(Room 4)</li>
<li>Secure Collaboration - How Web Applications can Share and Still Be Paranoid<br />
(Room 4)</li>
<li>Authenticating to Google Data Services<br />
(Room 9)</li>
</ol>
<p>Keynote - Google/Other announcements so far..</p>
<p>MySpace Mail Message center goes Mobile with announced Gears  support.</p>
<p>Google App Engine (GAE) announces two new API additions, the ever popular MEMCACHE and a Image Manipulation API. GAE Opens up the doors from limited beta by waiting list invite to all are welcome. They also announced their <a _fcksavedurl="http://googleappengine.blogspot.com/2008/05/announcing-open-signups-expected.html" target="_blank" href="http://googleappengine.blogspot.com/2008/05/announcing-open-signups-expected.html"><font color="#99aadd">pricing plan</font></a>.</p>
<p>Cool Item: Keynote showed off an AJAX API demo (we have all seen it before) but what was cool is that they were using the not yet finished jQuery 1.2.6 release.  Google's commitment to Open Source is awesome.  Google now provides hosting for many different Open Souce AJAX JavaScript API's so you no longer have to maintain your own versions/versioning of jQuery because Google does it for you. <a _fcksavedurl="http://code.google.com/apis/ajaxlibs/" target="_blank" href="http://code.google.com/apis/ajaxlibs/"><font color="#99aadd">AJAX Libraries API</font></a></p>
<p>GWT 1.5 Release available today with JAVA 5 Language/Feature support.</p>
<p>Session: Extend the Reach of your Google Apps Environment with Google APIs - Lots more JSON-Script style support for web apps.  I liked the <a _fcksavedurl="http://code.google.com/support/bin/answer.py?answer=86805&amp;topic=11369" target="_blank" href="http://code.google.com/support/bin/answer.py?answer=86805&amp;topic=11369"><font color="#99aadd">information for .Net</font></a> about the <a _fcksavedurl="http://code.google.com/apis/documents/overview.html" target="_blank" href="http://code.google.com/apis/documents/overview.html"><font color="#99aadd">Google Document List Data  API</font></a> that allows you upload multiple DOCS into Google documents.  SalesForce.com did not interest me much..  Wish I had gone to the AJAX track but was good information.</p>
<p>Session: Building an <a _fcksavedurl="http://code.google.com/android/what-is-android.html" target="_blank" href="http://code.google.com/android/what-is-android.html"><font color="#99aadd">Android</font></a> Application 101 (Room 3) -</p>
<p><img _fcksavedurl="http://code.google.com/android/images/logo_android.gif" src="http://code.google.com/android/images/logo_android.gif" align="right" /></p>
<p>IntentRecievers are listeners designed to respond to broadcasts. They are like a verb and object; a description of what you want done or an action (VIEW, PLAY.)  The core System matches Intent with actions. One cool thing about Android is the Integrated Browser called <a _fcksavedurl="http://webkit.org/" target="_blank" href="http://webkit.org/"><font color="#99aadd">WebKit</font></a> which is an open source project.  This API set is so cool I think that I might drop my iPhone just to write apps for it.  Well perhaps not but I could get another phone. Wow the whole hour is already gone..</p>
<p>Retweeting @gmitsopoulos: #IO2008 Android is scheduled to ship on first handhelds in second half of this year</p>
<p>My earlier session ended early so skipped over to another session and managed to get in a question as they were talking about the Google Language Translation API.  I fired off a question about contextual HTML parsing and got back no real answer.  Post event one of the API team members approached and told me he had read some of my posts/reviews on the Translator API over the last year. (Very cool to know that I'm being read, wowza.)  They did mention some improvements in the API with HTML handling which means I should take another look at it again.</p>
<p>Session: Can we get there from here? - This is a tough topic for the speaker to take on.  They had to delve quite a bit into overview and historical tense to get to the root of where things are going (looking at user needs are now and anticipating what they will need later.)  The speakers position seemed to be that the worst browser sets the bar that we get stuck with regarding HTML rendered pages.  Speaker said what is needed are better tools that will allow for ouicker delivery of newer browsers versions supporting the latest "accepted" standards. Alex Russell (the speaker) mentioned that he thinks that "Browser Sucks" (but he can clarify his position here if I got it wrong.)  So many browsers that just don't work together, provide standard API's, standard formatting on platforms from desktop to mobile phones, etc.  His opinion of what will make these browser vendors better is more competition. One thing that is true though is that we are seeing more major upgrades much faster in recent years and new major versions for all the major browsers as (perhaps) due before the end of the year.</p>
<p>Mono-cultures reduce costs in the short run - (Not sure what that exactly means but I wrote it down.)</p>
<p>There exists an idea that web developers are hostage to deployed web browsers and the realm of web-ish applications although cool do not get us to the desktop-ish applications that Silverlight and FX take us too.</p>
<p>BTW - Alex Russell is a frigging genius and I need to get on board with his preaching's.</p>
<p>Session: Secure Collaboration - How Web Applications can Share and Still Be Paranoid<br />
(Room 4) - Mike Samuel</p>
<p><a _fcksavedurl="http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=706" target="_blank" href="http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=706"><font color="#99aadd">Douglas Crockford's ADSafe</font></a> and <a _fcksavedurl="http://code.google.com/p/google-caja/" target="_blank" href="http://code.google.com/p/google-caja/"><font color="#99aadd">Google Code Caja Project</font></a> are just to approaches to securing third party code.</p>
<p>Turns out that Caja is not yet usable today but there are prototypes.  Not much use to me though since this is just all theory.</p>
<p>Was very short presentation..</p>
<p>Break - Sitting around attempting to digest the new and old.  It's amazing how far things have moved since Google Dev Days about a year plus ago.  Software changes are so much more rapid these days and that is for sure one thing to look for in my own work and designs.  I think foundations for rapid change is a better sought after approach than doing things the manual way.</p>
<p>Session: Authenticating to Google Data Services<br />
(Room 9) - <a _fcksavedurl="http://code.google.com/apis/gdata/auth.html" target="_blank" href="http://code.google.com/apis/gdata/auth.html"><font color="#99aadd">Google Data API Authentication Overview</font></a></p>
<p><a _fcksavedurl="http://code.google.com/apis/gdata/" target="_blank" href="http://code.google.com/apis/gdata/"><font color="#99aadd">Google Data API's about</font></a></p>
<p>ClientLogin - Stored on the client machine only.</p>
<blockquote><p>When you cant always do a browser redirection.  Typically uses HTTPS and sometimes CAPTCHA when negotiating security authorization.</p>
<p>HTTP POST URL - CGI Headers (accountType,Email,password,service,source) and gets back plaintext key-value pairs SID LSID and Auth.  Auth is the important token that you use in the authorization header to get a users data for them.</p></blockquote>
<p>AuthSub - redirection style login using redirection.</p>
<blockquote><p>Redirects to a Google branded web page and gives approval for your web application and redirects the user back to the originating page.  Apps have to be registered with Google for this to work.  Remember that this is all about Google user personal data access.</p>
<p>Scope - <strong><em><font color="#ff0000">New</font></em></strong> Is a new feature that allows coverage over many different user Google Data sets (Calendar,Email,Contacts,etc..)</p>
<p>This is a more complex approach and to protect against this the web app domain must be registered with Google in order to use AuthSub.  This approach uses Asymmetric Cryptography with Public/Private keys for verification.  You own your Private Key signature and it's a PKI like exchange.</p>
<p>myrsakey.pem - private RSA key</p>
<p>myrsacert.pem - public RSA certificate</p>
<p>opensll req -x509 -nodes -days etc...</p>
<p>1&gt; Register your account domain with Google (for example softwarecommunity.intel.com.  They use an HTML file you place into the root of the server.</p>
<p>2&gt; Then you Agree to a TOS and upload your certificate till it becomes active.</p>
<p>When complete your ready to roll</p>
<p>Client Libraries are available in Java,.Net,Python,PHP,Objective-C</p></blockquote>
<p><a _fcksavedurl="http://en.wikipedia.org/wiki/OAuth" target="_blank" href="http://en.wikipedia.org/wiki/OAuth"><font color="#99aadd">OAuth</font></a> - net step for AuthSub just more complex.</p>
<blockquote><p>Open standard with specification still being developed with Open Source Libraries already available.</p></blockquote>
<p>Most of this stuff I already know but what the heck it was very good to get the juices flowing to see how I can better our SoftwareCommunity.intel.com offerings down the road.</p>
<p>End Day 1 - Time for dinner and a nap...</p>
<p>Kevin Pirkl</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2008/05/28/google-io-day-1-twitter-io2008-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google AJAX Language API first impressions</title>
		<link>http://softwareblogs.intel.com/2008/03/21/google-ajax-language-api-first-impressions/</link>
		<comments>http://softwareblogs.intel.com/2008/03/21/google-ajax-language-api-first-impressions/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 20:24:28 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2008/03/21/google-ajax-language-api-first-impressions/</guid>
		<description><![CDATA[Darn I have been one-upped by Google and they finally implemented a serviceable API onto their language translation services!

Google announced yesterday a new AJAX Language API and while language detection is not high on my priorities the actual “contextual translation” of HTML and TEXT has always been of great interest to me.  In fact I [...]]]></description>
			<content:encoded><![CDATA[<p><font size="2"><span style="font-size: 10pt; font-family: Verdana"><span style="font-size: 10pt; font-family: Verdana">Darn I have been one-upped by Google and they finally implemented a serviceable API onto their language translation services!</span></span></font></p>
<p><font size="2"><span style="font-size: 10pt; font-family: Verdana"><span style="font-size: 10pt; font-family: Verdana"><br />
<o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Google announced yesterday a new AJAX Language API and while language detection is not high on my priorities the actual “contextual translation” of HTML and TEXT has always been of great interest to me.  In fact I create a screen scraper version of Google HTML Translator page and wrapped it into a nice <a target="_blank" href="http://docs.jquery.com/Main_Page" title="jQuery JavaScript" id="a9wx">jQuery JavaScript</a> library for fun. <o:p></o:p></span></span></font><font size="2"><span style="font-size: 10pt; font-family: Verdana"> </span></font><font size="2"><span style="font-size: 10pt; font-family: Verdana"></span></font><font size="2"><span style="font-size: 10pt; font-family: Verdana"></span></font><font size="2"><span style="font-size: 10pt; font-family: Verdana"></span></font><font size="2"><span style="font-size: 10pt; font-family: Verdana"></span></font><font size="2"><span style="font-size: 10pt; font-family: Verdana"></p>
<ul type="disc" style="margin-top: 0in">
<li style="background: white; margin: 0in 0in 0pt; tab-stops: list .5in" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"><a target="_blank" href="http://googleblog.blogspot.com/2008/03/new-google-ajax-language-api-tools-for.html" title="New Google AJAX Language API - Tools for translation and language detection" id="t20.">New Google AJAX Language API - Tools for translation and language detection</a> <o:p></o:p></span></li>
</ul>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana">My original work (out I might mention it was done over a year ago) was finally posted to my personal blog <a target="_blank" href="http://zombiebob.blogspot.com/" title="ZombieBob's Weblog" id="diuo">ZombieBob's Weblog</a> on March 11 with the full article on Google Docs “<a target="_blank" href="http://snurl.com/21jdf" title="Spinning SOA onto Google Language Translator" id="m-7_">Spinning SOA onto Google Language Translator</a>”  shows off some original work creating a translator API that screen scrapes the <a target="_blank" href="http://translate.google.com/translate_t" title="Google language Translator page" id="pvek">Google language Translator page</a>.</span></p>
<p><span style="font-size: 10pt; font-family: Verdana">You might want to peek at the examples page that contains my original work on the subject quite a few implementation samples <a target="_blank" href="http://softwarecommunity.intel.com/isn/Home/test.htm" title="Localizing Web Page Elements using jQuery" id="q_q.">Localizing Web Page Elements using jQuery</a> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Here is the documentation for the <a target="_blank" href="http://code.google.com/apis/ajaxlanguage/documentation/" title="Google AJAX Language API" id="f_-j">Google AJAX Language API</a> and the Class reference can be found there as well.<o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">My work started from this <a target="_blank" href="http://www.google.com/uds/samples/language/translate.html" title="Google example translator page" id="jc.g">Google example translator page</a> saved to disk and modified a bit to support a little more text and jQuery style code and here are some of my notes.</span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span> </p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">I started with a TEXTAREA field so I could submit more data at one time and stuffed in the following HTML for test purposes.</span></p>
<blockquote><p><span style="font-size: 10pt; font-family: Verdana">&lt;div&gt;This is an test article for DPD. This &lt;div&gt;article&lt;/div&gt; &lt;div&gt;belong sto Multi Core.&lt;/div&gt;&lt;/div&gt;<br />
&lt;h2 class="sectionHeading"&gt;Section I - This is good stuff&lt;/h2&gt;<br />
&lt;p&gt;This is the stuff that I like to see..&lt;/p&gt;<br />
&lt;h2 class="sectionHeadingText"&gt;Article Heading A&lt;/h2&gt;<br />
&lt;h3 class="sectionBody"&gt;Subsection - I.1&lt;/h3&gt;</span></p></blockquote>
<p><span style="font-size: 10pt; font-family: Verdana"></span><strong><span style="font-size: 10pt; font-family: Verdana"></span></strong></p>
<p><strong><span style="font-size: 10pt; font-family: Verdana">Browser imposed HTTP GET limitations</span></strong><span style="font-size: 10pt; font-family: Verdana"> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Around 2048 characters or 2000 characters for the path portion. I Googled the terms “<a target="_blank" href="http://www.google.com/search?hl=en&amp;q=Browser+imposed+HTTP+GET+limitations+of+2048+characters&amp;btnG=Google+Search" title="Browser imposed HTTP GET limitations of 2048 characters" id="x1ad">Browser imposed HTTP GET limitations of 2048 characters</a> ” for you and came up with this “<a target="_blank" href="http://www.boutell.com/newfaq/misc/urllength.html" title="WWW FAQs: What is the maximum length of a URL?" id="xd8o">WWW FAQs: What is the maximum length of a URL?</a> ”  which is good enough to explain some details the limitation.</span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">I stuffed the test page with the HTML above multiple times so the number of characters would go well beyond the HTTP GET limit of most browsers so I could show a point.  In this case you have an character limit and imposed cross domain security constraint if prevents and API (and this one as well) from doing a POST and thus getting around the 2048 characters limit.  The end result is that the API will bomb because Google’s API doesn’t check the URL string length for this limit and warn you about it.  Perhaps they should be checking this. </span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Note that this just means that you have an imposed limit to the size of the text that your planning on submitting to this API and you should plan and code accordingly.</span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana"><v:shapetype coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f" id="_x0000_t75"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><o:p></o:p></span> <span style="font-size: 10pt; font-family: Verdana"><o:p><img border="0" width="557" src="http://docs.google.com/File?id=dc7x9fp2_33gd6qhr2z" height="218" /><br />
</o:p></span><strong><span style="font-size: 10pt; color: black; font-family: Verdana"> </span></strong><strong><span style="font-size: 10pt; color: black; font-family: Verdana"></span></strong><strong><span style="font-size: 10pt; color: black; font-family: Verdana">Context - First letter capitalized</span></strong></p>
<p><strong><span style="font-size: 10pt; color: black; font-family: Verdana"><br />
</span></strong><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana"><img border="0" width="1" src="http://docs.google.com/File?id=dc7x9fp2_34crck95dw" height="1" /><br />
<img border="0" width="522" src="http://docs.google.com/File?id=dc7x9fp2_34crck95dw" height="263" /><br />
</span><span style="font-size: 10pt; font-family: Verdana">Note that after a period the return translator text capitalizes the first character in the DIV tag.</span><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><strong><span style="font-size: 10pt; font-family: Verdana">DIV is moved - Single word context nested in HTML</span></strong><strong><span style="font-size: 10pt; font-family: Verdana"></span></strong><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"><img border="0" width="694" src="http://docs.google.com/File?id=dc7x9fp2_35hnx7shgm" height="199" style="width: 547px; height: 214px" /> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana">When a word is encapsulated within an HTML tag it gets moved.  Notice that the word "article" on the return translation gets left shifted.  If you put in an HTML STRONG tag you can see the same results.  This is pretty annoying.</span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><strong><span style="font-size: 10pt; font-family: Verdana"> </span></strong><strong><span style="font-size: 10pt; font-family: Verdana">Carriage Return/LineFeed and HTML Entities translation results</span></strong><strong><span style="font-size: 10pt; font-family: Verdana"></span></strong><strong><span style="font-size: 10pt; font-family: Verdana"></span></strong><strong><span style="font-size: 10pt; font-family: Verdana"></span></strong><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Here is a another test to understand some more about data processing glitches.  Data submitted was the following <o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana"> hello\r\nworld <o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">I used <a target="_blank" href="http://www.fiddlertool.com/" title="Microsoft Fiddler" id="sp6.">Microsoft Fiddler</a> to capture the following underpinnings<br />
</span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"><img border="0" width="1" src="http://docs.google.com/File?id=dc7x9fp2_36hkm5wvkm" height="1" /><img border="0" width="459" src="http://docs.google.com/File?id=dc7x9fp2_36hkm5wvkm" height="202" /> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana">Microsoft Fiddler copy of the captured URL is</span></p>
<blockquote><p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">http://www.google.com/uds/Gtranslate?callback=google.language.callbacks.id101&amp;context=22&amp;q=<strong>%26nbsp%3B</strong>hello<strong>%0D%0A</strong>world&amp;langpair=en%7Ces&amp;key=internal&amp;v=1.0&amp;nocache=1206122786074</span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Note that the HTML entity   is there sent in the request header as is the \r\n characters..</span></p>
<blockquote><p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">The Fiddler Response only shows the following return results.  Note that the HTML entity is gone and the only the newline character is sent back (the \r\n context was lost an I think that a big deal.) </span></p>
<blockquote><p><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana">google.language.callbacks.id101('22',{"translatedText":"<strong>Hola \n Mundo</strong>"}, 200, null, 200)</span></p></blockquote>
</blockquote>
<blockquote><p><span style="font-size: 10pt; font-family: Verdana"><br />
<o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">I did a quick test of trying a space instead of the HTML non-breaking space and this is the result.  Note the extra <strong>two spaces</strong> in front on the translation (space space Hola \n Mundo.) </span></p>
<blockquote><p><span style="font-size: 10pt; font-family: Verdana">google.language.callbacks.id103('22',{"translatedText":"  Hola \n Mundo"}, 200, null, 200)</span><strong><span style="font-size: 10pt; font-family: Verdana"> </span></strong></p></blockquote>
</blockquote>
</blockquote>
<p><strong><span style="font-size: 10pt; font-family: Verdana">Rewriting the code to a more favored JS Library style</span></strong><span style="font-size: 10pt; font-family: Verdana"> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">Code rewritten into a more jQuery like fashion and as I would get extremely tired of typing google.language.translate() and since the pattern/callback almost always remains the same I rewrapped it like so.</span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">The original code taken from the Google example Page</span><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"> <o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">  </span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"><span style="color: blue">&lt;</span><span style="color: maroon">script</span> <span style="color: red">type</span><span style="color: blue">="text/javascript"&gt;<br />
</span>    google.load("language", "1");<br />
    google.setOnLoadCallback(submitChange);<br />
    <span style="color: blue">function</span> submitChange() {<br />
      <span style="color: blue">var</span> value = document.getElementById('source').value;<br />
      <span style="color: blue">var</span> langpair = document.getElementById('langpair');<br />
      <span style="color: blue">var</span> pair = langpair.options[langpair.selectedIndex].value.split('|');<br />
      <span style="color: blue">var</span> src = pair[0];<br />
      <span style="color: blue">var</span> dest = pair[1];<br />
      google.language.translate(value, src, dest, translateResult);<br />
      <span style="color: blue">return</span> <span style="color: blue">false</span>;<br />
    }</span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">    <span style="color: blue">function</span> translateResult(result) {<br />
      <span style="color: blue">var</span> resultBody = document.getElementById("results_body");<br />
      <span style="color: blue">if</span> (result.translation) {<br />
        resultBody.innerHTML = result.translation;<br />
      } <span style="color: blue">else</span> {<br />
        resultBody.innerHTML = '&lt;span style="color:red"&gt;Error Translating&lt;/span&gt;';<br />
      }<br />
    }<br />
  <span style="color: blue">&lt;/</span><span style="color: maroon">script</span><span style="color: blue">&gt;</span></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana">I did not let my code auto-run so I just removed that line and I removed the HTML FORM as well can the jQuery stylized everything and just placed a click event on the button.   Here is the modified version of the code (in this case I make multiple calls to gt(...) to translate multiple items.</span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana">  <o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana"> <o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">  </span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"><span style="color: blue">&lt;</span><span style="color: maroon">script</span> <span style="color: red">type</span><span style="color: blue">="text/javascript"&gt;<br />
</span>      google.load("language", "1");<br />
      $("#cmdTranslate").click(<span style="color: blue">function</span>(){<br />
            <span style="color: blue">var</span> langpair = $("#langpair").<span style="color: blue">get</span>(0);<br />
            <span style="color: blue">var</span> pair = langpair.options[langpair.selectedIndex].value.split('|');<br />
            <span style="color: blue">var</span> src = pair[0];<br />
            <span style="color: blue">var</span> dest = pair[1];<br />
            <span style="color: blue">var</span> gt = <span style="color: blue">function</span>(fld){<br />
                        google.language.translate($(fld).text(),src,dest,<span style="color: blue">function</span>(result){<br />
                              <span style="color: blue">if</span> (result.translation)<br />
                                    $(fld).text(result.translation);<br />
                        });<br />
                  }<br />
            gt(".pageHeading");<br />
            $("#PublishedModifiedDate b").each(<span style="color: blue">function</span>(){gt(<span style="color: blue">this</span>);});<br />
            gt("#DocumentBody");<br />
            <span style="color: blue">return</span> <span style="color: blue">false</span>;          <br />
      });<br />
  <span style="color: blue">&lt;/</span><span style="color: maroon">script</span><span style="color: blue">&gt;</span></span><span style="font-size: 10pt; font-family: Verdana"><span style="color: blue"></span></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><span style="color: blue"></span></span><span style="font-size: 10pt; font-family: Verdana"><span style="color: blue"></span></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><strong><span style="font-size: 10pt; font-family: Verdana">What I would consider on a live implementation</span></strong><span style="font-size: 10pt; font-family: Verdana"> <o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">Working from our content delivery system and making some modifications to add the translator API yields this small screen snip</span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"><img border="0" width="1" src="http://docs.google.com/File?id=dc7x9fp2_37v4jnqmdw" height="1" /><img border="0" width="572" src="http://docs.google.com/File?id=dc7x9fp2_37v4jnqmdw" height="301" /> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><br />
In this case I added only the Article Title, some Labels on the page and the main Document Body for translation.  Given what I learned about the Google Translator API above I know that stripping out all the HTML, keeping the carriage returns, then translating the whole text and post translation wrapping it in an HTML PRE tag would be the way to go.  Internet Explorer and Firefox seem to display the \n differently though which messes the result and some string replace of the translated results might be in order (convert the /n to /r/n) for a better unified experience in both browsers. </p>
<p></span><span style="font-size: 10pt; font-family: Verdana"></span><span style="font-size: 10pt; font-family: Verdana"><o:p></o:p></span><span style="font-size: 10pt; font-family: Verdana">In my own wanderings I find that this style jQuery code is cleaner and easier on the brain.  jQuery give more comprehensive bite to JavaScript code.  I think I would probably use the <a href="http://docs.jquery.com/Core/data#namevalue">jQuery Core Data Cache</a> for storage of the original HTML so I can revert it all if necessary as I had that concept in my own earlier work example and before I knew about the jQuery Data Cache.</span><span style="font-size: 10pt; font-family: Verdana"> <o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">Since I did not get around to all of these things I mention I will just leave you with the end result anyway.  Given the API Querystring length limitation such a bit of work would not work on a large document anyway.</span></p>
<p><span style="font-size: 10pt; font-family: Verdana"><img border="0" width="1" src="http://docs.google.com/File?id=dc7x9fp2_38dzwt9cf9" height="1" /><img border="0" width="562" src="http://docs.google.com/File?id=dc7x9fp2_38dzwt9cf9" height="210" /> </span></p>
<p><span style="font-size: 10pt; font-family: Verdana">There are a ton of different possible uses here from auto text chat style translations to Twitter translation on the fly or auto label text localization on data entry forms.  Take your pick..<o:p></o:p></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">One last thought before I hit the Publish key and this goes down on the record books.. <br />
</span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"><br />
</span><span style="font-size: 10pt; font-family: Verdana">My thinking is that context aware HTML page translation or machine translation of HTML snippets is perhaps a long ways away. While I am sure there are tools you can hook that make page translation an easy thing to do and the fact that Google Page Translator services engine does a excellent job of keeping the look and feel (I would not mind seeing some notes from the Google Team on how they do that) I still find the first version of this API lacking.  For the small stuff it's very cool but who wants to sweat the small stuff anyway...</span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p style="background: white; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p><span style="font-size: 10pt; font-family: Verdana">Well that is about all I have to say for now and I hope these details help you in making your own decisions.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana">Kevin Pirkl</span></p>
<p></font></p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2008/03/21/google-ajax-language-api-first-impressions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Parallel FX &#038; Threading for newbies (like me.)</title>
		<link>http://softwareblogs.intel.com/2008/01/09/parallel-fx-threading-for-newbies-like-me/</link>
		<comments>http://softwareblogs.intel.com/2008/01/09/parallel-fx-threading-for-newbies-like-me/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 22:04:28 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Multicore]]></category>

		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2008/01/09/parallel-fx-threading-for-newbies-like-me/</guid>
		<description><![CDATA[This is my first real foray into writing threaded applications (I use worker thread's in ASP.Net applications quite often to do small tasks) and taking a peek into how much more effort it will add for managed code apps (.Net.) First let me throw out that I consider new stuff technologies kind-of a pain in the butt [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first real foray into writing threaded applications (I use worker thread's in ASP.Net applications quite often to do small tasks) and taking a peek into how much more effort it will add for managed code apps (.Net.) First let me throw out that I consider new stuff technologies kind-of a pain in the butt and perfer spoon feeding. I like what works where code is concerned and consider change as a hard truth. I hope the details and links and notes and such can help you in your own endeavors though even if this post taken as a total attempt is only a BRICK. Like I said I am not an expert but only a newbie with Threading so enjoy it or toss it. :)</p>
<p>Here are some quick thoughts I have, "YATTL (Yet another technology to learn)", "Clay Breshears post "<a target="_blank" href="http://softwareblogs.intel.com/2007/09/28/this-is-like-deja-vu-all-over-again/" title="This is like deja vu all over again">This is like deja vu all over again</a>", Rick Strahl "<a target="_blank" href="http://west-wind.com/weblog/posts/198731.aspx" title="Whats ailing Web Forms by Rick Strahl">What's ailing ASP.Net Web Forms</a>" Clay and Rick sum up quite well my two thoughts on new technologies, what I would gripe about myself if they hadn't already mentioned it. Many of us would like to start writing code that makes use of threading and multi-core technologies but we also want it to be as easy as using an iPod menu system (jk.) Laura Hess wrote an article titled "<a target="_blank" href="http://www.inlightimes.com/archives/2000/12/hess.htm" title="Slaves To Technology">Slaves To Technology</a>" which provides simple insights into why technology becomes more oppressive as opposed to unburdening. To me this means that the average developer when learning a new framework, developer tool version, etc every year or so forces them to be the beasts of burden as opposed to the other way around. Technology should make life easier and not harder or more complicated and that's all I have to say on the subject.</p>
<p>Learning new technologies and tools is not an easy process and typically requires a small <a target="_blank" href="http://en.wikipedia.org/wiki/Paradigm_shift" title="Paradigm Shift">paradigm shift</a> for each new iteration. Modern days have given us two very big developers shifts with the first being <a target="_blank" href="http://en.wikipedia.org/wiki/Object-oriented_programming" title="Object Oriented Programming">OOP</a> which I read about at age 13 (approximately 1978) and Parallel Programming which I would consider the second modern day paradigm shift. Parallel Programming requires some steep brain function to wrap your head around but once you get it the going get's much better.</p>
<p>The Parallel Programming paradigm shift is happening today and wont be ignored. Some good readings can be found by Matt Gillespie "<a target="_blank" href="http://softwarecommunity.intel.com/articles/eng/1273.htm" title="MultiCore Madness">Transitioning Software to Future Generations of Multi-Core</a>" and Herb Sutter wrote a Dr. Dobb's Journal article "<a target="_blank" href="http://www.gotw.ca/publications/concurrency-ddj.htm" title="The Free Lunch Is Over">The Free Lunch Is Over - A Fundamental Turn Toward Concurrency in Software</a>" which talks all about the switch from faster processors to multi-core architectures. Parallel Programming represents a problem for the generalist software developer in terms of language availability. Many <a target="_blank" href="http://www.tiobe.com/tpci.htm" title="Popular programming languages">popular languages</a> already have the basics underpinnings for wiring into multi-core but many languages do not and may never be done in such a way as to provide visibility to the developer. </p>
<p>So why the headache and me complaining so much when I plan to use the technology anyway.  Well lets work our way through an application and see what we find.</p>
<p>Here is an example of some sample code that I converted to make use of TPL and the blowback from the changes. I found an old Managed Code WinForm Migration Utility Application (just MU for short) we used to convert XML documents into HTML data for a new content delivery system we created last year. Migration Utility (MU) is a C# WinForm application that I will convert over to use a few features of the <a target="_blank" href="http://msdn.microsoft.com/msdnmag/issues/07/10/Futures/default.aspx" title="Tasks Parallel Library">Tasks Parallel Library</a> (<a target="_blank" href="http://en.wikipedia.org/wiki/Task_Parallel_Library#TPL" title="TPL Wikipedia">TPL</a>.)  For this conversion I used the Customer Technology Preview .Net Framework 3.5 and Visual C# 2008 Express Edition and sample code found in the MSDN article "<a target="_blank" href="http://msdn.microsoft.com/msdnmag/issues/07/10/Futures/default.aspx" title="Optimized managed code for multicore">Optimize Managed Code For Multi-Core Machines</a>" as a guide for converting the MU code. Note that it took me three install attempts on different computers to get everything working. Code segments that I'll show here parse XML files in a disk folder and downloads all the images to disk. Note that this code was not written by me (but modified) to make use of TPL and other asynchronous approaches to better see TPL in action. This was perhaps not the best example and I think something like the Quick Sort problem on the <a target="_blank" href="http://softwarecontests.intel.com/threadingchallenge/" title="Intel Threading Challenge">Intel Threading Challenge</a> page would have made for a better example for comparison shoppers. In fact with TPL you might even consider the taking one of the next challenges and win $100 (see <a target="_blank" href="http://softwarecommunity.intel.com/articles/eng/1526.htm" title="contest rules">contest rules</a> for details.)  &lt;--  Shameless plug *kp</p>
<p>My base computer for testing is a Dual Core <a target="_blank" href="http://www.apple.com/macbookpro/" title="MacBookPro">MacBook Pro</a> running Windows XP at boot.</p>
<p>Here is the MU application and what it did and the changes I will make and thoughts along the way.</p>
<p>So take some 2027 files in a folder</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig1_FilesList.gif" alt="File List" /></p>
<p>And process each one in a sequential fashion</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig2_FileProcessing.gif" alt="File Processing Loop" /></p>
<p>First parsing the HTML contents</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig3_ContentProcessng.gif" alt="Content Processing" /></p>
<p>And then downloading the images extracted from the HTML source attributes using a synchronous download.</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig4_ImageDownloader.gif" alt="Image Processing" /></p>
<p>Now lets make changes to this application start to make use of TPL.</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig5_Loop1.gif" alt="Parallel FX TPL Loop" /></p>
<p>One item that becomes very apparent on running this web application is that the System.Net.WebClient call to DownloadFile(...) is not being done in an asynchronous manner which is easily changed. Before that change the main processing look took 10 minutes for the UI to come back and become responsive and with that change it comes back in under 10 seconds. Problem now is that with a responsive UI I need to add code to disable buttons and I have to add an indicator to show how many downloads still remain (I'll skip that for now.) One download complete callback handler to the rescue like so will suit our purposes for the time being.</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig6_AsynchDownloading.gif" alt="WebClient.DownloadFileAsynch() Downloading" style="width: 600px; height: 247px" /></p>
<p>So we have to wrap the call in a callback handler for the on completion event and also implement a counter to track all the calls to know when the application has completed downloading files but I still needed a polling mechanism to know when downloading was complete.</p>
<p>Regarding the asynchronous downloading I attempted to see if I could get better performance via setting some connections configuration options in app.config but the enhancement was negligible as the connections for images were all over the place so call blocking was not a real problem. Setting up say four connections per IP address over the normal two lent small gains but say 8/16 did not make much of a difference.</p>
<p>One other thing to note is the responsiveness of the UI. With the linear processing the UI just locks up and control does not come back till the entire application has completed the directory files processing. I read this little article by jfoscoding called "Keeping your UI Responsive and the Dangers of Application.DoEvents <a href="http://blogs.msdn.com/jfoscoding/archive/2005/08/06/448560.aspx">http://blogs.msdn.com/jfoscoding/archive/2005/08/06/448560.aspx</a>" and attempted a Application.DoEvents but looking at the CPU utilization it pushed up over a constant %50 burn rate. </p>
<p>Don't do this.... (Perhaps except in the Winform bound timer event though.)</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig7_WaitTillDownloadsDone.gif" alt="Application.DoEvents() Loop" /></p>
<p>I tried a better approach using a thread timer callback that checked a counter and informed the user when the process was complete. Later I changed the timer to only check back every couple of seconds (initially I had set it to every 10th of a second which still pushed the CPU utilization up.)</p>
<p><img border="0" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig8_BetterWaitApproach.gif" alt="Threaded Wait Timer" /></p>
<p>While debugging I came across an issue/error message with multiple threads attempting to update the WinForm's list object. There is an overriding setting to ignore these errors but then your nice linear listing gets out of order. Some suggestions are to buffer the text and write it all at once when the file processing is completed. I just commented out all writes to the list object in the end but this line of code took care of some annoying non thread safe write error messages</p>
<p>  CheckForIllegalCrossThreadCalls = false; </p>
<p>I decided to cut out the image processing code just to see how some loop performance numbers. Regarding image downloading taking a peeking at the task manager statistics it appears that WebClient uses Asynchronous callbacks spawned multiple to threads anyway so disabling the image downloads (now Asynch) to better check performance. </p>
<p>For the average run processing all the files in the folder without downloading images.</p>
<p><img border="1" width="320" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig10_SerialProcessingNoImages.gif" alt="Serial Loop timing" height="196" /></p>
<p>Using TPL the average run processing all the files in the folder without downloading images.</p>
<p><img border="1" width="352" src="http://softwarecommunity.intel.com/userfiles/en-us/image/kevin/Fig11_TPL_w_ThreadTimerNoImages.gif" alt="TPL Loop Average" height="228" /></p>
<p>Conclusion:</p>
<p>Sometimes on exit the application crashes so you would need to add some checks for object existance before trying to use those objects which means more potential error handling. </p>
<p>Well digging the net and articles above I've read that even with multiple cores it does not mean double the speed but in some cases close to it. It perhaps kind of stinks that I did not do more but then again my only purpose was to learn a little more about TPL and I think I've managed that.</p>
<p>The biggest gain here is the responsiveness of the UI by just implementing WebClient using Asynchronous callbacks and TPL in this case only made things a couple seconds faster. Perhaps my bad choice of applications for this test but then again a good learning experience.</p>
<p>Some of my worries and lack of understanding about this new way surround thread safety.  Using static variables (or not) for counters and thread timers kind of scares me as I do not understand the underpinnings in .Net on how these work and what's really safe and what's not when writing threaded code. What I did like was the ease of use of the TPL For loops and the new Lambda expressions (which you can read about at Scott Guthrie's Blog entry "<a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx" title="New lambda expressions in .Net">New Orcas Language Feature: Lambda Expressions</a>")</p>
<p>Given the changes I made the applications still crashes from time to time due to some screen objects going out of scope when exiting via the close box. All in all it was not worth the effort to make this particular application "Parallel" and it was a sort of failure but a good experience.</p>
<p>I like to think that the lie of "Ontogeny recapitulates phylogeny" as applied to technology might yield a better organization and core usage for Parallel Programming and a common set of base constructs found across programming languages. Even while it's a lie it's one I would still like to believe in that TBB/TPL/etc. planners could get together and organized to provide multi-core aware object constructs that act like communities making things simple once again.</p>
<p>Supporting notes:</p>
<p>Loosely taken from the thoughts of David Charbonneau's article "<a target="_blank" href="http://www.cariboo.bc.ca/carryon/dcharbon/kdn04/time.htm" title="Mental Health and Technology">Hectic lifestyle catching up with Canadians health</a>"<br />
Clay Breshears "<a target="_blank" href="http://softwarecommunity.intel.com/articles/eng/1607.htm" title="Eight simple rules for designing threaded applications">Eight Simple Rules for Designing Threaded Applications</a>" provides some basic thinking guidance on good approaches when designing or writing threaded applications.</p>
<p>Communities like Intel's "<a target="_blank" href="http://softwarecommunity.intel.com/isn/home/MultiCore.aspx" title="Intel Multi-Core Community">Multi-Core Developer Community</a>"</p>
<p>Microsoft's "<a target="_blank" href="http://msdn2.microsoft.com/en-us/concurrency/default.aspx" title="MSFT Parallel dev center">Parallel Computing Developer Center</a>" both provide a good start for developers seeking to gain a better understanding for both managed and un-managed environments where the developer wants to start making headway into writing code for Parallel Computing. </p>
<p>Other resources:</p>
<p>Scott Hanselman's - <a href="http://www.hanselman.com/blog/HanselminutesPodcast84ConcurencyProgrammingWithNETParallelFrameworkExtensions.aspx" title="Hansleman's Podcasts">Hanselminutes Podcast 84 - Concurency Programming with .NET Parallel Framework Extensions</a></p>
<p>Intel's Software College - "<a target="_blank" href="http://www3.intel.com/cd/ids/developer/asmo-na/eng/344899.htm?cid=sw:college100" title="Intel Software College Classes in Parallel Programming">Introduction to Parallel Programming Courses</a>" </p>
<p><a target="_blank" href="http://softwarecommunity.intel.com/isn/home/default.aspx" title="Intel Software Network Home">Intel Software Network Home</a> - </p>
<p><a target="_blank" href="http://blogs.msdn.com/somasegar/archive/2007/11/29/parallel-extensions-to-the-net-fx-ctp.aspx" title=".Net Parallels FX Extensions CTP">Parallel Extensions to the .NET FX CTP</a> -</p>
<p>Welcome to Intel <a target="_blank" href="http://threadingbuildingblocks.org/" title="Intel Threading Building Blocks Org">Threading Building Blocks.org</a> -</p>
<p><a target="_blank" href="http://blogs.msdn.com/pfxteam/" title="Microsoft's Parallel FX Blog">Microsoft's Parallel FX Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2008/01/09/parallel-fx-threading-for-newbies-like-me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Gears - 4th hour working with Gears</title>
		<link>http://softwareblogs.intel.com/2007/10/04/google-gears-4th-hour-working-with-gears/</link>
		<comments>http://softwareblogs.intel.com/2007/10/04/google-gears-4th-hour-working-with-gears/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 22:05:21 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Intel® Software Network 2.0]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2007/10/04/google-gears-4th-hour-working-with-gears/</guid>
		<description><![CDATA[In memory of my friend Steve T - The wandering electron!
OK so here it is, after a bit of mulling around I finally found a good use for Google Gears! (I would find about a thousand more but they keep me locked up in my cube with a stack of ToDo items.)
Use Case for a web [...]]]></description>
			<content:encoded><![CDATA[<p>In memory of my friend Steve T - The wandering electron!</p>
<p>OK so here it is, after a bit of mulling around I finally found a good use for <a href="http://code.google.com/apis/gears/" title="Google Gears API">Google Gears</a>! (I would find about a thousand more but they keep me locked up in my cube with a stack of ToDo items.)</p>
<p><a href="http://en.wikipedia.org/wiki/Use_Case" title="Wikipedia Defn">Use Case</a> for a web application distance problem: There are times that a person wants to write a web application that works in distant geographies like from China to the USA and still maintain excellent performance. Consider a Content Management System (<a href="http://en.wikipedia.org/wiki/Content_Management_System" title="Content Management System">CMS</a>) administration tool that spans multiple geographies.</p>
<p>Here are a couple approaches (I sure there are a million more)</p>
<ol>
<li>One approach would be to place the CMS administration tool in one place have all geographies work there. Nightly copies of data would be delivered to a Content Delivery Network (<a href="http://en.wikipedia.org/wiki/Content_Delivery_Network" title="CDN">CDN</a>) hosting a web front end like the <a href="http://www.akamai.com/" title="Akamai">Akamai</a> network. A slight variation on that theme might be to generate static files derived from the CMS tool delivered to the CDN for even faster performance.<br />
:-)</li>
<li>Another more distributed approach might be to place server racks in multiple geographies across the world and then create nightly data synchronization routines to bring data back to a central server for final distribution back to servers (insane from an administrative standpoint.) Each geography would own and maintain it's own information and a copy of all other geographies data. Administration tool would run fast for sure and the delivery vehicle in each geography would be faster. The trade off here is that system application maintenance would be pain in the a$$. Imagine having to make a single change and distributing that change to 14 locations not to mention the cost of updating the data synchronization routines.</li>
</ol>
<p>Google Gears to the rescue - Application performance gripes in this case scenario can be boiled down to the parts of such a system. What are some internal pieces we might see in such an application approach with ISN.</p>
<ul>
<li>Localization support patterns and distinction. Each page needs to be able to be translated (potentially) into multiple languages. Virtualized URL pattern support for localization and display.</li>
<li>Rich Text Formatting editor (<a href="http://en.wikipedia.org/wiki/Rich_Text_Format" title="RTF">RTF</a>) that can enforce style and formatting usage. Pages should share a common look and feel and shared functionality. Ability to embed JavaScript and HTML forms.</li>
<li>Categories and Page types for classifications. More ways to sort, compile and report the data as it is consumed by clients.</li>
<li>Custom navigation options editor. Links and menu options that apply to specific content or even groups of content.</li>
<li>Lists of non-translated articles for each geograph or a work list. Search and report on articles by category, type, language code etc.</li>
<li>RSS by category and language support.</li>
</ul>
<p>There are more but I am most concerned with the slowest parts of this style of application and why single point delivery is a problem. Out of all the above aside from distance based latency large and complex pages and the biggest problem. Take for instance a nice RTF editor like <a href="http://en.wikipedia.org/wiki/Fckeditor" title="FCKEditor Wikipedia">FCKEditor</a>. Put this tool on a single web page and deliver it from the USA to China and see how long it takes. There are about 10-15 subfiles that comprise the FCKEditor experience (just a very rough estimate.) FCKEditor files are pretty static and using <a href="http://code.google.com/apis/gears/api_localserver.html" title="Gears Local Server">Gears Local Server Module API</a> give an excellent resource cache for all of these files. Using the Gears <a href="http://code.google.com/apis/gears/api_localserver.html#LocalServer" title="Gears LocalServer">LocalServer</a> class container to create a <a href="http://code.google.com/apis/gears/api_localserver.html#ManagedResourceStore" title="Gears ManagedResourceStore">ManagedResourceStore</a> that contains these 10-15 controlled by a simple <a href="http://code.google.com/apis/gears/api_localserver.html#manifest_file" title="Gears Manifest File">manifest file</a> means mighty groovy goodness! If fact the time it will take me to write up this blog post will be much longer than it took me to code the solution to the problem.</p>
<p>I ran into a couple hangups here with some version problems with Gears sample code and the main download page. I had this same problem the first time around on my own development box but have sorted it out. If you happened to install Gears from the main link http://gears.google.com/ then you should just uninstall it and go to this "<a href="http://code.google.com/p/google-gears/downloads/list" title="Gears corrected release to match sample code">Gears .2 release</a>" link instead. From my experience it appears that they might have updated the sample code to work with the new release and it is not compatible with the older version. I installed from the first link on clean server boxes for in Russia and China for testing the performance boost and both had the same issue which was solved by re-installing from the .2 release.  <strong><em>Update (Oct 15 2007)  Addition - I get something here at least why my code seems to have some issues. My problem here with Gears versions is that I’ve been working from the Beta site install version code or .2 versus the main site downloader. </em></strong><a href="http://code.google.com/apis/gears/install.html"><strong><em>http://code.google.com/apis/gears/install.html</em></strong></a><strong><em> versus </em></strong><a href="http://code.google.com/p/google-gears/downloads/list"><strong><em>http://code.google.com/p/google-gears/downloads/list</em></strong></a><strong><em>. I’m just not sure all about it but it appears that the sample code has been updated to use the second link or version .2. KP</em></strong></p>
<p>One other problem that I can across is that I wanted to add a little bit of code to call openStore(string name, [string requiredCookie]) to check to see if the store existed so I could enable/disable buttons on the screen for a clean user experience but the calls to openStore always returned null for me even though I can see that it is working correctly. Not sure what I might have done wrong on that end but I will take a better look at the code tomorrow.</p>
<p>The RTF editor was the biggest hindrance to the geographic distribution of this application and Gears solves that problem. It's worth noting that some other changes like HTML reduction via style sheets and dropping viewstate from the ASP.Net pages has made a big difference in overall search performance as well but those are often issues dealt with in a second go around with the code. What I like about all this is that the page that took 15 seconds to load in China now takes about three.</p>
<p>So in three hours of play and one hour of coding I have all the code up and working in production and a viable future implementation change that will end up saving thousands of dollars in application maintenance costs (and developer headaches later.)</p>
<p>I just want to say Google Gears Rocks! For more resources check and watch the <a href="http://gearsblog.blogspot.com/" title="Google Gears API Blog">Gears API Blog</a></p>
<p>Kevin Pirkl</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2007/10/04/google-gears-4th-hour-working-with-gears/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hacking Intel - XSS Security exploit with ASP.Net using .RewritePath and Request.RawUrl bypassing ASP.Net native script protection</title>
		<link>http://softwareblogs.intel.com/2007/09/20/hacking-intel-xss-security-exploit-with-aspnet-using-rewritepath-and-requestrawurl-bypassing-aspnet-native-script-protection/</link>
		<comments>http://softwareblogs.intel.com/2007/09/20/hacking-intel-xss-security-exploit-with-aspnet-using-rewritepath-and-requestrawurl-bypassing-aspnet-native-script-protection/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 22:46:16 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Intel® Software Network 2.0]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2007/09/20/hacking-intel-xss-security-exploit-with-aspnet-using-rewritepath-and-requestrawurl-bypassing-aspnet-native-script-protection/</guid>
		<description><![CDATA[Hacking Intel: XSS Security exploit with ASP.Net using .RewritePath and Request.RawUrl bypassing ASP.Net native script protection (.Net 1.1 and 2.0)
What is XSS: http://en.wikipedia.org/wiki/Cross-site_scripting XSS also called Cross-Site Scripting is a web based security vulnerability by which a person injects HTML or Client side script code into a web page without the knowledge of the originator [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Hacking Intel:</strong> XSS Security exploit with ASP.Net using .RewritePath and Request.RawUrl bypassing ASP.Net native script protection (.Net 1.1 and 2.0)</p>
<p><strong>What is XSS:</strong> <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">http://en.wikipedia.org/wiki/Cross-site_scripting</a> XSS also called Cross-Site Scripting is a web based security vulnerability by which a person injects HTML or Client side script code into a web page without the knowledge of the originator of the web page.</p>
<p>Web 2.0 enhanced GUI experiences and RTF editors go hand in hand and the increased support and ability to POST HTML content (and to protect against malign intent) means that XSS becomes a more serious issue on a daily basis. Practically weekly a new hack or workaround enabling a user to inject malign content gets found.</p>
<p>Any web page that can take as input QueryString or POST input like &lt;SCRIPT&gt;alert("hello from script")&lt;/SCRIPT&gt; and echo's it back can practically be considered a XSS exploitable site. Other simple variations on this theme are described but another simple one that I will consider here is &lt;/SCRIPT&gt;&lt;SCRIPT&gt;alert("hello from script")&lt;/SCRIPT&gt;</p>
<p><strong>Securing ASP.Net:</strong> Typically ASP.Net web page developers rely on one or two mechanisms to prevent XSS issues. The fist layer of protection is found already set on in most machine.config files.</p>
<p>&lt;configuration&gt;<br />
&lt;system.web&gt;<br />
&lt;pages validateRequest="true" /&gt;</p>
<p>This is a first level of protection and can be explicitly set in web.config files or down to the @Page level for making allowances of HTML RTF editor posted content. With validateRequest set to "false" we now start to enter the realm of the XSS exploitable web site. From this point on it is would be considered on part of the developer to scan and remove CSS includes, JavaScript:, &lt;script&gt; tags, and more advanced versions like style style="any: expression(window.location=myevilsite.com)" from all submitted content. The developer must also check the content for same origins policy for all allowable HTML to ensure that malign viral images, embed objects etc are stripped out. Quite a tall order for most developers.</p>
<p>For the life of me I have not found a good ASP.Net content scrubber DLL that maintains a same origins policy but my concern extends beyond just page content cleanup.</p>
<p><strong>Rewrite Path XSS Exploit:</strong> (perhaps not all that new good to be aware of) This is not a common problem for most web applications but can impact those applications that make use of virtualized URL's to help organize content. I need to throw a little background at you before I lay out the new XSS exploit.</p>
<p>Take for example a blog that wants to organize content by year, month. The old format for posts might take on ShowBlogPostings.aspx?year=NNNN&amp;month=NN which is not very friendly. Using virtualized URL's you can easily create a group view using something like http://../myblog/2007/11/index.html for the base URL which could easily be re-written using an ASP.Net IHttpModule with .RewritePath(SOMEURLHERE) by parameterized calls against the virtualized URL into the original format. So with /myblog/2007/11/index.html we can take out the year and month via some easy expression pattern like /myblog/(.*?)/(.*?)/index.html and call .RewritePath(ShowBlogPostings.aspx?year=$1&amp;month=$2) thus insulating the user and providing better organization of data.</p>
<p>So lets take that URL and malign it to /myblog/(.*?)/(.*?)/index.html?a= &lt;/SCRIPT&gt;&lt;SCRIPT&gt;alert("XSS Exploited")&lt;/SCRIPT&gt; and using the .RewritePath(ShowBlogPostings.aspx?year=$1&amp;month=$2) I echo the Request.RawUrl to the web page and BOOM!</p>
<p>Doing some more isolation work on this XSS exploit to determine why it was getting by I've found that if my re-write path is plain or without QueryString parameters to the page i.e. "ShowBlogPostings.aspx" that ASP.Net responds with a proper error message (<em>A potentially dangerous Request.QueryString value was detected from the client (a="&lt;/SCRIPT&gt;&lt;SCRIPT&gt;alert("XSS E...")</em> like you would expect. Once the .RewritePath contains QueryString parameters i.e. (ShowBlogPostings.aspx?year=$1&amp;month=$2) then it slips right by. and there will be no error message or issue with the ASP.Net worker engine. Any page that echoes back RawUrl will be in trouble. (ASP.Net FORM ACTION takes on the rewritten URL which is a site virtualization issue but I would skip that here as being out of scope)</p>
<p>Part of the problem was our initial expression in that it only looked for a partial match of content instead of being more explicit and passing on extra parameters. Best code track would be a first pattern of /myblog/(.*?)/(.*?)/index.html?(.*) and only then handling the original pattern of /myblog/(.*?)/(.*?)/index.html. Basically by not passing on all the data the XSS vulnerability was found. With the original pattern the RewritePath call is made .RewritePath("ShowBlogPostings.aspx?year=$1&amp;month=$2"); which tosses out additional parameter data in $3. The context of the original Request.RawUrl is maintained and thus bypass the page validateRequest mechanism without error or incident.</p>
<p>My last thought on this is why one might use RawUrl let alone echo it back into a web page? Request.RawUrl can be tossed into a HIDDEN FORM field for navigation or into a login or logout script links to provide a quick way to get back and forth between web pages. There are as many reasons to use Request.RawUrl as there are developers on the planet, so who's to say?</p>
<p><strong>Developer Response:</strong> Don't trust end user data submissions and URL or HTML encode <strong>all</strong> Request variables (QueryString, Post, Etc..) It's hard to believe that problems like this have been around since 2003 or earlier and they keep cropping back up.<br />
<a href="http://weblogs.asp.net/gad/archive/2003/11/12/37219.aspx">http://weblogs.asp.net/gad/archive/2003/11/12/37219.aspx</a><br />
<a href="http://weblogs.asp.net/rhurlbut/archive/2004/02/04/67684.aspx">http://weblogs.asp.net/rhurlbut/archive/2004/02/04/67684.aspx</a></p>
<p>Rebuild reflected URL's manually (use the .Net call of System.Uri u = new Uri(someurl); to break the URL apart) on the fly, don't rely upon Microsoft to provide safe data handling either and be paranoid, mistrustful.</p>
<p>Use the Microsoft Anti-Cross Site Scripting Library <a href="http://msdn2.microsoft.com/en-us/security/aa973814.aspx">http://msdn2.microsoft.com/en-us/security/aa973814.aspx</a> for everything.</p>
<p>Use White Lists (allowed) over Black (disallowed) Lists <a href="http://www.feedparser.org/docs/html-sanitization.html">http://www.feedparser.org/docs/html-sanitization.html</a> and know what you will consider safe for your site (in this day and age and localized application sets that might be a tough call to do.) Consider all Request fields that will not contain HTML to encoded. For HTML submittals consider a granularity down to acceptable attribute's and tags to accept and toss the rest, better safe than sorry!</p>
<p><strong>Microsoft's Response:</strong> <strike>No idea yet. Perhaps this has already been discovered. Will post more on this as I become aware of it.</strike></p>
<p>Stefan Schackow - This functionality would be more like a DCR for a future ASP.NET release rather than a security bug with a clear fix.  Although the query string portion of the raw Url could be included in request validation pretty easily, we don’t perform the same validations on the path segments of a Url.  With rewritten Urls the entirety of the Url becomes interesting to an attacker, not just the query string portion.We do have future plans to expand the scope of the request validation feature, and that’s where I think this kind of work would make sense.  On my end I’ll enter a DCR about this so that we don’t lose track.<strong>Conclusion:</strong> Though I have not delved into Microsoft's code via Lutz Reflector <a href="http://www.aisto.com/roeder/dotnet/">http://www.aisto.com/roeder/dotnet/</a> I would think this exploit a principal violation that Microsoft should protect against with validateRequest and that they should fix it. If anyone is aware of a patch or better approach please drop a message here. If you know of a manual way to trigger the validateRequest that would be nice to know as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2007/09/20/hacking-intel-xss-security-exploit-with-aspnet-using-rewritepath-and-requestrawurl-bypassing-aspnet-native-script-protection/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Gears - 3rd hour working with Gears</title>
		<link>http://softwareblogs.intel.com/2007/09/04/google-gears-3rd-hour-working-with-gears/</link>
		<comments>http://softwareblogs.intel.com/2007/09/04/google-gears-3rd-hour-working-with-gears/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 01:06:13 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Intel® Software Network 2.0]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2007/09/04/google-gears-3rd-hour-working-with-gears/</guid>
		<description><![CDATA[Ok here I am in my third short session (1 hour today) working with Gears to better understand what the heck I can do with Gears. What I really want to get out of GG is the ability to make my web pages haul serious a$$ for load speeds.
Based on my earlier time spent with [...]]]></description>
			<content:encoded><![CDATA[<p>Ok here I am in my third short session (1 hour today) working with Gears to better understand what the heck I can do with Gears. What I really want to get out of GG is the ability to make my web pages haul serious a$$ for load speeds.</p>
<p>Based on my earlier time spent with the <a target="_blank" href="http://code.google.com/apis/gears/tools.html">Resource and Tools</a> samples I managed to gather a better understanding of how to make use of the ManagedResourceStore but I need a little more flexibility. Web pages around here change daily so I suppose managing a manifest file is a little out of the question and it appears that the <a target="_blank" href="http://code.google.com/apis/gears/api_localserver.html#ResourceStore">ResourceStore</a> gives me the ability to <a target="_blank" href="http://code.google.com/apis/gears/api_localserver.html#ResourceStore">capture</a> an array or URLs and that is closer to what I would like to do.</p>
<p>The only problem that still remains in that darn <a target="_blank" href="http://en.wikipedia.org/wiki/Same_origin_policy">same origins policy</a>. I deliberately tried a URL delivered from a different authority but of course no luck there as expected. It might be worth noting that at this point that the capture call died on the bad URL and never got to the captureCallback method which makes me curious about the nature of ManagedResource class lastErrorMessage and updateStatus attributes versus the exception thrown by the ResourceStore capture call. Work seems to be happening in two different fashions here but both appear to generalize to file retrieval processes via JavaScript Array or JSON stucture. Well I make no claims to understand it all yet anyway.</p>
<p>I can see a way around the same origins the same origins policy security approach by using <a target="_blank" href="http://jquery.com/">jQuery</a> and a little bit of local file Proxying magic via ASP.Net. jQuery <a target="_blank" href="http://docs.jquery.com/Utilities">.each</a> generic iterator would allow a person to quickly gather page elements like all the images on a page and rewrite the URL's to be delivered via a local same origins call. Couple this with the ResourceStore and you can quickly come up with an approach to take any web page offline. Check the protocol used and the origin and create a new composite URL pointing to a local Proxy page and you have what you need to begin using it against the ResourceStore. The capture call seemed to retrieve page elements sequentially but I would guess that it does each item two at a time based on standard windows HTTP TCP calling limitations. Just make sure if your taking this Proxy approach that you also use .Net Caching and asynchronous page calls. There are some web.config settings to get around the two connection limits and your page can inherit from Anynch instead of the standard Page base class.</p>
<p><a target="_blank" href="http://support.microsoft.com/kb/q183110/">WinInet limits connections per server</a></p>
<p>Well that is all the time I have for today, writing these blog posts consumes more time than the learning.</p>
<p>Cheers</p>
<p>Kevin Pirkl</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2007/09/04/google-gears-3rd-hour-working-with-gears/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting in Gear with Google Gears</title>
		<link>http://softwareblogs.intel.com/2007/08/31/getting-in-gear-with-google-gears/</link>
		<comments>http://softwareblogs.intel.com/2007/08/31/getting-in-gear-with-google-gears/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 19:54:58 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Intel® Software Network 2.0]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2007/08/31/getting-in-gear-with-google-gears/</guid>
		<description><![CDATA[Forgive the free flow of consciousness within, after-all I am a developer and we all tend to talk to ourselves (and listen to loud music.) 
I keep asking myself what can I do with Google Gears and think well, hmm, not that, no that would not work either, ah - nah - nope that would not buy me anything [...]]]></description>
			<content:encoded><![CDATA[<p>Forgive the free flow of consciousness within, after-all I am a developer and we all tend to talk to ourselves (and listen to loud music.) </p>
<p>I keep asking myself what can I do with <a target="_blank" href="http://code.google.com/apis/gears/index.html" title="Google Gears">Google Gears</a> and think well, hmm, not that, no that would not work either, ah - nah - nope that would not buy me anything as well.  Well it's time to take a peek and see what I can do with it in the next couple of hours.   Ok, so the first hurdle is that it appears that a new version of Gears was just released the other day and I know I am running the first version. Time to update...</p>
<p>Click on the new installer, OK so the MSI package is running, hmm 1/2 hour later it is still running, hmm I guess it is time to kill the process and try it again.  Nope same behavior so a re-boot is in order.</p>
<p>Well looking into add/remove programs it appears that I can un-install it so lets do that.  Now run the installer again and nope the msiexec is still running... Hmm shucks this is getting tiring so I guess I will just move on to the <a target="_blank" href="http://code.google.com/apis/gears/design.html" title="Getting Started With Gears">Getting Started</a>examples...  OK no problems there and forcing through the Gears installer page appears to be working and gives a good user experience.</p>
<p>So on to the <a target="_blank" href="http://code.google.com/apis/gears/tutorial.html" title="Gears Tutorial">Tutorial</a>.  Hmm, some errors in the steps but nothing that can't be easily fixed.  Not great for a new user experience but not so bad...</p>
<p>1 hour passes... </p>
<p>Somewhere into the <a target="_blank" href="http://code.google.com/apis/gears/tools.html" title="Gears Resources">Resource and Tools</a>samples.  OK so I have managed the offline sample app, created a local db and put information into it and even created and destroyed tables, the <a target="_blank" href="http://www.sqlite.org/lang.html" title="SQLite Language">SQLite language</a> is easy enough to understand.   I also managed  yet another review of the <a target="_blank" href="http://en.wikipedia.org/wiki/Same_origin_policy" title="Same Origins">same origins policy</a> security approach that they implement. </p>
<p>Ok time to go home....</p>
<p>Ok I'm back after one ruddy nights sleep (typical...)</p>
<p>Ok, so now this looks promising, the <a target="_blank" href="http://code.google.com/apis/gears/samples/hello_world_managedstore/managed_store.html" title="Gears MRSDemo">ManagedResourceStoreDemo</a>online show something more along the lines of what I want to do.  Now that is pretty cool.  I pop open Microsoft Fiddler to get a better view of what is going on...  The trace and file loading of page elements as resources is pretty cool from what it is showing.  They manifest loads all the files from the Internet.  I put all the demo files on a local web head and ran it again along with adding a image file to one of the pages and manifest and viola it all works. </p>
<p>So end all events summary - I think I may be able to get the speed that I would like out of some of our slow moving web pages with Google Gears but how to talk our Managers and End-Users into adopting the technology.  Perhaps I will push it into some administrative applications..</p>
<p>I like what I see so far but the same origins policy kinda makes it harder to use with <a target="_blank" href="http://en.wikipedia.org/wiki/Content_Delivery_Network" title="Content Delivery Networks">CDN</a>'s and same sub-domain's like cache-www.intel.com and softwarecommunity.intel.com sites.  Getting around that limitation may never happen.  Still I see some potential already.</p>
<p>One other thought would be to automate some of the heavier ISN pages that contain lots of images and perhaps use the WorkerPool for more intense client side processing like the tree view control found on the <a target="_blank" href="http://softwarecommunity.intel.com/wiki" title="KB Wiki">Wiki KB</a>. </p>
<p>Cool beginnings though and I like what I see but it also brings up quite a few questions about security, hackability and does the <a target="_blank" href="http://code.google.com/apis/gears/api_httprequest.html" title="Gears HttpRequest">HttpRequest</a> object block the UI?</p>
<p>Cheers</p>
<p>Kevin Pirkl </p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2007/08/31/getting-in-gear-with-google-gears/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Linden Labs Second Life - A dirty little secret!</title>
		<link>http://softwareblogs.intel.com/2007/06/28/linden-labs-second-life-a-dirty-little-secret/</link>
		<comments>http://softwareblogs.intel.com/2007/06/28/linden-labs-second-life-a-dirty-little-secret/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 03:44:07 +0000</pubDate>
		<dc:creator>Kevin Pirkl (Intel)</dc:creator>
		
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://softwareblogs.intel.com/2007/06/28/linden-labs-second-life-a-dirty-little-secret/</guid>
		<description><![CDATA[NixHex Hax of ElectricWebsites.com was chatting at me a few minutes ago and pointed out to me that Second Life has a web browser embedded in user profile screen. NixHex runs a popular WebDeveloper group within SL is building a rapidly growing following in the virtual space. In fact IMHO the outreach will probably best [...]]]></description>
			<content:encoded><![CDATA[<p>NixHex Hax of <a href="http://www.electricwebsites.com/">ElectricWebsites.com</a> was chatting at me a few minutes ago and pointed out to me that <a href="http://secondlife.com/">Second Life</a> has a web browser embedded in user profile screen. NixHex runs a popular WebDeveloper group within SL is building a rapidly growing following in the virtual space. In fact IMHO the outreach will probably best developer events and other web developer resources in the number of participants within a year perhaps two.</p>
<p>I hopped on board and I checked it out in more detail and found it to be a fully functional web browser supporting AJAX style pop-ups and felt suitably impressed so now it is time to determine just what the browser is.</p>
<p>I did some poking around with a <a href="http://www.microsoft.com/technet/sysinternals/Networking/TcpView.mspx">TCP analyzer</a> from SysInternals (now part of Microsoft) and found that the web traffic was being generated directly from the SL.EXE so my next step was to obtain a packet inspection tool. It took me a little digging in the recesses of my brain but I remembered the name "Simon Fell" which led me back to "<a href="http://www.pocketsoap.com/tcptrace/pt.aspx">Proxy Trace</a>" tool that I have used in the past to debug SOAP requests. With that I confirmed my suspicions.</p>
<blockquote><p>GET / HTTP/1.1<br />
Host: localhost<br />
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; chrome://navigator/locale/navigator.properties; rv:1.8.0.12) Gecko/20070605 [Second Life 1.17.1.0]<br />
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br />
Accept-Encoding: gzip,deflate<br />
Keep-Alive: 300<br />
Connection: keep-alive</p></blockquote>
<p>I have researched this before in some attempts to create a web browser screen capture utility that can run from within ASP.Net web pages (but have not yet found a working set of code that will do back-flips for me like I want it to.) Some of my research in this area had previously led me to Gecko Mozilla rendering engine and eventually to a web site called <a href="http://ubrowser.com/">uBrowser</a> which contains the answer that I was looking for in this case.</p>
<p>With this user-agent now know it should not be that hard to get a WordPress <a href="http://imthi.com/wp-pda/">small profile plug-in</a> that can support the in-world SL browser. I'm actually quite surprised that this magnificent piece of work is not embeddable onto a prim but then again if they did that then SL's entire marketing approach to $10 linden per texture upload would be in trouble. Usage of such a tool would be for sure to be abused.</p>
<p>It would be very cool if Linden did provide some kind of lslAvatarProfile details function or special note card capability that extended this browser tool. More potential for abuse but think about the real rich capability of the UI with this kind browser embedded card. Cards would be able to be very awesome indeed.</p>
<p>Kevin Pirkl (ZombieBob Zenovka in SL)</p>
]]></content:encoded>
			<wfw:commentRss>http://softwareblogs.intel.com/2007/06/28/linden-labs-second-life-a-dirty-little-secret/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
