<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pavel Chuchuva</title>
	<atom:link href="http://chuchuva.com/pavel/feed/" rel="self" type="application/rss+xml" />
	<link>http://chuchuva.com/pavel</link>
	<description>Blog about software</description>
	<lastBuildDate>Mon, 07 May 2012 11:22:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>PowerShell Exit Codes</title>
		<link>http://chuchuva.com/pavel/2012/05/powershell-exit-codes/</link>
		<comments>http://chuchuva.com/pavel/2012/05/powershell-exit-codes/#comments</comments>
		<pubDate>Mon, 07 May 2012 11:22:06 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=268</guid>
		<description><![CDATA[Recently I came across an interesting quirk in PowerShell: exit codes from powershell.exe are inconsistent. As you may know there are two ways of launching PowerShell script: you can use -File or -Command parameter. powershell -File test.ps1 or powershell -Command &#8230; <a href="http://chuchuva.com/pavel/2012/05/powershell-exit-codes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I came across an interesting quirk in PowerShell: exit codes from powershell.exe are inconsistent.</p>
<p>As you may know there are two ways of launching PowerShell script: you can use -File or -Command parameter.</p>
<pre><code>powershell -File test.ps1
</code></pre>
<p>or</p>
<pre><code>powershell -Command .\test.ps1
</code></pre>
<p>-Command could be ommitted:</p>
<pre><code>powershell .\test.ps1
</code></pre>
<p>Now let&#8217;s say you want to execute PowerShell script from a scheduled task or from continuous integration server. Naturally, you would be interested if the script fails or not.</p>
<p>And here&#8217;s the bug: if you launch your script using -File parameter powershell.exe exits with zero code even if there was an exception.</p>
<p>You can confirm this by creating a script that always throws an error:</p>
<pre><code>throw 'oops'
</code></pre>
<p>Now if you launch it using -File parameter exit code is 0:</p>
<pre><code>powershell.exe -File testerror.ps1
echo Error level is %ERRORLEVEL%

oops
At C:\testerror.ps1:1 char:6
+ throw &lt;&lt;&lt;&lt;  'oops'
    + CategoryInfo          : OperationStopped: (oops:String) [], RuntimeException
    + FullyQualifiedErrorId : oops

Error level is 0
</code></pre>
<p>But if you use -Command parameter exit code is set as expected:</p>
<pre><code>powershell.exe -Command .\testerror.ps1
echo Error level is %ERRORLEVEL%
</code></pre>
<p>Chris Oldwood also <a href="http://chrisoldwood.blogspot.com.au/2011/05/powershell-throwing-exceptions-exit.html">came across</a> this bug:</p>
<blockquote>
<p>depending on whether I use the “-File” or “-Command” switch to execute the .ps1 script I get different behaviour. Is this a PowerShell bug or is there something fundamental about the execution model the differs between -File and -Command that I’ve yet to understand?</p>
</blockquote>
<h2>Bonus</h2>
<p>How to execute PowerShell script from NAnt script:</p>
<pre><code>&lt;exec program="powershell.exe" append="true"&gt;
  &lt;arg value="-noprofile" /&gt;
  &lt;arg value="&amp;amp;'C:\your-script.ps1'" /&gt;
  &lt;arg value="param1" /&gt;
  &lt;arg value="'param 2 with spaces'" /&gt;
&lt;/exec&gt;
</code></pre>
<h2>References</h2>
<ul>
<li><a href="http://blogs.msdn.com/b/powershell/archive/2006/10/14/windows-powershell-exit-codes.aspx">Windows PowerShell Exit Codes</a></li>
<li><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/06/06/get-legacy-exit-codes-in-powershell.aspx">Get Legacy Exit Codes in PowerShell</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2012/05/powershell-exit-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Far Manager and Quotes</title>
		<link>http://chuchuva.com/pavel/2012/02/far-manager-and-quotes/</link>
		<comments>http://chuchuva.com/pavel/2012/02/far-manager-and-quotes/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 10:58:16 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=267</guid>
		<description><![CDATA[Far Manager has two keyboard shortcuts to copy file name to clipboard: Ctrl+Ins copies selected file name Alt+Shift+Ins copies full path to selected file These shortcuts also work if multiple files are selected which is great for creating batch renames. &#8230; <a href="http://chuchuva.com/pavel/2012/02/far-manager-and-quotes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Far Manager has two keyboard shortcuts to copy file name to clipboard:</p>
<ul>
<li>Ctrl+Ins copies selected file name</li>
<li>Alt+Shift+Ins copies full path to selected file</li>
</ul>
<p>These shortcuts also work if multiple files are selected which is great for creating batch renames.</p>
<p>Let&#8217;s say file name contains spaces. In this case Far Manager adds quotes around file name. Supposedly this saves time if you construct some command line somewhere. Personally I find this totally unnecessary. I can add quotes myself, thank you very much.</p>
<p>Here&#8217;s how to disable this behaviour:</p>
<ol>
<li>Open HKEY_CURRENT_USER\Software\Far2\System</li>
<li>Create QuotedName as DWORD value</li>
<li>Set it to 1</li>
</ol>
<p><a href="http://www.farmanager.com/svn/trunk/docs/ENG/TechInfo.txt">Official documentation</a> for this feature is a bit obscure:</p>
<blockquote>
<pre><code>File or folder names, containing characters specified in rule  34,  will
be quoted when inserted into the editor/command line or the clipboard.
The key "System/QuotedName" of DWORD type controls this behaviour.
Bits:
  0 - if set then file or folder names will be quoted inserted into
      the editor/command line.
  1 - if set then file or folder names will be quoted inserted into
      the clipboard.
The default value = 0xFFFFFFFF (quote file or folders names).
</code></pre>
</blockquote>
<p>I think you need to be a developer to understand this.</p>
<p>Note two similar shortcuts:</p>
<ul>
<li>Ctrl+Enter copies selected file name to command line</li>
<li>Ctrl+F copies full path</li>
</ul>
<p>For this auto-quoting is actually useful, therefore I set QuotedName to 1, not 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2012/02/far-manager-and-quotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to open HTML files with Visual Studio from Far Manager</title>
		<link>http://chuchuva.com/pavel/2012/01/how-to-open-html-files-with-visual-studio-from-far-manager/</link>
		<comments>http://chuchuva.com/pavel/2012/01/how-to-open-html-files-with-visual-studio-from-far-manager/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 10:02:07 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[far-manager]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=264</guid>
		<description><![CDATA[Occasionally I want to edit plain HTML file in Visual Studio. You know, those files with .htm or .html extension. Normally pressing Enter in Far Manager opens them in a browser. This is what I want most of the time, &#8230; <a href="http://chuchuva.com/pavel/2012/01/how-to-open-html-files-with-visual-studio-from-far-manager/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Occasionally I want to edit plain HTML file in Visual Studio. You know, those files with .htm or .html extension. Normally pressing Enter in Far Manager opens them in a browser. This is what I want most of the time, so let&#8217;s keep it.</p>
<p>Idea: let&#8217;s use F4 key to open file in Visual Studio.</p>
<p>Here&#8217;s how to achieve it:</p>
<p>* Open Commands menu, select File associations.<br />
* Add new association, enter *.htm;*.html as a mask. Enter this command for F4:</p>
<pre><code>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /edit "!.!"</code></pre>
<p><img class="alignnone size-full wp-image-265" src="http://chuchuva.com/pavel/images/2012/01/far-file-associations.png" alt="" width="727" height="389" /></p>
<p>Change path to devenv.exe if you have different version of Visual Studio.</p>
<p>Note the /edit parameter. It makes Visual Studio to re-use existing window if it is alredy running. Visual Studio is not exactly a lightweight editor so let&#8217;s be efficient here.</p>
<p>What if you want to open HTML file in internal Far editor? Simple: press Alft+F4.</p>
<p><strong>Reference:</strong></p>
<p><a href="http://msdn.microsoft.com/en-us/library/xee0c8y7.aspx">Devenv Command Line Switches</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2012/01/how-to-open-html-files-with-visual-studio-from-far-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solyanka Recipe</title>
		<link>http://chuchuva.com/pavel/2011/10/solyanka-recipe/</link>
		<comments>http://chuchuva.com/pavel/2011/10/solyanka-recipe/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 09:57:08 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=243</guid>
		<description><![CDATA[Solyanka is a traditional Russian soup, very tasty. This recipe is from cooking site say7.info, translated from Russian. Ingredients 700 g beef 6-10 types of ham, smoked ribs, sausages, salami, hot dogs, small sausages etc. Total weight 1 kg. 150 &#8230; <a href="http://chuchuva.com/pavel/2011/10/solyanka-recipe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Solyanka is a traditional Russian soup, very tasty. This recipe is from cooking site <a href="http://www.say7.info/cook/recipe/258-Solyanka-myasnaya.html">say7.info</a>, translated from Russian.</p>
<p><img src="http://chuchuva.com/pavel/images/2011/10/258_0162p9x_4643_6gi.jpg" alt="" title="258_0162p9x_4643_6gi" width="640" height="480" class="alignnone size-full wp-image-244" /></p>
<h2>Ingredients</h2>
<p>
<img id="ingrphoto" width="300" height="225" src="http://chuchuva.com/pavel/images/2011/10/258_010042a2e_4163_b.jpg" alt="Ingredients" class="alignright size-full"></p>
<ul>
<li>700 g beef</li>
<li>6-10 types of ham, smoked ribs, sausages, salami, hot dogs, small sausages etc. Total weight 1 kg.</li>
<li>150 g carrot</li>
<li>150 g onion</li>
<li>200 g pickled cucumbers</li>
<li>5 tablespoons tomato paste </li>
<li>3 tablespoons capers</li>
<li>black pepper</li>
<li>3-4 bay leaves</li>
<li>vegetable oil</li>
<li>1 lemon</li>
<li>olives to taste</li>
<li>dill or parsley</li>
</ul>
<h2>Method</h2>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0242a2e_4230_b.jpg"><br />
  Place beef in a pan. Bring to a boil, cover and simmer for one and half hour (on medium, skim off the scum).</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0342a2e_4448_b.jpg"><br />
  Take the meat out, let it cool, chop into small pieces.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0442a2e_4454_b.jpg"><br />
  Chop onion.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0576r2s_4459_b.jpg"><br />
  Grate carrot on medium grater.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0676r2s_4469_b.jpg"><br />
  Dice cucumbers.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0776r2s_4481_b.jpg"><br />
  Dice or julienne meat items (cervelat, ham, smoked ribs, sausages, salami, hot dogs, small sausages, bacon etc).</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0876r2s_4499_b.jpg"><br />
  Fry meat items slightly on vegetable oil.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_0928ugt_4507_b.jpg"><br />
    Fry onion slightly on vegetable oil.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_01028ugt_4520_b.jpg"><br />
  Add carrot, fry a bit.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_01128ugt_4534_b.jpg"><br />
  Add cucumbers, fry for 2-3 minutes.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_01287_8720_b.jpg"><br />
  Add tomato paste, simmer for 5-7 minutes on low.<br />
  <br />
  If tomato paste is too thick you can add some water. </p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_01328ugt_4553_b.jpg"><br />
  Add meat items to the boiling stock.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_01428ugt_4565_b.jpg"><br />
  Then add beef. Simmer for 5-7 minutes.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_01528ugt_4580_b.jpg"><br />
  Add few capers to taste.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_016861nj_4598_b.jpg"><br />
  Add fried onion, carrot and cucumbers.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_017861nj_4609_b.jpg"><br />
  Add  half of cup of cucumber or olive pickle. Simmer for 5-7 minutes more.</p>
<p style="clear:both">
  <img width="300" height="225" alt="" class="alignleft size-full" src="http://chuchuva.com/pavel/images/2011/10/258_018861nj_4619_b.jpg"><br />
  Add bay leaves, pepper, dill, parsley.<br />
  <br />
Add salt if needed. Leave it covered for 15-20 minutes. Remove bay leaves.</p>
<p style="clear:both">
<p>  Pour soup into bowls. Put lemon and olives into each bowl.</p>
<p><b>Enjoy!</b></p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2011/10/solyanka-recipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving backup to Amazon S3</title>
		<link>http://chuchuva.com/pavel/2011/03/improving-backup-to-amazon-s3/</link>
		<comments>http://chuchuva.com/pavel/2011/03/improving-backup-to-amazon-s3/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 20:08:39 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Develop]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=236</guid>
		<description><![CDATA[I use s3.exe command line utility to backup photos to Amazon Simple Storage (S3) and it works great. I have lots of photos to backup: 900,000 files in 4,000 folders. Obivously it is impractical to copy all files on every &#8230; <a href="http://chuchuva.com/pavel/2011/03/improving-backup-to-amazon-s3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://s3.codeplex.com/">s3.exe command line</a> utility to backup photos to Amazon Simple Storage (S3) and it works great.</p>
<p>I have lots of photos to backup: 900,000 files in 4,000 folders.</p>
<p>Obivously it is impractical to copy all files on every backup &#8211; it will take forever. s3.exe has exact feature that I need:</p>
<blockquote><p>/sync is used with the put command and only uploads files that do not exist on S3 or have been modified since last being uploaded, based on the timestamp. It can be used alone or in conjunction with the /sub option for a fast incremental backup of a whole directory.</p></blockquote>
<p>Here&#8217;s command line that I use for backups:</p>
<pre><code>s3.exe put mybucket C:\photos\ /sub:withdelete /sync /acl:public-read /yes /nogui</code></pre>
<h1>Charges</h1>
<p>When I started using S3 however I was surpised with the bill from Amazon.</p>
<p>Let&#8217;s open source code to see how backup is done. Here are relevant bits:</p>
<pre><code class="prettyprint">foreach (string file in Sub.GetFiles(directory, filename, sub))
...
DateTime? lastModified = svc.getLastModified(bucket, key);
if (lastModified.HasValue &amp;&amp; lastModified.Value &gt; File.GetLastWriteTimeUtc(file))
{
Progress.reportProgress(key, 0, 0);
continue;
}
</code></pre>
<p>For each file s3.exe gets last modified date from the storage. If it is greater than last modified date of local file then no upload is performed.</p>
<p>Let&#8217;s do some calculations. To get last modified date s3.exe sends HEAD request. Amazon charges $0.01 per 10,000 HEAD requests. So I would end up paying $0.09 every time I perform backup. If I do it every day that&#8217;s $27 per month.</p>
<p>Let&#8217;s try to optimize it. How about this: for every local folder get the corresponding list of files in storage. Last modified date will be included in response. Now we&#8217;re going to issue about 4,000 LIST requests (1 for each folder). 1,000 LIST requests is $0.01 so that would be $0.04 in total. Or $1.20 per month &#8211; that&#8217;s saving ofÂ $25.80 &#8211; a big win <img src='http://chuchuva.com/pavel/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h1>Making the Patch</h1>
<p>I have created a patch by following steps from <a href="http://www.hanselman.com/blog/ExampleHowToContributeAPatchToAnOpenSourceProjectLikeDasBlog.aspx">Scott Hanselman&#8217;s blog post</a>.</p>
<p><img class="alignnone size-full wp-image-237" src="http://chuchuva.com/pavel/images/2011/03/patch1.png" alt="" width="350" height="229" /></p>
<p><img class="alignnone size-full wp-image-238" src="http://chuchuva.com/pavel/images/2011/03/patch2.png" alt="" width="409" height="388" /></p>
<p>I have submitted my patch to Codeplex, let&#8217;s see if project owner decides that it&#8217;s good enough to be applied.</p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2011/03/improving-backup-to-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Progress so far</title>
		<link>http://chuchuva.com/pavel/2010/12/progress-so-far/</link>
		<comments>http://chuchuva.com/pavel/2010/12/progress-so-far/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 07:16:08 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[progress-report]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=210</guid>
		<description><![CDATA[I have started working on my own business in December 2008. Here&#8217;s the progress so far. Idea Idea is very simple: Â web gallery with shopping cart for wedding photographers. For more details see my older post. Pricing Fotrel is a &#8230; <a href="http://chuchuva.com/pavel/2010/12/progress-so-far/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have started working on my own business in December 2008. Here&#8217;s the progress so far.</p>
<h1>Idea</h1>
<p>Idea is very simple: Â web gallery with shopping cart for wedding photographers. For more details see my older post.</p>
<h1>Pricing</h1>
<p>Fotrel is a web application. My clients use it as a service. The whole software-as-a-service model has a great appeal to me. I can make money while I sleep. There is no pain ofÂ acquiringÂ new clients.</p>
<p>I&#8217;ve set the price to $95 per month right from the beginning. I didn&#8217;t want my product to look cheap. On the other hand it is flat price. I don&#8217;t like the idea of charging commission for this kind of service. For some reason it feels like putting my hands in client&#8217;s pocket. After all, my expenses are exactly the same regardless of how many orders my client gets.</p>
<p>Then, after reading <a href="http://www.amazon.com/gp/product/0312284543?ie=UTF8&amp;tag=pavechuc-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0312284543">Jay Abraham&#8217;s book</a> I got an idea: charge $95 per month only if photographer has sales in that month. This creates a safety net for my clients: if my product doesn&#8217;t bring profit to them at least they are not losing money on it. This should be especially appealing to small (one-person) studios. Also, when you have sales paying $95 feels like giving away part of the profit, not parting with your own money. So far people like this idea. It certainly makes it easier to say yes rather than no.</p>
<h1>Clients</h1>
<p>Not everyone pays me each month because of the pricing structure. So it is somewhat hard to tell if someone is my customer. A photographer could sign up for my service just to try it out and then never come back. I define my client as someone who has uploaded at least one wedding or portrait gallery in past 3 months.</p>
<p>At the moment I have 15 clients.</p>
<h1>Profits</h1>
<p><img class="alignnone size-full wp-image-230" src="http://chuchuva.com/pavel/images/2010/12/profit.png" alt="Profits chart" width="643" height="407" /></p>
<p>On average, I get $300 per month.</p>
<h1>Expenses</h1>
<p>You might be wondering why I have those redÂ months with negative profit.</p>
<ul>
<li>I hired web designer twice.</li>
<li>I sponsored few <a href="http://www.aipp.com.au/">AIPP</a> mentoring sessions.</li>
</ul>
<p>Hosting is the biggest part of myÂ expenses at the moment &#8211; about $150 per month. I&#8217;m using Amazon EC2 and <a href="http://www.softsyshosting.com/">Softsys Hosting</a>.</p>
<h1>Conclusion</h1>
<p>Overall, I&#8217;m happy with my progress. For now, my focus is on preventing those red bars from appearing again.</p>
<p>P.S. You can take a look at my product here: <a href="http://www.fotrel.com/">Fotrel</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2010/12/progress-so-far/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Detaching Far Manager from long-running process on Windows 7</title>
		<link>http://chuchuva.com/pavel/2010/10/detaching-far-manager-from-long-running-process-on-windows-7/</link>
		<comments>http://chuchuva.com/pavel/2010/10/detaching-far-manager-from-long-running-process-on-windows-7/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 10:29:49 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[far-manager]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=221</guid>
		<description><![CDATA[OccasionallyÂ I launch a program from Far Manager that takes very long to complete. Normally you can use Ctrl+Alt+Tab to &#8220;detach&#8221; Far from a running process. Technical note #27 explains this well: If a long-running process (for example, archiving) was run &#8230; <a href="http://chuchuva.com/pavel/2010/10/detaching-far-manager-from-long-running-process-on-windows-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>OccasionallyÂ I launch a program from Far Manager that takes very long to complete. Normally you can use Ctrl+Alt+Tab to &#8220;detach&#8221; Far from a running process.<a href="http://www.farmanager.com/svn/trunk/docs/ENG/TechInfo.txt"> Technical note #27</a> explains this well:</p>
<blockquote><p>If a long-running process (for example, archiving) was run in a FAR console, and for some reasons this very instance of FAR is needed (an editor in the background) or it is undesirable to run a new instance ofFAR, pressing this key combination will create a new console for FAR where it will continue running as if the process has already ended, and the process will continue working in the old console.</p></blockquote>
<p>Unfortunately this doesn&#8217;t work on Windows 7. Instead of detaching you get Windows task switcher:</p>
<p><img class="alignnone size-full wp-image-222" src="http://chuchuva.com/pavel/images/2010/10/windows-7-task-switcher.jpg" alt="Windows 7 task switcher" width="622" height="198" /></p>
<p>Interestingly the switcher is in &#8220;sticky&#8221; mode. It doesn&#8217;t disappear when you release keys. You can use arrow keys to select a window.</p>
<p>The fix is easy:</p>
<ol>
<li>Start regedit, open HKCU\Software\far2\System key.</li>
<li>CreateÂ ConsoleDetachKey string value, set it to some keyboard shortcut. I use CtrlAltX.</li>
<li>Restart Far Manager</li>
</ol>
<p>To test it try executing this command from Far:</p>
<pre><code>ping google.com -t</code></pre>
<p>Press Ctrl+Alt+X to get back to Far without stopping pings.</p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2010/10/detaching-far-manager-from-long-running-process-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting .Net DateTime to JavaScript Date</title>
		<link>http://chuchuva.com/pavel/2010/10/converting-net-datetime-to-javascript-date/</link>
		<comments>http://chuchuva.com/pavel/2010/10/converting-net-datetime-to-javascript-date/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 09:53:14 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Develop]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=213</guid>
		<description><![CDATA[JavaScript Date constructor accepts number of milliseconds since Unix epoch (1 January 1970 00:00:00 UTC). Here&#8217;s C# extension method that converts .Net DateTime object to JavaScript date: public static class DateTimeJavaScript { private static readonly long DatetimeMinTimeTicks = (new DateTime(1970, &#8230; <a href="http://chuchuva.com/pavel/2010/10/converting-net-datetime-to-javascript-date/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>JavaScript <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date">Date</a> constructor accepts number of milliseconds since Unix epoch (1 January 1970 00:00:00 UTC). Here&#8217;s C# extension method that converts .Net DateTime object to JavaScript date:</p>
<pre><code class="prettyprint">public static class DateTimeJavaScript
{
   private static readonly long DatetimeMinTimeTicks =
      (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).Ticks;

   public static long ToJavaScriptMilliseconds(this DateTime dt)
   {
      return (long)((dt.ToUniversalTime().Ticks - DatetimeMinTimeTicks) / 10000);
   }
}
</code></pre>
<p>Usage:</p>
<pre><code class="prettyprint">var dt = new Date(&lt;%= DateTime.Today.ToJavaScriptMilliseconds() %&gt;);
alert(dt);
</code></pre>
<h3>Reference</h3>
<p><a href="http://stackoverflow.com/questions/290227/java-system-currenttimemillis-equivalent-in-c">Java System.currentTimeMillis() equivalent in C#</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2010/10/converting-net-datetime-to-javascript-date/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to enable detailed error information for IIS and ASP.NET</title>
		<link>http://chuchuva.com/pavel/2010/08/how-to-enable-detailed-error-information-for-iis-and-asp-net/</link>
		<comments>http://chuchuva.com/pavel/2010/08/how-to-enable-detailed-error-information-for-iis-and-asp-net/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 01:09:27 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Develop]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=197</guid>
		<description><![CDATA[By default, IIS and ASP.NET hide detailed error information to prevent revealing sensitive information about your web application: Sometimes you need to see error details (think shared hosting). Add these entries to your web.config file to disable generic errors: &#60;configuration&#62; &#8230; <a href="http://chuchuva.com/pavel/2010/08/how-to-enable-detailed-error-information-for-iis-and-asp-net/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>By default, IIS and ASP.NET hide detailed error information to prevent revealing sensitive information about your web application:<br />
<img src="http://chuchuva.com/pavel/images/2010/08/iis-generic-error.png" alt="IIS generic error" title="" width="502" height="343" class="alignnone size-full wp-image-201" /></p>
<p><img src="http://chuchuva.com/pavel/images/2010/08/asp-net-generic-error.png" alt="ASP.NET generic error" title="" width="715" height="482" class="alignnone size-full wp-image-202" /></p>
<p>Sometimes you need to see error details (think shared hosting). Add these entries to your web.config file to disable generic errors:</p>
<pre><code class="prettyprint">&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;customErrors mode="Off" /&gt;
  &lt;/system.web&gt;

  &lt;system.webServer&gt;
    &lt;httpErrors errorMode="Detailed" /&gt;
  &lt;/system.webServer&gt;
&lt;/configuration&gt;
</code></pre>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://learn.iis.net/page.aspx/267/how-to-use-http-detailed-errors-in-iis-70/">How to Use HTTP Detailed Errors in IIS 7.0</a></li>
<li><a href="http://blogs.iis.net/ksingla/archive/2008/02/18/what-to-expect-from-iis7-custom-error-module.aspx">What to expect from IIS7 custom error module</a></li>
<li><a href="http://www.west-wind.com/weblog/posts/745738.aspx">IIS 7 Error Pages taking over 500 Errors</a></li>
<li><a href="http://stackoverflow.com/questions/434272/iis7-overrides-customerrors-when-setting-response-statuscode">IIS7 Overrides customErrors when setting Response.StatusCode?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2010/08/how-to-enable-detailed-error-information-for-iis-and-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to safely remove USB flash drive with Far Manager</title>
		<link>http://chuchuva.com/pavel/2010/05/how-to-safely-remove-usb-flash-drive-with-far-manager/</link>
		<comments>http://chuchuva.com/pavel/2010/05/how-to-safely-remove-usb-flash-drive-with-far-manager/#comments</comments>
		<pubDate>Mon, 10 May 2010 12:44:06 +0000</pubDate>
		<dc:creator>Pavel Chuchuva</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[far-manager]]></category>

		<guid isPermaLink="false">http://chuchuva.com/pavel/?p=186</guid>
		<description><![CDATA[Do you have one of these: When you finish copying files from and to your USB flash drive you need to safely remove it, otherwise you risk losing data. Normally you do this by clicking icon with green arrow in &#8230; <a href="http://chuchuva.com/pavel/2010/05/how-to-safely-remove-usb-flash-drive-with-far-manager/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Do you have one of these:<br />
<img class="alignnone size-full wp-image-187" src="http://chuchuva.com/pavel/images/2010/05/usb-flash-drive.jpg" alt="USB flash drive" width="500" height="340" /><br />
When you finish copying files from and to your USB flash drive you need to safely remove it, otherwise you risk losing data. Normally you do this by clicking icon with green arrow in system tray:<br />
<img class="alignnone size-full wp-image-189" src="http://chuchuva.com/pavel/images/2010/05/safely-remove-hardware.png" alt="" width="159" height="53" /></p>
<p>You can do the same with Far Manager. Open drive menu (Alt+F1 or Alt+F2), select your flash drive and press Shift+Del. You should get this confirmation:<br />
<img class="alignnone size-full wp-image-190" src="http://chuchuva.com/pavel/images/2010/05/far-device-removal.png" alt="" width="440" height="180" /><br />
Select &#8220;Remove&#8221; and you&#8217;re done. Note that the key combo (Shift+Del) is different from <a href="http://chuchuva.com/pavel/2010/01/trick-eject-cd-dvd-from-far-manager/">ejecting CD/DVD</a> (Del).</p>
]]></content:encoded>
			<wfw:commentRss>http://chuchuva.com/pavel/2010/05/how-to-safely-remove-usb-flash-drive-with-far-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

