<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="http://feeds.feedburner.com/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Identity Interface</title>
	
	<link>http://jonshern.com</link>
	<description>Zen, Development, and Motorcycle Repair</description>
	<pubDate>Wed, 16 Jul 2008 17:07:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/jonshern" type="application/rss+xml" /><item>
		<title>Linq to Xsd</title>
		<link>http://jonshern.com/2008/07/16/linq-to-xsd/</link>
		<comments>http://jonshern.com/2008/07/16/linq-to-xsd/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 17:07:25 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jonshern.com/?p=108</guid>
		<description><![CDATA[Linq to Xsd is one of microsofts many incubating projects.
Sounds like a great technology.
The question I am always faced with, is it worth it.
Time is limited and there are plenty of technologies out there that are in production that I know almost nothing about.
The ablility to access Xml in a strongly typed manner.
Man that sounds [...]]]></description>
			<content:encoded><![CDATA[<p>Linq to Xsd is one of microsofts many incubating projects.</p>
<p>Sounds like a great technology.<br />
The question I am always faced with, is it worth it.<br />
Time is limited and there are plenty of technologies out there that are in production that I know almost nothing about.<br />
The ablility to access Xml in a strongly typed manner.<br />
Man that sounds like a no brainer.<br />
I understand that Microsoft is overcome with projects.<br />
Jeff Atwood wrote a great article on why <a href="http://www.codinghorror.com/blog/archives/001144.html">Microsoft Can&#8217;t Go Open Source </a><br />
I think this dove tails perfectly into the point that MS just spends too much time reinventing the wheel and not enough time introducing full featured development products.<br />
Linq is a great product. But why not release it with oracle support out of the box.</p>
<p>I would love to pick up Linq to Xsd and run with it, but it seems like it just going to be another dead end.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/07/16/linq-to-xsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Click Detection in a WPF Listview</title>
		<link>http://jonshern.com/2008/07/08/click-detection-in-a-wpf-listview/</link>
		<comments>http://jonshern.com/2008/07/08/click-detection-in-a-wpf-listview/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 04:57:56 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://jonshern.com/?p=107</guid>
		<description><![CDATA[Once you have the event wired up, getting the current row only takes a couple lines of code.

&#160;
        private void listPictures_MouseDoubleClick&#40;object sender, MouseButtonEventArgs e&#41;
        &#123;
            Shern.PhotoManager.Common.ImageProperty value = &#40;Shern.PhotoManager.Common.ImageProperty&#41;listPictures.SelectedValue;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Once you have the event wired up, getting the current row only takes a couple lines of code.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp">&nbsp;
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> listPictures_MouseDoubleClick<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, MouseButtonEventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            Shern.<span style="color: #0000FF;">PhotoManager</span>.<span style="color: #0000FF;">Common</span>.<span style="color: #0000FF;">ImageProperty</span> value <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>Shern.<span style="color: #0000FF;">PhotoManager</span>.<span style="color: #0000FF;">Common</span>.<span style="color: #0000FF;">ImageProperty</span><span style="color: #000000;">&#41;</span>listPictures.<span style="color: #0000FF;">SelectedValue</span><span style="color: #008000;">;</span>
            PictureViewer pictureViewer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> PictureViewer<span style="color: #000000;">&#40;</span>value.<span style="color: #0000FF;">FileName</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            pictureViewer.<span style="color: #0000FF;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span></pre></div></div>

<p>In this example ImageProperty is the type that is bound to the ListView control.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/07/08/click-detection-in-a-wpf-listview/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting started with the Google App Engine.</title>
		<link>http://jonshern.com/2008/05/18/getting-started-with-the-google-app-engine/</link>
		<comments>http://jonshern.com/2008/05/18/getting-started-with-the-google-app-engine/#comments</comments>
		<pubDate>Sun, 18 May 2008 11:30:43 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[maps]]></category>

		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://jonshern.com/?p=105</guid>
		<description><![CDATA[The tutorial goes over some basic concepts surrounding Google&#8217;s App Engine Framework, demonstrates using the Google App Engine to store data, and using Django templates to create a GeoRss feed that is consumed by Google maps.
Setup your environment
I chose eclipse as my ide.
The nice thing about eclipse is if you add the lib directories of [...]]]></description>
			<content:encoded><![CDATA[<p>The tutorial goes over some basic concepts surrounding Google&#8217;s App Engine Framework, demonstrates using the Google App Engine to store data, and using Django templates to create a GeoRss feed that is consumed by Google maps.</p>
<p><strong>Setup your environment</strong></p>
<p>I chose eclipse as my ide.<br />
The nice thing about eclipse is if you add the lib directories of whatever you are using (including the Google App Engine) you will get some intellisense.</p>
<p>Download the necessary components.<br />
<a href="https://www.google.com/accounts/ServiceLogin?service=ah&#038;continue=http://appengine.google.com/_ah/login%3Fcontinue%3Dhttp://appengine.google.com/&#038;ltmpl=ae&#038;sig=2441550b0617bb4eb9e7f8c3eb9e63b1">Google app engine</a><br />
<a href="http://www.eclipse.org/downloads/">Eclipse</a><br />
<a href="http://www.fabioz.com/pydev/manual_101_install.html">Installing Pydev</a><br />
The documentation helped, but the link was bad. I used http://pydev.sf.net/updates/.</p>
<p><strong>The guts of the python file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python">&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">cgi</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> wsgiref.<span style="color: black;">handlers</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> users
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">ext</span> <span style="color: #ff7700;font-weight:bold;">import</span> webapp
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">ext</span> <span style="color: #ff7700;font-weight:bold;">import</span> db
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">ext</span>.<span style="color: black;">webapp</span> <span style="color: #ff7700;font-weight:bold;">import</span> template
&nbsp;
_DEBUG=<span style="color: #008000;">True</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Business<span style="color: black;">&#40;</span>db.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    ......
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    application = webapp.<span style="color: black;">WSGIApplication</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>
            <span style="color: black;">&#40;</span><span style="color: #483d8b;">'/'</span>,MainPage<span style="color: black;">&#41;</span>,
            <span style="color: black;">&#40;</span><span style="color: #483d8b;">'/createbusiness.do'</span>,BusinessSignup<span style="color: black;">&#41;</span>,
            <span style="color: black;">&#40;</span><span style="color: #483d8b;">'/georssfeed.xml'</span>,GeoRssFeed<span style="color: black;">&#41;</span>
            <span style="color: black;">&#93;</span>,debug=_DEBUG<span style="color: black;">&#41;</span>
    wsgiref.<span style="color: black;">handlers</span>.<span style="color: black;">CGIHandler</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">run</span><span style="color: black;">&#40;</span>application<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>The main method is where we map our urls to the classes we have defined within the python file.<br />
Each class that handles requests should have a get or a post method.<br />
When a get or a post occurs it will be routed automagically to the appropriate method.</p>
<p><strong>Creating the table</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: #ff7700;font-weight:bold;">class</span> Business<span style="color: black;">&#40;</span>db.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    name = db.<span style="color: black;">StringProperty</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    description = db.<span style="color: black;">StringProperty</span><span style="color: black;">&#40;</span>multiline=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    url = db.<span style="color: black;">URLProperty</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    location = db.<span style="color: black;">StringProperty</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    latitude = db.<span style="color: black;">StringProperty</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    longitude = db.<span style="color: black;">StringProperty</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    address = db.<span style="color: black;">StringProperty</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    created = db.<span style="color: black;">DateTimeProperty</span><span style="color: black;">&#40;</span>auto_now_add=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Description can contain line breaks so we specify multiline=True<br />
Created is of type DateTime and has the property auto_now_add set to true<br />
created is set to the current time the first time the model instance is stored in the datastore, unless the property has already been assigned a value.</p>
<p>There is also an auto_now property that can be used to set the current time each time the record is created or updated. Useful for modified dates.</p>
<p><strong><br />
Handling the request</strong></p>
<p>In one of googles examples(Task List) they used a base class for the request.<br />
Here is my modified version.</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: #ff7700;font-weight:bold;">class</span> BaseRequestHandler<span style="color: black;">&#40;</span>webapp.<span style="color: black;">RequestHandler</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;Supplies a common template generation function&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> generate<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,template_name,template_values=<span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>:
        values = <span style="color: black;">&#123;</span>
                  <span style="color: #483d8b;">'request'</span>: <span style="color: #008000;">self</span>.<span style="color: black;">request</span>,
                  <span style="color: #483d8b;">'debug'</span>: <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'deb'</span><span style="color: black;">&#41;</span>,
                  <span style="color: #483d8b;">'application_name'</span>: <span style="color: #483d8b;">'Local Business Directory'</span>
                  <span style="color: black;">&#125;</span>
&nbsp;
        values.<span style="color: black;">update</span><span style="color: black;">&#40;</span>template_values<span style="color: black;">&#41;</span>
        directory = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span>
        path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>directory,<span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'templates'</span>,template_name<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">response</span>.<span style="color: black;">out</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>template.<span style="color: black;">render</span><span style="color: black;">&#40;</span>path,values,debug=_DEBUG<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This does a few nice things.</p>

<div class="wp_syntax"><div class="code"><pre class="python">        values = <span style="color: black;">&#123;</span>
                  <span style="color: #483d8b;">'request'</span>: <span style="color: #008000;">self</span>.<span style="color: black;">request</span>,
                  <span style="color: #483d8b;">'debug'</span>: <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'deb'</span><span style="color: black;">&#41;</span>,
                  <span style="color: #483d8b;">'application_name'</span>: <span style="color: #483d8b;">'Local Business Directory'</span>
                  <span style="color: black;">&#125;</span>
        values.<span style="color: black;">update</span><span style="color: black;">&#40;</span>template_values<span style="color: black;">&#41;</span></pre></div></div>

<p>This sets up an array of base values that will be passed into the template.<br />
In other methods that use base request, we will add other objects to this array. So our html templates can process data.<br />
The last line values.update is where the two arrays gets merged.</p>

<div class="wp_syntax"><div class="code"><pre class="python">        path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>directory,<span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'templates'</span>,template_name<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>In this application I created a templates folder to separate the html from the code. This line just adds the template_name to the /templates path.</p>

<div class="wp_syntax"><div class="code"><pre class="python">    <span style="color: #008000;">self</span>.<span style="color: black;">response</span>.<span style="color: black;">out</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>template.<span style="color: black;">render</span><span style="color: black;">&#40;</span>path,values,debug=_DEBUG<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>And finally<br />
Write the request out.</p>
<p>Using the BaseRequestHandler</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: #ff7700;font-weight:bold;">class</span> MainPage<span style="color: black;">&#40;</span>BaseRequestHandler<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> get<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
&nbsp;
        <span style="color: #808080; font-style: italic;">#Get all of the businesses</span>
        businesses = Business.<span style="color: black;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">order</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-created'</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">generate</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'index.html'</span>, <span style="color: black;">&#123;</span>
                                     <span style="color: #483d8b;">'businesses'</span>: businesses
                                     <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Here is a simple example of querying all of the businesses ordered by created date.<br />
We then call the generate method on the BaseRequestHandler, passing in our additional objects, along with the template name.</p>
<p><strong>Using Templates</strong><br />
The Google App Engine uses the Django templating engine.  W00t</p>
<p>The for loop</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> <span style="color: #ff7700;font-weight:bold;">for</span> athlete <span style="color: #ff7700;font-weight:bold;">in</span> athlete_list <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span>
    <span style="color: #66cc66;">&lt;</span>li<span style="color: #66cc66;">&gt;</span><span style="color: black;">&#123;</span><span style="color: black;">&#123;</span> athlete.<span style="color: black;">name</span> <span style="color: black;">&#125;</span><span style="color: black;">&#125;</span><span style="color: #66cc66;">&lt;</span>/li<span style="color: #66cc66;">&gt;</span>
<span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> endfor <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span></pre></div></div>

<p>The if statement(there are several varieties)</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> <span style="color: #ff7700;font-weight:bold;">if</span> athlete_list <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span>
    Number of athletes: <span style="color: black;">&#123;</span><span style="color: black;">&#123;</span> athlete_list|length <span style="color: black;">&#125;</span><span style="color: black;">&#125;</span>
<span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span>
    No athletes.
<span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> endif <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span>
&nbsp;
<span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> ifequal <span style="color: #dc143c;">user</span>.<span style="color: #008000;">id</span> comment.<span style="color: black;">user_id</span> <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span>
    ...
<span style="color: black;">&#123;</span><span style="color: #66cc66;">%</span> endifequal <span style="color: #66cc66;">%</span><span style="color: black;">&#125;</span></pre></div></div>

<p>In the spirit of python, there are a lot of functions that Django gives you.<br />
Examples:<br />
timesince: Formats a date as the time since that date (e.g., “4 days, 6 hours”).<br />
phone2numeric: Converts a phone number (possibly containing letters) to its numerical equivalent. For example, &#8216;800-COLLECT&#8217; will be converted to &#8216;800-2655328&#8242;.</p>
<p><a href="http://www.djangoproject.com/documentation/templates/">More Information on Django templates</a></p>
<p>In order to display a list of businesses I am just using a simple for loop and creating a row each time.</p>

<div class="wp_syntax"><div class="code"><pre>&lt;div class=&quot;table&quot;&gt;
	&lt;table&gt;
		&lt;tr&gt;
			&lt;th&gt;Business Name&lt;/th&gt;
			&lt;th&gt;Address(Address, City, State)&lt;/th&gt;
			&lt;th&gt;Description&lt;/th&gt;
			&lt;th&gt;Url&lt;/th&gt;
			&lt;th&gt;Location&lt;/th&gt;
			&lt;th&gt;Latitude&lt;/th&gt;
			&lt;th&gt;Longitude&lt;/th&gt;
		&lt;/tr&gt;
		&lt;/tr&gt;
		{% for business in businesses %}
		&lt;tr id=&quot;row{{ forloop.counter}}&quot;&gt;
		&lt;td class=&quot;main&quot; 
		  &lt;div class=&quot;name&quot;&gt;{{ business.name }}&lt;/div&gt;
		&lt;/td&gt;
		&lt;td class=&quot;members&quot;&gt;
			{{ business.address }}
		&lt;/td&gt;
		&lt;td class=&quot;members&quot;&gt;
			{{ business.description }}
		&lt;/td&gt;
		&lt;td class=&quot;members&quot;&gt;
			{{ business.url }}
		&lt;/td&gt;
		&lt;td class=&quot;members&quot;&gt;
			{{ business.location }}
		&lt;/td&gt;
		&lt;td class=&quot;members&quot;&gt;
			{{ business.latitude }}
		&lt;/td&gt;
		&lt;td class=&quot;members&quot;&gt;
			{{ business.longitude }}
		&lt;/td&gt;
&nbsp;
		&lt;/tr&gt;
		{% endfor %}
	&lt;/table&gt;
&lt;/div&gt;</pre></div></div>

<p><strong>Entering Data</strong></p>
<p>Two pieces of code were necessary for this<br />
Plumbing in the python file</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: #ff7700;font-weight:bold;">class</span> BusinessSignup<span style="color: black;">&#40;</span>webapp.<span style="color: black;">RequestHandler</span><span style="color: black;">&#41;</span>:    
    <span style="color: #ff7700;font-weight:bold;">def</span> post<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        business = Business<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        business.<span style="color: black;">name</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;txtBusinessName&quot;</span><span style="color: black;">&#41;</span>
        business.<span style="color: black;">address</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'txtAddress'</span><span style="color: black;">&#41;</span>
        business.<span style="color: black;">description</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'txtDescription'</span><span style="color: black;">&#41;</span>
        business.<span style="color: black;">url</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'txtUrl'</span><span style="color: black;">&#41;</span>
        business.<span style="color: black;">location</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'txtLocation'</span><span style="color: black;">&#41;</span>
        business.<span style="color: black;">latitude</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'txtLatitude'</span><span style="color: black;">&#41;</span>
        business.<span style="color: black;">longitude</span> = <span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'txtLongitude'</span><span style="color: black;">&#41;</span>
&nbsp;
        business.<span style="color: black;">put</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">redirect</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This just grabs from the data from the request and sets each property on our business object.<br />
Then calls put.<br />
put is an instance method that saves the data to the database.<br />
delete, to_xml, is_saved, are a couple of other useful instance methods.</p>

<div class="wp_syntax"><div class="code"><pre>    &lt;form action=&quot;/createbusiness.do&quot; method=&quot;post&quot; id=&quot;businessform&quot;&gt;</pre></div></div>

<p>Tells the form to post to the specified address.</p>
<p><strong>Bringing it all together</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml">application: yourapplication
version: 1
runtime: python
api_version: 1
&nbsp;
handlers:
- url: /static
  static_dir: static
&nbsp;
- url: /.*
  script: localbusinesslocator.py</pre></div></div>

<p>The app.yaml is where your external url mapping occurs.<br />
If you wanted to use several python files, this is where that would happen.<br />
More Info can be found <a href="http://code.google.com/appengine/docs/configuringanapp.html">here</a></p>
<p>Testing the application<br />
usr/local/google_appengine/dev_appserver.py /sourcedirectory/</p>
<p>Hopefully this fills in some gaps left by <a href="http://code.google.com/appengine/docs/gettingstarted/">Googles tutorial.</a></p>
<p>The next installment of the series will go over displaying the data in the GeoRss format and displaying it on google maps.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/05/18/getting-started-with-the-google-app-engine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Modeling using Enterprise Architect</title>
		<link>http://jonshern.com/2008/04/12/modeling-using-enterprise-architect/</link>
		<comments>http://jonshern.com/2008/04/12/modeling-using-enterprise-architect/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 19:47:11 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/04/12/modeling-using-enterprise-architect/</guid>
		<description><![CDATA[Recently I have been introduced to a new modeling tool called Enterprise Architect.
It is truly a great product for a great price.
It has full support for UML 2.1.
They have a robust and easy solution for distributed teams that have a need to access design artifacts.
Artifact Store
Local File or Shared Network Store
As with any modeling software [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been introduced to a new modeling tool called <a href="http://www.sparxsystems.com.au/">Enterprise Architect</a>.<br />
It is truly a great product for a great price.<br />
It has full support for UML 2.1.</p>
<p>They have a robust and easy solution for distributed teams that have a need to access design artifacts.</p>
<p><strong>Artifact Store</strong></p>
<p>Local File or Shared Network Store<br />
As with any modeling software you can store a file containing your models.</p>
<p>DBMS<br />
You can easily configure SQL server to be your backend store, which allows a multi-user access to your modeling projects.</p>
<p><strong>Source Control</strong><br />
Either you can use a DBMS in conjuction with a Version Control Product (Shared Model)<br />
or you<br />
use a local file based solution with a Version Control.<br />
The major source control providers are supported out of the box, and you can add support for work item tracking in tfs with an optional plugin.</p>
<p>The price is very reasonable at $250 for an enterprise seat.<br />
Compared with $5000 for Rational Software Architect, which is comparable to Power Designer and ErWin.</p>
<p>If you want to do some serious modeling without having to sacrifice your yearly budget. I would suggest getting a few copies of enterprise architect for your team.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/04/12/modeling-using-enterprise-architect/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Time Tracking and Timing</title>
		<link>http://jonshern.com/2008/03/17/time-tracking-and-timing/</link>
		<comments>http://jonshern.com/2008/03/17/time-tracking-and-timing/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 05:01:50 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/03/17/time-tracking-and-timing/</guid>
		<description><![CDATA[Slim Timer is great web based task tracker and timer.
It also has some great reporting built in.
Check it out.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.slimtimer.com">Slim Timer</a> is great web based task tracker and timer.<br />
It also has some great reporting built in.<br />
Check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/03/17/time-tracking-and-timing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lazy Loading Architecture</title>
		<link>http://jonshern.com/2008/03/14/lazy-loading-architecture/</link>
		<comments>http://jonshern.com/2008/03/14/lazy-loading-architecture/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 14:56:33 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/03/14/lazy-loading-architecture/</guid>
		<description><![CDATA[Every place of employment has their favorite patterns and this one is no different.
Lazy Loading is a common theme amongst many of of the entities.
Basically take a property and in the get, check for null. If its null then load using a manager or something. If its not null then the list has been loaded.
It [...]]]></description>
			<content:encoded><![CDATA[<p>Every place of employment has their favorite patterns and this one is no different.<br />
Lazy Loading is a common theme amongst many of of the entities.</p>
<p>Basically take a property and in the get, check for null. If its null then load using a manager or something. If its not null then the list has been loaded.<br />
It really only works for lists.</p>
<p>I think if you are going to do a SOA app, you should stick with the philosophy of plain old clr objects (poco) and just leave your accessors alone. Put the loading logic in a manager and load explicitly. It can become a hidden performance issue, when lists are just loading when you look at them.</p>
<p>The method I am talking about above is called <a href="http://martinfowler.com/eaaCatalog/lazyLoad.html">Lazy Initialization (Fowler) </a><br />
There are also several other types of Lazy Loading Fowler talks about including: Virtual Proxy, Value Holder, and Using Ghosts</p>
<p>The Ghost pattern looks as though it may overcome the hidden performance problem by creating a lazy loading supertype that wraps the load status. So you can tell if the list is of type &#8220;ghost&#8221;,  &#8220;loading&#8221; or &#8220;loaded&#8221; A ghost would mean that the property should be lazy loaded when the oppurtunity arose.  The problem I have with this, is the extra complexity of adding more layers.</p>
<p>In the end for me, it just seems easier to develop a robust manager architecture where explicit loads are easy and intuitive.</p>
<p>Fowler  Martin. Patterns of Enterprise Architecture. 2003.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/03/14/lazy-loading-architecture/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Resisting temptations of new language features</title>
		<link>http://jonshern.com/2008/03/13/resisting-temptations-of-new-language-features/</link>
		<comments>http://jonshern.com/2008/03/13/resisting-temptations-of-new-language-features/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 05:27:05 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/03/13/resisting-temptations-of-new-language-features/</guid>
		<description><![CDATA[Before you go out and drop some extension methods on System.Object, read the this addendum on framework design guidelines for C# 3.0.
]]></description>
			<content:encoded><![CDATA[<p>Before you go out and drop some extension methods on System.Object, read the this addendum on <a href="http://blogs.msdn.com/mirceat/archive/2008/03/13/linq-framework-design-guidelines.aspx">framework design guidelines for C# 3.0</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/03/13/resisting-temptations-of-new-language-features/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quick and Dirty Data Layer  — Subsonic or Enterprise Application Blocks</title>
		<link>http://jonshern.com/2008/02/29/quick-and-dirty-data-layer-subsonic-or-enterprise-application-blocks/</link>
		<comments>http://jonshern.com/2008/02/29/quick-and-dirty-data-layer-subsonic-or-enterprise-application-blocks/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 01:01:58 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/02/29/quick-and-dirty-data-layer-subsonic-or-enterprise-application-blocks/</guid>
		<description><![CDATA[So the f1webchallenge is happening tomorrow morning.
The question is how does a .net developer who traditionally works on large projects transition to a development project that happens in just 24 hours.
One question is how do we handle our Data Layer.
Since it is Mysql, we can just use MySql.Data and get basic functionality, but for something [...]]]></description>
			<content:encoded><![CDATA[<p>So the <a href="http://www.f1webchallenge.com/">f1webchallenge </a>is happening tomorrow morning.<br />
The question is how does a .net developer who traditionally works on large projects transition to a development project that happens in just 24 hours.</p>
<p>One question is how do we handle our Data Layer.<br />
Since it is Mysql, we can just use MySql.Data and get basic functionality, but for something that is going to need to be done very fast will that cut it?<br />
There is also the Enterprise Application Blocks.<br />
Here is how to build it into the Enterprise Application Blocks.<br />
<a href="http://www.codeproject.com/KB/database/MySql_with_Ent_Lib.aspx">Adding MySQL.Data to Enterprise Application Blocks</a></p>
<p>There is also <a href="http://www.codeplex.com/entlibcontrib/Release/ProjectReleases.aspx?ReleaseId=7302">Enterprise Library Contrib</a><br />
Something similar to the building it in, except you just run an installer. </p>
<p>Then there is the OR/M frameworks.<br />
NHibernate<br />
This just seems to big and bulky for a quick and dirty project.<br />
I have used this in a larger application and things that should be simple are difficuly and things that should be hard are easy(sometimes).</p>
<p><a href="http://www.subsonicproject.com/">Subsonic</a><br />
I am going to do some more experimenting with Subsonic.<br />
I have used it before and hooked it up as a post compile task, this had the disadvantage of invalidating code whenever the database was updated.<br />
Early in a project this can be frequent.<br />
This time around I have a batch file, and I am going to just generate the Table classes when something changes.<br />
This should work pretty slick and should save a lot of time writing CRUD stuff.</p>
<p>I will post the results after the competition to see what solution wins.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/02/29/quick-and-dirty-data-layer-subsonic-or-enterprise-application-blocks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>XNA on the Zune</title>
		<link>http://jonshern.com/2008/02/20/xna-on-the-zune/</link>
		<comments>http://jonshern.com/2008/02/20/xna-on-the-zune/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 20:04:28 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/02/20/xna-on-the-zune/</guid>
		<description><![CDATA[Just heard the announcement.
XNA games on the zune by the end of the year.
I am so excited.
]]></description>
			<content:encoded><![CDATA[<p>Just heard the announcement.<br />
XNA games on the zune by the end of the year.</p>
<p>I am so excited.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/02/20/xna-on-the-zune/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How do you pass a pirate a message?</title>
		<link>http://jonshern.com/2008/02/11/how-do-you-pass-a-pirate-a-message/</link>
		<comments>http://jonshern.com/2008/02/11/how-do-you-pass-a-pirate-a-message/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 17:24:32 +0000</pubDate>
		<dc:creator>jonshern</dc:creator>
		
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jonshern.com/2008/02/11/how-do-you-pass-a-pirate-a-message/</guid>
		<description><![CDATA[Using the EventArgggggs.
]]></description>
			<content:encoded><![CDATA[<p>Using the EventArgggggs.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonshern.com/2008/02/11/how-do-you-pass-a-pirate-a-message/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
