<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://dimapasko.spaces.live.com/mmm2008-05-17_13.22/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fdimapasko.spaces.live.com%2fcategory%2fCode%2bSamples%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Dima Pasko: Code Samples</title><description /><link>http://dimapasko.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catCode%2bSamples</link><language>en-US</language><pubDate>Tue, 20 May 2008 09:46:23 GMT</pubDate><lastBuildDate>Tue, 20 May 2008 09:46:23 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://dimapasko.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>7266316396383656</live:id><live:alias>dimapasko</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>Корректный Double Checking Locking Pattern</title><link>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!153.entry</link><description>&lt;p&gt; &lt;pre lang=cpp&gt;&lt;font color=blue&gt;class&lt;/font&gt; Singleton 
{
    &lt;font color=blue&gt;private&lt;/font&gt; &lt;font color=blue&gt;static&lt;/font&gt; readonly object _locker = &lt;font color=blue&gt;new&lt;/font&gt; object();
    &lt;font color=blue&gt;private&lt;/font&gt; &lt;font color=blue&gt;static&lt;/font&gt; &lt;font color=blue&gt;&lt;strong&gt;volatile&lt;/strong&gt;&lt;/font&gt; Singleton _instance = null;

    &lt;font color=blue&gt;public&lt;/font&gt; &lt;font color=blue&gt;static&lt;/font&gt; Singleton Instance
    {
	get
	{
	    &lt;font color=blue&gt;if&lt;/font&gt;( _instance == null ) 
	    {
                lock( _locker ) 
                    &lt;font color=blue&gt;if&lt;/font&gt;( _instance == null ) 
                        _instance = &lt;font color=blue&gt;new&lt;/font&gt; Singleton();
            }
            &lt;font color=blue&gt;return&lt;/font&gt; _instance;      
        }
    }
}&lt;/pre&gt;
&lt;p&gt;Взято с &lt;a href="http://blogs.byte-force.com/xor/archive/2006/01/25/754.aspx"&gt;http://blogs.byte-force.com/xor/archive/2006/01/25...&lt;/a&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7266316396383656&amp;page=RSS%3a+%d0%9a%d0%be%d1%80%d1%80%d0%b5%d0%ba%d1%82%d0%bd%d1%8b%d0%b9+Double+Checking+Locking+Pattern&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dimapasko.spaces.live.com&amp;amp;GT1=dimapasko"&gt;</description><comments>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!153.entry#comment</comments><guid isPermaLink="true">http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!153.entry</guid><pubDate>Thu, 02 Nov 2006 13:31:08 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dimapasko.spaces.live.com/blog/cns!19D0AD1FA1CDA8!153/comments/feed.rss</wfw:commentRss><wfw:comment>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!153.entry#comment</wfw:comment><dcterms:modified>2006-11-02T13:32:19Z</dcterms:modified></item><item><title>Web Request &amp; Security Exception</title><link>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!148.entry</link><description>&lt;p&gt; &lt;p&gt;Юзаем на хостинге:&lt;pre lang=cpp&gt;HttpWebRequest request = (HttpWebRequest) WebRequest.Create(http:&lt;font color=green&gt;//www.ya.ru/);&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;выдает:&lt;br&gt;&lt;em&gt;Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.&lt;br&gt;Exception Details: System.Security.SecurityException: Request for the permission of type System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.&lt;br&gt;&lt;/em&gt;&lt;br&gt;долго думали :-)&lt;br&gt;читали &lt;a href="http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/50dd64175a525bc8/c9e86e834ee517d0?lnk=st&amp;amp;q=WebRequest.Create+Security+Exception&amp;amp;amp;amp;amp;rnum=2&amp;amp;hl=ru#c9e86e834ee517d0"&gt;Google Group&lt;/a&gt;&lt;br&gt;добавили в web.config:&lt;pre lang=cpp&gt;&amp;lt;system.web&amp;gt;
&amp;lt;trust originurl=&lt;font color=magenta&gt;&amp;quot;&amp;quot; level=&amp;quot;&lt;/font&gt;Full&amp;quot;&amp;gt;
&amp;lt;/system.web&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;заработало!!!&lt;/strong&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7266316396383656&amp;page=RSS%3a+Web+Request+%26+Security+Exception&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dimapasko.spaces.live.com&amp;amp;GT1=dimapasko"&gt;</description><comments>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!148.entry#comment</comments><guid isPermaLink="true">http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!148.entry</guid><pubDate>Fri, 13 Oct 2006 08:54:24 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dimapasko.spaces.live.com/blog/cns!19D0AD1FA1CDA8!148/comments/feed.rss</wfw:commentRss><wfw:comment>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!148.entry#comment</wfw:comment><dcterms:modified>2006-10-13T08:54:56Z</dcterms:modified></item><item><title>Convert IList to Generic List</title><link>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!138.entry</link><description>&lt;pre lang=cpp&gt;        &lt;font color=blue&gt;protected&lt;/font&gt; &lt;font color=blue&gt;static&lt;/font&gt; List&amp;lt;T&amp;gt; ConvertToGenericList(IList listObjects)
        {
            List&amp;lt;T&amp;gt; convertedList = &lt;font color=blue&gt;new&lt;/font&gt; List&amp;lt;T&amp;gt;(listObjects.Count);

            foreach (object listObject in listObjects)
            {
                convertedList.Add((T) listObject);
            }

            &lt;font color=blue&gt;return&lt;/font&gt; convertedList;
        }&lt;/pre&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7266316396383656&amp;page=RSS%3a+Convert+IList+to+Generic+List&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dimapasko.spaces.live.com&amp;amp;GT1=dimapasko"&gt;</description><comments>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!138.entry#comment</comments><guid isPermaLink="true">http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!138.entry</guid><pubDate>Fri, 25 Aug 2006 12:12:57 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dimapasko.spaces.live.com/blog/cns!19D0AD1FA1CDA8!138/comments/feed.rss</wfw:commentRss><wfw:comment>http://dimapasko.spaces.live.com/Blog/cns!19D0AD1FA1CDA8!138.entry#comment</wfw:comment><dcterms:modified>2006-08-25T12:15:43Z</dcterms:modified></item></channel></rss>