<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Eran Nachum's Blog</title>
    <link>http://www.eranachum.com/</link>
    <description>www.eranachum.com - Implementing &amp; executing my thoughts...</description>
    <language>en-us</language>
    <copyright>Eran Nachum</copyright>
    <lastBuildDate>Wed, 19 Oct 2011 08:50:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>eranachum@hotmail.com</managingEditor>
    <webMaster>eranachum@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=ce318f15-b02b-4d6b-8f31-0a91a238de11</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,ce318f15-b02b-4d6b-8f31-0a91a238de11.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I bumped into a nice solution that enables you to speed up your websites pages loading.
   </p>
        <p>
          <em>“Page Speed Service is an online service to automatically speed up loading of
      your web pages. Page Speed Service fetches content from your servers, rewrites your
      pages by applying web performance best practices and serves them to end users via
      Google's servers across the globe”.</em>
        </p>
        <p>
      I think that this is a good solution for those who doesn’t familiar with the advanced
      caching solutions or for beginner or not pro developers which want a way to increase
      performance, but if you are an experienced developer you should get your own solutions
      coding them under your application like: caching,  load balancer solutions for
      large website etc…
   </p>
        <p>
      you get get some more information <a href="http://code.google.com/speed/pss/index.html" target="_blank">here</a>.
   </p>
        <p>
          <img src="http://www.google.com/images/icons/product/pagespeed-100.png" />
        </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=ce318f15-b02b-4d6b-8f31-0a91a238de11" />
      </body>
      <title>Web Page Speed Service &amp;ndash; Google Service</title>
      <guid>http://www.eranachum.com/PermaLink,guid,ce318f15-b02b-4d6b-8f31-0a91a238de11.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,ce318f15-b02b-4d6b-8f31-0a91a238de11.aspx</link>
      <pubDate>Wed, 19 Oct 2011 08:50:00 GMT</pubDate>
      <description>&lt;p&gt;
   I bumped into a nice solution that enables you to speed up your websites pages loading.
&lt;/p&gt;
&lt;p&gt;
   &lt;em&gt;“Page Speed Service is an online service to automatically speed up loading of
   your web pages. Page Speed Service fetches content from your servers, rewrites your
   pages by applying web performance best practices and serves them to end users via
   Google's servers across the globe”.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
   I think that this is a good solution for those who doesn’t familiar with the advanced
   caching solutions or for beginner or not pro developers which want a way to increase
   performance, but if you are an experienced developer you should get your own solutions
   coding them under your application like: caching,&amp;#160; load balancer solutions for
   large website etc…
&lt;/p&gt;
&lt;p&gt;
   you get get some more information &lt;a href="http://code.google.com/speed/pss/index.html" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
   &lt;img src="http://www.google.com/images/icons/product/pagespeed-100.png" /&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=ce318f15-b02b-4d6b-8f31-0a91a238de11" /&gt;</description>
      <category>Solutions;Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=99f2cc60-1579-477c-9814-5fcead0af6df</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,99f2cc60-1579-477c-9814-5fcead0af6df.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I had a task at work to get a web page content (using System.Net.WebRequest) in order
      to send the data by demand by email or in other ways.
   </p>
        <p>
      The web page holds contents like images and more that need to be send by email in
      order to display the html content properly.
   </p>
        <p>
      In order to parse the html content and look out for the images in order to download
      them to the server manually (a thing that will cause a lot of regex work and parsing
      issues), I found a great open source module (by <strong>Sharon Djabnoun</strong>,
      my allrise.com teammate, recommendation) that called <strong>HTML Agility Pack. <em>“</em></strong><em>This
      is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT
      (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...).
      It is a .NET code library that allows you to parse "out of the web" HTML
      files. The parser is very tolerant with "real world" malformed HTML. The
      object model is very similar to what proposes System.Xml, but for HTML documents (or
      streams).”</em></p>
        <p>
      Now, the work on the html content will be very easy and fast – the only thing that
      I’ll need to do is to fine the images node, download the images to the server, set
      the directive of the image’s source and send the email with the attachments and the
      fixed URL content to point the new location of the images.
   </p>
        <p>
      You can find it <a href="http://www.codeplex.com/htmlagilitypack" target="_blank">here</a>.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=99f2cc60-1579-477c-9814-5fcead0af6df" />
      </body>
      <title>Html Agility Pack</title>
      <guid>http://www.eranachum.com/PermaLink,guid,99f2cc60-1579-477c-9814-5fcead0af6df.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,99f2cc60-1579-477c-9814-5fcead0af6df.aspx</link>
      <pubDate>Wed, 10 Jun 2009 06:59:00 GMT</pubDate>
      <description>&lt;p&gt;
   I had a task at work to get a web page content (using System.Net.WebRequest) in order
   to send the data by demand by email or in other ways.
&lt;/p&gt;
&lt;p&gt;
   The web page holds contents like images and more that need to be send by email in
   order to display the html content properly.
&lt;/p&gt;
&lt;p&gt;
   In order to parse the html content and look out for the images in order to download
   them to the server manually (a thing that will cause a lot of regex work and parsing
   issues), I found a great open source module (by &lt;strong&gt;Sharon Djabnoun&lt;/strong&gt;,
   my allrise.com teammate, recommendation) that called &lt;strong&gt;HTML Agility Pack. &lt;em&gt;“&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;This
   is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT
   (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...).
   It is a .NET code library that allows you to parse &amp;quot;out of the web&amp;quot; HTML
   files. The parser is very tolerant with &amp;quot;real world&amp;quot; malformed HTML. The
   object model is very similar to what proposes System.Xml, but for HTML documents (or
   streams).”&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
   Now, the work on the html content will be very easy and fast – the only thing that
   I’ll need to do is to fine the images node, download the images to the server, set
   the directive of the image’s source and send the email with the attachments and the
   fixed URL content to point the new location of the images.
&lt;/p&gt;
&lt;p&gt;
   You can find it &lt;a href="http://www.codeplex.com/htmlagilitypack" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=99f2cc60-1579-477c-9814-5fcead0af6df" /&gt;</description>
      <category>Solutions;C#</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=55ea5712-7d7d-4343-9a13-421ff45a01c4</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,55ea5712-7d7d-4343-9a13-421ff45a01c4.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      This is quite strange story... but I decided to publish this post because I didn't
      find any proper solution anywhere; and I mean it <strong>ANYWHERE!</strong></p>
        <p>
      It begins like that: I am running an asp.net 2.0 web application that as part of its
      work, it has to communicate 3rd party assembly, which suppose to retrieve some validation
      data. Until here everything is just fine right?
   </p>
        <p>
      In order to invoke the 3rd party service (using an API of course), there is a need
      to install a X509Cerificate with 'secret' password and to install it on the server
      that runs the web application. After doing it you must  impersonate the ASP.NET
      process with the logged-in user that installed the certificate in order to 'grant'
      this user permission (administrator) to the current context of the web application.
   </p>
        <p>
          <em>Note: the user credentials will be kept in the web application web.config encrypted
      of course.</em>
        </p>
        <p>
      When running this application in my dev box, everything was working just fine, but
      when done with unit testing and was ready to QA, only when the user that installed
      the X509Certificate was logged in to the system (windows) the access to this specific
      certificate could be done. When the user was logged off, the Initialize method that
      initializes the certificate, couldn't find it in the CurrentUserStore:
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Initialize(some
      parameters...)<br />
      {<br />
         X509CertificateCollection certificates;<br />
         X509CertificateStore store <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> X509CertificateStore.CurrentUserStore(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"My"</span>);<br />
         <br /></span>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   store.Open();<br />
         certificates <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> store.FindCertificateBySubjectName(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;subject&gt;"</span>);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">   if</span> (certificates.Count
      &lt;= 0)<br />
         {<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">      throw</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Exception(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"&lt;message&gt;"</span>));<br />
         }<br />
      }<br /><br /></span>
        </p>
        <p>
      I admit that I didn't have any clue of how solving this acute problem, which of course
      stuck all the process of dev.
   </p>
        <p>
      After consulting with some colleagues, we decided to try a 'detour solution', that
      will raise the user up into the system (will keep it alive, unlike doing log off to
      the user that terminates it from the OS).
   </p>
        <p>
          <strong>Finally the solution (what you've waited for of course):</strong> 
   </p>
        <p>
      We created a blank window service (with an installer) that actually does nothing,
      complied it and installed it in the QA server. Now here is the catch: First, the window
      service's startup type is set to <strong>Automatically</strong> (will be started always
      when the OS is up). secondly we adjusted the service's log on to a specific account
      that held the credentials of the user that installed the certificate of course. The
      purpose of this action is to keep this user up all time in order let our 3rd party
      application find its certificate in its store.
   </p>
        <p>
      Outcome - it is working smoothly like magic. We can continue working...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=55ea5712-7d7d-4343-9a13-421ff45a01c4" />
      </body>
      <title>Runtime Error: Cannot Find X509Certificate in CurrentUserStore when User is Logged Off</title>
      <guid>http://www.eranachum.com/PermaLink,guid,55ea5712-7d7d-4343-9a13-421ff45a01c4.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,55ea5712-7d7d-4343-9a13-421ff45a01c4.aspx</link>
      <pubDate>Tue, 25 Mar 2008 18:49:00 GMT</pubDate>
      <description>&lt;p&gt;
   This is quite strange story... but I decided to publish this post because I didn't
   find any proper solution anywhere; and I mean it &lt;strong&gt;ANYWHERE!&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   It begins like that: I am running an asp.net 2.0 web application that as part of its
   work, it has to communicate 3rd party assembly, which suppose to retrieve some validation
   data. Until here everything is just fine right?
&lt;/p&gt;
&lt;p&gt;
   In order to invoke the 3rd party service (using an API of course), there is a need
   to install a X509Cerificate with 'secret' password and to install it on the server
   that runs the web application. After doing it you must&amp;nbsp; impersonate the ASP.NET
   process with the logged-in user that installed the certificate in order to 'grant'
   this user permission (administrator) to the current context of the web application.
&lt;/p&gt;
&lt;p&gt;
   &lt;em&gt;Note: the user credentials will be kept in the web application web.config encrypted
   of course.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
   When running this application in my dev box, everything was working just fine, but
   when done with unit testing and was ready to QA, only when the user that installed
   the X509Certificate was logged in to the system (windows) the access to this specific
   certificate could be done. When the user was logged off, the Initialize method that
   initializes the certificate, couldn't find it in the CurrentUserStore:
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; Initialize(some
   parameters...)&lt;br&gt;
   {&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;X509CertificateCollection certificates;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;X509CertificateStore store &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; X509CertificateStore.CurrentUserStore(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"My"&lt;/span&gt;);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
   &lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;store.Open();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;certificates &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; store.FindCertificateBySubjectName(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"&amp;lt;subject&amp;gt;"&lt;/span&gt;);&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (certificates.Count
   &amp;lt;= 0)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Exception(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"&amp;lt;message&amp;gt;"&lt;/span&gt;));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   }&lt;br&gt;
   &lt;br&gt;
&lt;/p&gt;
&gt; 
&lt;p&gt;
   I admit that I didn't have any clue of how solving this acute problem, which of course
   stuck all the process of dev.
&lt;/p&gt;
&lt;p&gt;
   After consulting with some colleagues, we decided to try a 'detour solution', that
   will raise the user up into the system (will keep it alive, unlike doing log off to
   the user that terminates it from the OS).
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;Finally the solution (what you've waited for of course):&lt;/strong&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
   We created a blank window service (with an installer) that actually does nothing,
   complied it and installed it in the QA server. Now here is the catch: First, the window
   service's startup type is set to &lt;strong&gt;Automatically&lt;/strong&gt; (will be started always
   when the OS is up). secondly we adjusted the service's log on to a specific account
   that held the credentials of the user that installed the certificate of course. The
   purpose of this action is to keep this user up all time in order let our 3rd party
   application find its certificate in its store.
&lt;/p&gt;
&lt;p&gt;
   Outcome - it is working smoothly like magic. We can continue working...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=55ea5712-7d7d-4343-9a13-421ff45a01c4" /&gt;</description>
      <category>Bugs;Solutions;System</category>
    </item>
  </channel>
</rss>