<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DU8MSHo_eSp7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820</id><updated>2012-01-27T16:24:49.441+01:00</updated><category term="logging" /><category term="biztalk" /><category term="reflection" /><category term="mef" /><category term="tfs" /><category term="ironpython" /><category term="javascript" /><category term="bcl" /><category term="foglight" /><category term="wf" /><category term="serialization" /><category term="msbuild" /><category term="c#" /><category term="iphone" /><category term="asp.net ajax" /><category term="powershell" /><category term="xsl-fo" /><category term="python" /><category term="performance" /><category term="eclipse" /><category term="iOS" /><category term="mscrm" /><category term="wcf" /><category term="linux" /><category term="debug" /><category term="xml" /><category term="vs" /><category term="java" /><category term="windows 2008" /><category term="silverlight" /><category term="REST" /><category term="process" /><category term="patterns" /><category term="security" /><category term="esp/cep" /><category term="sqlite" /><category term="wix" /><category term="api design" /><category term="tibco" /><category term="concurrency" /><category term="sql server" /><category term="oracle" /><category term="versioning" /><category term="introspection" /><category term="android" /><category term="xcode" /><category term="enterprise library" /><category term="wpf" /><category term="bla-bla" /><category term="mac" /><category term="asp.net" /><category term="google engine" /><category term="testing" /><category term="ubuntu" /><category term="spring.net" /><category term="wetware" /><category term="w3c" /><category term="vista" /><category term="json" /><category term="taxican" /><title>Plain Old Stan</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://plainoldstan.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>180</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/PlainOldStan" /><feedburner:info uri="plainoldstan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DUUDQnk7eyp7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-1282168982527136584</id><published>2012-01-27T16:14:00.001+01:00</published><updated>2012-01-27T16:14:33.703+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-27T16:14:33.703+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="reflection" /><category scheme="http://www.blogger.com/atom/ns#" term="mscrm" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title>Removing Strong Name from .NET assembly</title><content type="html">&lt;p&gt;First in 10+ years of .net practice I had to solve removing the strong name from the assembly and recompiling it after the export with Reflector.&lt;/p&gt;  &lt;p&gt;The need for that was caused by customer’s extra security/audit requirements which could not be satisfied through a standard extensibility in MS CRM 3.0. And let us say MS CRM 3.0 is a very old lady now, so one can hardly expect year 2005 code to meet year 2012 security standards.&lt;/p&gt;  &lt;p&gt;I found two solutions over the web:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blog.fredrikhaglund.se/blog/2009/02/06/how-to-patchfixhack-someone-elses-assembly/" href="http://blog.fredrikhaglund.se/blog/2009/02/06/how-to-patchfixhack-someone-elses-assembly/"&gt;http://blog.fredrikhaglund.se/blog/2009/02/06/how-to-patchfixhack-someone-elses-assembly/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.codeproject.com/Articles/15374/Removing-Strong-Signing-from-assemblies-at-file-le" href="http://www.codeproject.com/Articles/15374/Removing-Strong-Signing-from-assemblies-at-file-le"&gt;http://www.codeproject.com/Articles/15374/Removing-Strong-Signing-from-assemblies-at-file-le&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I was happy I didn’t have to resort to a second one – quite heavier weight for what I needed. First one worked as a charm.&lt;/p&gt;  &lt;p&gt;By the way&amp;#160; I tried side by side latest .NET reflector from Red Gate with the last not expired version of original Reflector and should say that I didn’t notice any value added in Red Gate’s version. Nothing to advocate a sudden price tag and 1+ year of ownership, SHAME!&lt;/p&gt;  &lt;p&gt;As for decompile and recompile of a CRM assembly in question, just few issues I ran into:&lt;/p&gt;  &lt;p&gt;Compiler limit exceeded: Line cannot exceed 2046 characters (CS1034) - C:\CRM\PROJECTS\components.core\Microsoft\Crm\SystemCustomization\Security.cs:31,2046&lt;/p&gt;  &lt;p&gt;That was solved easily with splitting the line into several instructions.&lt;/p&gt;  &lt;p&gt;Microsoft.Crm.CalendarUtil:&lt;/p&gt;  &lt;p&gt;Operator '&amp;gt;=' cannot be applied to operands of type 'System.DayOfWeek' and 'int' (CS0019) - C:\CRM\PROJECTS\components.core\Microsoft\Crm\CalendarUtil.cs:157,17&lt;/p&gt;  &lt;p&gt;Corrected version of a method would look like (trick is in casting the enums to int):&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; DateTime GetFirstDayInCalendar(DateTime date)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    date = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DateTime(date.Year, date.Month, 1, 0, 0, 0);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; weekStartDayCode = OrganizationSettings.Current.WeekStartDayCode;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)date.DayOfWeek &amp;gt;= weekStartDayCode)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; date.AddDays((&lt;span style="color: #0000ff"&gt;double&lt;/span&gt;) (((&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)date.DayOfWeek - weekStartDayCode) * ~(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)DayOfWeek.Sunday));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; date.AddDays((&lt;span style="color: #0000ff"&gt;double&lt;/span&gt;) ((((&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)date.DayOfWeek + 7) - weekStartDayCode) * ~(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)DayOfWeek.Sunday));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And again, always something to learn! I was really puzzled with that tilda operator in front of DayOfWeek.Sunday so was glad to learn about it: &lt;a title="http://stackoverflow.com/questions/387424/what-is-the-tilde-in-a-c-sharp-enumeration" href="http://stackoverflow.com/questions/387424/what-is-the-tilde-in-a-c-sharp-enumeration"&gt;http://stackoverflow.com/questions/387424/what-is-the-tilde-in-a-c-sharp-enumeration&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is it. Hope my positive experience will ease your decisions once you stay in front of a similar task!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-1282168982527136584?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2eEaXDLJ7zHi-f_jBC_q1cw_UOc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2eEaXDLJ7zHi-f_jBC_q1cw_UOc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2eEaXDLJ7zHi-f_jBC_q1cw_UOc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2eEaXDLJ7zHi-f_jBC_q1cw_UOc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/rxpLD5Ilsoo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/1282168982527136584/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=1282168982527136584" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1282168982527136584?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1282168982527136584?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/rxpLD5Ilsoo/removing-strong-name-from-net-assembly.html" title="Removing Strong Name from .NET assembly" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2012/01/removing-strong-name-from-net-assembly.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUBRXwzeip7ImA9WhRSGU0.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-8742190437431110353</id><published>2011-11-21T20:20:00.001+01:00</published><updated>2011-11-21T20:20:54.282+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-21T20:20:54.282+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>iCloud – file backup with no UIDocument whistles. Part I.</title><content type="html">&lt;p&gt;I’m on a quest to add a backup feature to one of the iOS apps of mine (&lt;a href="http://itunes.apple.com/app/blocnote/id453015816?ls=1&amp;amp;mt=8"&gt;blocnote&lt;/a&gt;). App is only provided for iOS 5+ and my first option to use would be iCloud over Dropbox et al. I don’t want to use a UIDocument as well, as here it is only about simple file backup, no intent to keep this file in sync.&lt;/p&gt;  &lt;p&gt;After reading what I could (as Apple docs on iCloud can’t really be taken as a good reference):&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.raywenderlich.com/6015/beginning-icloud-in-ios-5-tutorial-part-1" href="http://www.raywenderlich.com/6015/beginning-icloud-in-ios-5-tutorial-part-1"&gt;http://www.raywenderlich.com/6015/beginning-icloud-in-ios-5-tutorial-part-1&lt;/a&gt;    &lt;br /&gt;&lt;a title="http://www.raywenderlich.com/6031/beginning-icloud-in-ios-5-tutorial-part-2" href="http://www.raywenderlich.com/6031/beginning-icloud-in-ios-5-tutorial-part-2"&gt;http://www.raywenderlich.com/6031/beginning-icloud-in-ios-5-tutorial-part-2&lt;/a&gt;    &lt;br /&gt;&lt;a title="http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample" href="http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample"&gt;http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;First stop would be to satisfy a requirement to create a single backup file from a sqlite db and put into the iCloud.&lt;/p&gt;  &lt;p&gt;Providing some very raw bits of code here, only building proof of concept at this stage!&lt;/p&gt;  &lt;p&gt;Checking for a iCloud availability:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;+ (&lt;span class="kwrd"&gt;bool&lt;/span&gt;) isiCloudAvailable&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSURL *ubiq = [[NSFileManager defaultManager] &lt;/pre&gt;

  &lt;pre&gt;                   URLForUbiquityContainerIdentifier:nil];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (ubiq) {&lt;/pre&gt;

  &lt;pre&gt;        NSLog(&lt;span class="str"&gt;@&amp;quot;iCloud access at %@&amp;quot;&lt;/span&gt;, ubiq);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;    } &lt;span class="kwrd"&gt;else&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        NSLog(&lt;span class="str"&gt;@&amp;quot;No iCloud access&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Getting db file copied inside the same documents directory:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;NSString *bName = [NSString stringWithFormat:&lt;span class="str"&gt;@&amp;quot;%@_%@%@&amp;quot;&lt;/span&gt;,backupName,[Formatter dateToBackupNameString:[NSDate date]],&lt;span class="str"&gt;@&amp;quot;.db&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSArray *searchPaths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);&lt;/pre&gt;

  &lt;pre&gt;    NSString *documentFolderPath = [searchPaths objectAtIndex: 0];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    NSString *backupPath = [documentFolderPath stringByAppendingPathComponent:bName];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSURL *backupUrl = [NSURL URLWithString:backupPath];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSError *copyError = nil;&lt;/pre&gt;

  &lt;pre&gt;    NSError *removeBckError = nil;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; ([[NSFileManager defaultManager] fileExistsAtPath:backupPath]) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;bool&lt;/span&gt; success = [[NSFileManager defaultManager] removeItemAtPath: backupPath error:&amp;amp;removeBckError];&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!success) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            NSLog(&lt;span class="str"&gt;@&amp;quot;Bck cleanup error: %@&amp;quot;&lt;/span&gt;, [removeBckError localizedDescription]);&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;    BOOL copiedBackupDb = [[NSFileManager defaultManager] copyItemAtPath:dbFilePath toPath:backupPath error:&amp;amp;copyError];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!copiedBackupDb)&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        NSLog(&lt;span class="str"&gt;@&amp;quot;bck db copy error: %@&amp;quot;&lt;/span&gt;, [copyError localizedDescription]);&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; NO;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;And moving a copy to iCloud:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;    NSFileManager*  fm = [NSFileManager defaultManager];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSURL *ubiq = [[NSFileManager defaultManager] &lt;/pre&gt;

  &lt;pre&gt;                   URLForUbiquityContainerIdentifier:nil];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (ubiq == nil) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; NO;&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    NSError *theError = nil;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    [fm setUbiquitous:&lt;span class="kwrd"&gt;true&lt;/span&gt; itemAtURL:backupUrl destinationURL:[[ubiq URLByAppendingPathComponent:&lt;span class="str"&gt;@&amp;quot;Documents&amp;quot;&lt;/span&gt; isDirectory:&lt;span class="kwrd"&gt;true&lt;/span&gt;] URLByAppendingPathComponent:bName] error:&amp;amp;theError];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (theError != nil) {&lt;/pre&gt;

  &lt;pre&gt;        NSLog(&lt;span class="str"&gt;@&amp;quot;iCloud error: %@&amp;quot;&lt;/span&gt;, [theError localizedDescription]);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Note that apple docs say you should not be using setUbiquitous on the main thread to avoid deadlocks. Plus there is no indication of progress is provided by this code yet to user. That will come…&lt;/p&gt;

&lt;p&gt;Attention should be paid where exactly you move your file in iCloud. Without that destinationURL:[[ubiq URLByAppendingPathComponent:&lt;span class="str"&gt;@&amp;quot;Documents&amp;quot;&lt;/span&gt; isDirectory:&lt;span class="kwrd"&gt;true&lt;/span&gt;] URLByAppendingPathComponent:bName] your file will end up in the common app documents&amp;amp;data container and user will have no ability to delete a separate backup file:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-4TC5EbADf6s/Tsqki6f1noI/AAAAAAAAA8c/exAEEp_FVcA/s1600-h/image%25255B2%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-ni489F7Mjbk/TsqkjkpUvJI/AAAAAAAAA8g/eaTEFJXgEgc/image_thumb.png?imgmax=800" width="244" height="153" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;When put inside Documents in iCloud, files can be seen like:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/--d0ccKsBVUs/TsqkkdEeTHI/AAAAAAAAA8o/NLs5c4IEQe0/s1600-h/image%25255B5%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-KImn4Ukj800/TsqklORC9pI/AAAAAAAAA8w/XCGzwQec784/image_thumb%25255B1%25255D.png?imgmax=800" width="244" height="238" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And can be deleted by user out of iCloud nicely one by one.&lt;/p&gt;

&lt;p&gt;This is it for today’s part, going for more exploration and will share as it goes.&lt;/p&gt;

&lt;p&gt;Yours, Stan.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-8742190437431110353?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qapkWTksVwGaf1hsVYr8o0QNUBs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qapkWTksVwGaf1hsVYr8o0QNUBs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qapkWTksVwGaf1hsVYr8o0QNUBs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qapkWTksVwGaf1hsVYr8o0QNUBs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/eoEMvEPtMbA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/8742190437431110353/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=8742190437431110353" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8742190437431110353?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8742190437431110353?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/eoEMvEPtMbA/im-on-quest-to-add-backup-feature-to.html" title="iCloud – file backup with no UIDocument whistles. Part I." /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-ni489F7Mjbk/TsqkjkpUvJI/AAAAAAAAA8g/eaTEFJXgEgc/s72-c/image_thumb.png?imgmax=800" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/11/im-on-quest-to-add-backup-feature-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8ERns9eyp7ImA9WhdbFEQ.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-2342114512799836423</id><published>2011-09-30T13:03:00.001+02:00</published><updated>2011-10-13T10:00:07.563+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-13T10:00:07.563+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mscrm" /><title>MSCRM – User privileges/access rights “report” script</title><content type="html">&lt;p&gt;This is again about MSCRM 3.0 and not sure that would be the same with higher versions. Without further ado, here it is:&lt;/p&gt;  &lt;p&gt;A script corresponds to the scenario/constraints I currently face, so in your case you might need to tweak it.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;select&lt;/span&gt; &lt;span style="color: #0000ff"&gt;distinct&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #006080"&gt;'Right'&lt;/span&gt; = &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Read'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 2 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Write'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 4 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Append'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 16 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Append To'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 32 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Create'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 65536 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Delete'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 262144 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Share'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; pb.AccessRight = 524288 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Assign'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;end&lt;/span&gt;, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; rb.Name, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #006080"&gt;'Scope'&lt;/span&gt; = &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Own Only'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 2 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Business Unit'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 4 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Parent-&amp;gt;Child'&lt;/span&gt;        &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 8 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Organization'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 16 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Own Only - Inherited'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 32 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Business Unit - Inherited'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 64 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Parent-&amp;gt;Child - Inherited'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; rp.PrivilegeDepthMask = 128 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'Organization - Inherited'&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;ELSE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;cast&lt;/span&gt;(rp.PrivilegeDepthMask &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(10))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;end&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    pb.Name&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    --rp.PrivilegeDepthMask, pb.AccessRight, bub.Name --,*&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;from&lt;/span&gt; PrivilegeBase pb&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;join&lt;/span&gt; RolePrivileges rp &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; rp.PrivilegeId = pb.PrivilegeId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;join&lt;/span&gt; RoleBase rb &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; rb.RoleId = rp.RoleId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;join&lt;/span&gt; BusinessUnitBase bub &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; bub.BusinessUnitId = rb.BusinessUnitId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; pb.Name &lt;span style="color: #0000ff"&gt;like&lt;/span&gt; &lt;span style="color: #006080"&gt;'%activity'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;and&lt;/span&gt; rp.PrivilegeDepthMask &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (16, 32, 64, 128)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;order&lt;/span&gt; &lt;span style="color: #0000ff"&gt;by&lt;/span&gt; pb.Name, rb.Name --, bub.Name&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Few notes.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;PrivilegeDepthMask of 16 and 128 is x*2^4, what happens (as I believe) when privilege is inherited from the organization level role to a business unit (I might be wrong, better verify yourself :). In my case inherited privileges are always the same, that’s why that rp.PrivilegeDepthMask &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (16, 128) at the end. I also filter by entity name in a hacky way, you might want to join entities table/view in your case.&lt;/p&gt;

&lt;p&gt;This is it.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Links: 
  &lt;br /&gt;&lt;a title="http://mscrmking.blogspot.com/2010/10/explination-of-accessright-and.html" href="http://mscrmking.blogspot.com/2010/10/explination-of-accessright-and.html"&gt;http://mscrmking.blogspot.com/2010/10/explination-of-accessright-and.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;[Update: 13-Oct-2011, script updated with parent to child scenarios]&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-2342114512799836423?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pwNhpf-HU45vTTbx1bUKm5rDVik/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pwNhpf-HU45vTTbx1bUKm5rDVik/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pwNhpf-HU45vTTbx1bUKm5rDVik/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pwNhpf-HU45vTTbx1bUKm5rDVik/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/fCaVJqQGYTY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/2342114512799836423/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=2342114512799836423" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/2342114512799836423?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/2342114512799836423?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/fCaVJqQGYTY/mscrm-user-privilegesaccess-rights.html" title="MSCRM – User privileges/access rights “report” script" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/09/mscrm-user-privilegesaccess-rights.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AHRnY4eip7ImA9WhdWE04.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-1507104785612294814</id><published>2011-09-06T19:55:00.001+02:00</published><updated>2011-09-06T19:55:37.832+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T19:55:37.832+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><title>When two same java strings are not equal</title><content type="html">&lt;p&gt;This is not about == vs. equals. This is not about encoding (almost). Explain this!!!:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-LuIwcFNzp-o/TmZelWG6MeI/AAAAAAAAA7Q/syykJinx7cI/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-6zACF4oHPw8/TmZemOzoQkI/AAAAAAAAA7U/YLi7wI1REk8/image_thumb%25255B1%25255D.png?imgmax=800" width="497" height="304" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is a quiz I’ve solved by banging my head for a long hour! Solution to my and Eclipses stupidity to be published separately :).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-1507104785612294814?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2pH3SQgfZpc0OOOhAACeMUN2P_A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2pH3SQgfZpc0OOOhAACeMUN2P_A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2pH3SQgfZpc0OOOhAACeMUN2P_A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2pH3SQgfZpc0OOOhAACeMUN2P_A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/aWy8BuZI5wk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/1507104785612294814/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=1507104785612294814" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1507104785612294814?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1507104785612294814?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/aWy8BuZI5wk/when-two-same-java-strings-are-not.html" title="When two same java strings are not equal" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-6zACF4oHPw8/TmZemOzoQkI/AAAAAAAAA7U/YLi7wI1REk8/s72-c/image_thumb%25255B1%25255D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/09/when-two-same-java-strings-are-not.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkANRXwzeip7ImA9WhdXGE0.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-8209344971412616850</id><published>2011-08-31T16:26:00.001+02:00</published><updated>2011-08-31T16:26:34.282+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T16:26:34.282+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mscrm" /><title>MSCRM – Relationships review helper script</title><content type="html">&lt;p&gt;Here is a tiny sample script to see all MS CRM relationships in one place and with nice attribute/entities names:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt;    r.Name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &amp;quot;RefName&amp;quot;, e1.Name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &amp;quot;fromEntity&amp;quot;, a1.Name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &amp;quot;fromAttr&amp;quot;, e2.Name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &amp;quot;toEntity&amp;quot;, a2.Name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &amp;quot;toAttr&amp;quot;, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        r.RelationshipType, r.IsLogical, r.CascadeDelete, r.CascadeAssign, r.CascadeShare,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        r.IsCustomRelationship&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt;  [dbo].[Relationship] r&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt;  [dbo].[Entity] e1 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; e1.EntityId = r.ReferencingEntityId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; [dbo].[Entity] e2 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; e2.EntityId = r.ReferencedEntityId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; dbo.Attribute a1 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; r.ReferencingAttributeId = a1.AttributeId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; dbo.Attribute a2 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; r.ReferencedAttributeId = a2.AttributeId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; e1.EntityId &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; EntityId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[Entity]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; Name &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            (&lt;span style="color: #006080"&gt;'Lead'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'V2_contract'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'Account'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'Email'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'V2_incidenthistory'&lt;/span&gt;, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #006080"&gt;'SystemUserLicenses'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'QuoteClose'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'BulkOperation'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'V2_technicalspec'&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            e2.EntityId &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; EntityId&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[Entity]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; Name &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            (&lt;span style="color: #006080"&gt;'Lead'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'V2_contract'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'Account'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'Email'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'V2_incidenthistory'&lt;/span&gt;, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #006080"&gt;'SystemUserLicenses'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'QuoteClose'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'BulkOperation'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'V2_technicalspec'&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &amp;quot;fromEntity&amp;quot;, &amp;quot;fromAttr&amp;quot;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Change the entity names in the filter to what you need or delete it altogether. To be executed on the MSCRM metabase DB. Hope might save someone a minute :).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-8209344971412616850?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KTnv2LxWRXWOEr3G_zWAZo8MkSg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KTnv2LxWRXWOEr3G_zWAZo8MkSg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KTnv2LxWRXWOEr3G_zWAZo8MkSg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KTnv2LxWRXWOEr3G_zWAZo8MkSg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/DfTevEQeiD8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/8209344971412616850/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=8209344971412616850" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8209344971412616850?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8209344971412616850?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/DfTevEQeiD8/mscrm-relationships-review-helper.html" title="MSCRM – Relationships review helper script" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/08/mscrm-relationships-review-helper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cEQXcyeip7ImA9WhdXFUk.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-728286973558848089</id><published>2011-08-28T17:23:00.001+02:00</published><updated>2011-08-28T17:23:20.992+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-28T17:23:20.992+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xcode" /><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><title>On GPX files for Xcode 4.2</title><content type="html">&lt;p&gt;I totally enjoy the new location testing features of xcode 4.2. Ability to test with any fake location is really a blessing! Today I saw that the app is not working right in one of the locations (it works poorly in few of them, but I’m fixing intensively :)). That was South Brisbane, and my first chance to add a custom location.&lt;/p&gt;  &lt;p&gt;After thinking for a while what would be the minimum data for a file required I actually found out that Xcode is capable of adding a minimalistic template for a start!:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-EE5_JK5akqE/TlpdYbNprwI/AAAAAAAAA6s/VliRAY35nDM/s1600-h/image3.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-nFh9d9oVzcI/TlpdZPcicVI/AAAAAAAAA6w/IH_IaeE7wkE/image_thumb1.png?imgmax=800" width="314" height="280" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That is what a file looks like:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt;?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;gpx&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1.1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;creator&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Xcode&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;wpt&lt;/span&gt; &lt;span class="attr"&gt;lat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;49.930008&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;lon&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;15.369873&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;         &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;South Brisbane, AU&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;wpt&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;gpx&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Name the file nicely as its name is used when you pick it up:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-LD3N5nTB5BU/TlpdZnveuZI/AAAAAAAAA60/elyj1ZLA7dM/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-xxO09Kh248s/TlpdaMmIKHI/AAAAAAAAA64/2-T8VuyjDr8/image_thumb.png?imgmax=800" width="244" height="219" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;p&gt;GPX specification: &lt;a title="http://www.topografix.com/gpx.asp" href="http://www.topografix.com/gpx.asp"&gt;http://www.topografix.com/gpx.asp&lt;/a&gt;

  &lt;br /&gt;Google Maps 2 GPX: &lt;a title="http://www.elsewhere.org/journal/gmaptogpx/" href="http://www.elsewhere.org/journal/gmaptogpx/"&gt;http://www.elsewhere.org/journal/gmaptogpx/&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-728286973558848089?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MOmmIR9PG1gWFyvNO135O_ZMMBk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MOmmIR9PG1gWFyvNO135O_ZMMBk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MOmmIR9PG1gWFyvNO135O_ZMMBk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MOmmIR9PG1gWFyvNO135O_ZMMBk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/BZEeIIIc-bc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/728286973558848089/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=728286973558848089" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/728286973558848089?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/728286973558848089?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/BZEeIIIc-bc/on-gpx-files-for-xcode-42.html" title="On GPX files for Xcode 4.2" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-nFh9d9oVzcI/TlpdZPcicVI/AAAAAAAAA6w/IH_IaeE7wkE/s72-c/image_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/08/on-gpx-files-for-xcode-42.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEERnYyfip7ImA9WhdXFUk.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-7754187259081731935</id><published>2011-08-28T16:10:00.001+02:00</published><updated>2011-08-28T16:10:07.896+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-28T16:10:07.896+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mac" /><title>VirtualBox vs. Parallels on MacOSx</title><content type="html">&lt;p&gt;This is just a short note to share my witness on the fact that VirtualBox on MacOSx works just alright. I quite regret I paid an extra for Parallels when I bought my Macbook Pro. As time went I had to uninstall or disable all of the whistles that Parallels had (like coherence and application shortcuts) as they were eating the battery, disabling the sleep and all the other stuff. And every time I had to investigate who and why, while getting only happy marketing emails from them. Never – “we found a problem because of OSX.XYZ update, please react/upgrade …”.&lt;/p&gt;  &lt;p&gt;Never mind, I hope my note will help you if you are picking the VM platform for your mac. Give VirtualBox at least a try, its painless, free, can pickup almost any hd format (except for parallels of course, but you can convert …) and runs on almost any OS platform you can think of.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-CG_1r_TyrTY/TlpMORuvVEI/AAAAAAAAA6k/Mo8QI2M6BdA/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-XImvFQwjWAw/TlpMPiY_xzI/AAAAAAAAA6o/P-zS0IGXwRo/image_thumb%25255B1%25255D.png?imgmax=800" width="513" height="361" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;links:&lt;/p&gt;  &lt;p&gt;Download:&lt;a title="http://www.virtualbox.org/wiki/Downloads" href="http://www.virtualbox.org/wiki/Downloads"&gt;http://www.virtualbox.org/wiki/Downloads&lt;/a&gt;    &lt;br /&gt;Converting parallels hd: &lt;a title="http://benfrain.com/notepad/2009/03/osx-converting-parallels-or-vmware-to.html" href="http://benfrain.com/notepad/2009/03/osx-converting-parallels-or-vmware-to.html"&gt;http://benfrain.com/notepad/2009/03/osx-converting-parallels-or-vmware-to.html&lt;/a&gt; (be sure to read comments as well if you are converting). Myself I just used the winxp vm I had for ages running under MS VM.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-7754187259081731935?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/o7J6UvAmXfoSIphIq8lEYxwI0OM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o7J6UvAmXfoSIphIq8lEYxwI0OM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/o7J6UvAmXfoSIphIq8lEYxwI0OM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/o7J6UvAmXfoSIphIq8lEYxwI0OM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/ChSOCSuvyRk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/7754187259081731935/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=7754187259081731935" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7754187259081731935?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7754187259081731935?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/ChSOCSuvyRk/virtualbox-vs-parallels-on-macosx.html" title="VirtualBox vs. Parallels on MacOSx" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-XImvFQwjWAw/TlpMPiY_xzI/AAAAAAAAA6o/P-zS0IGXwRo/s72-c/image_thumb%25255B1%25255D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/08/virtualbox-vs-parallels-on-macosx.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcDSX44eyp7ImA9WhdQFUU.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-7680680878237361423</id><published>2011-08-17T14:11:00.001+02:00</published><updated>2011-08-17T14:11:18.033+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-17T14:11:18.033+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="google engine" /><category scheme="http://www.blogger.com/atom/ns#" term="taxican" /><title>Google App Engine – JDO/Datastore optimization attempts</title><content type="html">&lt;p&gt;So here I’m, with google app engine starting to give me DeadlineExceededException. I don’t deserve it :)! The servlet under investigation normally runs within 1.5s which is quite long I agree, but as the app is not getting any amount of traffic right now, I told myself that I’m not going to be over quota, and will not optimize anything speculatively.&lt;/p&gt;  &lt;p&gt;Anyway, my first naive attempt was just to put that Quota service in action to measure better:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; QuotaService qs = QuotaServiceFactory.getQuotaService();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;long&lt;/span&gt; start = qs.getCpuTimeInMegaCycles();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; ....&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;long&lt;/span&gt; end = qs.getCpuTimeInMegaCycles();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; cpuSeconds = qs.convertMegacyclesToCpuSeconds(end - start);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; resp.setHeader(&lt;span style="color: #006080"&gt;&amp;quot;gaecost&amp;quot;&lt;/span&gt;, String.valueOf(cpuSeconds));&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Need to say, it doesn’t actually work with local jetty server, and what more it shows when in cloud something that is already available in the Log as cpu_ms consumption, etc. It lets you measure with higher granularity, but hardly worth an effort given we have the excellent goodie from google – &lt;strong&gt;Appstats&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;The official url for it is: &lt;a title="http://code.google.com/appengine/docs/java/tools/appstats.html" href="http://code.google.com/appengine/docs/java/tools/appstats.html"&gt;http://code.google.com/appengine/docs/java/tools/appstats.html&lt;/a&gt;. And good one to read is: &lt;a title="http://googleappengine.blogspot.com/2010/03/easy-performance-profiling-with.html" href="http://googleappengine.blogspot.com/2010/03/easy-performance-profiling-with.html"&gt;http://googleappengine.blogspot.com/2010/03/easy-performance-profiling-with.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that installed and running, we can access the profiling page (per what is configured above):&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-v5avDvjIocQ/TkqfskIlD5I/AAAAAAAAA40/CvQp_SG9BBo/s1600-h/image%25255B4%25255D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-W1-Otif3PE8/TkqfwQGkqeI/AAAAAAAAA44/Ev2rII4o0Mw/image_thumb%25255B2%25255D.png?imgmax=800" width="485" height="378" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We can see those RunQuery with following datastore_v3.Next causing extra overhead. The profile url for a request can be found either from looking at firebug response headers:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-kwM-mpFmBHY/Tkqf4z6yzoI/AAAAAAAAA48/PdTFGLX0tp8/s1600-h/image%25255B32%25255D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-2mWFoVmEGfY/Tkqf9zJbf7I/AAAAAAAAA5A/0SOazA6_JkY/image_thumb%25255B18%25255D.png?imgmax=800" width="502" height="107" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Or when you run locally, in eclipse console:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-3G3VKLLlOmU/TkqhLTepQ2I/AAAAAAAAA5E/mnpOA-uKCeM/s1600-h/image%25255B8%25255D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-Hop3L-LwZZg/TkqjpaCkT4I/AAAAAAAAA5g/lbRlr6NUYlo/image_thumb%25255B4%25255D.png?imgmax=800" width="499" height="82" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I first thought that probably I can change the batch size of a fetch and got to this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Extent&amp;lt;City&amp;gt; extent = pm.getExtent(City.&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;, false);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;extent.getFetchPlan().setFetchSize(FetchPlan.FETCH_SIZE_GREEDY); &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;But, that didn’t work for me… It was happily doing .Next as it did before. I found then on stackoverflow that it is not supported on gae, dooh! Makes some logic though …&lt;/p&gt;

&lt;p&gt;Ok, anyway, I deployed and tried the whole profiling setup in the cloud. Here is what it looked like there:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-qsJB8BTi6-E/Tkqjte7wNRI/AAAAAAAAA5k/E1kKpaAeU1k/s1600-h/image%25255B17%25255D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-63iv-kNootw/Tkqj3JUepYI/AAAAAAAAA5o/PwDjTMBSBaU/image_thumb%25255B9%25255D.png?imgmax=800" width="524" height="129" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Hmmm, actually “my” work in blue is only a tiny fraction of those “API” calls to a datastore! I need to get rid of all of those calls at best :).&lt;/p&gt;

&lt;p&gt;Memcache or JDO cache? My first stop was Datanucleus cache, here is the url for how to “install”: &lt;a title="http://ukena.de/content/enabling-jdo-caching-google-app-engine" href="http://ukena.de/content/enabling-jdo-caching-google-app-engine"&gt;http://ukena.de/content/enabling-jdo-caching-google-app-engine&lt;/a&gt;. And as I’m a complete java novice, I had to read this to make the entities required serializable: &lt;a title="http://java.sun.com/developer/technicalArticles/Programming/serialization/" href="http://java.sun.com/developer/technicalArticles/Programming/serialization/"&gt;http://java.sun.com/developer/technicalArticles/Programming/serialization/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After verifying it works locally, I deployed, and here is the bottom of the profiling graph (all profiling data provided are after first few requests!), as overall there were hundreds of calls to memcache:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-mMaLka_H-qg/Tkqkznoa4oI/AAAAAAAAA5w/7yuNXtVVPq0/s1600-h/image%25255B22%25255D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-5XGe_ZI3zDc/TkqmB7Ls03I/AAAAAAAAA58/9zBeJyNv4Zk/image_thumb%25255B12%25255D.png?imgmax=800" width="535" height="205" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;With in-response profiling data looking as:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-e0ZGjHcz8lg/TkqmDyKlM8I/AAAAAAAAA6A/RCkncLr_fHg/s1600-h/image%25255B26%25255D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-XrO-zOLYuHQ/Tkuv2Z6ADnI/AAAAAAAAA6E/dC6PF0bGonQ/image_thumb14.png?imgmax=800" width="388" height="92" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Hmmm, without caching on JDO level I used to have that (again, both after few first requests):&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-n7Umo8hm7Bg/Tkuv2u3choI/AAAAAAAAA6I/9VkYiRep-p4/s1600-h/image31.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-zzthJtQfvYg/Tkuv3iVaTSI/AAAAAAAAA6M/PKOl6AWL2R0/image_thumb17.png?imgmax=800" width="399" height="113" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So, it actually got worse! Still there is a question why those .Next are there even when cache is surely in place?!&lt;/p&gt;

&lt;p&gt;Next stop then, would be a memcached. Again, not expecting a miracle with that, but here is my target:&lt;/p&gt;

&lt;p&gt;- Based onto all that data in datastore I just calculate some expanded stats, a Coverage object with few fields and lists. So I can just cache this target object and this is it, I don’t need granular datastore records to be cached. That is how I expect really to avoid a lot of overhead.&lt;/p&gt;

&lt;p&gt;So, here is the updated piece (and I learned the outside api is JCache actually):&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Cache cache = null;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;List&amp;lt;Coverage&amp;gt; covs = null;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;try&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    CacheFactory cacheFactory = CacheManager.getInstance()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            .getCacheFactory();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    cache = cacheFactory.createCache(Collections.emptyMap());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    covs = (List&amp;lt;Coverage&amp;gt;) cache.get(&lt;span style="color: #006080"&gt;&amp;quot;coverage&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;} &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (CacheException e) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #008000"&gt;// ...&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (covs != null) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    completeRequest(req, resp, qs, start, out, covs);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// ... Initialize coverages from datastore&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// When at the end, put coverages into cache and return the response&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (cache != null) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    cache.put(&lt;span style="color: #006080"&gt;&amp;quot;coverage&amp;quot;&lt;/span&gt;, covs);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;completeRequest(req, resp, qs, start, out, covs);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;So how it looks now in local profile page?:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-ci2f-oqfefc/Tkuv4NM5QOI/AAAAAAAAA6Q/Ggt0hr4Tnd4/s1600-h/image37.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-5c-vqMBlH7c/Tkuv4QVI9LI/AAAAAAAAA6U/jX7cW6SVbJY/image_thumb21.png?imgmax=800" width="498" height="77" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As expected! And in the cloud:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh3.ggpht.com/-GMgnvDL_dlo/Tkuv48JI5xI/AAAAAAAAA6Y/DhabyrBaRcc/s1600-h/image47.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-0wzBpk1R1aE/Tkuv5P0o7gI/AAAAAAAAA6c/cFLKIWfQrHY/image_thumb29.png?imgmax=800" width="527" height="88" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is it! As that “coverage” of mine is only changing rarely (once a day, on a manual batch update basis), my plan for it will be to make it a datastore entity itself, re-calculated once a day. So, memcaching workaround will serve for now. &lt;/p&gt;

&lt;p&gt;I should tell I didn’t win on any of the JDO/Datastore optimization points. I really did expect the datastore to be faster though!&lt;/p&gt;

&lt;p&gt;At the end – a fresh critic’s view on gae performance and reliability: &lt;a title="http://3.14.by/en/read/why-google-appengine-sucks" href="http://3.14.by/en/read/why-google-appengine-sucks"&gt;http://3.14.by/en/read/why-google-appengine-sucks&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-7680680878237361423?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tcx_AzaAcgRf5SEZdGT_lbrO46s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tcx_AzaAcgRf5SEZdGT_lbrO46s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tcx_AzaAcgRf5SEZdGT_lbrO46s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tcx_AzaAcgRf5SEZdGT_lbrO46s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/TWFNJ3VNZNU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/7680680878237361423/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=7680680878237361423" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7680680878237361423?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7680680878237361423?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/TWFNJ3VNZNU/google-app-engine-jdodatastore.html" title="Google App Engine – JDO/Datastore optimization attempts" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-W1-Otif3PE8/TkqfwQGkqeI/AAAAAAAAA44/Ev2rII4o0Mw/s72-c/image_thumb%25255B2%25255D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/08/google-app-engine-jdodatastore.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIBR384eyp7ImA9WhdRGUo.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-8935128865788678236</id><published>2011-08-10T13:09:00.001+02:00</published><updated>2011-08-10T13:09:16.133+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-10T13:09:16.133+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mscrm" /><title>MS CRM IFrame request parameters – the look and helper code</title><content type="html">&lt;p&gt;Providing for the joy of sharing itself. This is for MS CRM 3.0 and I hope no one really works with it now except for myself :). This is what is being sent when you check the box to send the type and entity id:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-w7PKZSLWt6M/TkJm2Y-h83I/AAAAAAAAA4o/D6XO_Q1cCDk/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-Pk1WIU1uV0g/TkJm24HZhtI/AAAAAAAAA4s/NpgawwHMrwo/image_thumb%25255B1%25255D.png?imgmax=800" width="283" height="170" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And here goes the helper code (client-side only) for it:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;debug&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;amp;'); for (var i = 0; i &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt; hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     var urlVars = getUrlVars()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     for (rp in urlVars) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         $('#debug').append(rp + &amp;quot;:&amp;quot; + urlVars[rp] + &amp;quot;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;br&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&amp;quot;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Yours, Stan.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-8935128865788678236?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/w5m_TtKfFw9crz3j6qWUeLdBFfQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w5m_TtKfFw9crz3j6qWUeLdBFfQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/w5m_TtKfFw9crz3j6qWUeLdBFfQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w5m_TtKfFw9crz3j6qWUeLdBFfQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/txoXJOb14i0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/8935128865788678236/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=8935128865788678236" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8935128865788678236?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8935128865788678236?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/txoXJOb14i0/ms-crm-iframe-request-parameters-look.html" title="MS CRM IFrame request parameters – the look and helper code" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-Pk1WIU1uV0g/TkJm24HZhtI/AAAAAAAAA4s/NpgawwHMrwo/s72-c/image_thumb%25255B1%25255D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/08/ms-crm-iframe-request-parameters-look.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QCQn46fCp7ImA9WhdRGU0.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-5583479019302414293</id><published>2011-08-09T19:02:00.001+02:00</published><updated>2011-08-09T19:02:43.014+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-09T19:02:43.014+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="google engine" /><category scheme="http://www.blogger.com/atom/ns#" term="taxican" /><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>iPhone + Google App Engine + Plain Old Stan =&gt; Taxican. Part I.</title><content type="html">&lt;p&gt;I was lucky a week ago with Apple approving my first “reference” app to the app store. I thought I’d share the architecture and some specific design choices I applied for this app.&lt;/p&gt;  &lt;p&gt;App itself serves for booking a taxi. There are quite few apps doing this on the app market, though I believe this one should expand on options beyond just simple google based directory.&lt;/p&gt;  &lt;p&gt;Here goes a high level and quite simplified diagram:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-zk8jjOGTTiM/TkFoLzg7gcI/AAAAAAAAA4g/FIZK8akWU5o/s1600-h/image4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-HAs5-NtI57Q/TkFoMtQ7iLI/AAAAAAAAA4k/P16M9Iq6zUo/image_thumb2.png?imgmax=800" width="447" height="328" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Today, I only want to touch on API’s used and set a basis for future entries.&lt;/p&gt;  &lt;p&gt;In order to find taxi companies when I don’t have a match in on-device db I used google local search api. I recommend to play with a playground page first: &lt;a href="http://code.google.com/apis/ajax/playground/"&gt;http://code.google.com/apis/ajax/playground/&lt;/a&gt;. Example of a sample request and response can be found here: &lt;a title="http://code.google.com/p/toolsdotnet/wiki/GoogleApi" href="http://code.google.com/p/toolsdotnet/wiki/GoogleApi"&gt;http://code.google.com/p/toolsdotnet/wiki/GoogleApi&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Then for a situation when gps accuracy may be low, or you want taxi to pick you up at the bar where you are for example, I decided to integrate &lt;a href="http://www.foursquare.com"&gt;foursquare&lt;/a&gt;. So you can see the list of places “near” you and pick the right one as your pickup address. This API is named a “venues search” in Foursquare, and I aggregated some info I used here: &lt;a title="http://code.google.com/p/toolsdotnet/wiki/Foursquare" href="http://code.google.com/p/toolsdotnet/wiki/Foursquare"&gt;http://code.google.com/p/toolsdotnet/wiki/Foursquare&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This is it for today. If you are curious, and reading this article fresh :), then app should be still free here: &lt;a title="http://itunes.apple.com/app/taxican/id440230968?ls=1&amp;amp;mt=8" href="http://itunes.apple.com/app/taxican/id440230968?ls=1&amp;amp;mt=8"&gt;http://itunes.apple.com/app/taxican/id440230968?ls=1&amp;amp;mt=8&lt;/a&gt;, with supporting web site: &lt;a href="http://www.taxican.com"&gt;http://www.taxican.com&lt;/a&gt;. Still work in progress, excuse the mess :)… If you like the thing, you can give it your facebook like on the web site, as …&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;…&lt;/em&gt;&lt;/strong&gt;, on the power of social media. Friend of mine told me today the customer didn’t consider his app/business worth consideration/solid because it didn’t have even 1k likes on a facebook! Ouuuch!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-5583479019302414293?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QrKmh_y9KamozJhgFI6BI-rwjDM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QrKmh_y9KamozJhgFI6BI-rwjDM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QrKmh_y9KamozJhgFI6BI-rwjDM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QrKmh_y9KamozJhgFI6BI-rwjDM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/Toq6JWhnxzA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/5583479019302414293/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=5583479019302414293" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/5583479019302414293?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/5583479019302414293?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/Toq6JWhnxzA/iphone-google-app-engine-plain-old-stan.html" title="iPhone + Google App Engine + Plain Old Stan =&amp;gt; Taxican. Part I." /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-HAs5-NtI57Q/TkFoMtQ7iLI/AAAAAAAAA4k/P16M9Iq6zUo/s72-c/image_thumb2.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/08/iphone-google-app-engine-plain-old-stan.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMMQ3g-eCp7ImA9WhdREE4.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-6060660634396311932</id><published>2011-07-30T15:38:00.009+02:00</published><updated>2011-07-30T16:01:22.650+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-30T16:01:22.650+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>iOS Universal App with “Twitter’s” stacked scrollview</title><content type="html">For my next iOS project I want an effect that is akin to Twitter’s stacked scroll panels on iPad. It is not going to be exactly the same and should suit both iPad and iPhone screens. 
&lt;br/&gt;&lt;br/&gt;First step was to find something to speed up the way to the Universal app. For myself I found the best starting point here: &lt;a href="http://blog.corywiles.com/creating-a-universal-ios-app-tutorial"&gt;&lt;span class="s1"&gt;http://blog.corywiles.com/creating-a-universal-ios-app-tutorial&lt;/span&gt;&lt;/a&gt;. Make sure you don’t overlook a link to the git repo: &lt;a href="https://github.com/kwylez/Universal-iOS-App-Template"&gt;&lt;span class="s1"&gt;https://github.com/kwylez/Universal-iOS-App-Template&lt;/span&gt;&lt;/a&gt;.

&lt;br/&gt;&lt;br/&gt;Then for the stacked scroll view a quick search led to the work of &lt;a href="http://www.raweng.com/"&gt;&lt;span class="s1"&gt;http://www.raweng.com/&lt;/span&gt;&lt;/a&gt; team with repo here: &lt;a href="https://github.com/Reefaq/StackScrollView"&gt;&lt;span class="s1"&gt;https://github.com/Reefaq/StackScrollView&lt;/span&gt;&lt;/a&gt;.

&lt;br/&gt;&lt;br/&gt;Given all that, it was a no-brainer to put one and one together. Not going to repo this, so find all of the files required in this &lt;span class="s1"&gt;&lt;a href="https://skydrive.live.com/embedicon.aspx/Public/StackScrollForUniversalApp.zip?cid=c651f6a9f36fb87d&amp;amp;sc=documents"&gt;archive&lt;/a&gt;&lt;/span&gt;.
&lt;br/&gt;&lt;br/&gt;Just spread the files across the project as you wish and set the correct nib for iPhone and iPad in your project setting:&lt;/p&gt;&lt;img src="http://2.bp.blogspot.com/-HyWjT8yC6K0/TjQJyX3ih8I/AAAAAAAAA3Y/R70hbkSY3L0/s320/UniversalPlusTwitterStackScroll.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" border="0" alt="" id="BLOGGER_PHOTO_ID_5635139794752407490" /&gt;
&lt;br/&gt;&lt;br/&gt;Huge credit to the guys mentioned above for making my life so much easier !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-6060660634396311932?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qrPN-_cT_CBhI6DnlkbQ5rfdYdc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qrPN-_cT_CBhI6DnlkbQ5rfdYdc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qrPN-_cT_CBhI6DnlkbQ5rfdYdc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qrPN-_cT_CBhI6DnlkbQ5rfdYdc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/5jSD9XqryPY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/6060660634396311932/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=6060660634396311932" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/6060660634396311932?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/6060660634396311932?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/5jSD9XqryPY/ios-universal-app-with-twitters-stacked.html" title="iOS Universal App with “Twitter’s” stacked scrollview" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-HyWjT8yC6K0/TjQJyX3ih8I/AAAAAAAAA3Y/R70hbkSY3L0/s72-c/UniversalPlusTwitterStackScroll.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/07/ios-universal-app-with-twitters-stacked.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcCRns_cSp7ImA9WhdTFk4.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-6578750864104186874</id><published>2011-07-14T09:54:00.001+02:00</published><updated>2011-07-14T09:54:27.549+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-14T09:54:27.549+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xml" /><title>MSCRM – Parsing Business Entity, XPath memo to self</title><content type="html">&lt;p&gt;Just wanted to create a short memo to self as I tend to forget that .net/XPath stuff faster than periods of its usage follow :).&lt;/p&gt;  &lt;p&gt;So given the following MS CRM Business Entity xml:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;BusinessEntity&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     &lt;span style="color: #ff0000"&gt;xsi:type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;DynamicEntity&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;account&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #ff0000"&gt;xmlns:xsi&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://schemas.microsoft.com/crm/2006/WebServices&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xsi:type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;CrmDateTimeProperty&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;v2_lastchangeon&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;2011-07-13T10:46:15Z&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;BusinessEntity&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;One can parse it down to the value of v2_lastchangeon property as follows:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; XmlDocument xdoc = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlDocument();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; xdoc.LoadXml(xml);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; var element = xdoc.DocumentElement;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; XmlNamespaceManager nsmgr = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlNamespaceManager(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; OwnerDocument.NameTable);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; nsmgr.AddNamespace(&lt;span style="color: #006080"&gt;&amp;quot;x&amp;quot;&lt;/span&gt;, element.OwnerDocument.DocumentElement.NamespaceURI);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; nsmgr.AddNamespace(&lt;span style="color: #006080"&gt;&amp;quot;xsi&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; var prop = element.SelectSingleNode(&lt;span style="color: #006080"&gt;&amp;quot;x:Properties/x:Property[@Name='v2_lastchangeon']/x:Value/text()&amp;quot;&lt;/span&gt;, nsmgr);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (prop == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; || String.IsNullOrEmpty(prop.Value))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; defaultLastChangeValue;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;A bit of a catch here for me was (again!!! I’m really a sclerotic!) to use a non empty named namespace (“x” in my case) to get to the result. See &lt;a title="http://stackoverflow.com/questions/4271689/xml-selectnodes-with-default-namespace-via-xmlnamespacemanager-not-working-as-exp" href="http://stackoverflow.com/questions/4271689/xml-selectnodes-with-default-namespace-via-xmlnamespacemanager-not-working-as-exp"&gt;http://stackoverflow.com/questions/4271689/xml-selectnodes-with-default-namespace-via-xmlnamespacemanager-not-working-as-exp&lt;/a&gt; for more discussion on the subject.&lt;/p&gt;

&lt;p&gt;Hope I remember I wrote this when I need it again :):)!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-6578750864104186874?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GW7fieLp2MNpDgI6YNjFtuMKchs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GW7fieLp2MNpDgI6YNjFtuMKchs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GW7fieLp2MNpDgI6YNjFtuMKchs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GW7fieLp2MNpDgI6YNjFtuMKchs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/LKLbcl_ltVY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/6578750864104186874/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=6578750864104186874" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/6578750864104186874?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/6578750864104186874?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/LKLbcl_ltVY/mscrm-parsing-business-entity-xpath.html" title="MSCRM – Parsing Business Entity, XPath memo to self" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/07/mscrm-parsing-business-entity-xpath.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAAQXg-eyp7ImA9WhZWFUU.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-4134376208679385955</id><published>2011-05-16T23:08:00.002+02:00</published><updated>2011-05-17T00:59:00.653+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-17T00:59:00.653+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sqlite" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>sqlite: counter table idiom</title><content type="html">&lt;p&gt;Being in process of building my idioms “collection” for sqlite/iphone, wanted to share/log few lines showing “upsert” and coalesce usage.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;create&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt; &lt;span class="kwrd"&gt;usage&lt;/span&gt; (pid string, channel &lt;span class="kwrd"&gt;integer&lt;/span&gt;, &lt;span class="kwrd"&gt;count&lt;/span&gt; &lt;span class="kwrd"&gt;integer&lt;/span&gt;, &lt;span class="kwrd"&gt;PRIMARY&lt;/span&gt; &lt;span class="kwrd"&gt;KEY&lt;/span&gt; (pid, channel));&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;INSERT &lt;span class="kwrd"&gt;OR&lt;/span&gt; REPLACE &lt;span class="kwrd"&gt;INTO&lt;/span&gt; &lt;span class="kwrd"&gt;usage&lt;/span&gt; (pid, channel, &lt;span class="kwrd"&gt;count&lt;/span&gt;) &lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;values&lt;/span&gt; (11, 1, &lt;span class="kwrd"&gt;coalesce&lt;/span&gt;((&lt;span class="kwrd"&gt;select&lt;/span&gt; &lt;span class="kwrd"&gt;count&lt;/span&gt;+1 &lt;span class="kwrd"&gt;from&lt;/span&gt; &lt;span class="kwrd"&gt;usage&lt;/span&gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; pid = 11 &lt;span class="kwrd"&gt;and&lt;/span&gt; channel = 1),1));&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The above sample counts number of usages for the selected pid and channel. Provider id and order submission channel in my case.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-4134376208679385955?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ULOAvYfOBoZrQWULsd_cwoQh-lc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ULOAvYfOBoZrQWULsd_cwoQh-lc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ULOAvYfOBoZrQWULsd_cwoQh-lc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ULOAvYfOBoZrQWULsd_cwoQh-lc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/yLG_ABVaeR8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/4134376208679385955/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=4134376208679385955" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/4134376208679385955?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/4134376208679385955?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/yLG_ABVaeR8/sqlite-counter-table-idiom.html" title="sqlite: counter table idiom" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/05/sqlite-counter-table-idiom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkADSXY_eCp7ImA9WhZWFU4.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-88960046906994014</id><published>2011-05-16T09:26:00.001+02:00</published><updated>2011-05-16T09:26:18.840+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-16T09:26:18.840+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>ODP.NET - AccessViolationException: Attempted to read or write protected memory</title><content type="html">&lt;p&gt;When you are getting this one and evidence doesn’t match to the &lt;a href="http://blog.sergkazakov.com/2010/10/systemtransactions-with-odpnet.html"&gt;TransactionScope issues&lt;/a&gt; in ODP.NET – Check your command parameters. Did you assign them with a name? Direction? May be size….&lt;/p&gt;  &lt;p&gt;Oracle may punish hard with this meaningless error for the wrong parameters setup!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-88960046906994014?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yWP_A6Dj7Un_QllAZIcm9cBibxc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yWP_A6Dj7Un_QllAZIcm9cBibxc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yWP_A6Dj7Un_QllAZIcm9cBibxc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yWP_A6Dj7Un_QllAZIcm9cBibxc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/MXtb544yy80" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/88960046906994014/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=88960046906994014" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/88960046906994014?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/88960046906994014?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/MXtb544yy80/odpnet-accessviolationexception.html" title="ODP.NET - AccessViolationException: Attempted to read or write protected memory" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/05/odpnet-accessviolationexception.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEGQn4_cCp7ImA9WhZXE0g.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-7735253470965625760</id><published>2011-05-02T18:10:00.001+02:00</published><updated>2011-05-02T18:10:23.048+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-02T18:10:23.048+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><title>Gallio Icarus Tests Runner silently crashing on start</title><content type="html">&lt;p&gt;This one did not require any debugging as problem declared itself also with gallio control panel showing exception when trying to read an empty settings file.&lt;/p&gt;  &lt;p&gt;So, somehow between gallio test gui restarts and its intermittent failures, it managed to emptify that file I guess.   &lt;br /&gt;Just deleting everything from C:\Documents and Settings\[user]\Application Data\Gallio\Icarus cured the problem.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-7735253470965625760?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jB-MAEScFwUD8lBvQRPfQgS0k94/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jB-MAEScFwUD8lBvQRPfQgS0k94/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jB-MAEScFwUD8lBvQRPfQgS0k94/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jB-MAEScFwUD8lBvQRPfQgS0k94/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/HyUam7LXk2o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/7735253470965625760/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=7735253470965625760" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7735253470965625760?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7735253470965625760?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/HyUam7LXk2o/gallio-icarus-tests-runner-silently.html" title="Gallio Icarus Tests Runner silently crashing on start" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/05/gallio-icarus-tests-runner-silently.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UMR3gzeip7ImA9WhZSFks.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-7560593642297872211</id><published>2011-04-01T14:34:00.001+02:00</published><updated>2011-04-01T14:34:46.682+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-01T14:34:46.682+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="debug" /><category scheme="http://www.blogger.com/atom/ns#" term="wcf" /><title>WCF: Memory leak with TypedMessageConverter when using XmlSerializer</title><content type="html">&lt;p&gt;Ok, hint is given in the title, but here is the code for you to observe and tell before you go any further what kind exactly of memory leak its causing and why :).&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Message CreateResponseMessage(GetServiceStatusResponse result, Message message)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     TypedMessageConverter converter = TypedMessageConverter.Create(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(getServiceStatusResponse1), &lt;span style="color: #006080"&gt;&amp;quot;*&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;http://www.sitronics.com/V2/SCAdapter&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;strong&gt;XmlSerializerFormatAttribute()&lt;/strong&gt; );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     Message reply = converter.ToMessage(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; getServiceStatusResponse1&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         GetServiceStatusResponse = result,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         OutboundServiceData = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; OutboundServiceData { MsgCorrelations = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; OutboundServiceDataMsgCorrelations { CorrelationID = RouterService.CorrelationId } }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     }, OperationContext.Current.IncomingMessageVersion);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     RouterService.CopyRequestToReply(message, reply);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; reply;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Previous debugging points into classic assembly heap loader leak with XmlSerializer temp assemblies (here is the example for how to debug from Tess: &lt;a title="http://blogs.msdn.com/b/tess/archive/2006/02/15/532804.aspx" href="http://blogs.msdn.com/b/tess/archive/2006/02/15/532804.aspx"&gt;http://blogs.msdn.com/b/tess/archive/2006/02/15/532804.aspx&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;It is obvious that there should be XmlSerializer somewhere inside. Road to finding it starts with how the TypedMessageConverter is created:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; TypedMessageConverter Create(Type messageContract, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; action, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; defaultNamespace, XmlSerializerFormatAttribute formatterAttribute)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (messageContract == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; DiagnosticUtility.ExceptionUtility.ThrowHelperError(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;&amp;quot;messageContract&amp;quot;&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (defaultNamespace == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         defaultNamespace = &lt;span style="color: #006080"&gt;&amp;quot;http://tempuri.org/&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlMessageConverter(GetOperationFormatter(messageContract, formatterAttribute, defaultNamespace, action));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I’ll cut the story saying that inside that routes to creation of SerializerGenerationContext to instantiate the required serializers:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; XmlSerializer[] GenerateSerializers()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     List&amp;lt;XmlMembersMapping&amp;gt; list = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;XmlMembersMapping&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;[] numArray = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;[&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Mappings.Count];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Mappings.Count; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         XmlMembersMapping item = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Mappings[i];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; index = list.IndexOf(item);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (index &amp;lt; 0)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             list.Add(item);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             index = list.Count - 1;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         numArray[i] = index;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     XmlSerializer[] serializerArray = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CreateSerializersFromMappings(list.ToArray(), &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.type);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (list.Count == &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Mappings.Count)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; serializerArray;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;     XmlSerializer[] serializerArray2 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlSerializer[&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Mappings.Count];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = 0; j &amp;lt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Mappings.Count; j++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         serializerArray2[j] = serializerArray[numArray[j]];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; serializerArray2;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This “pre-cached” set of serializers is then used:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; XmlSerializer GetSerializer(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; handle)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (handle &amp;lt; 0)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.serializers == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;lock&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.thisLock)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.serializers == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.serializers = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GenerateSerializers();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.serializers[handle];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And just to complete the cycle of information, here is the inners of the XmlSerializer to return serializers from mappings:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [PermissionSet(SecurityAction.LinkDemand, Name=&lt;span style="color: #006080"&gt;&amp;quot;FullTrust&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; XmlSerializer[] FromMappings(XmlMapping[] mappings, Type type)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((mappings == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) || (mappings.Length == 0))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlSerializer[0];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     XmlSerializerImplementation contract = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     Assembly assembly = (type == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) ? &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; : TempAssembly.LoadGeneratedAssembly(type, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; contract);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     TempAssembly tempAssembly = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (assembly == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (XmlMapping.IsShallow(mappings))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlSerializer[0];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (type != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetSerializersFromCache(mappings, type);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         tempAssembly = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TempAssembly(mappings, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Type[] { type }, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         XmlSerializer[] serializerArray = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlSerializer[mappings.Length];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         contract = tempAssembly.Contract;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; j = 0; j &amp;lt; serializerArray.Length; j++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;             serializerArray[j] = (XmlSerializer) contract.TypedSerializers[mappings[j].Key];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;             serializerArray[j].SetTempAssembly(tempAssembly, mappings[j]);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; serializerArray;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;     XmlSerializer[] serializerArray2 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlSerializer[mappings.Length];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; serializerArray2.Length; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;         serializerArray2[i] = (XmlSerializer) contract.TypedSerializers[mappings[i].Key];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; serializerArray2;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;So, now we can quite easily say what would be the problem of implementation on the top. Unmercifully, it leads to generating temp assemblies for the types in question every time it is called. Code snippets provided are to confirm and understand when/why that would happen or not.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So solution will be to “cache” the instance of TypedMessageConverter per type required, same as a usual solution when using XmlSerializer itself with “non-caching” constructors.&lt;/strong&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-7560593642297872211?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qFUFacOv6VzV7QC7kYTlGSCMWYo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qFUFacOv6VzV7QC7kYTlGSCMWYo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qFUFacOv6VzV7QC7kYTlGSCMWYo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qFUFacOv6VzV7QC7kYTlGSCMWYo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/3aumADeO7-Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/7560593642297872211/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=7560593642297872211" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7560593642297872211?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7560593642297872211?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/3aumADeO7-Q/wcf-memory-leak-with.html" title="WCF: Memory leak with TypedMessageConverter when using XmlSerializer" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/04/wcf-memory-leak-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUARn84eCp7ImA9WhZRF0U.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-1570803898066705457</id><published>2011-03-15T18:43:00.001+01:00</published><updated>2011-04-14T13:57:27.130+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-14T13:57:27.130+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="logging" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>ODP.NET – Setting DB Trace with a little twist</title><content type="html">&lt;p&gt;Just wanted to share this small thingy. When you are setting up your DB Trace for DB gurus to read (I found in Oracle only real DB sorcerers can decode this) you might make your life easier a bit, if in addition to well known:&lt;/p&gt;  &lt;p&gt;&amp;quot;ALTER SESSION SET EVENTS '10046 trace name context forever, level 12'&amp;quot;; &lt;em&gt;– for switching on      &lt;br /&gt;&lt;/em&gt;&amp;quot;ALTER SESSION SET EVENTS '10046 trace name context off'&amp;quot;; &lt;em&gt;– for switching off&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;you add “ALTER SESSION SET tracefile_identifier” to give a name to a trace file and relate it to your activity in this way.&lt;/p&gt;  &lt;p&gt;Whole code would look like:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SwitchDBTrace(DBTraceState targetState, OracleConnection connection)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; commandText = (targetState == DBTraceState.Off) ? switchDBTraceOffCommand : switchDBTraceOnCommand;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         Log.TraceData(Log.Source, TraceEventType.Information, 0, String.Format(&lt;span style="color: #006080"&gt;&amp;quot;Switching DB Trace to [{0}].&amp;quot;&lt;/span&gt;, targetState));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (OracleCommand perfCmd = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; OracleCommand(commandText, connection))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             perfCmd.ExecuteNonQuery();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (targetState == DBTraceState.On)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;                 perfCmd.CommandText = String.Format(&lt;span style="color: #006080"&gt;&amp;quot;ALTER SESSION SET tracefile_identifier = '{0}'&amp;quot;&lt;/span&gt;, Trace.CorrelationManager.ActivityId.ToString().Replace(&lt;span style="color: #006080"&gt;&amp;quot;-&amp;quot;&lt;/span&gt;,&lt;span style="color: #006080"&gt;&amp;quot;_&amp;quot;&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;                 perfCmd.ExecuteNonQuery();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         Log.TraceData(Log.Source, TraceEventType.Information, 0, String.Format(&lt;span style="color: #006080"&gt;&amp;quot;DB Trace switched to [{0}].&amp;quot;&lt;/span&gt;, targetState));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         Log.TraceData(Log.Source, TraceEventType.Error, 0, String.Format(&lt;span style="color: #006080"&gt;&amp;quot;There was an error when trying to switch the DB trace with command [{0}]: Exception: {1}.&amp;quot;&lt;/span&gt;, commandText, ex));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;with helpers:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; switchDBTraceOnCommand = &lt;span style="color: #006080"&gt;&amp;quot;ALTER SESSION SET EVENTS '10046 trace name context forever, level 12'&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; switchDBTraceOffCommand = &lt;span style="color: #006080"&gt;&amp;quot;ALTER SESSION SET EVENTS '10046 trace name context off'&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;enum&lt;/span&gt; DBTraceState&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     None = 0,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     Off = None,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     On = 1&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This would give you file name like: xyz_ora_1142900_40a2e9ef_be21_4a0c_9a5e_aa70dfb8e423, that is quite better traceable back into your activity.&lt;/p&gt;

&lt;p&gt;[14-Apr-2011] Small update, here is how the db trace setup looks in the pl-sql itself if you ever need it:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;declare&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span style="color: #008000"&gt;-- declare params&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;begin&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span style="color: #008000"&gt;-- set params&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;execute&lt;/span&gt; &lt;span style="color: #0000ff"&gt;immediate&lt;/span&gt;(&lt;span style="color: #006080"&gt;'ALTER SESSION SET EVENTS '&lt;/span&gt;&lt;span style="color: #006080"&gt;'10046 trace name context forever, level 12'&lt;/span&gt;&lt;span style="color: #006080"&gt;''&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;   &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;   &lt;span style="color: #008000"&gt;-- Call the procedure&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;                              &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;execute&lt;/span&gt; &lt;span style="color: #0000ff"&gt;immediate&lt;/span&gt;(&lt;span style="color: #006080"&gt;'ALTER SESSION SET EVENTS '&lt;/span&gt;&lt;span style="color: #006080"&gt;'10046 trace name context off'&lt;/span&gt;&lt;span style="color: #006080"&gt;''&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;end&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-1570803898066705457?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aaVCXRSCEugo6BLCDG4hOeYZYho/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aaVCXRSCEugo6BLCDG4hOeYZYho/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aaVCXRSCEugo6BLCDG4hOeYZYho/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aaVCXRSCEugo6BLCDG4hOeYZYho/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/iZj1pQrEB4c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/1570803898066705457/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=1570803898066705457" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1570803898066705457?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1570803898066705457?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/iZj1pQrEB4c/odpnet-setting-db-trace-with-little.html" title="ODP.NET – Setting DB Trace with a little twist" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/03/odpnet-setting-db-trace-with-little.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AGSXkycSp7ImA9Wx9aGE0.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-7403117023212392611</id><published>2011-03-11T01:47:00.001+01:00</published><updated>2011-03-11T02:08:48.799+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-11T02:08:48.799+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xcode" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>XCode 4–svn. Could not authenticate to server: rejected Basic challenge</title><content type="html">&lt;p&gt;Yeah, why this should happen to me during my 1am attempt to check in changes back? I upgraded today to XCode 4 and everything seemed to work ok with svn until this moment. Based onto error message detail and some info here: &lt;a title="http://help.beanstalkapp.com/discussions/problems/3083-cannot-connect-with-xcode-4-dev-preview" href="http://help.beanstalkapp.com/discussions/problems/3083-cannot-connect-with-xcode-4-dev-preview"&gt;http://help.beanstalkapp.com/discussions/problems/3083-cannot-connect-with-xcode-4-dev-preview&lt;/a&gt; one can say xcode is not sending my credentials to svn right.&lt;/p&gt;  &lt;p&gt;I’m not sure what was the version of svn before upgrade on my mac, now it shows on svn –version: svn, version 1.6.5 (r38866). After several attempts to put my login info to the “repositories” place, I had a blast from the past. Ok, so probably this info is cached inside svn itself and after upgrade today it got wiped out?. I have anonymous read access enabled, so that would explain my checkouts working just fine.&lt;/p&gt;  &lt;p&gt;So lets use svn itself to attemt to solve this:&lt;/p&gt;  &lt;p&gt;cd to your working folder (where your xcode project is located)&lt;/p&gt;  &lt;p&gt;use svn st to list your changes inside working folder&lt;/p&gt;  &lt;p&gt;use svn commit to commit your changes.&lt;/p&gt;  &lt;p&gt;Here, the moment comes and dialog looks like:&lt;/p&gt;  &lt;p&gt;1. Stanislav-Dvoychenkos-MacBook-Pro: projectfolder stanislavdvoychenko$ svn commit -m&amp;quot;commit after xcode4 upgrade&amp;quot;   &lt;br /&gt;2. Authentication realm: &amp;lt;&lt;a href="http://192.168.1.181:80"&gt;http://192.168.1.181:80&lt;/a&gt;&amp;gt; Subversion Repository    &lt;br /&gt;3. Password for 'stanislavdvoychenko':     &lt;br /&gt;4. Authentication realm: &amp;lt;&lt;a href="http://192.168.1.181:80"&gt;http://192.168.1.181:80&lt;/a&gt;&amp;gt; Subversion Repository    &lt;br /&gt;5. Username: Enter Your username here    &lt;br /&gt;6. Password for 'Your username': Enter Your password here&lt;/p&gt;  &lt;p&gt;On line #3 just do enter, it will come to #5 eventually if there is no your “computer user” in svn. And on #5 and #6 comes your chance to input correct svn user name and password.   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;After this procedure, xcode 4 started to commit just ok as well. Argggh, now running to bed!   &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-7403117023212392611?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kd9YZOe7Mt2w3bWra5NqNn--beY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kd9YZOe7Mt2w3bWra5NqNn--beY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kd9YZOe7Mt2w3bWra5NqNn--beY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kd9YZOe7Mt2w3bWra5NqNn--beY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/Q2a4kt3PhkI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/7403117023212392611/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=7403117023212392611" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7403117023212392611?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/7403117023212392611?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/Q2a4kt3PhkI/xcode-4svn-could-not-authenticate-to.html" title="XCode 4–svn. Could not authenticate to server: rejected Basic challenge" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>9</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/03/xcode-4svn-could-not-authenticate-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8ESXY4fip7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-2585137577369132714</id><published>2011-03-08T01:00:00.001+01:00</published><updated>2012-01-27T16:23:28.836+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-27T16:23:28.836+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="json" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>IPhone–json deserialization of custom objects</title><content type="html">&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;[Update – 27-Jan-2012, Starting with iOS5 you can use built-in NSJSONSerialization class,&amp;#160; example here: &lt;/font&gt;&lt;/em&gt;&lt;a title="http://www.raywenderlich.com/5492/working-with-json-in-ios-5" href="http://www.raywenderlich.com/5492/working-with-json-in-ios-5"&gt;&lt;em&gt;&lt;font size="1"&gt;http://www.raywenderlich.com/5492/working-with-json-in-ios-5&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;font size="1"&gt;]&lt;em&gt;&amp;#160;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;After &lt;a href="http://plainoldstan.blogspot.com/2011/02/iphone-json-serialization-of-custom.html"&gt;last entry on serialization&lt;/a&gt; I still owe a snippet for deserialization.     &lt;br /&gt;Since that time my class grew up a bit and now its json string read from db is:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;{&lt;span class="str"&gt;&amp;quot;environment&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;  {&lt;span class="str"&gt;&amp;quot;fixedLongitude&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;14.471223&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;mobile&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;fixedLatitude&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;50.135194&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="str"&gt;&amp;quot;plans&amp;quot;&lt;/span&gt;:[&lt;/pre&gt;

  &lt;pre&gt;        {&lt;span class="str"&gt;&amp;quot;tasks&amp;quot;&lt;/span&gt;:[{&lt;span class="str"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;baby cries&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;dur&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;10&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;durUnit&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;desc&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;}],&lt;/pre&gt;

  &lt;pre class="alt"&gt;          &lt;span class="str"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;babysitter!&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;},      &lt;/pre&gt;

  &lt;pre&gt;        {&lt;span class="str"&gt;&amp;quot;tasks&amp;quot;&lt;/span&gt;:[{&lt;span class="str"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;this is it&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;dur&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;10&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;durUnit&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;desc&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;}],&lt;/pre&gt;

  &lt;pre class="alt"&gt;          &lt;span class="str"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;cook!&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;:&lt;span class="str"&gt;&amp;quot;Sample plan description&amp;quot;&lt;/span&gt;}]}}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;And here is a snippet to reversing it back into the object (with jsonString value provided above):&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;// Getting a json string from db&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    NSString *jsonString = [[NSString alloc] initWithUTF8String: (&lt;span class="kwrd"&gt;char&lt;/span&gt;*) sqlite3_column_text (dbps, 0)];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSLog(&lt;span class="str"&gt;@&amp;quot;data from db: %@&amp;quot;&lt;/span&gt;, jsonString);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="rem"&gt;// Top level dictionary, only contains &amp;quot;environment&amp;quot; key&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSDictionary *dictionary = [jsonString JSONValue];&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="rem"&gt;// Retrieve &amp;quot;environment&amp;quot; itself&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSDictionary *env = [dictionary objectForKey:&lt;span class="str"&gt;@&amp;quot;environment&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="rem"&gt;// From &amp;quot;environment&amp;quot; dictionary get plans array as a &amp;quot;plans&amp;quot; key&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSArray *plansArr = [env objectForKey:&lt;span class="str"&gt;@&amp;quot;plans&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="rem"&gt;// For simple &amp;quot;environment&amp;quot; attributes retrieval is simple&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    _environment.fixedLatitude = [[env objectForKey:&lt;span class="str"&gt;@&amp;quot;fixedLatitude&amp;quot;&lt;/span&gt;] doubleValue];&lt;/pre&gt;

  &lt;pre&gt;    _environment.fixedLongitude = [[env objectForKey:&lt;span class="str"&gt;@&amp;quot;fixedLongitude&amp;quot;&lt;/span&gt;] doubleValue];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;// Now getting to traverse the &amp;quot;plans&amp;quot; array, logic of traversal down the tree is same as above&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i=0; i &amp;lt; [plansArr count]; i++) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        NSDictionary *planJ = [plansArr objectAtIndex:i];&lt;/pre&gt;

  &lt;pre&gt;        Plan *p = [[Plan alloc] initWithTitle: [planJ objectForKey:&lt;span class="str"&gt;@&amp;quot;title&amp;quot;&lt;/span&gt;] &lt;/pre&gt;

  &lt;pre&gt;                                 description: [planJ objectForKey:&lt;span class="str"&gt;@&amp;quot;description&amp;quot;&lt;/span&gt;]];&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;/pre&gt;

  &lt;pre&gt;        NSArray *tasksJ = [planJ objectForKey:&lt;span class="str"&gt;@&amp;quot;tasks&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;    &lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; j=0; j &amp;lt; [tasksJ count]; j++) {&lt;/pre&gt;

  &lt;pre&gt;            NSDictionary *taskJ = [tasksJ objectAtIndex:j];&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;p&gt;            [p AddTaskWithTitle:[taskJ objectForKey:&lt;span class="str"&gt;@&amp;quot;title&amp;quot;&lt;/span&gt;] &lt;br /&gt;                       duration:[[taskJ objectForKey:&lt;span class="str"&gt;@&amp;quot;dur&amp;quot;&lt;/span&gt;] intValue] unit: [[taskJ objectForKey:&lt;span class="str"&gt;@&amp;quot;durUnit&amp;quot;&lt;/span&gt;] intValue] &lt;br /&gt;                       link:[taskJ objectForKey:&lt;span class="str"&gt;@&amp;quot;desc&amp;quot;&lt;/span&gt;]];&lt;/p&gt;&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;/pre&gt;

  &lt;pre&gt;        [[_environment plans] addObject:p];&lt;/pre&gt;

  &lt;pre class="alt"&gt;        [p release];&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    [jsonString release];&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This is it!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-2585137577369132714?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5_YdI6iN7C6lsoKcRg_8pjRfTVc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5_YdI6iN7C6lsoKcRg_8pjRfTVc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5_YdI6iN7C6lsoKcRg_8pjRfTVc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5_YdI6iN7C6lsoKcRg_8pjRfTVc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/WAyl4ZA-0J4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/2585137577369132714/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=2585137577369132714" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/2585137577369132714?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/2585137577369132714?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/WAyl4ZA-0J4/iphonejson-deserialization-of-custom.html" title="IPhone–json deserialization of custom objects" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/03/iphonejson-deserialization-of-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAFRnc5fyp7ImA9Wx9bFEw.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-2185056333730007601</id><published>2011-02-20T21:43:00.002+01:00</published><updated>2011-02-22T22:38:37.927+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-22T22:38:37.927+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="json" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>IPhone– json serialization of custom objects</title><content type="html">&lt;p&gt;After &lt;a href="http://plainoldstan.blogspot.com/2011/02/iphone-picking-up-json-objective-c.html"&gt;shallow review of libraries&lt;/a&gt;, I got to start using the one of my current choice: &lt;a href="http://stig.github.com/json-framework/"&gt;json-framework&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In my instance, first usage of json libraries would not be fetching data from internet, but to save data to SQLite database in a “document” style.   &lt;br /&gt;Why I insist on SQLite instead of a simple file for a “document” based db? I just want my writes to be transactional, so if device shuts down during the write, I’m not going to have a corrupted file. Same if I’m suddenly killed by system.&lt;/p&gt;  &lt;p&gt;I feel (but only checked in json-framework) that none of those json frameworks I reviewed a moment ago is capable of json to objective-c object mapping. Looks like there is a project doing this: &lt;a title="https://github.com/yfactorial/objectiveresource" href="https://github.com/yfactorial/objectiveresource"&gt;https://github.com/yfactorial/objectiveresource&lt;/a&gt;. The project says it is a “A port of Ruby on Rails' ActiveResource to Objective-C (and specifically the iPhone)”. With last activity in October 2009, project is far from being active and overall looks like a sledgehammer for killing ants if used only for json to objective-c objects mapping.&lt;/p&gt;  &lt;p&gt;Ok, it means that one would be back to encoding your very own objects to NSDictionaries and NSArrays in order to serialize them to json strings.&lt;/p&gt;  &lt;p&gt;Here is a small example for my Environment class with name field and array of Plan objects. We are start with the inner most class, in my case Plan:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;- (NSDictionary *) transformToDictionary&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;p&gt;    NSDictionary *body = [NSDictionary &lt;br /&gt;       dictionaryWithObjectsAndKeys: self.title, &lt;span class="str"&gt;@&amp;quot;title&amp;quot;&lt;/span&gt;, self.description, &lt;span class="str"&gt;@&amp;quot;description&amp;quot;&lt;/span&gt;, &lt;br /&gt;       self.author, &lt;span class="str"&gt;&amp;quot;author&amp;quot;&lt;/span&gt;, self.language, &lt;span class="str"&gt;&amp;quot;lang&amp;quot;&lt;/span&gt;, nil];&lt;/p&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; body;&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Then in Environment I’d have:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;- (NSDictionary *) transformToDictionary&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSMutableArray *plansArray = [[NSMutableArray alloc] initWithCapacity:[plans count]];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; [plans count]; i++) {&lt;/pre&gt;

  &lt;pre&gt;        Plan *p = [plans objectAtIndex:i];&lt;/pre&gt;

  &lt;pre class="alt"&gt;        [plansArray addObject:[p transformToDictionary]];&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    NSMutableDictionary *body = [NSMutableDictionary &lt;/pre&gt;

  &lt;pre&gt;           dictionaryWithObjectsAndKeys: self.name, &lt;span class="str"&gt;@&amp;quot;name&amp;quot;&lt;/span&gt;, plansArray, &lt;span class="str"&gt;@&amp;quot;plans&amp;quot;&lt;/span&gt;, nil];&lt;/pre&gt;

  &lt;pre class="alt"&gt;    [plansArray release];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    NSDictionary *envelope = [NSDictionary dictionaryWithObject:body forKey:&lt;span class="str"&gt;@&amp;quot;environment&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; envelope;&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Here I’m using the “wrapped” style of serialization where my environment will be a field of that resulting json anonymous object. dictionaryWithObjectsAndKeys is returning the autoreleased instance, that is why I’m not releasing in a caller method. &lt;/p&gt;

&lt;p&gt;Given I have that implemented, here is how I retrieve a json string to put into “document” database:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;        NSDictionary *envDict = [_environment transformToDictionary];&lt;/pre&gt;

  &lt;pre&gt;        NSString *envJson = [envDict JSONRepresentation];&lt;/pre&gt;

  &lt;pre class="alt"&gt;        NSLog(&lt;span class="str"&gt;@&amp;quot;%@&amp;quot;&lt;/span&gt;, envJson);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Again, not releasing envDict here as it is autoreleased. Though I’m not an objective-c guru yet, so I just hope I’m right about that releasing thing.&lt;/p&gt;

&lt;p&gt;With all that, here is my NSLog output:&lt;/p&gt;

&lt;p&gt;{&amp;quot;environment&amp;quot;:{&amp;quot;plans&amp;quot;:[{&amp;quot;title&amp;quot;:&amp;quot;Sample plan&amp;quot;,&amp;quot;description&amp;quot;:&amp;quot;Sample plan description&amp;quot;}],&amp;quot;name&amp;quot;:&amp;quot;Sample&amp;quot;}}&lt;/p&gt;







&lt;p&gt;Enough to make me happy for a moment.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-2185056333730007601?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0I0ORuj62HnCinyA1aH_sVCfrbs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0I0ORuj62HnCinyA1aH_sVCfrbs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0I0ORuj62HnCinyA1aH_sVCfrbs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0I0ORuj62HnCinyA1aH_sVCfrbs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/oDgH91WX1vw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/2185056333730007601/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=2185056333730007601" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/2185056333730007601?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/2185056333730007601?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/oDgH91WX1vw/iphone-json-serialization-of-custom.html" title="IPhone– json serialization of custom objects" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/02/iphone-json-serialization-of-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8MSHo-fCp7ImA9WhRUFko.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-1140506640864761371</id><published>2011-02-20T13:48:00.011+01:00</published><updated>2012-01-27T16:24:49.454+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-27T16:24:49.454+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="json" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>IPhone: Picking up a json objective-c library</title><content type="html">&lt;p&gt;&lt;span style="font-size: 85%"&gt;&lt;span style="font-style: italic"&gt;As you read through this, please note the date of publishing [20-Feb-2011]. The content is going to be quite volatile in regard to time.        &lt;br /&gt;&lt;em&gt;&lt;font size="1"&gt;&lt;strong&gt;[Update – 27-Jan-2012, Starting with iOS5 you can use built-in NSJSONSerialization class,&amp;#160; example here: &lt;/strong&gt;&lt;/font&gt;&lt;/em&gt;&lt;a title="http://www.raywenderlich.com/5492/working-with-json-in-ios-5" href="http://www.raywenderlich.com/5492/working-with-json-in-ios-5"&gt;&lt;em&gt;&lt;font size="1"&gt;&lt;strong&gt;http://www.raywenderlich.com/5492/working-with-json-in-ios-5&lt;/strong&gt;&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;font size="1"&gt;&lt;strong&gt;]&lt;em&gt;&amp;#160;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 85%"&gt;&lt;span style="font-style: italic"&gt;       &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Overcoming the temptation to use just a plist quasi &amp;quot;json&amp;quot; or xml format for storing my app user data, I went to see what json libraries would be readily available. Main driver for me here is the idea that I'm going to run into json API's in my app anyway, plus the &amp;quot;document&amp;quot; DB style aproach of NoSql databases will be sufficient for me for both on SQLite side and Google Datastore. So I'll keep some key data in SQLite with &amp;quot;blob&amp;quot; of json, and then will do the same on the datastore side.     &lt;br /&gt;    &lt;br /&gt;What I found is:     &lt;br /&gt;    &lt;br /&gt;&lt;span style="font-weight: bold"&gt;json-framework, newly hosted at: &lt;a href="http://stig.github.com/json-framework/"&gt;http://stig.github.com/json-framework/&lt;/a&gt;&lt;/span&gt;    &lt;br /&gt;Quite actively developed, currently in v3 beta1, with stable version offered for download as 2.3.2. I found quite a few links with iphone json tutorials based on this framework. It was as well easy copy &amp;quot;Sources&amp;quot; directory to integrate into the app. Walk though the code showed its well structured and easy to understand manner and there are some tests in the project as well.     &lt;br /&gt;    &lt;br /&gt;&lt;span style="font-weight: bold"&gt;YAJL framework: &lt;a href="https://github.com/gabriel/yajl-objc"&gt;https://github.com/gabriel/yajl-objc&lt;/a&gt;&lt;/span&gt;     &lt;br /&gt;Looks like last updated November 2010. Quite many files inside the project and author documented integration options talk more about binary library integration. I really want to see and play with the code myself, so not going further.     &lt;br /&gt;    &lt;br /&gt;&lt;span style="font-weight: bold"&gt;TouchJSON: &lt;a href="https://github.com/TouchCode/TouchJSON"&gt;https://github.com/TouchCode/TouchJSON&lt;/a&gt;&lt;/span&gt;     &lt;br /&gt;Looks like author is currently trying to reorganize the structure of his numerous projects, moved from google code to github and has made a few moves on github as well. Amount of code is bigger than in json-framework. Project is quite active and got quite a few tests inside as I can see, but I can't see as many tutorials and benefits actually. Not progressing.     &lt;br /&gt;    &lt;br /&gt;&lt;span style="font-weight: bold"&gt;JSONKit: &lt;a href="https://github.com/johnezang/JSONKit"&gt;https://github.com/johnezang/JSONKit&lt;/a&gt;&lt;/span&gt;     &lt;br /&gt;This is 1 m file + 1 h file long project. But there are no tests, so not progressing.     &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;Here are some performance testing links I found interesting:     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://psionides.jogger.pl/2010/12/12/cocoa-json-parsing-libraries-part-2/"&gt;http://psionides.jogger.pl/2010/12/12/cocoa-json-parsing-libraries-part-2/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://samsoff.es/posts/updated-iphone-json-benchmarks"&gt;http://samsoff.es/posts/updated-iphone-json-benchmarks&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Based on what I've read so far I'm not going to be disappointed with json-framework.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-1140506640864761371?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uGpeNyiOGFKTjnCbP_a0NNbosfc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uGpeNyiOGFKTjnCbP_a0NNbosfc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uGpeNyiOGFKTjnCbP_a0NNbosfc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uGpeNyiOGFKTjnCbP_a0NNbosfc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/djwvhUDpJBU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/1140506640864761371/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=1140506640864761371" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1140506640864761371?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/1140506640864761371?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/djwvhUDpJBU/iphone-picking-up-json-objective-c.html" title="IPhone: Picking up a json objective-c library" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/02/iphone-picking-up-json-objective-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cFRHY6fSp7ImA9Wx9UGUo.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-723219438826468017</id><published>2011-02-17T22:40:00.001+01:00</published><updated>2011-02-17T22:43:35.815+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-17T22:43:35.815+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="wcf" /><title>WCF–maxSizeOfMessageToLog and "Message not logged because its size exceeds configured quota"</title><content type="html">&lt;p&gt;I’m always in for investigating some features that smell of a bad design. And though I believe WCF is a very solid piece of a framework, this warning message while skipping the message log makes me nervous. By itself surely it is better to have an ability to skip logging messages over threshold size, but if I made my conscious decision through configuration for that size, why should I still be given a warning?    &lt;br /&gt;I’m used to log warnings and up into EventLog for admins to be alerted. This warning just makes my admins alerted for nothing. Not good.&lt;/p&gt;  &lt;p&gt;So I wanted to see if I can tame this in some legitimate way. I started with msdn:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.messageloggingelement.maxsizeofmessagetolog.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.messageloggingelement.maxsizeofmessagetolog.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Which by the way states about maxSizeOfMessageToLog the following: &amp;quot;The maximum size, in bytes, of a message to log. Messages larger than the limit are not logged. This setting affects all trace levels. The default is Int32.MaxValue&amp;quot; &lt;/p&gt;  &lt;p&gt;Int32.MaxValue??!! This would not be corresponding to any “secure by default” and to the real life experience working with wcf! So dive into the reflector shows:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;internal&lt;/span&gt; MessageLogTraceRecord(Stream stream, MessageLoggingSource source) : &lt;span class="kwrd"&gt;this&lt;/span&gt;(source)&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.type = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;    StringBuilder builder = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder();&lt;/pre&gt;

  &lt;pre class="alt"&gt;    StreamReader reader = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamReader(stream);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; size = 0x1000;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;char&lt;/span&gt;[] buffer = DiagnosticUtility.Utility.AllocateCharArray(size);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; maxMessageSize = MessageLogger.MaxMessageSize;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (-1 == maxMessageSize)&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        maxMessageSize = 0x1000;&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;while&lt;/span&gt; (maxMessageSize &amp;gt; 0)&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; num3 = reader.Read(buffer, 0, size);&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (num3 == 0)&lt;/pre&gt;

  &lt;pre class="alt"&gt;        {&lt;/pre&gt;

  &lt;pre&gt;            &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; charCount = (maxMessageSize &amp;lt; num3) ? maxMessageSize : num3;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        builder.Append(buffer, 0, charCount);&lt;/pre&gt;

  &lt;pre&gt;        maxMessageSize -= num3;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;    reader.Close();&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.messageString = builder.ToString();&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;



&lt;p&gt;As we see above the origins of the default value are found in the MessageLogTraceRecord with its value of 4096 bytes as per above (which is quite reasonable I think). &lt;/p&gt;

&lt;p&gt;As it often happens bad smells are coming in batches, so we can see in TraceXPathNavigator which is used by PlainXmlWriter (all in System.ServiceModel&lt;a href="http://code.google.com/p/toolsdotnet/w/edit/ServiceModel"&gt;?&lt;/a&gt;.Diagnostics namespace) how “business” case of exceeding the threshold is handled via exception:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; VerifySize(&lt;span class="kwrd"&gt;int&lt;/span&gt; nodeSize)&lt;/pre&gt;

  &lt;pre&gt;{   &lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;if&lt;/span&gt; ((&lt;span class="kwrd"&gt;this&lt;/span&gt;.maxSize != -1) &amp;amp;&amp;amp; ((&lt;span class="kwrd"&gt;this&lt;/span&gt;.currentSize + nodeSize) &amp;gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.maxSize))  &lt;/pre&gt;

  &lt;pre&gt;  {      &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; PlainXmlWriter.MaxSizeExceededException();    &lt;/pre&gt;

  &lt;pre&gt;  }  &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.currentSize += nodeSize;&lt;/pre&gt;

  &lt;pre&gt;  }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;And now to complete the parade this exception is handled by creation of a Warning message in System.ServiceModel.Diagnostics.MessageLogger LogInternal method:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;catch&lt;/span&gt; (PlainXmlWriter.MaxSizeExceededException)&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (DiagnosticUtility.ShouldTraceWarning)&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            TraceUtility.TraceEvent(TraceEventType.Warning, TraceCode.MessageNotLoggedQuotaExceeded, record.Message);&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This is quite far from any good design choice in my opinion! By bet is that this guy has moved from WCF team to Silverlight’s already. &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh4.ggpht.com/_n09qEDO5M-8/TV2Vw5nTAPI/AAAAAAAAAxk/6dbJUC1H58M/wlEmoticon-smile%5B2%5D.png?imgmax=800" /&gt;&lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh4.ggpht.com/_n09qEDO5M-8/TV2Vw5nTAPI/AAAAAAAAAxk/6dbJUC1H58M/wlEmoticon-smile%5B2%5D.png?imgmax=800" /&gt; But before he did that, he made it sure we have no legitimate way to avoid that warning message and probably didn’t tell the truth to the msisdn documentation team.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-723219438826468017?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KA8fG6wJDrW4IppMJlbnaTN8p0I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KA8fG6wJDrW4IppMJlbnaTN8p0I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KA8fG6wJDrW4IppMJlbnaTN8p0I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KA8fG6wJDrW4IppMJlbnaTN8p0I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/PR8O3SSTAd4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/723219438826468017/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=723219438826468017" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/723219438826468017?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/723219438826468017?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/PR8O3SSTAd4/wcfmaxsizeofmessagetolog-and-not-logged.html" title="WCF–maxSizeOfMessageToLog and &amp;quot;Message not logged because its size exceeds configured quota&amp;quot;" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_n09qEDO5M-8/TV2Vw5nTAPI/AAAAAAAAAxk/6dbJUC1H58M/s72-c/wlEmoticon-smile%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/02/wcfmaxsizeofmessagetolog-and-not-logged.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQHQHw-cSp7ImA9Wx9UEUw.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-8416808373027424170</id><published>2011-02-07T23:22:00.001+01:00</published><updated>2011-02-07T23:22:11.259+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-07T23:22:11.259+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="google engine" /><title>Plain old Stan on the road to Google engine. Part 2.</title><content type="html">&lt;p&gt;This time I wanted to   &lt;br /&gt;- integrate some kind of a client side (javascript) view engine    &lt;br /&gt;- look at app execution through a dashboard. Understand what takes CPU cycles or other resources. May be provide some early stage adjustments&lt;/p&gt;  &lt;p&gt;I also just newly read about &lt;a href="http://www.oracle.com/technetwork/articles/javase/servlets-jsp-140445.html"&gt;Model 2 of jsp&lt;/a&gt; – it is when your servlet plays a role of a controller, serving a view for presentation, like:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;doPost(...) {&lt;/pre&gt;

  &lt;pre&gt;...&lt;/pre&gt;

  &lt;pre class="alt"&gt;  session.setAttribute(&lt;span class="str"&gt;&amp;quot;teachers&amp;quot;&lt;/span&gt;, teachers);&lt;/pre&gt;

  &lt;pre&gt;  RequestDispatcher dispatcher = request.getRequestDispatcher(&lt;span class="str"&gt;&amp;quot;/admin.jsp&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;  dispatcher.forward( request, response); &lt;/pre&gt;

  &lt;pre&gt;...&lt;/pre&gt;

  &lt;pre class="alt"&gt;} &lt;a href="http://www.daniweb.com/forums/thread141776.html"&gt;source&lt;/a&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;So I’m quite unsure if I should continue with StringTemplate or better switch to that Model 2 of jsp thingy. That would be probably too speculative to decide at this point.&lt;/p&gt;

&lt;p&gt;But back to the plan, that’s javascript view engine. Back in time, when I was serving for Valtera, my brilliant colleague Konstantin Nalimov ran into one that is actually around 700 bytes of formatted code long and comes from John Resig himself – &lt;a href="http://ejohn.org/blog/javascript-micro-templating/"&gt;microtemplating&lt;/a&gt;. We gave it a run, and never had to look into anything else.&lt;/p&gt;

&lt;p&gt;So here is what my default StringTemplate template looked like in order to integrate jQuery, jQueryUI and microtemplating.js (and yes, I had to go to google again to see &lt;a href="http://code.google.com/appengine/docs/java/gettingstarted/staticfiles.html"&gt;how to integrate static files in gae app&lt;/a&gt;):&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&amp;lt;html&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;head&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;script src=&lt;span class="str"&gt;&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;script src=&lt;span class="str"&gt;&amp;quot;https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;script src=&lt;span class="str"&gt;&amp;quot;/js/microtemplating.js&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;/head&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;body&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;p id=&lt;span class="str"&gt;&amp;quot;helloP&amp;quot;&lt;/span&gt;&amp;gt;Hello world!&amp;lt;/p&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;script type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;jQuery(&lt;span class="str"&gt;'#helloP'&lt;/span&gt;).click(function() {&lt;/pre&gt;

  &lt;pre class="alt"&gt;  alert(1);&lt;/pre&gt;

  &lt;pre&gt;  });&lt;/pre&gt;

  &lt;pre class="alt"&gt;t = &lt;span class="kwrd"&gt;new&lt;/span&gt; sd.Templating();&lt;/pre&gt;

  &lt;pre&gt;data = {&lt;span class="str"&gt;&amp;quot;links&amp;quot;&lt;/span&gt;: [&lt;/pre&gt;

  &lt;pre class="alt"&gt;        {&lt;span class="str"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;: &lt;span class="str"&gt;&amp;quot;First link&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;url&amp;quot;&lt;/span&gt;: &lt;span class="str"&gt;&amp;quot;http://www.google.com&amp;quot;&lt;/span&gt;},&lt;/pre&gt;

  &lt;pre&gt;        {&lt;span class="str"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;: &lt;span class="str"&gt;&amp;quot;Second link&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;url&amp;quot;&lt;/span&gt;: &lt;span class="str"&gt;&amp;quot;http://www.msdn.com&amp;quot;&lt;/span&gt;},&lt;/pre&gt;

  &lt;pre class="alt"&gt;        {&lt;span class="str"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;: &lt;span class="str"&gt;&amp;quot;Third link&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;url&amp;quot;&lt;/span&gt;: &lt;span class="str"&gt;&amp;quot;http://www.msn.com&amp;quot;&lt;/span&gt;}&lt;/pre&gt;

  &lt;pre&gt;    ]&lt;/pre&gt;

  &lt;pre class="alt"&gt;};&lt;/pre&gt;

  &lt;pre&gt;jQuery(&lt;span class="str"&gt;'#helloP'&lt;/span&gt;).html(t.parseTemplate(t.getTemplateFromURL(&lt;span class="str"&gt;'/templates/Links.htm'&lt;/span&gt;), data));&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;/body&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I prepare some fake data for a template as you can see and then parsing the template into element with “helloP” id.&lt;/p&gt;

&lt;p&gt;Here is the microtemplating template:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&amp;lt;table id=&lt;span class="str"&gt;&amp;quot;linksTable&amp;quot;&lt;/span&gt; style=&lt;span class="str"&gt;&amp;quot;width: 100%&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;thead&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;tr&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;th style=&lt;span class="str"&gt;&amp;quot;text-align:left&amp;quot;&lt;/span&gt;&amp;gt;Description&amp;lt;/th&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;th style=&lt;span class="str"&gt;&amp;quot;text-align:left&amp;quot;&lt;/span&gt;&amp;gt;URL&amp;lt;/th&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;tr&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;/thead&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &amp;lt;tbody&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;        &amp;lt;# &lt;span class="kwrd"&gt;for&lt;/span&gt;(var i=0; i &amp;lt; links.length; i++) { var link = links[i]; #&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &amp;lt;tr&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;            &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;            &amp;lt;td&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;                &amp;lt;#= link.description #&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;            &amp;lt;/td&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &amp;lt;td&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;                &amp;lt;#= link.url #&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &amp;lt;/td&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;        &amp;lt;/tr&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &amp;lt;# } #&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;    &amp;lt;/tbody&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/table&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;And the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_n09qEDO5M-8/TVBwdvl5sFI/AAAAAAAAAwY/bglCDuI1kKY/s1600-h/image%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_n09qEDO5M-8/TVBwfRmiOcI/AAAAAAAAAwc/VhNROs2wTJ4/image_thumb%5B1%5D.png?imgmax=800" width="488" height="85" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to look at the dashboard:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_n09qEDO5M-8/TVBwgPo7R5I/AAAAAAAAAwg/l1HjwKlzv2o/s1600-h/image%5B7%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_n09qEDO5M-8/TVBwg61C0FI/AAAAAAAAAwk/yWoGvNQggG4/image_thumb%5B3%5D.png?imgmax=800" width="495" height="80" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately, I didn’t take the screenshot before I fixed the issue with favicon. So let return a bit back.&lt;/p&gt;

&lt;p&gt;That favicon.ico was taking ~60% of CPU with average of ~20 CPU cycles per download attempt. The picture above shows the corrected state, obviously last column for favicon will go to zero as well in 14 hours.&lt;/p&gt;

&lt;p&gt;Here is the log for that favicon to confirm:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_n09qEDO5M-8/TVBwiCrjj5I/AAAAAAAAAwo/7NprEoeanpY/s1600-h/image%5B12%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_n09qEDO5M-8/TVBwiqMGTwI/AAAAAAAAAws/Pa-gLvELL7Q/image_thumb%5B6%5D.png?imgmax=800" width="580" height="151" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yellow entries are those corresponding to the app startup. You can see favicon taking 0 CPU cycles after the fix. What was the fix? Just provide favicon.ico into your war directory! I should confess to my shame, it was the first time I ran into &lt;a href="http://en.wikipedia.org/wiki/Favicon"&gt;what favicon.ico actually is&lt;/a&gt;. So one could tell you better avoid false file lookups against your gae server, at least in case of favicon.ico…&lt;/p&gt;

&lt;p&gt;This is it for my progress right now. Yours Stan.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-8416808373027424170?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6xF1S6_Z_QH-QxCGLBqOj4UOdeY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6xF1S6_Z_QH-QxCGLBqOj4UOdeY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6xF1S6_Z_QH-QxCGLBqOj4UOdeY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6xF1S6_Z_QH-QxCGLBqOj4UOdeY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/aKXe0juv5DE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/8416808373027424170/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=8416808373027424170" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8416808373027424170?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/8416808373027424170?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/aKXe0juv5DE/plain-old-stan-on-road-to-google-engine.html" title="Plain old Stan on the road to Google engine. Part 2." /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_n09qEDO5M-8/TVBwfRmiOcI/AAAAAAAAAwc/VhNROs2wTJ4/s72-c/image_thumb%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/02/plain-old-stan-on-road-to-google-engine.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EMQHszeCp7ImA9Wx9VGU4.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-3395682135533746004</id><published>2011-02-05T19:48:00.001+01:00</published><updated>2011-02-05T19:48:01.580+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-05T19:48:01.580+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="google engine" /><title>Plain old M$ Stan on the road to Google app engine programming. Part 1.</title><content type="html">&lt;p&gt;This is a complete java and google app engine noob’s guide for getting from zero to somewhere. So if you are an experienced java/gae programmer please leave now &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh5.ggpht.com/_n09qEDO5M-8/TU2bUCSL6eI/AAAAAAAAAwM/aYr--rVsRi8/wlEmoticon-smile2.png?imgmax=800" /&gt;.&lt;/p&gt;  &lt;p&gt;You start with creating your app on a google engine: &lt;a title="http://code.google.com/appengine/" href="http://code.google.com/appengine/"&gt;http://code.google.com/appengine/&lt;/a&gt;. After you are through this bit, as an app developer you face a choice of python or java based development for the engine. For me this was a tough one. First, I was quite excited by all those google videos on python. But after few days developing and reading, I switched to java. Main reasons for that is similarity to C# (me bad), great support for refactoring and unit tests from Eclipse, amount of libraries available for java, and speculatively, java performance over python’s. Good post to read &lt;a href="http://stackoverflow.com/questions/1085898/choosing-java-vs-python-on-google-app-engine"&gt;here on StackOverflow&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;When creating my first Web app for the engine as described by google &lt;a href="http://code.google.com/appengine/docs/java/tools/eclipse.html"&gt;here&lt;/a&gt; I went for “with GWT” option. I don’t plan to use GWT but I was interested in what would the project layout be etc. I should say this GWT option with compile time of ~35 seconds for this HelloWorld type of application just confirmed what I learned from the classic ASP.NET world – that “automagic” is not worth it. I prefer to stay pretty much on the client side with javascript/jquery with some simple mvc on the server pumping json to me.&lt;/p&gt;  &lt;p&gt;And so I went with the “GWT” option unchecked for the next project. Build time? Can’t even notice!&lt;/p&gt;  &lt;p&gt;Here is that jsp war folder, I understand this is kind of a deployment structure for the app. That lib folder is something like “bin” folder in asp.net. Appengine-web.xml, logging.properties and web.xml comparable to web.config, let’s say.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_n09qEDO5M-8/TU2bUvSIa0I/AAAAAAAAAwQ/1wA5zpbqtvw/s1600-h/image3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_n09qEDO5M-8/TU2bWWqqggI/AAAAAAAAAwU/X9FMEN73s3g/image_thumb1.png?imgmax=800" width="250" height="262" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Next step was to scratch my head on the subject of an MVC framework. I wanted something really simple and when I saw that &lt;a href="http://www.antlr.org/wiki/display/ST/Five+minute+Introduction"&gt;StringTemplate from the same guy who wrote antlr&lt;/a&gt;, my choice was done for a moment.&lt;/p&gt;  &lt;p&gt;As a total java/eclipse noob I needed &lt;a href="http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29"&gt;this&lt;/a&gt; to see how to add StringTemplate jars to the project. I copied them as well to the war’s lib folder as you see above.&lt;/p&gt;  &lt;p&gt;I went with the simplest example I found, applied to servlet:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;package com.sdnotimetolose.gaelinks;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;import java.io.IOException;&lt;/pre&gt;

  &lt;pre&gt;import javax.servlet.http.*;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;import org.antlr.stringtemplate.*;&lt;/pre&gt;

  &lt;pre class="alt"&gt;import org.antlr.stringtemplate.language.*;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;@SuppressWarnings(&lt;span class="str"&gt;&amp;quot;serial&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Sdnotimetolose_gaeedilinksServlet extends HttpServlet {&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; doGet(HttpServletRequest req, HttpServletResponse resp)&lt;/pre&gt;

  &lt;pre&gt;            throws IOException {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        resp.setContentType(&lt;span class="str"&gt;&amp;quot;text/plain&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;        &lt;/pre&gt;

  &lt;pre class="alt"&gt;        StringTemplate hello = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringTemplate(&lt;span class="str"&gt;&amp;quot;Hello, $name$&amp;quot;&lt;/span&gt;, DefaultTemplateLexer.&lt;span class="kwrd"&gt;class&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;        hello.setAttribute(&lt;span class="str"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;World from GET and StringTemplate&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        resp.getWriter().println(hello.toString());&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; doPost(HttpServletRequest req, HttpServletResponse resp)&lt;/pre&gt;

  &lt;pre class="alt"&gt;            throws IOException {&lt;/pre&gt;

  &lt;pre&gt;        resp.setContentType(&lt;span class="str"&gt;&amp;quot;text/plain&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        resp.getWriter().println(&lt;span class="str"&gt;&amp;quot;Hello, world from POST method&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;To my happiness, that worked both locally and on the engine. Still I have to look if use of &lt;a href="http://code.google.com/closure/templates/docs/java_usage.html"&gt;Closure templates for java&lt;/a&gt; would not be more natural choice for the engine.&lt;/p&gt;

&lt;p&gt;This is it for today. Your’s Stan.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-3395682135533746004?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EvyacnhLQbfimU_HMAqUD1IUrR8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EvyacnhLQbfimU_HMAqUD1IUrR8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EvyacnhLQbfimU_HMAqUD1IUrR8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EvyacnhLQbfimU_HMAqUD1IUrR8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/YwNskRhetlc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/3395682135533746004/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=3395682135533746004" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/3395682135533746004?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/3395682135533746004?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/YwNskRhetlc/plain-old-m-stan-on-road-to-google-app.html" title="Plain old M$ Stan on the road to Google app engine programming. Part 1." /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_n09qEDO5M-8/TU2bUCSL6eI/AAAAAAAAAwM/aYr--rVsRi8/s72-c/wlEmoticon-smile2.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/02/plain-old-m-stan-on-road-to-google-app.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEAQn07cCp7ImA9Wx9VFUw.&quot;"><id>tag:blogger.com,1999:blog-584619127557205820.post-40975887473161903</id><published>2011-02-01T00:30:00.001+01:00</published><updated>2011-02-01T00:30:43.308+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-01T00:30:43.308+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="google engine" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Setting up Eclipse/Python for Google engine development on Mac</title><content type="html">&lt;p&gt;Just wanted to share about few diffs in google version of setup here: &lt;a title="http://code.google.com/appengine/articles/eclipse.html" href="http://code.google.com/appengine/articles/eclipse.html"&gt;http://code.google.com/appengine/articles/eclipse.html&lt;/a&gt; and current state.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://pydev.org/download.html"&gt;PyDev extension&lt;/a&gt; update site for Eclipse has moved to &lt;a href="http://pydev.org/updates"&gt;http://pydev.org/updates&lt;/a&gt; and google engine sdk is located normally here: /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine (found &lt;a href="http://groups.google.com/group/google-appengine-python/browse_thread/thread/1c6dcf31920b398b?pli=1"&gt;here&lt;/a&gt; on google groups).&lt;/p&gt;  &lt;p&gt;With those tiny updates to the article above I was able to achieve a python &lt;a href="http://www.urbandictionary.com/define.php?term=newbee"&gt;newbie&lt;/a&gt; nirvana on my Mac:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_n09qEDO5M-8/TUdGFsSh9OI/AAAAAAAAAwA/IE_6Vi5QOPs/s1600-h/image%5B5%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_n09qEDO5M-8/TUdGHfwO8yI/AAAAAAAAAwE/7jWEFSA3G70/image_thumb%5B3%5D.png?imgmax=800" width="605" height="413" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So far in my trip I’m keeping faith in javascript/jQuery over GWT, with my ASP.NET classic vs. MVC/json/jquery beliefs mapped quite well in this &lt;a href="http://blog.phiz.net/gwt-its-not-you-its-me"&gt;GWT vs. Javascript article&lt;/a&gt;. And still faithful on python choice over java. At least for those mid size apps…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/584619127557205820-40975887473161903?l=plainoldstan.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yraD5q5apmMwhj-1nfooJP4B4Vs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yraD5q5apmMwhj-1nfooJP4B4Vs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yraD5q5apmMwhj-1nfooJP4B4Vs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yraD5q5apmMwhj-1nfooJP4B4Vs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PlainOldStan/~4/YrmcyZsWblo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://plainoldstan.blogspot.com/feeds/40975887473161903/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=584619127557205820&amp;postID=40975887473161903" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/40975887473161903?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/584619127557205820/posts/default/40975887473161903?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PlainOldStan/~3/YrmcyZsWblo/setting-up-eclipsepython-for-google.html" title="Setting up Eclipse/Python for Google engine development on Mac" /><author><name>Stanislav Dvoychenko</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_n09qEDO5M-8/TUdGHfwO8yI/AAAAAAAAAwE/7jWEFSA3G70/s72-c/image_thumb%5B3%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://plainoldstan.blogspot.com/2011/01/setting-up-eclipsepython-for-google.html</feedburner:origLink></entry></feed>

