<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3554166144204741789</id><updated>2012-01-31T11:29:13.870-08:00</updated><title type='text'>1-800-MAGIC</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default?start-index=101&amp;max-results=100'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>546</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2246113288713125185</id><published>2012-01-31T11:29:00.001-08:00</published><updated>2012-01-31T11:29:13.878-08:00</updated><title type='text'>nude.js</title><content type='html'>&lt;a href="http://davidwalsh.name/nudejs"&gt;This is absolutely amazing...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2246113288713125185?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2246113288713125185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2246113288713125185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2246113288713125185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2246113288713125185'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2012/01/nudejs.html' title='nude.js'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-525263912323637588</id><published>2012-01-30T22:19:00.001-08:00</published><updated>2012-01-30T22:19:49.716-08:00</updated><title type='text'>Q: What's the shortest program one could copyright?</title><content type='html'>A: Zero instructions!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://trillian.mit.edu/~jc/humor/ATT_Copyright_true.html"&gt;http://trillian.mit.edu/~jc/humor/ATT_Copyright_true.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-525263912323637588?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/525263912323637588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=525263912323637588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/525263912323637588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/525263912323637588'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2012/01/whats-shortest-program-one-could.html' title='Q: What&apos;s the shortest program one could copyright?'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-9073095764968877808</id><published>2012-01-05T23:57:00.000-08:00</published><updated>2012-01-06T00:04:18.261-08:00</updated><title type='text'>On June 30 we get to sleep 1 second more...</title><content type='html'>...and the clock will count to&amp;nbsp;2012-06-30 23:59:&lt;span style="background-color: yellow;"&gt;60&lt;/span&gt;&amp;nbsp;to resynchronize the clock to Earth's rotation.&lt;br /&gt;&lt;br /&gt;ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS) &lt;br /&gt;&lt;br /&gt;SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE&lt;br /&gt;&lt;br /&gt;SERVICE DE LA ROTATION TERRESTRE&lt;br /&gt;OBSERVATOIRE DE PARIS                                   &lt;br /&gt;61, Av. de l'Observatoire 75014 PARIS (France)&lt;br /&gt;Tel.      : 33 (0) 1 40 51 22 26&lt;br /&gt;FAX       : 33 (0) 1 40 51 22 91&lt;br /&gt;e-mail    : services.iers@obspm.fr&lt;br /&gt;http://hpiers.obspm.fr/eop-pc&lt;br /&gt;&lt;br /&gt;                                              Paris, 5 January 2012&lt;br /&gt;&lt;br /&gt;                                              Bulletin C 43&lt;br /&gt;&lt;br /&gt;                                              To authorities responsible &lt;br /&gt;                                              for the measurement and &lt;br /&gt;                                              distribution of time&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                   UTC TIME STEP&lt;br /&gt;                            on the 1st of July 2012&lt;br /&gt;                      &lt;br /&gt;&lt;br /&gt; A positive leap second will be introduced at the end of June 2012.&lt;br /&gt; The sequence of dates of the UTC second markers will be:  &lt;br /&gt;  &lt;br /&gt;                          2012 June 30,     23h 59m 59s&lt;br /&gt;                          2012 June 30,     23h 59m 60s&lt;br /&gt;                          2012 July  1,      0h  0m  0s&lt;br /&gt;              &lt;br /&gt; The difference between UTC and the International Atomic Time TAI is:&lt;br /&gt;&lt;br /&gt;  from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s&lt;br /&gt;  from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s &lt;br /&gt;  &lt;br /&gt; Leap seconds can be introduced in UTC at the end of the months of December &lt;br /&gt; or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every &lt;br /&gt; six months, either to announce a time step in UTC or to confirm that there &lt;br /&gt; will be no time step at the next possible date. &lt;br /&gt;&lt;br /&gt;                                              Daniel GAMBIS&lt;br /&gt;                                              Head  &lt;br /&gt;                                              Earth Orientation Center of IERS&lt;br /&gt;                                              Observatoire de Paris, France&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-9073095764968877808?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/9073095764968877808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=9073095764968877808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/9073095764968877808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/9073095764968877808'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2012/01/on-june-30-we-get-to-sleep-1-second.html' title='On June 30 we get to sleep 1 second more...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6260204668657058805</id><published>2012-01-05T20:51:00.000-08:00</published><updated>2012-01-05T20:52:24.736-08:00</updated><title type='text'>Santorum</title><content type='html'>Google:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-La9K0bUBOoM/TwZ9UfgvRpI/AAAAAAAAAs8/tmSfC1QT2ec/s1600/santorum+-+goog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="469" src="http://4.bp.blogspot.com/-La9K0bUBOoM/TwZ9UfgvRpI/AAAAAAAAAs8/tmSfC1QT2ec/s640/santorum+-+goog.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Bing: &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Am4cFwme3Mo/TwZ9YV_A5RI/AAAAAAAAAtE/Pn90XhIBEFc/s1600/santorum+-+bing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="454" src="http://4.bp.blogspot.com/-Am4cFwme3Mo/TwZ9YV_A5RI/AAAAAAAAAtE/Pn90XhIBEFc/s640/santorum+-+bing.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It pains me to say this, but on &lt;a href="http://www.spreadingsantorum.com/"&gt;this &lt;/a&gt;&lt;a href="http://www.spreadingsantorum.com/"&gt;term &lt;/a&gt;Google's relevance is higher...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6260204668657058805?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6260204668657058805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6260204668657058805' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6260204668657058805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6260204668657058805'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2012/01/santorum.html' title='Santorum'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-La9K0bUBOoM/TwZ9UfgvRpI/AAAAAAAAAs8/tmSfC1QT2ec/s72-c/santorum+-+goog.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-409354811194160477</id><published>2011-12-28T21:10:00.000-08:00</published><updated>2011-12-28T21:10:56.441-08:00</updated><title type='text'>Fix for Samsung Focus beeping issue</title><content type='html'>For the last couple of days my Windows Phone have been very sick. It would not go to sleep when the power button was pressed. And when I unmuted the sound, I discovered that it was beeping incessantly.&lt;br /&gt;&lt;br /&gt;This was happening only when the device was on battery power. When I plugged it in, it behaved correctly. At first I assumed that it has something to do with the battery. Rebooting the device and removing/reinserting the battery did not help, however.&lt;br /&gt;&lt;br /&gt;The sound that it was making though was the same as the one for connecting the power. So I looked closely at the USB power connector in the phone, and discovered that the signal carrier was bent and was touching the walls of the adapter. I straightened it with a tiny screwdriver, and the problem disappeared.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-409354811194160477?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/409354811194160477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=409354811194160477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/409354811194160477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/409354811194160477'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/fix-for-samsung-focus-beeping-issue.html' title='Fix for Samsung Focus beeping issue'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3677562998164169065</id><published>2011-12-28T01:32:00.000-08:00</published><updated>2011-12-28T01:32:32.247-08:00</updated><title type='text'>North Korea has its own - official - reddit</title><content type='html'>The comments on it are absolutely hilarious.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.reddit.com/r/pyongyang"&gt;http://www.reddit.com/r/pyongyang&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bScMzhG31QI/TvriHprVizI/AAAAAAAAAsw/kGlZgys6iFU/s1600/pyongyang.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/-bScMzhG31QI/TvriHprVizI/AAAAAAAAAsw/kGlZgys6iFU/s640/pyongyang.jpg" width="570" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3677562998164169065?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3677562998164169065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3677562998164169065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3677562998164169065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3677562998164169065'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/north-korea-has-its-own-official-reddit.html' title='North Korea has its own - official - reddit'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-bScMzhG31QI/TvriHprVizI/AAAAAAAAAsw/kGlZgys6iFU/s72-c/pyongyang.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8172238648205999333</id><published>2011-12-20T16:52:00.000-08:00</published><updated>2011-12-20T16:52:01.356-08:00</updated><title type='text'>Nice try, Amazon!</title><content type='html'>I am sure this offer is entirely fair :-).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-rItyYsD0UHc/TvEtj9pc35I/AAAAAAAAAsk/t11i4RUbgmc/s1600/NiceTryAmazon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="313" src="http://1.bp.blogspot.com/-rItyYsD0UHc/TvEtj9pc35I/AAAAAAAAAsk/t11i4RUbgmc/s640/NiceTryAmazon.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8172238648205999333?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8172238648205999333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8172238648205999333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8172238648205999333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8172238648205999333'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/nice-try-amazon.html' title='Nice try, Amazon!'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-rItyYsD0UHc/TvEtj9pc35I/AAAAAAAAAsk/t11i4RUbgmc/s72-c/NiceTryAmazon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-293794410520479445</id><published>2011-12-17T11:17:00.000-08:00</published><updated>2011-12-17T11:17:50.108-08:00</updated><title type='text'>Sir Francis Bacon on Obama</title><content type='html'>"&lt;span style="background-color: white; font-size: 16px; text-align: left;"&gt;Hope is a good breakfast, but it is a bad supper."&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;&lt;br /&gt;&lt;a href="http://www.brainyquote.com/quotes/quotes/f/francisbac125278.html"&gt;http://www.brainyquote.com/quotes/quotes/f/francisbac125278.html&lt;/a&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-293794410520479445?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/293794410520479445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=293794410520479445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/293794410520479445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/293794410520479445'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/sir-francis-bacon-on-obama.html' title='Sir Francis Bacon on Obama'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8815153235016730200</id><published>2011-12-15T17:29:00.000-08:00</published><updated>2011-12-15T17:30:52.028-08:00</updated><title type='text'>National Defense Authorization Act for Fiscal Year 2012 (it looks like this time of the year again)</title><content type='html'>&lt;div&gt;"Göring: Why, of course, the people don't want war. Why would some poor slob on a farm want to risk his life in a war when the best that he can get out of it is to come back to his farm in one piece. Naturally, the common people don't want war; neither in Russia nor in England nor in America, nor for that matter in Germany. That is understood. But, after all, it is the leaders of the country who determine the policy and it is always a simple matter to drag the people along, whether it is a democracy or a fascist dictatorship or a Parliament or a Communist dictatorship.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Gilbert: There is one difference. In a democracy, the people have some say in the matter through their elected representatives, and in the United States only Congress can declare wars.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Göring: Oh, that is all well and good, but, voice or no voice, the people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;In an interview with Gilbert in Göring's jail cell during the Nuremberg War Crimes Trials (18 April 1946)"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://en.wikiquote.org/wiki/Hermann_G%C3%B6ring#Nuremberg_Diary_.281947.29"&gt;http://en.wikiquote.org/wiki/Hermann_Göring#Nuremberg_Diary_.281947.29&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8815153235016730200?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8815153235016730200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8815153235016730200' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8815153235016730200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8815153235016730200'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/national-defense-authorization-act-for.html' title='National Defense Authorization Act for Fiscal Year 2012 (it looks like this time of the year again)'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4471341931601522704</id><published>2011-12-15T12:42:00.000-08:00</published><updated>2011-12-15T12:44:33.914-08:00</updated><title type='text'>Why you should leave your vote for President (and most likely, Senator) blank next year</title><content type='html'>&lt;a href="http://jonathanturley.org/2011/12/15/obama-breaks-promise-to-veto-bill-allowing-indefinite-detention-of-americans/"&gt;http://jonathanturley.org/2011/12/15/obama-breaks-promise-to-veto-bill-allowing-indefinite-detention-of-americans/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;No matter what the Republican alternative is, the Democrats MUST be held accountable for this.&lt;br /&gt;&lt;br /&gt;"Virtually all Democrats and Republicans voted to strip citizens of their rights in a vote of 93-7."&lt;br /&gt;&lt;a href="http://jonathanturley.org/2011/12/02/42285/"&gt;http://jonathanturley.org/2011/12/02/42285/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the roll call.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.govtrack.us/congress/vote.xpd?vote=s2011-218"&gt;http://www.govtrack.us/congress/vote.xpd?vote=s2011-218&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following people voted Nay:&lt;br /&gt;&amp;nbsp; &amp;nbsp; Sanders, VT&lt;br /&gt;&amp;nbsp; &amp;nbsp; Lee, UT&lt;br /&gt;&amp;nbsp; &amp;nbsp; Wyden, OR&lt;br /&gt;&amp;nbsp; &amp;nbsp; Merkley, OR&lt;br /&gt;&amp;nbsp; &amp;nbsp; Coburn, OK&lt;br /&gt;&amp;nbsp; &amp;nbsp; Paul, KY&lt;br /&gt;&amp;nbsp; &amp;nbsp; Harkin, IA&lt;br /&gt;&lt;br /&gt;Both WA senators voted for it. None of them will get my vote next election season, no matter what the alternative is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4471341931601522704?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4471341931601522704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4471341931601522704' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4471341931601522704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4471341931601522704'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/why-you-should-leave-your-vote-for.html' title='Why you should leave your vote for President (and most likely, Senator) blank next year'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-5672185844242365385</id><published>2011-12-14T17:28:00.001-08:00</published><updated>2011-12-14T17:28:58.637-08:00</updated><title type='text'>Is Facebook driving the Greek debt crisis?</title><content type='html'>&lt;a href="http://www.businessweek.com/magazine/correlation-or-causation-12012011-gfx.html"&gt;http://www.businessweek.com/magazine/correlation-or-causation-12012011-gfx.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-5672185844242365385?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/5672185844242365385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=5672185844242365385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5672185844242365385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5672185844242365385'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/is-facebook-driving-greek-debt-crisis.html' title='Is Facebook driving the Greek debt crisis?'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3835773101199337301</id><published>2011-12-13T23:54:00.000-08:00</published><updated>2011-12-14T00:19:25.414-08:00</updated><title type='text'>Generating random numbers with normal distribution</title><content type='html'>Question: Given a standard generator with uniform distribution, generate a normally distributed sequence of random numbers.&lt;br /&gt;Answer: Box-Muller transform!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform"&gt;http://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Source snippet:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;class NormalRandom&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private bool haveNextRandom = false;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private &amp;nbsp;double nextRandom = 0;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private &amp;nbsp;Random rnd = new Random();&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// Implements random number generator with normal distribution&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// based on the polar form of Box-Muller transform.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;returns&amp;gt;&lt;/span&gt;&lt;returns style="color: blue;"&gt;A random number with normal distribution.&amp;lt;/returns&amp;gt;&lt;/returns&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public double NextDouble()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (haveNextRandom)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; haveNextRandom = false;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return nextRandom;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double x1, x2, w;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x1 = 2.0 * rnd.NextDouble() - 1.0;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x2 = 2.0 * rnd.NextDouble() - 1.0;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; w = x1 * x1 + x2 * x2;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } while (w &amp;gt;= 1.0);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; w = Math.Sqrt((-2.0 * Math.Log(w)) / w);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nextRandom = x2 * w;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; haveNextRandom = true;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return x1 * w;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;...and here are the results:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-rIQmjbDEIYo/Tuhb_TTyC_I/AAAAAAAAAsc/SM-XlzpuLLU/s1600/graph.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-rIQmjbDEIYo/Tuhb_TTyC_I/AAAAAAAAAsc/SM-XlzpuLLU/s1600/graph.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3835773101199337301?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3835773101199337301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3835773101199337301' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3835773101199337301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3835773101199337301'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/generating-random-numbers-with-normal.html' title='Generating random numbers with normal distribution'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-rIQmjbDEIYo/Tuhb_TTyC_I/AAAAAAAAAsc/SM-XlzpuLLU/s72-c/graph.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1746464775509577031</id><published>2011-12-12T17:45:00.000-08:00</published><updated>2011-12-12T17:45:21.168-08:00</updated><title type='text'>Graphics in console application</title><content type='html'>A long, long time ago when programming for Windows you had to make a choice - your application would have to be either console, or GUI, but not both. If you liked your app for the console subsystem, you could not create windows or dialog boxes, and the application did not have a message loop. If you were a GUI app, you could only use console if you created it yourself, and your app could not inherit its parent's console.&lt;br /&gt;&lt;br /&gt;At some point down the line this got fixed, so a console application today can have UI elements - for example, it can call MessageBox(). Despite the weirdness - I am sure HCI purists/Apple would never approve of it - it can actually come quite handy. I, for one, quite often find myself in need of a graphic in the middle of a simple application (sometimes to just visualize something as part of a debug code path) - which I don't want to convert to fully-fledged GUI.&lt;br /&gt;&lt;br /&gt;Unfortunately, there is precious little information on how to do do mixed mode console/GUI programming on the Internet, so I figured I'd fill the void :-).&lt;br /&gt;&lt;br /&gt;First add references to System.Windows.Forms and System.Drawing (only if you are going to be drawing of course) to your app, as well as the corresponding "using"s.&lt;br /&gt;&lt;br /&gt;Then you can create a dialog box that derives from Form:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; using System.Windows.Forms;&lt;br /&gt;&amp;nbsp; &amp;nbsp; class MyForm : Form&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;br /&gt;...and display it as follows:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; MyForm f = new MyForm();&lt;br /&gt;&amp;nbsp; &amp;nbsp; f.ShowDialog();&lt;br /&gt;&lt;br /&gt;ShowDialog function is blocking - your console thread will not get control until user closes the window. Of course, standard console functions all work, you can print to the screen like so:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; class MyForm : Form&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void OnPaint(PaintEventArgs e)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base.OnPaint(e);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("Paint called!");&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As an example, here is a very simple application that allows a user to plot simple functions from Math library:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//-----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// Copyright (C) Sergey Solyanik.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//-----------------------------------------------------------------------&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System.Drawing;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System.Reflection;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System.Windows.Forms;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;namespace Graph&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; class Graph : Form&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public delegate double Function(double x);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Function F;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public double X1;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public double X2;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public double Y1;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public double Y2;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private double stretchX;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private double stretchY;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int ToScreenX(double x)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ClientRectangle.Left + (int)((x - X1) * stretchX);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int ToScreenY(double y)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ClientRectangle.Bottom + (int)((y - Y1) * stretchY);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private double ToPlaneX(int x)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return X1 + ((double)(x - ClientRectangle.Left)) / stretchX;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private double ToPlaneY(int y)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Y1 + ((double)(y - ClientRectangle.Bottom)) / stretchY;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void OnPaint(PaintEventArgs e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;base.OnPaint(e);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stretchX = (double)(ClientRectangle.Right - ClientRectangle.Left) /&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (X2 - X1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stretchY = (double)(ClientRectangle.Top - ClientRectangle.Bottom) /&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Y2 - Y1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Math.Sign(X1) != Math.Sign(X2))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.Graphics.DrawLine(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pens.Black,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToScreenX(0),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ClientRectangle.Bottom,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToScreenX(0),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ClientRectangle.Top);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Math.Sign(Y1) != Math.Sign(Y2))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.Graphics.DrawLine(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pens.Black,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ClientRectangle.Left,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToScreenY(0),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ClientRectangle.Right,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToScreenY(0));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int x = ClientRectangle.Left; x &amp;lt; ClientRectangle.Right - 1; ++x)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.Graphics.DrawLine(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pens.Blue,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToScreenY(F(ToPlaneX(x))),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x + 1,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToScreenY(F(ToPlaneX(x + 1))));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static Graph.Function SelectFunction()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("Available functions:");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type t = typeof(Math);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MethodInfo[] m = t.GetMethods();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; m.Length; ++i)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (m[i].IsPublic &amp;amp;&amp;amp; m[i].IsStatic &amp;amp;&amp;amp; m[i].ReturnType == typeof(double))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ParameterInfo[] p = m[i].GetParameters();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (p.Length == 1 &amp;amp;&amp;amp; p[0].ParameterType == typeof(double))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(" &amp;nbsp; &amp;nbsp;" + m[i].Name);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (true)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write("Select a function to plot: ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string response = Console.ReadLine();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; m.Length; ++i)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (m[i].IsPublic &amp;amp;&amp;amp; m[i].IsStatic &amp;amp;&amp;amp; m[i].ReturnType == typeof(double))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ParameterInfo[] p = m[i].GetParameters();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (p.Length == 1 &amp;amp;&amp;amp; p[0].ParameterType == typeof(double))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (m[i].Name.Equals(response))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return (Graph.Function)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Delegate.CreateDelegate(typeof(Graph.Function), m[i]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static double GetNumber(string prompt)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (; ; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write(prompt);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string response = Console.ReadLine();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; double result;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (double.TryParse(response, out result))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return result;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.CancelKeyPress += delegate&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("Cancelled!");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Environment.Exit(1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("Press Ctrl-C to quit.");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Graph g = new Graph();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.F = SelectFunction();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.X1 = GetNumber("Abscissa lower boundary: ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.X2 = GetNumber("Abscissa upper boundary: ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.Y1 = GetNumber("Ordinate lower boundary: ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.Y2 = GetNumber("Ordinate upper boundary: ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.ShowDialog();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1746464775509577031?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1746464775509577031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1746464775509577031' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1746464775509577031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1746464775509577031'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/graphics-in-console-application.html' title='Graphics in console application'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6998374932695737054</id><published>2011-12-07T18:29:00.000-08:00</published><updated>2011-12-07T18:30:21.366-08:00</updated><title type='text'>War on Christmas</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-zsqqSA3ZgGQ/TuAhEwkQ_PI/AAAAAAAAAsU/AhrkfM9qEeM/s1600/war+on+christmas.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="169" src="http://1.bp.blogspot.com/-zsqqSA3ZgGQ/TuAhEwkQ_PI/AAAAAAAAAsU/AhrkfM9qEeM/s640/war+on+christmas.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span id="goog_225861290"&gt;&lt;/span&gt;&lt;span id="goog_225861291"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6998374932695737054?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6998374932695737054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6998374932695737054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6998374932695737054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6998374932695737054'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/war-on-christmas.html' title='War on Christmas'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-zsqqSA3ZgGQ/TuAhEwkQ_PI/AAAAAAAAAsU/AhrkfM9qEeM/s72-c/war+on+christmas.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3321830167214339225</id><published>2011-12-06T16:47:00.000-08:00</published><updated>2011-12-06T16:47:18.353-08:00</updated><title type='text'>WCF web services and a calculator implementation in one easy snippet!</title><content type='html'>I wanted to write a calculator that supported parentheses and operator precedence for a while, but never got to sit down and do it. Recently I was poking around WCF (yes, I know I am VERY late for that party!) and wanted something less trivial than "Hello, world" to explore it. Suddenly, it felt like a reasonable opportunity to kill two birds with one stone.&lt;br /&gt;&lt;br /&gt;Below is an implementation of a calculator web service. A problem like this is most frequently dealt with using a parse tree, and this solution is no exception. A parse tree is a binary tree representation of an expression which makes the result very easy to calculate by recursive evaluation. Our service exposes two APIs: one takes a string and returns a computed result, the other returns the parse tree for the expression for educational purposes (and to give WCF something non-trivial to marshal).&lt;br /&gt;&lt;br /&gt;A parse tree has operators such as +, -, *, and / stored in the nodes with the children of the nodes being the operands. For example, 2 + 2 would generate the following parse tree:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;br /&gt;&lt;br /&gt;A more complex example, 3 * 4 + 2 will result in:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;br /&gt;&lt;br /&gt;Once a parse tree is built, the evaluation is trivial: at every node, apply evaluation recursively to the children, then perform the arithmetic operator on the results.&amp;nbsp;The trick here is to build it, as its construction must account for the operator precedence, parentheses, and such.&lt;br /&gt;&lt;br /&gt;The &amp;nbsp;data structure for the node contains an operator, its two children (only would of which will be set for unary operator and in other cases), the parent, and value field used for nodes that represent values. A parenthesized subexpression lives under the separate node rooted in its right child, as illustrated below:&lt;br /&gt;&lt;br /&gt;2 * (3 + 5) =&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*&lt;br /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;br /&gt;&lt;br /&gt;The program moves alongside the expression and adds the nodes corresponding to the tokens it parses to the tree. For example, given the following expression: 2 + 2 + 2 it will:&lt;br /&gt;1) Read 2, create a value node for 2, and remember it as its current node:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;lt;=&lt;br /&gt;&lt;br /&gt;2) Read +, create an operator node for +, set node for 2 as its left child:&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ &amp;lt;=&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;br /&gt;&lt;br /&gt;3) Read 2, create a value node for 2, and add it to the current (+) node as its right child;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;lt;=&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) Read +, create an operator node for +, set node for 2 as its left child and hooking it in place of the value node under the earlier +:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &amp;lt;=&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;br /&gt;&lt;div&gt;&lt;br /&gt;5) Read 2, create a value node for 2, and add it to the current (+) node as its right child;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; +&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;lt;=&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;How does the operator precedence work in this scheme? It is encoded in the tree itself. Note that the tree for 3 * 4 + 2 must be built as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and not like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The later would treat the expression as 3 * (4 + 2), which is, of course incorrect. However, this would be the tree that a naive algorithm that just reads the next token and stuffs it into a tree would build.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To account for operator precedence, before adding a new operator node, our algorithm would look at the parent nodes of its current position and if the operator at that node has a higher precedence than the operator we are about to add, it will move up the chain and hook the new node above all the higher-precedence operators, so the tree construction for 3 * 4 * 5 + 2 will proceed like this;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3&amp;lt;= &amp;nbsp;=&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&amp;lt;= &amp;nbsp; =&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; +&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;lt;= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 &amp;nbsp; &amp;nbsp; * &amp;lt;= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 &amp;nbsp; &amp;nbsp;* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; 5 &amp;lt;= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; *&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp;5&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once this concept is clear, the rest is pure accounting (as is most of the software development :-)). The code below implements it and publishes the results through a template implementation of WCF web service, which takes on the order of 7 functional lines of code (at the very end, in the main function).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//-----------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// &lt;copyright&gt;&lt;/copyright&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// Copyright (C) Sergey Solyanik.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//-----------------------------------------------------------------------&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System.ServiceModel;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System.ServiceModel.Description;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System.Runtime.Serialization;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;namespace WCFCalc&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; [ServiceContract]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; public interface IWCFCalc&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [OperationContract]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int Calculate(string expr);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [OperationContract]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExprNode Parse(string expr);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; public enum Operator&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PLUS,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MINUS,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MUL,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIV,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAL,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EXPR,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OPENPAREN,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ERROR&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; [DataContract]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; public class ExprNode&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [DataMember]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public ExprNode Left;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [DataMember]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public ExprNode Right;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // This is not exported because the&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // serialization would take it as a&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // circular reference.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public ExprNode Parent;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [DataMember]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Operator Op;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [DataMember]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int Value;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; public class WCFCalcSvc : IWCFCalc&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void Err(string s)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(s);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new FaultException&lt;invalidoperationexception&gt;(&lt;/invalidoperationexception&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new InvalidOperationException(s), s);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private Operator ToOp(char c)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (c)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case '+': return Operator.PLUS;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case '-': return Operator.MINUS;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case '*': return Operator.MUL;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case '/': return Operator.DIV;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default: return Operator.ERROR;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private bool HigherPrecedence(Operator o1, Operator o2)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((o2 == Operator.PLUS || o2 == Operator.MINUS) &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (o1 == Operator.MUL || o1 == Operator.DIV))&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int Calculate(ExprNode expr)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Op == Operator.VAL)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return expr.Value;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Op == Operator.EXPR)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Calculate(expr.Right);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Op == Operator.PLUS)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Calculate(expr.Left) + Calculate(expr.Right);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Op == Operator.MINUS)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Left == null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return -Calculate(expr.Right);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Calculate(expr.Left) - Calculate(expr.Right);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Op == Operator.MUL)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Calculate(expr.Left) * Calculate(expr.Right);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr.Op == Operator.DIV)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Calculate(expr.Left) / Calculate(expr.Right);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Internal error: unknown operator!");&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int Calculate(string expr)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Calculate(Parse(expr));&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public ExprNode Parse(string expr)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x = 0;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExprNode current = null;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (x &amp;lt; expr.Length)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr[x] == ' ')&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++x;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr[x] == '(')&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++x;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExprNode node = new ExprNode();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Op = Operator.OPENPAREN;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current == null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((current.Op == Operator.VAL) ||&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (current.Right != null))&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Error @ " + x);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Parent = current;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Right = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr[x] == ')')&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++x;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (current != null &amp;amp;&amp;amp; current.Op != Operator.OPENPAREN)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = current.Parent;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current == null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Error @ " + x);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Close the paren&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Op = Operator.EXPR;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Operator op = ToOp(expr[x]);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (op != Operator.ERROR)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++x;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExprNode node = new ExprNode();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Op = op;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // currently no support for unary ops&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current == null ||&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (current.Op != Operator.VAL &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Op != Operator.EXPR))&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (op == Operator.MINUS)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Parent = current;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current != null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Right = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Error @ " + x);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // This ensures that the higher precedence&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // operators are lower in the expression&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // tree, and therefore execute before the&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // lower precedence operators.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (current.Parent != null &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Parent.Op != Operator.OPENPAREN &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; !HigherPrecedence(op, current.Parent.Op))&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = current.Parent;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Parent = current.Parent;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current.Parent != null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Parent.Right = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Parent = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Left = current;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // value&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (expr[x] &amp;gt;= '0' &amp;amp;&amp;amp; expr[x] &amp;lt;= '9')&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int n = 0;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (x &amp;lt; expr.Length &amp;amp;&amp;amp; (expr[x] &amp;gt;= '0' &amp;amp;&amp;amp; expr[x] &amp;lt;= '9'))&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; n = n * 10 + (expr[x] - '0');&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++x;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExprNode node = new ExprNode();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Op = Operator.VAL;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Value = n;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current == null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current.Op == Operator.VAL)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Error @ " + x);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current.Right != null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Error @ " + x);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node.Parent = current;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.Right = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = node;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (current != null &amp;amp;&amp;amp; current.Parent != null)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current.Op == Operator.OPENPAREN)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Not enough closed parens!");&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current = current.Parent;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (current != null &amp;amp;&amp;amp; current.Op == Operator.OPENPAREN)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err("Not enough closed parens!");&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return current;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uri baseAddress = new Uri("http://localhost:8000/Calculator");&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServiceHost selfHost = new ServiceHost(typeof(WCFCalcSvc), baseAddress);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selfHost.AddServiceEndpoint(&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; typeof(IWCFCalc),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // DANGER! DO NOT CARRY SecurityMode.None&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // INTO PRODUCTION SERVICE BY DEFAULT!!!&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new WSHttpBinding(SecurityMode.None),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Calculator");&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServiceMetadataBehavior smb = new ServiceMetadataBehavior();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; smb.HttpGetEnabled = true;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selfHost.Description.Behaviors.Add(smb);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selfHost.Open();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("The service is ready.");&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("Press &lt;enter&gt; to terminate service.");&lt;/enter&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.ReadLine();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selfHost.Close();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (CommunicationException ce)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine("An exception occurred: {0}", ce.Message);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; selfHost.Abort();&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To compile the service, create an empty console project, add System.Runtime.Serialization and System.ServiceModel to the list of references, and copy the code into it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To consume the service, create a client project with the following code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//-----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// &lt;copyright&gt;&lt;/copyright&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// Copyright (C) Sergey Solyanik.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;// &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;//-----------------------------------------------------------------------&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using System;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;using WCFTestClient.WCFCalc;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;namespace WCFTestClient&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; class Program&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Print(ExprNode n)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write("(" + n.Op + " ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (n.Left != null &amp;amp;&amp;amp; n.Right != null)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(n.Left);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write(", ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(n.Right);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write(")");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (n.Left != null || n.Right != null)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(n.Left != null ? n.Left : n.Right);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write(")");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write(n.Value + ")");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WCFCalcClient svc = new WCFCalcClient();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (; ; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.Write("&amp;gt; ");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string s = Console.ReadLine();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (s.Equals("exit", StringComparison.OrdinalIgnoreCase))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (s.StartsWith("p"))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s = s.Substring(1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ExprNode n = svc.Parse(s);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(n);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(s + " = " + svc.Calculate(s));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(e.Message);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you can see, it only takes 1 line of code (!) to connect to our service. The rest constitutes the logic of the program itself.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now run the service from a command line.&amp;nbsp;Right-click on Service References, select "Add Service Reference", point it to&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;http://localhost:8000/Calculator&lt;/span&gt;, set WCFCalc as a namespace, and click import. That's it - you are done. The service importer will create app.config with all the endpoint details, you can now just run the client.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Prefix your expression with p to display the parse tree for it, like so: p2+2, or type "exit" to leave.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3321830167214339225?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3321830167214339225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3321830167214339225' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3321830167214339225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3321830167214339225'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/wcf-web-services-and-calculator.html' title='WCF web services and a calculator implementation in one easy snippet!'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7563159741687387190</id><published>2011-12-01T12:00:00.000-08:00</published><updated>2011-12-01T12:00:54.584-08:00</updated><title type='text'>Pepper spray</title><content type='html'>"It is becoming more and more fashionable right now, this day and age, to use chemical on people who have an opinion. And that to me is a complete lack of leadership both in the police department and other people who cannot really deal with the root of the problem and they want to spray people to quiet them down. And it’s really not supposed to be that. It’s not a thing that solves any problem nor is it something that quiets people down.”&lt;br /&gt;&lt;br /&gt;Kamran Loghman, inventor of modern pepper spray and developer of police procedures for its use&lt;br /&gt;&lt;br /&gt;&lt;a href="http://boingboing.net/2011/11/30/pepper-spray-inventor-its.html"&gt;http://boingboing.net/2011/11/30/pepper-spray-inventor-its.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7563159741687387190?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7563159741687387190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7563159741687387190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7563159741687387190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7563159741687387190'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/12/pepper-spray.html' title='Pepper spray'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4283480631338598336</id><published>2011-11-26T13:48:00.000-08:00</published><updated>2011-11-26T13:49:42.063-08:00</updated><title type='text'>"War on militancy"</title><content type='html'>The attack comes as relations between the United States and Pakistan — its &lt;strong&gt;ally in the war on militancy&lt;/strong&gt; — are already strained following the killing of al-Qaida leader Osama bin Laden by U.S. special forces in a secret raid on the Pakistani garrison town of Abbottabad in May. &lt;br /&gt;&lt;a href="http://www.msnbc.msn.com/id/45442885/ns/world_news-south_and_central_asia/#.TtDjXPLCcSg"&gt;http://www.msnbc.msn.com/id/45442885/ns/world_news-south_and_central_asia/#.TtDjXPLCcSg&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Our ministry of self-censorship is clearly still recovering from a Thanksgiving dinner today...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4283480631338598336?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4283480631338598336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4283480631338598336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4283480631338598336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4283480631338598336'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/war-on-militancy.html' title='&quot;War on militancy&quot;'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2582131355555048077</id><published>2011-11-26T13:30:00.001-08:00</published><updated>2011-11-26T13:30:56.582-08:00</updated><title type='text'>Economics, as understood by Alan Greenspan</title><content type='html'>&lt;a href="http://cscs.umich.edu/~crshalizi/weblog/841.html"&gt;http://cscs.umich.edu/~crshalizi/weblog/841.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2582131355555048077?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2582131355555048077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2582131355555048077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2582131355555048077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2582131355555048077'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/economics-as-understood-by-alan.html' title='Economics, as understood by Alan Greenspan'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1507142924555645837</id><published>2011-11-26T13:23:00.000-08:00</published><updated>2011-11-26T13:23:13.435-08:00</updated><title type='text'>State secrets</title><content type='html'>"By the way, during  seven of the eight George W. Bush years, the IRS report on the top 400  taxpayers was labeled a state secret, a policy that the Obama  administration overturned almost instantly after his inauguration."&lt;br /&gt;&lt;a href="http://wweek.com/portland/article-17350-9_things_the_rich_dont_want_you_to_know_about_taxes.html"&gt;http://wweek.com/portland/article-17350-9_things_the_rich_dont_want_you_to_know_about_taxes.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1507142924555645837?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1507142924555645837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1507142924555645837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1507142924555645837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1507142924555645837'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/state-secrets.html' title='State secrets'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3393628664644344120</id><published>2011-11-22T13:58:00.000-08:00</published><updated>2011-11-22T18:59:06.859-08:00</updated><title type='text'>Hiring at elite companies</title><content type='html'>A friend sent me a pointer to this blog post: &lt;a href="http://econlog.econlib.org/archives/2011/11/how_elite_firms.html"&gt;http://econlog.econlib.org/archives/2011/11/how_elite_firms.html&lt;/a&gt;&lt;br /&gt;The original paper is about hiring practices in financial institutions, but the fact that the best companies prefer applicants from the best universities (much in the same way the top grad schools mostly accept people from the top undergrad schools) is a recurring complaint in software industry as well.&lt;br /&gt;&lt;br /&gt;In all cases the preferential treatment is driven by selectivity of the school, not so much by the quality of skills developed there: the idea is that since colleges are highly selective, you can apply them as the first filter to the applicant pool. The system then continues - the resumes from the candidates working at the top companies draw more attention than the resumes from lesser brands, and so it goes.&lt;br /&gt;&lt;br /&gt;Which means that if you missed out on a good school early on, you are kinda screwed; while upward mobility is not impossible, it becomes much, much harder.&lt;br /&gt;&lt;br /&gt;A long time ago I experienced something similar myself. When I came to the United States, I took the GRE and applied to several top graduate programs in physics. My GRE scores were far, far&amp;nbsp;above the published average scores for all of these programs except MIT, where it was closer to (but still above) average.&lt;br /&gt;&lt;br /&gt;In the Soviet Union where I was from, test results were the only allowed criteria for admission. There was no concept of reference letters, legacy status,&amp;nbsp;nor other out-of-band information that would feed into the decision making process. In fact, anything resembling legacy considerations were considered corruption and would earn all involved parties a one-way, all expenses paid, trip&amp;nbsp;to Siberia's finest labor camps (corruption did of course exist, and&amp;nbsp;when discovered it was dealt with harshly; one of the people on my alma mater admission committee ended up in jail for bartering admissions spots for favors from other well-connected people).&lt;br /&gt;&lt;br /&gt;Imagine my surprise when I got the rejection letter from UPenn - UPenn! - where the average subject GRE score was in 600s! At the time I did not know what a "safety school" was, but if I did I have thought about it as such at the time. I only applied to UPenn because I lived in Philadelphia at the time, all our relatives lived there, and I needed to show that I was not dismissing the idea of staying "close to the family" outright.&lt;br /&gt;&lt;br /&gt;Completely baffled, I wrote them a letter, pointing out the huge discrepancy in the scores and asking them to explain the decision. Soon I befriended another Russian who had emigrated a year earlier and who filled me in on admission practices in the US. According to him, most of the people in the theoretical physics&amp;nbsp;department at Princeton did not even take the GRE - which was listed as a requirement.&lt;br /&gt;&lt;br /&gt;Instead, they were being accepted based strictly on references from their undergrad professors. And because people from the top grad schools knew people from the top undergrad schools, their references were trusted far more.&lt;br /&gt;&lt;br /&gt;I, on the other hand, was completely unaware of the relative importance of the references, so I got them from random people who were unknown to the admissions committees, and so my application was roundly rejected - the letters from all the other schools arrived a bit later. (UPenn later reversed its decision and accepted me - they must have read my letter and decided that a guy so naive would end up living under a bridge were they not to save me).&lt;br /&gt;&lt;br /&gt;But I digress.&lt;br /&gt;&lt;br /&gt;This system of course leads to very high rate of false negatives - essentially, first strike out. Also, not surprisingly,&amp;nbsp;it results in some amount of false positives as well - once inside, you have a larger than normal share of opportunities to recover from previous failures&amp;nbsp;- regardless of your skills, that degree from Harvard will keep opening doors for you years from now.&lt;br /&gt;&lt;br /&gt;The system is obviously sub-optimal, so over the years we tried our best to fix it. Microsoft pioneered the concept of a coding interview - where people are forced to write code on the whiteboard as part of the interview process, a system that is now standard almost everywhere.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Would-Move-Mount-Microsofts-Puzzle/dp/0316919160"&gt;http://www.amazon.com/Would-Move-Mount-Microsofts-Puzzle/dp/0316919160&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/1466208686"&gt;http://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/1466208686&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is infinitely better than hiring people based strictly on their resume and some feel-good conversation during the interview, but it is not entirely fool-proof.&lt;br /&gt;&lt;br /&gt;First, it emphasizes a set of skills - specifically, algorithm design - that are not all that frequently required in the actual jobs that people do. Ask yourself, how many times have you had to write quick sort, a hash table, an AVL tree, or a read-write lock&amp;nbsp;implementation at work (and if you did, I would really be interested to know why :-)). The vast majority of people - especially those who work on maintaining very large code bases&amp;nbsp;- like Windows - simply do not get the opportunity to exercise their algorithmic muscle very often.&lt;br /&gt;&lt;br /&gt;Yet these are all fair questions during the interview. Don't get me wrong - I BELIEVE that these are fair questions, and I ask them myself: even if you don't need to code hashtables every day, it still helps to know how they work.&lt;br /&gt;&lt;br /&gt;For example, I ran into a situation at a hiring committee at Google where an interviewer was unhappy that the interviewee could not find an O(1) solution to a problem that - as far as I was concerned - did not have one. When I asked how exactly could one solve it in O(1) time, the person said - why, by using a hash, of course! Put a person who is convinced that a hash always exhibits O(1) performance on an OS component, and you are in for a number of interesting and intractable performance bugs down the road.&lt;br /&gt;So knowing algorithms and data structures well is very important, but our jobs are not preparing us for that. Which is why I found that often hiring a person from college - especially, an elite college - is easier than hiring a person from the industry - they have not yet had time to forget the theory.&lt;br /&gt;&lt;br /&gt;Also, knowing the things that are testable in the coding interview - algorithms, design practices, etc - is necessary, but not sufficient for engineering stardom. I've seen - and hired! - a number of people who were fantastic during the interview, but were very ineffective when they needed to deal with a real engineering problem - such as fixing a complex bug in a large system in a way that does not break existing functionality. To this day I have no idea how to do a practical examination of this skill in an interview setting!&lt;br /&gt;&lt;br /&gt;Meanwhile, the candidate pool is huge, and the resumes are mostly BS. I once did an experiment.&amp;nbsp;We needed a contractor for web development - AJAX, Javascript, things like that. So I took every person who claimed to be an expert in Web development on the resume that the contract agencies gave me for a standardized test - about 20 people in all. The test was not very advanced. The questions were "What is a closure in Javascript?", "What is&amp;nbsp;the difference between A.foo = 'bar'; and A.prototype.foo = 'bar';", etc - introductory stuff. The best person on the test scored 25%. The average was below 10%.&lt;br /&gt;&lt;br /&gt;Therein lies the cornerstone problem of the software industry, which I will summarize thus:&lt;br /&gt;&lt;br /&gt;1) Success of a software company is dependent on hiring great people. A star software engineer is an order of magnitude more productive than an average engineer, but costs only marginally more. Thus there is a huge incentive for companies to hire the best of the best.&lt;br /&gt;&lt;br /&gt;2) Many qualities of the best of the best engineers are very hard to measure directly. We can test problem solving, knowledge, and design skills during the interview, but we are forced to rely on a candidate's word when it comes to equally important qualifications such as ability to face ambiguity, passion, leadership, and working with others.&lt;br /&gt;&lt;br /&gt;3) There is a huge pool of candidates. The resume databases at the top companies have literally millions of entries. Most of the resumes are "enhanced" for "quality".&lt;br /&gt;&lt;br /&gt;4) Vast majority of the candidates are not... well, they are not in the top 10% :-). They may be enough to perform a lot of the jobs adequately, but they are nowhere near the productivity of the best of the best (see #1), and once the job for which they were hired is done, they may not be easily transferable to a different one.&lt;br /&gt;&lt;br /&gt;5) Firing someone from a big company requires a lot of work, is a very lengthy process, and so the cost of false positive is very high - both in the company's bottom line as well as in morale of the team.&lt;br /&gt;&lt;br /&gt;So... what do we do? How do we even screen the resumes - in a fully meritocratic system that pays no attention to selectivity of the previous places of work or study&amp;nbsp;- given the pure amount of BS in an average sample?&lt;br /&gt;&lt;br /&gt;The existing system that relies both on the selectivity of the environment as well as on the interview performance works in the sense that everything else we tried was worse.&lt;br /&gt;&lt;br /&gt;After all, I do not ever see anything near the stuff people reported on this thread at work: &lt;a href="http://www.reddit.com/r/AskReddit/comments/mk7yn/managers_supervisors_and_hr_people_of_reddit_tell/"&gt;http://www.reddit.com/r/AskReddit/comments/mk7yn/managers_supervisors_and_hr_people_of_reddit_tell/&lt;/a&gt;. As a matter of fact, even things worthy of the Daily WTF (&lt;a href="http://thedailywtf.com/Default.aspx"&gt;http://thedailywtf.com/Default.aspx&lt;/a&gt;)&amp;nbsp;almost never come up - at least as long as you are staying inside MSFT product development teams.&lt;br /&gt;&lt;br /&gt;This does not mean that the system cannot be improved further - but how? Your ideas are welcome in the comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3393628664644344120?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3393628664644344120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3393628664644344120' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3393628664644344120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3393628664644344120'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/hiring-at-elite-companies.html' title='Hiring at elite companies'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4875215581245347367</id><published>2011-11-21T19:24:00.000-08:00</published><updated>2011-11-21T19:24:39.528-08:00</updated><title type='text'>How to clean up the Internet (via Reddit)</title><content type='html'>"She tells me one day her husband is a really great guy because he spends his free time helping to "clean up the internet."&lt;br /&gt;I ask her what she means and she told me she found a bunch of porn in husbands web browser history. He informed her that he goes to porn sites to download the porn off of the internet servers onto his computer so that he can delete it. Apparently there's &lt;em&gt;a lot&lt;/em&gt; of porn on the internet, but he was trying to do what he could to remove as much of it as possible - for the children and all...&lt;br /&gt;&lt;br /&gt;She actually believes that he is doing this and uses it as a bragging point to show what a great guy her husband is in conversations."&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.reddit.com/r/AskReddit/comments/mk7yn/managers_supervisors_and_hr_people_of_reddit_tell/c31lp65"&gt;http://www.reddit.com/r/AskReddit/comments/mk7yn/managers_supervisors_and_hr_people_of_reddit_tell/c31lp65&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4875215581245347367?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4875215581245347367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4875215581245347367' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4875215581245347367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4875215581245347367'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/how-to-clean-up-internet-via-reddit.html' title='How to clean up the Internet (via Reddit)'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1847160009732998931</id><published>2011-11-18T14:36:00.000-08:00</published><updated>2011-11-18T14:36:07.384-08:00</updated><title type='text'>How to sign device drivers with a test certificate</title><content type='html'>This: &lt;a href="http://msdn.microsoft.com/en-us/library/bb530195.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb530195.aspx&lt;/a&gt;&amp;nbsp;has a long, unwieldy explanation.&lt;br /&gt;&lt;br /&gt;Here is a much simpler, step-by-step protocol:&lt;br /&gt;1) Run the following from an elevated CMD window (RunAs Administrator):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bcdedit /set testsigning on&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bcdedit /set nointegritychecks on&lt;br /&gt;2) Reboot&lt;br /&gt;3) Make a certificate. From a DDK command line window, type:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; makecert -r -pe -ss MyTestCertStore -n "CN=MyTestCert" mytestcert.cer&lt;br /&gt;4) From an elevated CMD window&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; certmgr -add mytestcert.cer -s -r localmachine root&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; certmgr -add mytestcert.cer -s -r localmachine trustedpublisher&lt;br /&gt;5) From certmgr window that just opened in step one or two (or type certmgr):&lt;br /&gt;&amp;nbsp; a) Right click on Trusted Root Certification Authorities -&amp;gt; All Tasks -&amp;gt; Import&lt;br /&gt;&amp;nbsp; b) Navigate to the cert file you have just created in step (3) (mytestcert.cer).&lt;br /&gt;&amp;nbsp; c) Say "yes"&lt;br /&gt;6) To sign the driver:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; signtool sign /n MyTestCert /s "MyTestCert" yourdrivername.sys&lt;br /&gt;&lt;br /&gt;Why can't our documentation people produce something similar???&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1847160009732998931?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1847160009732998931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1847160009732998931' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1847160009732998931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1847160009732998931'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/how-to-sign-device-drivers-with-test.html' title='How to sign device drivers with a test certificate'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8805731186692117290</id><published>2011-11-15T01:12:00.000-08:00</published><updated>2011-11-15T01:12:52.089-08:00</updated><title type='text'>The new Free Speech protocol</title><content type='html'>Citizen! It has recently come to our attention that you wish to exercise your first amendment freedoms. In order to ensure compliance with Free Speech Safety standards please obey the following rules to ensure that your protest in conducted properly.&lt;ul&gt;&lt;li&gt;You can exercise your rights in a designated Free Speech Zone. Anyone who is caught outside specified zones participating in a free speech action will be beaten and jailed.&lt;/li&gt;&lt;li&gt;You must apply for a permit to designate a Free Speech Zone. To apply for a permit please contact the Board of Permitting and Public Safety. It is expected that you will have your sanitation, safety, education, environmental impact and concessions permits before applying. Anyone found participating in a free speech action without a permit will be beaten and jailed.&lt;/li&gt;&lt;li&gt;Free Speech Zones operate between the hours of 9am - 5pm, anyone caught participating in a free speech action outside of those times will be beaten and jailed.&lt;/li&gt;&lt;li&gt;All citizens participating in free speech actions must be properly dressed to identify themselves to authorities, corporate representatives and interested third parties. These uniforms can be purchased at several Free Speech Distribution Authorities located throughout your community. Anyone caught participating in a free speech action without proper attire will be beaten and jailed.&lt;/li&gt;&lt;li&gt;No items will be allowed to be carried into the Free Speech Zone. Anything that is not attached directly to your person or is out of compliance with the standard Free Speech Zone attire protocol will confiscated before entering the Free Speech Zone. Those caught with foreign items are subject to beatings and possible incarceration at the officers discretion. Any property confiscated will be promptly destroyed.&lt;/li&gt;&lt;/ul&gt;The first amendment is important to us, and we hope by obeying these simple rules you can make our community a safer and happier place.&lt;br /&gt;&lt;br /&gt;Good luck with your free speech action!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.reddit.com/r/politics/comments/mcsy3/occupy_wall_street_being_evicted_calls_all_hands/c2zw30v"&gt;http://www.reddit.com/r/politics/comments/mcsy3/occupy_wall_street_being_evicted_calls_all_hands/c2zw30v&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8805731186692117290?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8805731186692117290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8805731186692117290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8805731186692117290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8805731186692117290'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/new-free-speech-protocol.html' title='The new Free Speech protocol'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8835010413673109850</id><published>2011-11-12T11:07:00.000-08:00</published><updated>2011-11-12T11:07:22.094-08:00</updated><title type='text'>How I Stopped Worrying and Learned to Love the OWS Protests</title><content type='html'>&lt;a href="http://www.rollingstone.com/politics/news/how-i-stopped-worrying-and-learned-to-love-the-ows-protests-20111110"&gt;http://www.rollingstone.com/politics/news/how-i-stopped-worrying-and-learned-to-love-the-ows-protests-20111110&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;"I originally was very uncomfortable with the way the protesters were focusing  on the NYPD as symbols of the system. After all, I thought, these are just  working-class guys from the Bronx and Staten Island who have never seen the  inside of a Wall Street investment firm, much less had anything to do with the  corruption of our financial system.&lt;br /&gt;&lt;br /&gt;But I was wrong. The police in their own way are symbols of the problem. All  over the country, thousands of armed cops have been deployed to stand around and  surveil and even assault the polite crowds of Occupy protesters. This deployment  of law-enforcement resources already dwarfs the amount of money and manpower  that the government "committed" to fighting crime and corruption during the  financial crisis. One OWS protester steps in the wrong place, and she  immediately has police roping her off like wayward cattle. But in the  skyscrapers above the protests, anything goes."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8835010413673109850?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8835010413673109850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8835010413673109850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8835010413673109850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8835010413673109850'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/how-i-stopped-worrying-and-learned-to.html' title='How I Stopped Worrying and Learned to Love the OWS Protests'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3973646875627121364</id><published>2011-11-09T15:20:00.000-08:00</published><updated>2011-11-09T15:22:38.947-08:00</updated><title type='text'>Puzzling heap performance in CRT under Visual Studio</title><content type='html'>So I'm running this app which does reasonable amount of allocations using standard CRT functions. It's compiled for release, but I was running it under Visual Studio. Absolutely terrible memory allocator performance, especially the one in free: 89 seconds to free just under a million structures (the app uses just two sizes - around 32000&amp;nbsp;2056 byte structures&amp;nbsp;and about 900000 36 byte structures).&lt;br /&gt;&lt;br /&gt;Generating: 1000000&lt;br /&gt;&lt;strong&gt;Adding: 951 ms&lt;/strong&gt;&lt;br /&gt;Port: 10000, total ip entries: 994937, total memory used: 3673124&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 1: 128 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 2: 32768 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 3: 885384 (blanket: 3975)&lt;br /&gt;Testing the ip ranges... 0&lt;br /&gt;Testing ip ranges: 27378 ms&lt;br /&gt;Total ips allowed across all ports: 2012537&lt;br /&gt;&lt;strong&gt;Removing: 71355 ms&lt;/strong&gt;&lt;br /&gt;Port: 10000, total ip entries: 0, total memory used: 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 1: 0 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 2: 0 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 3: 0 (blanket: 0)&lt;br /&gt;&lt;br /&gt;Fine, I replaced the allocator with my own, using fixed memory blocks (described here: &lt;a href="http://1-800-magic.blogspot.com/2007/11/guerilla-guide-to-native-memory.html"&gt;http://1-800-magic.blogspot.com/2007/11/guerilla-guide-to-native-memory.html&lt;/a&gt;). The object removal time promptly dropped to just above 200ms. Ok. Then, on a hunch, I run this - with the standard CRT allocator - from the command line:&lt;br /&gt;&lt;br /&gt;Generating: 1000000&lt;br /&gt;&lt;strong&gt;Adding: 281 ms&lt;/strong&gt;&lt;br /&gt;Port: 10000, total ip entries: 994937, total memory used: 3673124&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 1: 128 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 2: 32768 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 3: 885384 (blanket: 3975)&lt;br /&gt;Testing the ip ranges... 0&lt;br /&gt;Testing ip ranges: 27831 ms&lt;br /&gt;Total ips allowed across all ports: 2012537&lt;br /&gt;&lt;strong&gt;Removing: 249 ms&lt;/strong&gt;Port: 10000, total ip entries: 0, total memory used: 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 1: 0 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 2: 0 (blanket: 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entries at level 3: 0 (blanket: 0)&lt;br /&gt;&lt;br /&gt;Come on, Visual Studio guys. Release should mean RELEASE - not a debug heap!&lt;br /&gt;&lt;br /&gt;Interestingly, I ran it under profiler after this, and the profiler does the right thing - it uses the fast heap. Otherwise the results would be really, really screwed. It's a good thing - if you happen to use the profiler or at least run it outside the environment before pursuing the problem that does not even exist!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3973646875627121364?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3973646875627121364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3973646875627121364' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3973646875627121364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3973646875627121364'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/puzzling-heap-performance-in-crt-under.html' title='Puzzling heap performance in CRT under Visual Studio'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-5181507956899418835</id><published>2011-11-08T15:54:00.000-08:00</published><updated>2011-11-08T15:54:06.297-08:00</updated><title type='text'>My daughter releases her first Microsoft product!</title><content type='html'>&lt;a href="http://channel9.msdn.com/Blogs/Charles/Summer-Interns-2011-Parallel-Watch-Visualizers-for-Visual-Studio-11"&gt;http://channel9.msdn.com/Blogs/Charles/Summer-Interns-2011-Parallel-Watch-Visualizers-for-Visual-Studio-11&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-5181507956899418835?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/5181507956899418835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=5181507956899418835' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5181507956899418835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5181507956899418835'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/11/my-daughter-releases-her-first.html' title='My daughter releases her first Microsoft product!'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3956528559591262757</id><published>2011-10-10T14:50:00.000-07:00</published><updated>2011-10-10T14:53:17.421-07:00</updated><title type='text'>String-matching automaton</title><content type='html'>&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;static void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; Main(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;[] args)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; (args.Length &amp;lt; 2)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #2b91af; font-family: Consolas;"&gt;&lt;span style="color: #2b91af; font-family: Consolas;"&gt;&lt;span style="color: #2b91af; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;.WriteLine(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas;"&gt;&lt;span style="color: #a31515; font-family: Consolas;"&gt;&lt;span style="color: #a31515; font-family: Consolas;"&gt;"Usage: {0} string_pattern string"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="color: #2b91af;"&gt;Environment&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.GetCommandLineArgs()[0]);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; pattern = args[0].ToUpper();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; str = args[1].ToUpper();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="color: green; font-family: Consolas;"&gt;&lt;span style="color: green; font-family: Consolas;"&gt;&lt;span style="color: green; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The automaton. Simple state machine that contains back-links to self-repeating&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;// patterns inside the pattern. This takes a long time to compute:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // O(pattern size cubed&amp;nbsp;times size of the alphabet). This makes this algorithm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// not very practical in general.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;const&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; alphabetLen = &lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;'Z'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; - &lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;'A'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; + 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; [,] transitionFunc = &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;[alphabetLen, pattern.Length];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; (&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;stateIndex = 0;&amp;nbsp;stateIndex &amp;lt; pattern.Length; ++stateIndex)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; (&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;ch = 0;&amp;nbsp;ch &amp;lt; alphabetLen; ++ch)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; suffix = pattern.Substring(0, stateIndex) + (&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;char&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)(&lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;'A'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; + ch);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; stateTransition = &lt;span style="color: #2b91af;"&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="color: #2b91af;"&gt;Math&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.Min(pattern.Length + 1,&amp;nbsp;stateIndex + 2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; prefix;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;do&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --stateTransition;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prefix = pattern.Substring(0, stateTransition);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;while&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; (!suffix.EndsWith(prefix));&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; transitionFunc[ch, stateIndex] = stateTransition;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="color: green; font-family: Consolas;"&gt;&lt;span style="color: green; font-family: Consolas;"&gt;&lt;span style="color: green; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// The match.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; state = 0;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; (&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; i = 0; i &amp;lt; str.Length; ++i)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state = transitionFunc[str[i] - &lt;/span&gt;&lt;span style="color: #a31515; font-family: Consolas;"&gt;&lt;span style="color: #a31515; font-family: Consolas;"&gt;&lt;span style="color: #a31515; font-family: Consolas;"&gt;'A'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;, state];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; (state == pattern.Length)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;&lt;span style="color: #2b91af;"&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="color: #a31515;"&gt;"Substring found at "&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; + (i - pattern.Length + 1));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: blue;"&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3956528559591262757?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3956528559591262757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3956528559591262757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3956528559591262757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3956528559591262757'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/10/string-matching-automaton.html' title='String-matching automaton'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2641548668915064822</id><published>2011-10-06T10:42:00.000-07:00</published><updated>2011-10-06T10:42:58.708-07:00</updated><title type='text'>SleepSort</title><content type='html'>&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; SleepSort(&lt;span style="color: blue;"&gt;int&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; count = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;TimerCallback&lt;/span&gt; t = (&lt;span style="color: blue;"&gt;object&lt;/span&gt; o) =&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(o);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Interlocked&lt;/span&gt;.Increment(&lt;span style="color: blue;"&gt;ref&lt;/span&gt; count);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; a &lt;span style="color: blue;"&gt;in&lt;/span&gt; args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Timer&lt;/span&gt;(t, a, a * 1000, System.Threading.&lt;span style="color: #2b91af;"&gt;Timeout&lt;/span&gt;.Infinite);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;while&lt;/span&gt; (count &amp;lt; args.Length)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Thread&lt;/span&gt;.Sleep(1000);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SleepSort(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt;[] {5, 3, 12, 10, 1, 2});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2641548668915064822?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2641548668915064822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2641548668915064822' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2641548668915064822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2641548668915064822'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/10/sleepsort.html' title='SleepSort'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1673138227202667843</id><published>2011-10-05T15:56:00.000-07:00</published><updated>2011-10-05T15:57:10.556-07:00</updated><title type='text'>Code snippet: how to use Windows Task Scheduler from .NET</title><content type='html'>First, make a reference to TaskScheduler 1.1 Type Library in COM components.&lt;br /&gt;&lt;br /&gt;Then:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Threading;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;using TaskScheduler;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;namespace TaskScheduleDemo&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Program&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main(string[] args)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (args.Length &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (args[0].Equals("bing"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 10; ++i)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Bing!");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(1000);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (args[0].Equals("install"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Install();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (args[0].Equals("remove"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Error.WriteLine("Usage: {0} {bing|install|remove}");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static private void Remove()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITaskService service = new TaskSchedulerClass();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service.Connect(null, null, null, null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITaskFolder folder = service.GetFolder(@"\");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; folder.DeleteTask(@"\Microsoft\Bing\Bing", 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; folder.DeleteFolder(@"\Microsoft\Bing", 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (FileNotFoundException)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (DirectoryNotFoundException)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (System.Runtime.InteropServices.COMException cex)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;Something else is still there&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((uint)cex.ErrorCode != 0x80070091)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Error.WriteLine("Failed to remove task: {0}", cex.ErrorCode);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static private void Install()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITaskService service = new TaskSchedulerClass();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service.Connect(null, null, null, null);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITaskFolder folder = service.GetFolder(@"\");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITaskFolder bing = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bing = folder.GetFolder(@"Microsoft\Bing");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (FileNotFoundException)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (bing == null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bing = folder.CreateFolder(@"Microsoft\Bing",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "D:(A;;FA;;;BA)(A;;FA;;;SY)(A;;GR;;;WD)");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITaskDefinition td = service.NewTask(0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; td.RegistrationInfo.Description = "Bing!";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; td.Settings.Enabled = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; td.Principal.LogonType = _TASK_LOGON_TYPE.TASK_LOGON_INTERACTIVE_TOKEN;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IExecAction action = td.Actions.Create(_TASK_ACTION_TYPE.TASK_ACTION_EXEC)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as IExecAction;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string executable = System.Reflection.Assembly.GetExecutingAssembly().Location;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action.Path = executable;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action.WorkingDirectory = Path.GetDirectoryName(executable);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action.Arguments = "bing";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITrigger trigger = td.Triggers.Create(_TASK_TRIGGER_TYPE2.TASK_TRIGGER_TIME);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trigger.StartBoundary = DateTime.Now.AddMinutes(1).ToString("o");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trigger.Enabled = true;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bing.RegisterTaskDefinition(@"Bing", td, 6, null, null,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _TASK_LOGON_TYPE.TASK_LOGON_INTERACTIVE_TOKEN, null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1673138227202667843?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1673138227202667843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1673138227202667843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1673138227202667843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1673138227202667843'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/10/code-snippet-how-to-use-windows-task.html' title='Code snippet: how to use Windows Task Scheduler from .NET'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7216985833602136982</id><published>2011-06-30T12:25:00.000-07:00</published><updated>2011-06-30T12:26:09.587-07:00</updated><title type='text'>A quote</title><content type='html'>"Great minds discuss ideas; Average minds discuss events; Small minds discuss people."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- Eleanor Roosevelt&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.quotationspage.com/quote/36354.html"&gt;http://www.quotationspage.com/quote/36354.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Today US public discourse is almost entirely devoid of ideas. There aren't even&amp;nbsp;all that&amp;nbsp;many events being discussed. Instead, everyone is focusing on what Sarah Palin is doing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7216985833602136982?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7216985833602136982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7216985833602136982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7216985833602136982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7216985833602136982'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/06/quote.html' title='A quote'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2320683776577421056</id><published>2011-05-16T09:10:00.001-07:00</published><updated>2011-05-16T09:10:52.044-07:00</updated><title type='text'>NSA title: "Senior Change Leader/Chief, Change Leadership &amp; Communications Office, Signals Intelligence Directorate"</title><content type='html'>&lt;a href="http://www.newyorker.com/reporting/2011/05/23/110523fa_fact_mayer?currentPage=all"&gt;http://www.newyorker.com/reporting/2011/05/23/110523fa_fact_mayer?currentPage=all&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2320683776577421056?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2320683776577421056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2320683776577421056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2320683776577421056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2320683776577421056'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/05/nsa-title-senior-change-leaderchief.html' title='NSA title: &quot;Senior Change Leader/Chief, Change Leadership &amp; Communications Office, Signals Intelligence Directorate&quot;'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6033137016396729774</id><published>2011-05-11T10:19:00.001-07:00</published><updated>2011-05-11T10:19:23.938-07:00</updated><title type='text'>Clever, this one is...</title><content type='html'>&lt;a href="http://www.galacticempiretimes.com/2011/05/09/galaxy/outer-rim/obi-wan-kenobi-is-killed.html"&gt;http://www.galacticempiretimes.com/2011/05/09/galaxy/outer-rim/obi-wan-kenobi-is-killed.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6033137016396729774?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6033137016396729774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6033137016396729774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6033137016396729774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6033137016396729774'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/05/clever-this-one-is.html' title='Clever, this one is...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3143201756288823285</id><published>2011-04-25T23:36:00.000-07:00</published><updated>2011-04-25T23:36:09.994-07:00</updated><title type='text'>A GUID, cheap!</title><content type='html'>Someone was selling them on eBay a while ago, but there's none available now. So I'm offering one of my own. Inexpensively!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://cgi.ebay.com/new-freshly-generated-GUID-/320690777459?pt=LH_DefaultDomain_0&amp;amp;hash=item4aaaa8ed73"&gt;http://cgi.ebay.com/new-freshly-generated-GUID-/320690777459?pt=LH_DefaultDomain_0&amp;amp;hash=item4aaaa8ed73&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3143201756288823285?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3143201756288823285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3143201756288823285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3143201756288823285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3143201756288823285'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/04/guid-cheap.html' title='A GUID, cheap!'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-24468771505529523</id><published>2011-04-24T23:35:00.000-07:00</published><updated>2011-04-24T23:40:16.799-07:00</updated><title type='text'>Kimber 82 Government</title><content type='html'>The Civilian Marksmanship Program, a quasi-government organization set up to promote firearms training among the US population is selling surplus military rifles.&lt;br /&gt;The rimfire rifle of the day is Kimber 82G. 20000 of these were made in the late 80s for the Army's marksmanship training. The ones on sale by CMP are unused.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.thecmp.org/22targetsurplus.htm"&gt;http://www.thecmp.org/22targetsurplus.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been eyeing these rifles for a long, long time. Target rimfire rifles (in fact, target rifles of any kind) is a scarce - and dwindling - commodity. In fact, I don't think anyone in the US makes target rimfire rifles any more - if you want a new one, it has to be&amp;nbsp;Anshutz, they are expensive and they are sold through relatively vague channels - you definitely cannot just play with one at a store. At least not at a store anywhere near Seattle.&lt;br /&gt;&lt;br /&gt;Unfortunately, the requirements to buy rifles from CMP are quite onerous as well - you have to have a "demonstrated" interest in shooting (C&amp;amp;R license works for this). You have to be a member of the right club (&lt;a href="http://clubs.odcmp.com/cgi-bin/clubSearch.cgi"&gt;http://clubs.odcmp.com/cgi-bin/clubSearch.cgi&lt;/a&gt;). You have to have a proof of US citizenship. You have to send an application for the purchase, signed and notarized (&lt;a href="http://www.thecmp.org/orderinginfo.htm"&gt;http://www.thecmp.org/orderinginfo.htm&lt;/a&gt;), by snail-mail.&lt;br /&gt;&lt;br /&gt;So a couple of months back I have finally collected all the necessary documentation, joined the right club, and sent in the paperwork for three "rusty" Kimbers. The consensus on the Internet was that the "rusty" version is the way to go - the actual amount of rust is minor and in any case if shows (if at all) in the places where it does not matter. So I figured I'd take the risk and get 3 for the price of 2 regular ones.&lt;br /&gt;&lt;br /&gt;It takes 45-90 days, according to the CMP website, to get the rifle, and so it was in my case. They ship them back FedEx next day, morning delivery, and email the day before, so&amp;nbsp;I waited for them to show up at home.&lt;br /&gt;&lt;br /&gt;The very first thing that I did that same morning was to check them for rust. The rust definitely was there. The rifle came with match aperture sights, and that's where a lot of visible rust was concentrated. Not one of the three sets of the sights was rust free. The rusting was light - just tiny dots of bright red.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Gqbmmm7HeA0/TbUANQMVS4I/AAAAAAAAArk/lymGLsOSOGU/s1600/Rear+sight+rust+specs+2+clipped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://2.bp.blogspot.com/-Gqbmmm7HeA0/TbUANQMVS4I/AAAAAAAAArk/lymGLsOSOGU/s640/Rear+sight+rust+specs+2+clipped.png" width="626" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The photos overemphasize it, somehow, it looks much better in real life.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-I3YbkHEFTKI/TbUAoqm86BI/AAAAAAAAAro/u7ce3l5AZOE/s1600/Rear+sight+rust+specs+clipped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://2.bp.blogspot.com/-I3YbkHEFTKI/TbUAoqm86BI/AAAAAAAAAro/u7ce3l5AZOE/s640/Rear+sight+rust+specs+clipped.png" width="616" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;How the rust got there, given the fact that the sights were in a sealed plastic bag, is completely beyond me.&lt;br /&gt;&lt;br /&gt;All three bores had a few imperfections, mostly close to the chamber, but in one of the three rifles it was roughly 1/3rd barrel length from the muzzle. I do not have a boroscope, so I could not tell if these were rust spots or tool marks, but the patches came out with not even a minor tinge of red, so I assume that they were the tool marks. Other than these impefections, the bores were mirror-bright.&lt;br /&gt;&lt;br /&gt;The were much smaller specs of rust on the trigger assembly and the receiver. All of them came off easily after being rubbed by a patch soaked with Break-Free CLP, or drowned in the CLP bath. There were a number of posts on the Internet forums about rust inside the bolt, so I took apart mine. (The instructions on how to do it&amp;nbsp;are here: &lt;a href="http://solyanik.com/drop/k82bc.pdf"&gt;http://solyanik.com/drop/k82bc.pdf&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Two of the bolts had very minor amount of rust specs on the outside. One had significant amount inside - to the point that rust has caked the gaps between the strands of the spring. It was not deep, though, and all came off after an overnight soaking in CLP and going-over with a patch.&lt;br /&gt;&lt;br /&gt;The final imperfection was a shallow cut in the stock made when the rifles were opened for inventory in the mid-90s. The pictures below show the damage, which was approximately the same on all three rifles.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-KAzX6tXE7iM/TbUHkAd2LbI/AAAAAAAAArs/3dcfmos_c-I/s1600/Kimber+-+scratch+forward.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="424" src="http://2.bp.blogspot.com/-KAzX6tXE7iM/TbUHkAd2LbI/AAAAAAAAArs/3dcfmos_c-I/s640/Kimber+-+scratch+forward.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-BGkgmHp3YBg/TbUHshDtGyI/AAAAAAAAArw/4cztG2H1pRw/s1600/Kimber+-+scratch+rear.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="424" src="http://3.bp.blogspot.com/-BGkgmHp3YBg/TbUHshDtGyI/AAAAAAAAArw/4cztG2H1pRw/s640/Kimber+-+scratch+rear.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Other than that, the rifle looked perfect - blue, wood, everything was new.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-jPLqHURLqc8/TbULG6SaEcI/AAAAAAAAAr0/FxPnPZah19M/s1600/Kimbebr+clipped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="170" src="http://3.bp.blogspot.com/-jPLqHURLqc8/TbULG6SaEcI/AAAAAAAAAr0/FxPnPZah19M/s640/Kimbebr+clipped.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;On to the range. This is the result of shooting CCI Green Tag, American Eagle, and Wolf Match Target today. Conditions - light rain, calm. Shooting was at 50 yards, the orange dots are 1" in diameter.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--MuyMPkHsMY/TbUS_IssqjI/AAAAAAAAAr8/BBfTHN9qnlc/s1600/Target+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="584" src="http://2.bp.blogspot.com/--MuyMPkHsMY/TbUS_IssqjI/AAAAAAAAAr8/BBfTHN9qnlc/s640/Target+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The results are as follows.&lt;br /&gt;&lt;br /&gt;CCI Green Tag:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Smallest: 0.312&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Largest: 0.788&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average: 0.588&lt;br /&gt;&lt;br /&gt;American Eage:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Smallest: 0.404&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Largest: 0.840&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average: 0.525&lt;br /&gt;&lt;br /&gt;Wolf Match Target (*):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Smallest: 0.242&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Largest: 0.489&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average: 0.376&lt;br /&gt;&lt;br /&gt;(*) The top middle group shooting Wolf was 10 shots and was excluded from the sample. The other groups were 5 shot groups. The 10-shot group measured 0.624".&lt;br /&gt;&lt;br /&gt;Next round will be on a 100 yard lane...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-24468771505529523?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/24468771505529523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=24468771505529523' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/24468771505529523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/24468771505529523'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/04/kimber-82-government.html' title='Kimber 82 Government'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Gqbmmm7HeA0/TbUANQMVS4I/AAAAAAAAArk/lymGLsOSOGU/s72-c/Rear+sight+rust+specs+2+clipped.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2260973115569979767</id><published>2011-04-17T23:43:00.000-07:00</published><updated>2011-04-17T23:43:20.138-07:00</updated><title type='text'>Reddit on taxes</title><content type='html'>This is the original link:&lt;br /&gt;&lt;a href="http://www.reddit.com/r/AskReddit/comments/gs6ov/people_are_angry_the_ge_did_not_pay_us_taxes_but/c1px4sv?context=1"&gt;http://www.reddit.com/r/AskReddit/comments/gs6ov/people_are_angry_the_ge_did_not_pay_us_taxes_but/c1px4sv?context=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saving the text for posterity (because who knows what Reddit's retention rules would look like in a year), because it deserves it.&lt;br /&gt;&lt;br /&gt;By kleinbl00 (&lt;a href="http://www.reddit.com/user/kleinbl00"&gt;http://www.reddit.com/user/kleinbl00&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;"I have a financial planner.  He's a dyed-in-the-wool PNAC militant Republican, all the more ironic considering he's an Iraqi with family ties to Chemical Ali.  I watched him give a seminar once where in one breathtaking sentence he managed to tie Rosie the Riveter to Osama Bin Laden and blame the rise of Islamic terrorism to the post-war appearance of women in the workplace.  I mention this not only to illustrate that his mindset is very much not my own, but to illustrate exactly how far away it is from anything I would consider "progressive."&lt;br /&gt;&lt;br /&gt;Yet he manages my money.  And he manages it aggressively.  When we had this come-to-jesus about philosophy he said "I'll tell you the same thing I told (a prominent liberal whose money he also manages).  I don't make the laws.  I just play by them.  You can hate the policies as much as you want but if I leave money on the table, &lt;em&gt;I'm not doing my job.&lt;/em&gt;  What you do with it is up to you - give everything I save you to Greenpeace for all I care.  But can we have an understanding that because the tax code is written for the rich by the rich, you'd be a fool not to play the game by our rules?"&lt;br /&gt;&lt;br /&gt;We fully arrived in Bizarro-World when we were talking about how our current state and our former state don't grant the same professional rights to my wife (a naturopathic doctor) and that her scope of practice would be significantly curtailed compared to what she was used to.  "The cheapest thing to do would be to hire a lobbyist and get the laws changed," he said.  We just sort of stared at him, bug-eyed.  &lt;em&gt;Cheapest?&lt;/em&gt;  "Well, you're talking a state law with a very narrow scope.  We could probably overturn that for ten, twenty thousand dollars."  It turns out he was speaking hyperbolically, but he wasn't far off.  The list of lobbyists he showed us was the same as the list of lobbyists my wife's professional organization hired off of.  His prices were off - maybe a factor of two, factor of three.  Not a factor of ten.&lt;br /&gt;&lt;hr /&gt;Americans need to understand down to their very bones that their money is going to - and their country is being run by - people who know that an inconvenient tax law doesn't need to be suffered, it needs to be &lt;em&gt;changed.&lt;/em&gt;  These people know that if $200k of lobbying saves them $200m in taxes that lobbying is their most financially efficient tax strategy.  Americans need to understand that the entire system is rigged against people who take the 1040EZ, who always get the Standard Deduction, who think that their $10k account on eTrade makes them a "player."  The entire system is rigged so heavily against the individual with a middle-class income that the average taxpayer still thinks he's a small fish in a small pond - he doesn't even realize he's a goldfish in an aquarium bought and paid for by people whose fortunes dwarf his so extravagantly that scientific notation is necessary to illustrate the difference.&lt;br /&gt;&lt;br /&gt;The AP ran a pie chart in 2001 that I saw in a newspaper once and haven't seen since.  It broke down who, exactly, benefited from the &lt;a href="http://en.wikipedia.org/wiki/Economic_Growth_and_Tax_Relief_Reconciliation_Act_of_2001"&gt;Bush Tax Cuts&lt;/a&gt; - remember, back when you got a $300 check as pablum to get you to shut up?  Prosperity for everybody, right?&lt;br /&gt;&lt;br /&gt;That graph had a lot of stuff on it that wouldn't surprise you.  "Businesses" got a big chunk of it.  "The Middle class" got a tiny chunk of it.  "The wealthy" got a big chunk of it.  But way down at the bottom, next to a "2%" there was an asterisk.  That asterisk, down in the footnotes, said &lt;a href="http://en.wikipedia.org/wiki/Walton_family"&gt;"Samuel, John, Christy, Alice and James Walton."&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2% of the benefits of an entire national tax cut - &lt;a href="http://www.cbo.gov/doc.cfm?index=8337&amp;amp;type=0"&gt;about four billion dollars&lt;/a&gt; -  went directly to five people.  Who happen to own Walmart.  They cut you a $300 check so yo wouldn't grumble about it.  Each Walton, individually, got more tax cut than 2.5 million people, collectively.  But it's okay, because you got an X-box.&lt;br /&gt;&lt;br /&gt;That's the system we live in.  And the people who have the most direct power to change it are the ones that are benefiting the most.  Be angry at GE.  Be angry at the tax laws.  Be angry at the lobbyists.  Be angry at the people taking advantage of it.  If you aren't outraged, you aren't paying attention.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;"Socialism never took root in America because the poor see themselves not as an exploited proletariat, but as temporality embarrassed millionaires."&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;code&gt;John Steinbeck"&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2260973115569979767?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2260973115569979767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2260973115569979767' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2260973115569979767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2260973115569979767'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/04/reddit-on-taxes.html' title='Reddit on taxes'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4194218120229983275</id><published>2011-04-17T19:39:00.000-07:00</published><updated>2011-04-17T19:40:05.906-07:00</updated><title type='text'>Why is Idiocracy so funny? Because it's true...</title><content type='html'>(Idiocracy) "The years passed, mankind became stupider at a frightening rate. Some had high hopes the genetic engineering would correct this trend in evolution, but sadly the greatest minds and resources where focused on conquering hair loss and prolonging erections.&lt;u&gt;&lt;span style="color: navy;"&gt;"&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;span style="color: navy;"&gt;&lt;a href="http://www.businessweek.com/magazine/content/11_17/b4225060960537.htm"&gt;http://www.businessweek.com/magazine/content/11_17/b4225060960537.htm&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: navy;"&gt;"The best minds of my generation are thinking about how to make people click ads"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4194218120229983275?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4194218120229983275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4194218120229983275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4194218120229983275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4194218120229983275'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/04/why-is-idiocracy-so-funny-because-its.html' title='Why is Idiocracy so funny? Because it&apos;s true...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2294945900972064191</id><published>2011-03-31T19:53:00.000-07:00</published><updated>2011-03-31T19:54:19.388-07:00</updated><title type='text'>A very compact representation of $20000</title><content type='html'>No, they are not mine. Picked up this picture at a collector's forum. Each one is worth $2-3k...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-mlaDgRq1nvk/TZUk2dwy6hI/AAAAAAAAArg/9bpk7N5pUWI/s1600/PEM11%252520138.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://4.bp.blogspot.com/-mlaDgRq1nvk/TZUk2dwy6hI/AAAAAAAAArg/9bpk7N5pUWI/s640/PEM11%252520138.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2294945900972064191?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2294945900972064191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2294945900972064191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2294945900972064191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2294945900972064191'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/03/very-compact-representation-of-20000.html' title='A very compact representation of $20000'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-mlaDgRq1nvk/TZUk2dwy6hI/AAAAAAAAArg/9bpk7N5pUWI/s72-c/PEM11%252520138.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3685014912387633331</id><published>2011-03-11T14:59:00.000-08:00</published><updated>2011-03-11T14:59:09.403-08:00</updated><title type='text'>Looking for awesome testers</title><content type='html'>My team is looking for very senior test engineers. The testers on our team do more than writing tests - alongside the devs they are responsible for the health of production instance, so the job is similar to that of Google SREs in many (but not all) respects. By the way, we are looking for Google SREs of all levels as well, in the more traditional SRE roles.&lt;br /&gt;&lt;br /&gt;If you are interested, please send me your resume (&lt;a href="mailto:resumes@solyanik.com"&gt;mailto:resumes@solyanik.com&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Are you working on one of the most important problems in your field? If not, come join the team that is.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;======================================================================&lt;br /&gt;&lt;br /&gt;As Web 2.0 matures, a new paradigm is being born - massively distributed development, where a typical application runs on hundreds, thousands, sometimes tens of thousands computers at the same time. A new software stack that resembles familiar operating system concepts is being built to support this model.&lt;br /&gt;Would you like to participate in the creation of the Web 2.0 framework?&lt;br /&gt;The Manageability Services Group (MSG) builds components that massively distributed applications live and die by - deployment, automation, monitoring, discovery, etc. We have it all - complex algorithmic tasks, opportunity to write a lot of code, potential to influence the entire industry, and, last but not least, soon to be running millions of computers!&lt;br /&gt;&lt;br /&gt;Interested?&lt;br /&gt;&lt;br /&gt;We’re looking for strong algorithmic skills, native fluency in C#, and a lot of passion - proven by shipping real software! A SDET on our team is responsible for managing the design, implementation and automation of test cases to ensure high quality solutions are shipping across large data centers.&lt;br /&gt;Qualifications:&lt;br /&gt;&lt;br /&gt;Interested candidates should possess a thorough understanding of the software development lifecycle from specification, through implementation and testing, to final deployment and operation.&lt;br /&gt;Passion for distributed systems, fault tolerance and recovery, and geo-distributed solutions&lt;br /&gt;8+ years of Software Development experience working with a structured programming language (C++, C#, Java, etc.)&lt;br /&gt;6+ years of broad testing experience required&lt;br /&gt;Deep knowledge of test engineering and software development required.&lt;br /&gt;Excellent troubleshooting skills&lt;br /&gt;Knowledge of networking (tracing, packet sniffers, etc.) a big plus&lt;br /&gt;Communications excellence including cross-team collaboration, presentation and documentation&lt;br /&gt;Demonstrated technical leadership, great communication skills and a history of driving for results is required.&lt;br /&gt;BS or MS in Computer Science or related areas is preferred and we will take experience and a proven track record over other requirements&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3685014912387633331?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3685014912387633331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3685014912387633331' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3685014912387633331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3685014912387633331'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/03/looking-for-awesome-testers.html' title='Looking for awesome testers'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8299621971634723762</id><published>2011-03-11T11:53:00.000-08:00</published><updated>2011-03-11T11:53:35.479-08:00</updated><title type='text'>Intellectual property is now infrastructure</title><content type='html'>Wondered why the creme-de-la-creme of the modern web companies such as Google and Facebook do not seem to value software as a form of market lock-in? Google is, and has always been, publishing lots of articles containing detailed information - and source code - for their core systems.&lt;br /&gt;&lt;br /&gt;MapReduce, Bigtable, GFS, Chubby, Closure, Chrome, Android et al would be the major source of competitive advantage 10 years ago, and now most of the key technologies that comprise Google are either open source or public domain.&lt;br /&gt;&lt;br /&gt;Why?&lt;br /&gt;&lt;br /&gt;Because Google does not derive its competitive advantage from software. They are betting that even if someone could replicate their technologies, they would never be able to replicate their datacenters. Incidentally, there is far less information about both hardware and software that runs it (try, for example, googling for&amp;nbsp;"Google Borg").&lt;br /&gt;&lt;br /&gt;It appears that the infrastructure - hardware and software - is becoming the modern answer to the open source. After the open source sucked the value out of the software as THE value proposition, the competitive advantage had so move somewhere, and infrastructure was the obvious way to go.&lt;br /&gt;&lt;br /&gt;You move, FSF?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8299621971634723762?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8299621971634723762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8299621971634723762' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8299621971634723762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8299621971634723762'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/03/intellectual-property-is-now.html' title='Intellectual property is now infrastructure'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-227626944175297352</id><published>2011-03-01T18:42:00.001-08:00</published><updated>2011-03-01T18:42:53.049-08:00</updated><title type='text'>Caviar! It's jumping off the shelf.</title><content type='html'>The owner of a specialty food store on Manhattan's Upper East Side—Maureen's Passion—was touting the top-income tax cuts the GOP had shoved into Obama's compromise. "It all turned around when the tax bill passed," he'd told a financial news website. "Caviar! It's jumping off the shelf."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://motherjones.com/politics/2011/02/reagan-anniversary-david-stockman"&gt;http://motherjones.com/politics/2011/02/reagan-anniversary-david-stockman&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-227626944175297352?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/227626944175297352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=227626944175297352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/227626944175297352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/227626944175297352'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/03/caviar-its-jumping-off-shelf.html' title='Caviar! It&apos;s jumping off the shelf.'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1392054465364566066</id><published>2011-02-21T13:39:00.001-08:00</published><updated>2011-02-21T13:39:47.368-08:00</updated><title type='text'>Wikipedia quote on Idiocracy</title><content type='html'>"Fox downplayed the release of Idiocracy because the company did not want to offend its typical viewers."&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Idiocracy#Release_issues"&gt;http://en.wikipedia.org/wiki/Idiocracy#Release_issues&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1392054465364566066?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1392054465364566066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1392054465364566066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1392054465364566066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1392054465364566066'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/02/wikipedia-quote-on-idiocracy.html' title='Wikipedia quote on Idiocracy'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6591384695406638193</id><published>2011-02-19T10:14:00.001-08:00</published><updated>2011-02-19T10:14:27.288-08:00</updated><title type='text'>Access Denied</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-EuXXleRPARc/TWAIdTDLQWI/AAAAAAAAArQ/aJjp3Zp_n3s/s1600/access+denied.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" j6="true" src="http://1.bp.blogspot.com/-EuXXleRPARc/TWAIdTDLQWI/AAAAAAAAArQ/aJjp3Zp_n3s/s1600/access+denied.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6591384695406638193?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6591384695406638193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6591384695406638193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6591384695406638193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6591384695406638193'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/02/access-denied.html' title='Access Denied'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-EuXXleRPARc/TWAIdTDLQWI/AAAAAAAAArQ/aJjp3Zp_n3s/s72-c/access+denied.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6672937148451654129</id><published>2011-02-14T10:58:00.000-08:00</published><updated>2011-02-14T10:58:12.836-08:00</updated><title type='text'>Google's JavaScript style guide is available</title><content type='html'>&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;a href="http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml"&gt;&lt;span style="font-family: Calibri;"&gt;http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;Very much worth a read if you are doing JavaScript development - it's not just about appearance!&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6672937148451654129?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6672937148451654129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6672937148451654129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6672937148451654129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6672937148451654129'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/02/googles-javascript-style-guide-is.html' title='Google&apos;s JavaScript style guide is available'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8563745719130255211</id><published>2011-02-06T12:03:00.000-08:00</published><updated>2011-02-06T12:03:06.364-08:00</updated><title type='text'>Seriously, there is a huge correlation between rightwinginness and stupidity</title><content type='html'>Bill O'Reilly does not know that Earth is not the only planet that has moons...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://latimesblogs.latimes.com/the_big_picture/2011/02/bill-oreillys-latest-faux-science-lesson-the-other-planets-dont-really-have-any-moons.html"&gt;http://latimesblogs.latimes.com/the_big_picture/2011/02/bill-oreillys-latest-faux-science-lesson-the-other-planets-dont-really-have-any-moons.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8563745719130255211?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8563745719130255211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8563745719130255211' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8563745719130255211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8563745719130255211'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/02/seriously-there-is-huge-correlation.html' title='Seriously, there is a huge correlation between rightwinginness and stupidity'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1324746777548529645</id><published>2011-02-02T13:23:00.001-08:00</published><updated>2011-02-02T13:23:13.388-08:00</updated><title type='text'>Onion story of the year (via Reddit)</title><content type='html'>&lt;a href="http://www.theonion.com/articles/republicans-vote-to-repeal-obamabacked-bill-that-w,19025/"&gt;http://www.theonion.com/articles/republicans-vote-to-repeal-obamabacked-bill-that-w,19025/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1324746777548529645?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1324746777548529645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1324746777548529645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1324746777548529645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1324746777548529645'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/02/onion-story-of-year-via-reddit.html' title='Onion story of the year (via Reddit)'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1002156505884126486</id><published>2011-01-28T17:45:00.000-08:00</published><updated>2011-01-28T17:45:29.622-08:00</updated><title type='text'>The most important health question that is asked first every time I visit a doctor:</title><content type='html'>"Do you still have Premera?"&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;For non-US readers: Premera Blue Cross is a health&amp;nbsp;insurance provider.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1002156505884126486?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1002156505884126486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1002156505884126486' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1002156505884126486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1002156505884126486'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/01/most-important-health-question-that-is.html' title='The most important health question that is asked first every time I visit a doctor:'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3125955882368664237</id><published>2011-01-24T17:45:00.000-08:00</published><updated>2011-01-24T17:45:43.257-08:00</updated><title type='text'>Whatever Apple does, it's not computers...</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TT4rKdA_YMI/AAAAAAAAAq4/5OgyqOG18IM/s1600/AppleIsNotComputers.png" imageanchor="1"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TT4rKdA_YMI/AAAAAAAAAq4/5OgyqOG18IM/s1600/AppleIsNotComputers.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3125955882368664237?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3125955882368664237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3125955882368664237' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3125955882368664237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3125955882368664237'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/01/whatever-apple-does-its-not-computers.html' title='Whatever Apple does, it&apos;s not computers...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_VsIB2Nr2f1c/TT4rKdA_YMI/AAAAAAAAAq4/5OgyqOG18IM/s72-c/AppleIsNotComputers.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-5608608326832895212</id><published>2011-01-05T19:23:00.001-08:00</published><updated>2011-01-05T19:23:16.471-08:00</updated><title type='text'>Democrats are the new republicans</title><content type='html'>&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4Jc4U4ugi_4?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4Jc4U4ugi_4?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;An oldie but a goodie...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-5608608326832895212?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/5608608326832895212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=5608608326832895212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5608608326832895212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5608608326832895212'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/01/democrats-are-new-republicans.html' title='Democrats are the new republicans'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-5513102897184935058</id><published>2011-01-02T18:15:00.000-08:00</published><updated>2011-01-02T18:15:01.943-08:00</updated><title type='text'>Detroit</title><content type='html'>Just watched this documentary about the current state of Detroit. Apparently, 30 millions of people left the are after auto manufacturing industry collapsed, but the life is slowly coming back.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vbs.tv/watch/uneven-terrain/palladium-detroit-full-new-credits--3"&gt;http://www.vbs.tv/watch/uneven-terrain/palladium-detroit-full-new-credits--3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One thing that this underscores is a complete lack of vision on the part of our political class.&lt;br /&gt;&lt;br /&gt;Instead of vasting $700B on rescuing banks that are not ready to collapse again, how about talking to a bunch of companies - Google, Microsoft, Amazon, others in software industry, venture capitalists&amp;nbsp;- getting them to come into the area. Pouring money into revitalizing culture (hiring artists, opening theaters, clubs, etc), education to support the newcomers...&lt;br /&gt;&lt;br /&gt;I bet a lot of people can be attracted by a prospect of almost free housing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-5513102897184935058?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/5513102897184935058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=5513102897184935058' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5513102897184935058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5513102897184935058'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2011/01/detroit.html' title='Detroit'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-9216977762755014474</id><published>2010-12-25T11:11:00.001-08:00</published><updated>2010-12-25T11:12:23.576-08:00</updated><title type='text'>Meanwhile in Britain...</title><content type='html'>Every year, researchers from the British Social Attitudes survey ask a representative sample of British people whether they regard themselves as belonging to any particular religion and, if so, to which one? When the survey first asked these questions in 1985, 63% of the respondents answered that they were Christians, compared with 34% who said they had no religion (the rest belonged to non-Christian religions). &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.guardian.co.uk/commentisfree/2010/dec/24/religion-respecting-the-minority?CMP=EMCGT_241210"&gt;http://www.guardian.co.uk/commentisfree/2010/dec/24/religion-respecting-the-minority?CMP=EMCGT_241210&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-9216977762755014474?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/9216977762755014474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=9216977762755014474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/9216977762755014474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/9216977762755014474'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/12/meanwhile-in-britain.html' title='Meanwhile in Britain...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7527611136315722835</id><published>2010-12-19T18:25:00.001-08:00</published><updated>2010-12-19T18:25:25.355-08:00</updated><title type='text'>4 in 10 Americans believe in strict creationism</title><content type='html'>&lt;a href="http://www.gallup.com/poll/145286/four-americans-believe-strict-creationism.aspx"&gt;http://www.gallup.com/poll/145286/four-americans-believe-strict-creationism.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7527611136315722835?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7527611136315722835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7527611136315722835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7527611136315722835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7527611136315722835'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/12/4-in-10-americans-believe-in-strict.html' title='4 in 10 Americans believe in strict creationism'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-1197899796840529182</id><published>2010-12-19T17:24:00.000-08:00</published><updated>2010-12-19T18:14:34.313-08:00</updated><title type='text'>The spirit of American revolution is now officially and irrevocably dead</title><content type='html'>People WANT to be duped by the government. Passionately so.&lt;br /&gt;&lt;br /&gt;"The American public is highly critical of the recent release of confidential U.S. diplomatic cables on the WikiLeaks Web site and would support the arrest of WikiLeaks founder Julian Assange by U.S. authorities, a new Washington Post-ABC News poll finds. &lt;br /&gt;Most of those polled - 68 percent - say the WikiLeaks' exposure of government documents about the State Department and U.S. diplomacy harms the public interest. Nearly as many - 59 percent - say the U.S. government should arrest Assange and charge him with a crime for releasing the diplomatic cables."&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2010/12/14/AR2010121401650.html"&gt;http://www.washingtonpost.com/wp-dyn/content/article/2010/12/14/AR2010121401650.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Vladimir Putin, we are finally ready for your leadership...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://i.imgur.com/6VBhD.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" n4="true" src="http://i.imgur.com/6VBhD.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-1197899796840529182?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/1197899796840529182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=1197899796840529182' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1197899796840529182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/1197899796840529182'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/12/spirit-of-american-revolution-is-now.html' title='The spirit of American revolution is now officially and irrevocably dead'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3471574911870143171</id><published>2010-12-18T09:57:00.000-08:00</published><updated>2010-12-18T09:57:15.764-08:00</updated><title type='text'>If you ever doubted that GOP specifically targets morons for its electoral base...</title><content type='html'>...there should be no doubts now: the first target of the new Republican majority is... National Science Foundation.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://scottaaronson.com/blog/?p=476"&gt;http://scottaaronson.com/blog/?p=476&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3471574911870143171?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3471574911870143171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3471574911870143171' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3471574911870143171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3471574911870143171'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/12/if-you-ever-doubted-that-gop.html' title='If you ever doubted that GOP specifically targets morons for its electoral base...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-5313666676879374314</id><published>2010-12-08T12:03:00.000-08:00</published><updated>2010-12-08T12:04:32.784-08:00</updated><title type='text'>Obama's record</title><content type='html'>&lt;a href="http://www.reddit.com/r/politics/comments/ei2ka/olbermann_still_has_it_calls_obama_sellout/c18aby5"&gt;http://www.reddit.com/r/politics/comments/ei2ka/olbermann_still_has_it_calls_obama_sellout/c18aby5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Obama was a sellout when he &lt;a href="http://www.nytimes.com/2010/06/26/us/politics/26gitmo.html?_r=1&amp;amp;partner=rss&amp;amp;emc=rss"&gt;backed off on closing Guantanamo&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when he &lt;a href="http://www.huffingtonpost.com/2009/10/26/islam-siddiqui-obama-nomi_n_333972.html"&gt;backed off of his promise to keep lobbyists out of his administration&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when he &lt;a href="http://washingtonindependent.com/33985/in-torture-cases-obama-toes-bush-line"&gt;protected the Bush administration from prosecution for torture&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when he &lt;a href="http://www.nytimes.com/2010/04/07/world/middleeast/07yemen.html?hp"&gt;authorized the assassination of U.S. citizens abroad&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when he rescinded on his promise to not prosecute marijuana users in states where it is legal, and &lt;a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2009/04/21/BA1V175SB9.DTL"&gt;pushed for a 5 year prison term for a California-legal medical marijuana dispensary operator&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when he &lt;a href="http://www.truth-out.org/omar-khadr-jury-hammers-final-nail-into-coffin-american-justice64718"&gt;prosecuted child-soldier Omar Khadr using evidence gained through torture&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when he &lt;a href="http://www.mcclatchydc.com/2010/05/07/93761/despite-spill-feds-still-giving.html"&gt;granted 27 waivers to oil companies drilling in the weeks following the Deepwater Horizon disaster&lt;/a&gt;.&lt;br /&gt;Obama was a sellout when &lt;a href="http://www.salon.com/news/opinion/glenn_greenwald/2010/05/21/bagram/index.html"&gt;he fought for, and won, the right to deny habeas corpus to detainees&lt;/a&gt;.&lt;br /&gt;He was a sellout when he &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2009/07/22/AR2009072203281.html"&gt;blocked UN human rights investigations at Guantanamo&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.nytimes.com/2010/11/10/world/10tapes.html?_r=2&amp;amp;partner=rss&amp;amp;emc=rss"&gt;dropped charges against the CIA for destroying videotapes documenting torture of detainees&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.csmonitor.com/USA/Justice/2010/0812/Obama-as-border-cop-He-s-deported-record-numbers-of-illegal-immigrants"&gt;deported record number of undocumented immigrants&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.nytimes.com/2009/08/25/us/politics/25rendition.html"&gt;continued rendition of alleged terrorists to countries where they could be tortured&lt;/a&gt;.&lt;br /&gt;He continued &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2009/05/21/AR2009052104045.html"&gt;indefinitely detaining alleged terrorists, WITHOUT TRIAL&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.csmonitor.com/USA/Politics/2010/0301/Obama-signs-Patriot-Act-extension-without-reforms"&gt;extended the PATRIOT Act, with no reforms&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.huffingtonpost.com/2010/03/16/obamas-broken-promise-fed_n_500526.html"&gt;dramatically increased government secrecy, denying more Freedom of Information Act requests in 2009 than Bush did in 2008&lt;/a&gt;. So much for open government.&lt;br /&gt;He &lt;a href="http://www.huffingtonpost.com/miles-mogulescu/ny-times-reporter-confirm_b_500999.html"&gt;cut a secret deal to kill the public option, while still campaigning on its behalf&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.cnn.com/2010/POLITICS/10/13/military.gays.appeal/"&gt;defended Don't Ask Don't Tell from legal challenges&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://thehill.com/blogs/blog-briefing-room/news/112795-axelrod-obama-remains-opposed-gay-marriage"&gt;reaffirmed his opposition to same-sex marriage&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.usatoday.com/money/industries/health/2010-10-07-healthlaw07_ST_N.htm?loc=interstitialskip"&gt;granted waivers to 30 companies, including McDonalds, exempting them from health care reform&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.cbsnews.com/8301-503543_162-20016181-503543.html"&gt;announced the single largest arms deal in history, of $60bil worth of arms, to Saudi Arabian dictatorship&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.nytimes.com/2010/05/14/us/14agency.html"&gt;gave permits to BP and other oil companies, exempting them from environmental protection laws&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://counterpunch.com/kenfield08142009.html"&gt;appointed Monsanto executive Michael Taylor to the FDA&lt;/a&gt;.&lt;br /&gt;He &lt;a href="http://www.huffingtonpost.com/2009/10/26/islam-siddiqui-obama-nomi_n_333972.html"&gt;appointed a former Monsanto lobbyist as Chief Agriculture Negotiator&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But NOW, he's a sellout, when he extends Bush's tax cuts? Oh no. &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Obama has been a sellout since day one.&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-5313666676879374314?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/5313666676879374314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=5313666676879374314' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5313666676879374314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5313666676879374314'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/12/obamas-record.html' title='Obama&apos;s record'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8267526278891842389</id><published>2010-12-06T20:53:00.001-08:00</published><updated>2010-12-06T20:53:47.941-08:00</updated><title type='text'>Trickle down</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TP29xMRtiBI/AAAAAAAAAqY/LToEfwc0Gf4/s1600/Reaganomics.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TP29xMRtiBI/AAAAAAAAAqY/LToEfwc0Gf4/s1600/Reaganomics.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8267526278891842389?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8267526278891842389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8267526278891842389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8267526278891842389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8267526278891842389'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/12/trickle-down.html' title='Trickle down'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_VsIB2Nr2f1c/TP29xMRtiBI/AAAAAAAAAqY/LToEfwc0Gf4/s72-c/Reaganomics.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2858311224676022965</id><published>2010-11-28T12:14:00.000-08:00</published><updated>2010-11-28T12:18:31.325-08:00</updated><title type='text'>Winows Phone 7</title><content type='html'>WP7 has hit the Microsoft campus on November 18. This was the date when the free phones the company gave to all the employees have arrived.&lt;br /&gt;&lt;br /&gt;I've got one, too, and has been playing with it ever since. So far I cannot imagine going back to my iPhone 3GS.&lt;br /&gt;&lt;br /&gt;The UI&amp;nbsp;is slick and extremely responsive. In two weeks of use there was not a single case when the UI lagged. Not one frame of scrolling, zooming, or moving between apps. Not a trace of hesitation. It is also quite intuitive, everything you use often is at your fingertips when you need it.&lt;br /&gt;&lt;br /&gt;Search is fully integrated into the experience. It works in the context of the currently running program - in maps it searches maps, in IE it searches the Internet, in Zune UI it searches the music, and in the Marketplace it searches the app store. It works well, too - the results are formatted for the phone, and the way local results are mixed in is uniquely useful for a mobile device.&lt;br /&gt;&lt;br /&gt;The IE works great. Really, truly great. It feels faster than the iPhone's Safari browser. With the Samsung Focus' gigantic, bright screen it feels like a mini-tablet. When I bought the iPhone I noticed that I go to my laptop to browse less. With this device I go back to a real computer even less.&lt;br /&gt;&lt;br /&gt;One of the reasons that I was awaiting WP7 was that the iPhone was syncing my calendar unreliably. Some of the appointments were transferred, and some were not. I have heard similar complaints from my peers who are also very heavy calendar users. Needless to say, this is the most critical part of the device for me, possibly even more important than the actual phone - I use it as a phone at most twice a day, but I use it as a calendar and email device at least once an hour.&lt;br /&gt;&lt;br /&gt;Both calendar and email sync flawlessly on WP7. So does the rest of Office integration. I've spent a few hours reading a book formatted as a Word file, and, again, performance was fantastic and the document rendered flawlessly.&lt;br /&gt;&lt;br /&gt;The device is rock solid. I have never&amp;nbsp;- ever - had to reboot it for anything other than the change of the system locale.&lt;br /&gt;&lt;br /&gt;Of course, as a v1 device, WP7 has a number of problems as well.&lt;br /&gt;&lt;br /&gt;First, it has no way to upload custom ring tones to the device. Yes, this is actually true - the only ringtones that are available are ones preinstalled by the OEM. I have no idea how they managed to cut a feature that at this point is available anywhere else.&lt;br /&gt;&lt;br /&gt;Second, the phone only supports a handful of mostly western European locales. For example, it has no support for entering Cyrillic, which, with me being in Russia right now is a big problem. Actually, this plus the absense of copy-paste makes entering an internet search query in any language other than English impossible. Given iPhone's completely universal keyboard that allows writing in any language with ease, this is a big disadvantage for anyone who speaks more than one language.&lt;br /&gt;&lt;br /&gt;Third, the phone does not support - this is absolutely, amazingly stupid - user names that have spaces. So if your company has a "First Last" template for the user names, you are out of luck - Exchange sync will not work. Whoever tested the user input dialog - please hang your head in shame now.&lt;br /&gt;&lt;br /&gt;Windows Phone 7 lacks the iPhone's breadth of apps, but this is actually an opportunity for developers, and the gap will probably be closed quickly.&lt;br /&gt;&lt;br /&gt;Other than that - the device is actually great. I gave away my 3GS after playing with WP7 for less than a day, and 2 weeks in I did not regret that decision for a second. Very highly recommended!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2858311224676022965?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2858311224676022965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2858311224676022965' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2858311224676022965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2858311224676022965'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/winows-phone-7.html' title='Winows Phone 7'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2065413209694737423</id><published>2010-11-25T00:08:00.000-08:00</published><updated>2010-11-25T00:09:19.769-08:00</updated><title type='text'>Windows Phone 7 unlocking - NOT!</title><content type='html'>I am travelling to Russia, and tried to use the services of this company - &lt;span style="color: #388222;"&gt;&lt;strong&gt;windowsphoneunlock&lt;/strong&gt;.com &lt;/span&gt;&lt;span style="color: black;"&gt;- to unlock my phone. They claim on the web site that it takes "up to 72 hours" to unlock the phone.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;After waiting for 3 days, no response, I sent them an email, asking about the status. They responded that "some Windows Phone 7 devices take longer", and they will be clarifying this on their web page. However, they are confident that they will have the code in 24 hours.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Two more days go through, no code in the mail. I send them another query. This time, the response:&lt;br /&gt;&lt;br /&gt;"Dear Sergey&lt;br /&gt;Please accept our apologies with the length of time it is taking to acquire your unlock code. This is because it is with AT&amp;amp;T. It seems that they will not be giving out the unlock codes for several months after the phone has been registered, or until June 2011. We have just had your order returned to us as not found, not surprising as we are finding out no-one can get codes for Windows Phone 7 handsets on AT&amp;amp;T. However along with yours and other returns of not found came back one successful code return, which is peculiar. I don't know if this is a one-off or it means with some other techniques it might be possible.&lt;br /&gt;&lt;br /&gt;I appreciate it has been a long time to wait, so at this point can you please advise if you want a full refund, or you want us to keep trying other techniques.&lt;br /&gt;&lt;br /&gt;Many thanks for your patience,&lt;br /&gt;&lt;br /&gt;windowsphoneunlock.com" &lt;br /&gt;&amp;nbsp; &lt;br /&gt;So, basically, &lt;br /&gt;(1) They claimed that they could unlock Windows 7 phones, but they did not actually check it. &lt;br /&gt;(2) The way they unlock phones is by simply asking for the code from AT&amp;amp;T on your behalf. Or, you can do it yourself and save the money. Of course,&amp;nbsp;in either case AT&amp;amp;T does not supply the unlock code unless you own the phone for 90 days, as any customer service rep will tell you, which is why they couldn't "unlock" mine. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;So stay away from these "services" and save yourself some time and money.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2065413209694737423?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2065413209694737423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2065413209694737423' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2065413209694737423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2065413209694737423'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/windows-phone-7-unlocking-not.html' title='Windows Phone 7 unlocking - NOT!'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6124693558576739834</id><published>2010-11-17T11:29:00.000-08:00</published><updated>2010-11-17T11:29:26.418-08:00</updated><title type='text'>Google content blocker</title><content type='html'>&lt;a href="http://j-walk.com/other/googlecb/index.htm"&gt;http://j-walk.com/other/googlecb/index.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oldie, but goodie...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6124693558576739834?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6124693558576739834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6124693558576739834' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6124693558576739834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6124693558576739834'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/google-content-blocker.html' title='Google content blocker'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-75077180960833301</id><published>2010-11-16T10:11:00.000-08:00</published><updated>2010-11-16T10:11:24.430-08:00</updated><title type='text'>Trickle-up economics</title><content type='html'>With all the talk about tax cuts as a universal cure (for which of course there is exactly zero statistical evidence) that are prevalent in US media I wonder why no one is talking about much more obvious concept - a trickle-up economics, where the well-being of the population is certain to benefit the people at the top of the economic ladder.&lt;br /&gt;&lt;br /&gt;After all, to earn more money companies need more people who can afford their products. The debt-financed prosperity of 1990s is perverse, but recent,&amp;nbsp;evidence for this. By supporting policies that lead to growing inequality, the top 1% of earners are actually digging a hole for themselves. With the debt as a source of income nearly exhausted, the population will soon not be able to afford much, and the inevitable result will be collapsing incomes at the top as well...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-75077180960833301?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/75077180960833301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=75077180960833301' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/75077180960833301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/75077180960833301'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/trickle-up-economics.html' title='Trickle-up economics'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4596754984173031333</id><published>2010-11-16T09:29:00.000-08:00</published><updated>2010-11-16T09:55:18.402-08:00</updated><title type='text'>Devices and PCs</title><content type='html'>The device wave seems to be sweeping the world. Apple's new tablet is selling like hot cakes, there are over a dozen of eBook readers on the market, and Android announces the support of a new device category every week.&lt;br /&gt;&lt;br /&gt;I have been building the OS for devices for what is still the majority of my career at Microsoft, and had been a passionate advocate for and an avid user of various embedded electronics since 1997. I have shipped the first Microsoft's embedded product that sold for less than $100 (MN-700 residential gateway). &lt;br /&gt;&lt;br /&gt;I have&amp;nbsp;used video players, networked storage, terminal server clients, eBook readers, tablets, Internet terminals, portable music players, PDAs, car media players, portable displays, residential gateways, cameras, game boxes, etc, etc, etc. And, of course, smartphones, smartphones, smartphones, and more smartphones.&lt;br /&gt;&lt;br /&gt;Over the years I have accumulated 4 large cardboard boxes full of devices in my basement. Almost all of them followed a very similar usage pattern: a new exciting device would come to market, I would get it and use it for about a year. Within a year though, rarely two, almost never three, the device would be obsolete.&amp;nbsp;A new media format will become popular. A new display technology would call for higher video resolution. An upgrade to an OS would obsolete the device drivers. A company would go out of business and shut the web service down.&lt;br /&gt;&lt;br /&gt;In the end, the destiny of all these gizmos was always the same - the brown box under the stairs. I think the longest I had embedded device was a couple of $15 wireless routers I got at Fry's 3-4 years ago, and I had a Sony eBook reader for 3 years. All the rest hit the box in at most 2 years.&lt;br /&gt;&lt;br /&gt;I actually loved my SONY Reader. Despite the fact it took 10 minutes to boot. Despite the fact that there was no way to organize the collection in any meaningful way, so I always had to go through 66 pages of book titles to find the one I intended to read. Despite the fact that the battery life was nothing like advertized.&lt;br /&gt;&lt;br /&gt;I even wrote a filter to automatically translate Project Gutenberg books to LRF format (&lt;a href="http://1-800-magic.blogspot.com/2008/01/gutenberg-for-sony-pre-alpha.html"&gt;http://1-800-magic.blogspot.com/2008/01/gutenberg-for-sony-pre-alpha.html&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;What eventually killed the Reader was a multitude of factors. The hacked support for Russian script was no longer available for the most current firmware upgrade, so I had to stay on the old version. The new connection software no longer supports the old firmware. Finally, BookDesigner, a program that I used to translate RTF files into LRF to read them on the device does not work on newer operating systems.&lt;br /&gt;&lt;br /&gt;At the same time, while playing with all these devices,&amp;nbsp;I was slowly but surely - and mostly without realizing it - replacing them with PCs. Where devices lasted only a bit, PCs persisted.&lt;br /&gt;&lt;br /&gt;A NAS device was replaced by three of server PCs first consisting of expensive case, good power supplies, cheap motherboards, and 30 disks. The cheap motherboards were quickly replaced by an expensive ones, but the rest was reused, and the machines are now in service 24/7 through the last 5 years. I have replaced a few disks, taking a couple of opportunities to upgrade - first going from 300 to 500GB, then to 1TB drives.&lt;br /&gt;&lt;br /&gt;A couple of media center PCs that were in the house since 2005 went through a refresh this year. I have replaced motherboards, CPU, and memory ($400 per PC for 6-core Athlons, 8GB RAM, &amp;nbsp;and top of the line ASUS boards), and upgraded the OS to Windows 7. I have reused the 500GB disks that were left over from the server upgrade.&lt;br /&gt;&lt;br /&gt;A gaming PC that I have in my garage in front of a thread mill is in daily use since 2007, and it plays Halo 2 as well as it was on the first day of its life four and a half years ago. I have turned on the Xbox 360 next to it less than a dozen times over the same period of time. Last time only to find out that it had died, perhaps of loneliness.&lt;br /&gt;&lt;br /&gt;Because of the super high level of commoditization, PC hardware is unmatched in price. Even the retail markup is different - for devices such as DVD players it usually is over 50%, whereas for PC hardware - thank you, Dell! - it is almost always below 15%. So you can buy a 4TB TerraStation for $800, or a pretty decent PC with 4 1TB hard drives which would in many cases cost much less.&lt;br /&gt;&lt;br /&gt;And because PC hardware is interchangeable, when you decomission an old PC, you can almost always reuse at least some of the parts - a case, a power supply, a DVD drive - at a minimum, which makes your new build so much cheaper.&lt;br /&gt;&lt;br /&gt;But of course the biggest advantage of the PC platform is that it is constantly evolving. A new codec that could kill a media player will be just a tiny upgrade to a Media Center PC. A Blu-ray is trivial to install without changing much of the existing functionality.&lt;br /&gt;&lt;br /&gt;PCs do come with a cost - they could be hard to maintain. But there is a very simple solution - my PCs are all single function. A game PC is only used to play games. A Media Center is only used to watch movies. Servers are only used for storage and virtualization. There is a dedicated PC for Skype. I do software development and email on a VM that is specially built just for that.&lt;br /&gt;&lt;br /&gt;As a result, there are usually no compatibility problems with software, and in fact configuration changes are very infrequent, so I spend very little time on my home infrastructure these days. Much less, in fact, than I used to spend trying to get all the devices to talk to each other :-).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4596754984173031333?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4596754984173031333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4596754984173031333' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4596754984173031333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4596754984173031333'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/devices-and-pcs.html' title='Devices and PCs'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-2124967686912495727</id><published>2010-11-10T00:36:00.000-08:00</published><updated>2010-11-10T00:38:47.024-08:00</updated><title type='text'>We are screwed...</title><content type='html'>Here's the new (Republican) chairman of Energy and Commerce Committee. He says that Bible promises to not flood the Earth after Noah, therefore there will be no global warming. True story. This is the level of idiocy in Congress. I think I would rather live under Brezhnev again... Soviet government may have been evil, but it was not so monumentally stupid.&lt;br /&gt;&lt;br /&gt;&lt;object height="390" width="640"&gt;&lt;param name="movie" value="http://www.youtube.com/v/U5yNZ1U37sE&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/U5yNZ1U37sE&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-2124967686912495727?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/2124967686912495727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=2124967686912495727' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2124967686912495727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/2124967686912495727'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/we-are-screwed.html' title='We are screwed...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-3088672412477660652</id><published>2010-11-02T21:26:00.000-07:00</published><updated>2010-11-02T21:27:36.817-07:00</updated><title type='text'>This is why Democrats need to abolish farm subsidies...</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TNDjFts0UAI/AAAAAAAAAqE/vVY74gvvdZo/s1600/wa+senatorial.png" imageanchor="1" style="cssfloat: left; margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" nx="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TNDjFts0UAI/AAAAAAAAAqE/vVY74gvvdZo/s1600/wa+senatorial.png" /&gt;&lt;/a&gt;&lt;/div&gt;...to hold on to power.&lt;br /&gt;&lt;br /&gt;Among other things that they should have done, but didn't (&lt;a href="http://1-800-magic.blogspot.com/2008/11/next-depression.html"&gt;http://1-800-magic.blogspot.com/2008/11/next-depression.html&lt;/a&gt;) because they are too corrupt and incompetent...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-3088672412477660652?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/3088672412477660652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=3088672412477660652' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3088672412477660652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/3088672412477660652'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/this-is-why-democrats-need-to-abolish.html' title='This is why Democrats need to abolish farm subsidies...'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VsIB2Nr2f1c/TNDjFts0UAI/AAAAAAAAAqE/vVY74gvvdZo/s72-c/wa+senatorial.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7505728182748705700</id><published>2010-11-01T18:39:00.000-07:00</published><updated>2010-11-01T18:39:36.745-07:00</updated><title type='text'>Couple of interesting quotes</title><content type='html'>"Egotism is the anesthetic that dulls the pain of stupidity."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- Frank Leahy&lt;br /&gt;&lt;br /&gt;"Competition whose motive is merely to compete, to drive some other fellow out, never carries very far. The competitor to be feared is one who never bothers about you at all, but goes on making his own business better all the time. Businesses that grow by development and improvement do not die. But when a business ceases to be creative, when it believes it has reached perfection and needs to do nothing but produce - no improvement, no development - it is done."&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -- Henry Ford&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7505728182748705700?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7505728182748705700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7505728182748705700' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7505728182748705700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7505728182748705700'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/11/couple-of-interesting-quotes.html' title='Couple of interesting quotes'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8978038746691872748</id><published>2010-10-28T00:34:00.000-07:00</published><updated>2010-10-28T00:34:14.330-07:00</updated><title type='text'>Windows disk management with .NET framework</title><content type='html'>Windows has a very powerful programming API that allows developers almost total control over the way storage is managed. There are 3 main API subsets:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;VDS (Virtual Disk Service) allows to programmatically manage disks, volumes, and access features of Windows software RAID implementation. (&lt;a href="http://msdn.microsoft.com/en-us/library/bb986750(v=VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb986750(v=VS.85).aspx&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;VSS (Volume Shadow Copy Service) lets one create snapshots of the current disk state. This can be used for a backup (these snapshots are internally consistent, because VSS exposes - and many software products consume - a subscription interface that allows application to write their state to disk before the snapshot is taken), as well as to&amp;nbsp;preserve the current state of the volume state in time, so it (or individual files) could be rolled back at a later date. (&lt;a href="http://msdn.microsoft.com/en-us/library/bb968832(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb968832(VS.85).aspx&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Block device access through device IOCTL and direct I/O (&lt;a href="http://1-800-magic.blogspot.com/2008/02/taking-disk-image-snapshots.html"&gt;http://1-800-magic.blogspot.com/2008/02/taking-disk-image-snapshots.html&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;This article explores the undocumented API to VDS for managed code available in Windows Server 2008 and Windows Server 2008 R2.&lt;br /&gt;&lt;br /&gt;Unfortunately, .NET framework does not ship with an official wrapper, so there are two ways to access VDS from managed code. VDS is exposed through COM, but has no automation support, so one could use .NET COM interop, but would have to declare the interface by hand. There is a good example of how to do it here: &lt;a href="http://stackoverflow.com/questions/2755458/retrieving-virtual-disk-file-name-from-disk-number/2892042"&gt;http://stackoverflow.com/questions/2755458/retrieving-virtual-disk-file-name-from-disk-number/2892042&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;However, VDS is a relatively big API, and so doing the marshalling by hand is a challenging job. Of course, if you do this, the humanity will be eternally grateful (especially if you post the results to &lt;a href="http://pinvoke.net/"&gt;http://pinvoke.net/&lt;/a&gt;)!&lt;br /&gt;&lt;br /&gt;For those of us who are lazy, the next best thing is to use the DLL that is present on Windows Server 2008 and above - Microsoft.Storage.Vds.dll. It lives in both GAC and SxS. In both cases the paths to the files are absolutely awful, and I will dare not utter them here. Instead, go to you Windows directory and do "dir /s Microsoft.Storage.Vds.dll". The resulting DLL you can then copy to your application and add a reference to it in your project.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Important note&lt;/strong&gt;: the DLL is ONLY present in Server OS - not in consumer Windows - but the interop logic that it exposes will work on Windows 7 as well. You just have to carry the file around with your app (note of course that Microsoft does not grant you any rights to redistribute parts of Windows!)&amp;nbsp;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Another important note&lt;/strong&gt;: to use VDS on a local machine, your application must have an admin token in its process. When debugging in Visual Studio, it helps to start VS "as Administrator". To ensure that the right privileges exist when running the application, add the manifest file as follows:&lt;br /&gt;&lt;blockquote&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;assemblyIdentity version="1.0.0.0" name="MyApplication.app"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/requestedPrivileges&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/trustInfo&amp;gt;&lt;br /&gt;&amp;lt;/asmv1:assembly&amp;gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/blockquote&gt;&lt;strong&gt;The most important note:&lt;/strong&gt; The managed API lacks one member of IVdsPack&amp;nbsp;interface - the function that is absolutely crucial to creating RAID arrays (IVdsPack::MigrateDisks). As you can see in reflector, the IVdsPack is not completely marshalled ("slot7" occupies the place where MigrateDisks should have been):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TMjSCiwVvxI/AAAAAAAAAp8/xlNPrhpwF84/s1600/IVdsPack.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" nx="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TMjSCiwVvxI/AAAAAAAAAp8/xlNPrhpwF84/s1600/IVdsPack.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This means that a new disk cannot be made dynamic using this interface, and therefore it cannot be used to build new disk arrays. If you need this functionality, you are &lt;strike&gt;screwed&lt;/strike&gt; have to do COM interop by hand. You can still use this library with the reflector to extract much of the interop code. However, all the code needed to check the disk system health, and to replace a disk is present, which means that the library is very useful for many interesting scenarios. (Again, Microsoft does not give you a right to reverse-engineer parts of Windows to incorporate them into your application!)&lt;br /&gt;&lt;br /&gt;With this in mind, on to managed VDS!&lt;br /&gt;&lt;br /&gt;To use VDS, you have to first connect to VDS service. You can connect to a service both on your local machine as well as on a remote computer (providing that your user has admin rights on it:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;using Microsoft.Storage.Vds;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;ServiceLoader loader = new ServiceLoader();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Service vds = loader.LoadService("computername"); // or null&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;vds.WaitForServiceReady();&lt;/span&gt;&lt;/blockquote&gt;The object hierarchy in VDS is as follows. The VDS object contains a list of providers, and a list of unallocated disks. Unallocated disks are the disks that have not been initialized. You can access them as follows: &lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;foreach (Disk d in vds.UnallocatedDisks) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Found unused disk {0} {1} {2} {3} {4}",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.FriendlyName, d.Name, d.DevicePath, d.Size, d.Health);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;On most computers (excluding the very rare cases where hardware manufacturers exposed their custom storage systems through VDS, which can happen with SANs), there are two providers, a dynamic provider and basic provider. A dynamic provider contains dynamic disks - the disks that can contain RAID volumes&amp;nbsp;(simple volumes, spanned volumes, RAID-0, RAID-1, and RAID-5). You make the disk dynamic in disk management applet: &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TMjgcDJvHlI/AAAAAAAAAqA/kpunSENsuv0/s1600/Disk+Manager+Dynamic.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" nx="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TMjgcDJvHlI/AAAAAAAAAqA/kpunSENsuv0/s1600/Disk+Manager+Dynamic.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The basic provider contains all the "normal", non-dynamic disks. To get dynamic and basic providers, do the following:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;private static SoftwareProvider GetDynamicProvider(Service vds)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Provider p in vds.Providers)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((p.Flags &amp;amp; ProviderFlags.Dynamic) != 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p as SoftwareProvider;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;private static SoftwareProvider GetBasicProvider(Service vds)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Provider p in vds.Providers)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((p.Flags &amp;amp; (ProviderFlags.Dynamic |&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProviderFlags.InternalHardwareProvider)) == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p as SoftwareProvider;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;Provider contains a list of packs. There is usually only one pack in the dynamic provider, unless a set of dynamic disks initialized on a different computer was added, but not migrated (they appear as "foreign" disks in disk management applet). Basic disks are one per pack, so if there several basic disks in the system, there would be multiple packs in basic provider.&lt;br /&gt;&lt;br /&gt;Here is how to print information on all the disks in a system:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;SoftwareProvider dynamicProvider = GetDynamicProvider(vds);&lt;br /&gt;foreach (Pack p in dynamicProvider.Packs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Disk d in p.Disks)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Found dynamic disk {0} {1} {2} {3} {4}",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.FriendlyName, d.Name, d.DevicePath, d.Size, d.Health);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;SoftwareProvider basicProvider = GetBasicProvider(vds);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;foreach (Pack p in basicProvider.Packs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Disk d in p.Disks)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Found basic disk {0} {1} {2} {3} {4}",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.FriendlyName, d.Name, d.DevicePath, d.Size, d.Health);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;foreach (Disk d in vds.UnallocatedDisks)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Found unused disk {0} {1} {2} {3} {4}",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.FriendlyName, d.Name, d.DevicePath, d.Size, d.Health);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Among other things, Disk.Heath is a property that allows you to ferret out disks that are missing or unhealthy. From the reflector:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;public enum Health&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unknown = 0,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Healthy = 1,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rebuilding = 2,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stale = 3,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Failing = 4,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FailingRedundancy = 5,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FailedRedundancy = 6,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FailedRedundancyFailing = 7,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Failed = 8,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;The pack also contains volumes, e.g.:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;foreach (Volume v in p.Volumes)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Found volume {0}: {1} {2} {3} {4}",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v.DriveLetter, v.Name, v.Type, v.Size, v.Health);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;And, of course, given a disk, it is easy to figure out which volumes are on this disk (in case of RAID arrays, of course, the volume might not be on just one disk of course). A Disk structure has a list of extents in it. An extent has a volume id, which can be translated into a Volume object:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;foreach (DiskExtent de in d.Extents)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Volume v = vds.GetObject&amp;lt;Volume&amp;gt;(de.DiskId);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;The reverse - finding out what disks a volume occupies - is only slightly more involved:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;foreach (VolumePlex vp in v.Plexes)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (DiskExtent de in vp.Extents)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk d = vds.GetObject&amp;lt;Disk&amp;gt;(de.DiskId);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;Another useful piece of functionality in managed VDS interface is ability to replace a dead disk easily by using Pack.BeginReplaceDisk.&lt;br /&gt;&lt;br /&gt;Time for a complete example. The following program scans a disk system on a running computer, finds disks that went missing/unhealthy, and sends an email to a pre-defined account.&lt;br /&gt;&lt;br /&gt;Program.cs:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;//-----------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;// &amp;lt;copyright&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;// Copyright (C) Sergey Solyanik.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;// &amp;lt;/copyright&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;//----------------------------------------------------------------------- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using System;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using System.Configuration;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using System.Net.Mail;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using System.Text;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;using Microsoft.Storage.Vds;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;namespace DiskMonitor&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Implements a simple disk monitor. The program is a periodic task&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// that looks for an unhealthy disk and sends an email if it finds one.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Main program.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;param name="args"&amp;gt; Arguments from the command line. None expected. &amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceLoader loader = new ServiceLoader();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Service vds = loader.LoadService(null);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vds.WaitForServiceReady();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringBuilder sb = new StringBuilder();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SoftwareProvider dynamicProvider = GetDynamicProvider(vds);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Pack p in dynamicProvider.Packs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Disk d in p.Disks)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (d.Health != Health.Healthy &amp;amp;&amp;amp; d.Health != Health.Rebuilding)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sb.Append(string.Format("Disk {0} has health status {1}\n",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.Name, d.Health));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SoftwareProvider basicProvider = GetBasicProvider(vds);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Pack p in basicProvider.Packs)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Disk d in p.Disks)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (d.Health != Health.Healthy &amp;amp;&amp;amp; d.Health != Health.Rebuilding)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sb.Append(string.Format("Disk {0} has health status {1}\n",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.Name, d.Health));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (sb.Length != 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Error.Write(sb);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Everything is great!");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MailMessage m = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m.To.Add(ConfigurationManager.AppSettings["NotificationEmail"]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m.From = new MailAddress(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings["FromEmail"]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m.Sender = new MailAddress(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings["FromEmail"]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m.IsBodyHtml = false;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (sb.Length != 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;m.Subject = string.Format(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Problems with disk array on {0}", Environment.MachineName);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; m.Body = sb.ToString();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (bool.Parse(ConfigurationManager.AppSettings["VerboseMail"]))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; m.Subject = string.Format(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Checked out disk system on {0}: everything is healthy!",&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Environment.MachineName);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m.Body = "Nothing to report.";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SmtpClient client = new SmtpClient(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ConfigurationManager.AppSettings["SmtpServer"]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.UseDefaultCredentials = true;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.EnableSsl = bool.Parse(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings["UseSslForSmtp"]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;client.Send(m);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Finds the dynamic software provider.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;param name="vds"&amp;gt; VDS service. &amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;returns&amp;gt; Basic software provider or null of none exists. &amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static SoftwareProvider GetDynamicProvider(Service vds)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Provider p in vds.Providers)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((p.Flags &amp;amp; ProviderFlags.Dynamic) != 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p as SoftwareProvider;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Finds the basic software provider.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;param name="vds"&amp;gt; VDS service. &amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;returns&amp;gt; Basic software provider or null of none exists. &amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static SoftwareProvider GetBasicProvider(Service vds)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Provider p in vds.Providers)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((p.Flags &amp;amp; (ProviderFlags.Dynamic |&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProviderFlags.InternalHardwareProvider)) == 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return p as SoftwareProvider;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;app.config:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;configuration&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;lt;appSettings&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="SmtpServer" value="smtp.server.domain.com" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="NotificationEmail" value="target@domain.com" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="FromEmail" value="user@domain.com" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="UseSslForSmtp" value="true" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="VerboseMail" value="true" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;lt;/appSettings&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;app.manifest: &lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: blue;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi=&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;lt;assemblyIdentity version="1.0.0.0" name="DiskMonitor"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/requestedPrivileges&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/security&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp; &amp;lt;/trustInfo&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;/asmv1:assembly&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8978038746691872748?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8978038746691872748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8978038746691872748' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8978038746691872748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8978038746691872748'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/10/windows-disk-management-with-net.html' title='Windows disk management with .NET framework'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_VsIB2Nr2f1c/TMjSCiwVvxI/AAAAAAAAAp8/xlNPrhpwF84/s72-c/IVdsPack.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8383808204417199367</id><published>2010-10-19T17:57:00.000-07:00</published><updated>2010-10-20T22:24:49.810-07:00</updated><title type='text'>How much is mobile entertainment market worth?</title><content type='html'>With AAPL approaching $300B, it is worth &lt;strong&gt;more than Toyota, Daimler, and Honda combined&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;In fact, here is the list of top automobile manufacturers (which apparently includes ZAP, the&amp;nbsp;electric scooter company):&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;Market Cap&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Toyota Motor Corporation (ADR)&lt;/td&gt;&lt;td&gt;112.13 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Daimler AG (USA)&lt;/td&gt;&lt;td&gt;70.73 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;HONDA MOTOR CO., LTD. (ADR)&lt;/td&gt;&lt;td&gt;66.31 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Volkswagen AG (ADR)&lt;/td&gt;&lt;td&gt;53.73 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ford Motor Company&lt;/td&gt;&lt;td&gt;47.46 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Nissan Motor Co., Ltd. (ADR)&lt;/td&gt;&lt;td&gt;38.77 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AB Volvo (ADR)&lt;/td&gt;&lt;td&gt;28.26 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Fiat S.p.A. (ADR)&lt;/td&gt;&lt;td&gt;20.35 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tata Motors Limited (ADR)&lt;/td&gt;&lt;td&gt;12.22 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tesla Motors Inc&lt;/td&gt;&lt;td&gt;1.91 Bil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Sorl Auto Parts, Inc.&lt;/td&gt;&lt;td&gt;172.59 Mil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Azure Dynamics Corp&lt;/td&gt;&lt;td&gt;161.25 Mil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ZAP&lt;/td&gt;&lt;td&gt;56.02 Mil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Zenn Motor Co Inc&lt;/td&gt;&lt;td&gt;55.25 Mil&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Tongxin International Ltd&lt;/td&gt;&lt;td&gt;37.68 Mil&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Together, these companies are worth a combined total of $453.7B, only 50% more than AAPL. Wow. Just wow...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8383808204417199367?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8383808204417199367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8383808204417199367' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8383808204417199367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8383808204417199367'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/10/how-much-is-mobile-entertainment-market.html' title='How much is mobile entertainment market worth?'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4314614872368232948</id><published>2010-09-30T20:52:00.000-07:00</published><updated>2010-09-30T20:52:30.998-07:00</updated><title type='text'>David Patterson</title><content type='html'>David Patterson (of &lt;a href="http://www.amazon.com/Computer-Architecture-Quantitative-Approach-ebook/dp/B001KYEI0I/ref=dp_kinw_strp_1?ie=UTF8&amp;amp;m=AG56TWVU5XWC2"&gt;&lt;strong&gt;&lt;span style="color: #003399;"&gt;Computer Architecture: A Quantitative Approach&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;) gave a lecture today at Microsoft about his ROC project.&lt;br /&gt;&lt;br /&gt;Among other things, I&amp;nbsp;learned two things:&lt;br /&gt;&lt;br /&gt;...Peres's law&lt;br /&gt;&lt;br /&gt;“If a problem has no solution, it may not be a problem, but a fact, not to be solved, but to be coped with over time” &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; — Shimon Peres&lt;br /&gt;&amp;nbsp; &lt;br /&gt;...and that Bing is now a better search engine than Google. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;For the last several months I was using Bing and Google more or less interchangeably, but Google was always an authoritative source. So when&amp;nbsp;a few hours after the lecture I wanted to quote the Peres's law to a co-worker, I went to Google first. I typed in the following query: "unsolvable problems Shimon Peres facts cope". To my surprise, the quote was nowhere to be found: &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TKVasKP7dyI/AAAAAAAAAp4/QLOfYr4GpmA/s1600/unsolvable+google.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" px="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TKVasKP7dyI/AAAAAAAAAp4/QLOfYr4GpmA/s1600/unsolvable+google.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;I was really surprised, and tried Bing. Both of the top two results pointed to the quote.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4314614872368232948?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4314614872368232948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4314614872368232948' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4314614872368232948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4314614872368232948'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/09/david-patterson.html' title='David Patterson'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_VsIB2Nr2f1c/TKVasKP7dyI/AAAAAAAAAp4/QLOfYr4GpmA/s72-c/unsolvable+google.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-6241189231164529811</id><published>2010-09-23T10:17:00.000-07:00</published><updated>2010-09-23T10:17:56.737-07:00</updated><title type='text'>Taliban, v2</title><content type='html'>&lt;a href="http://www.independent.co.uk/news/world/asia/how-the-cia-ran-a-secret-army-of-3000-assassins-2087039.html"&gt;http://www.independent.co.uk/news/world/asia/how-the-cia-ran-a-secret-army-of-3000-assassins-2087039.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Apparently CIA is financing an army in Afghanistan in exactly the same way they finances the anti-Soviet resistance which resulted in Osama Bin Ladin's movement. Smart people learn on other's mistakes. Dumb people learn on their own. And then there's a whole new level...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-6241189231164529811?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/6241189231164529811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=6241189231164529811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6241189231164529811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/6241189231164529811'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/09/taliban-v2.html' title='Taliban, v2'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-328410550245813032</id><published>2010-09-11T11:33:00.000-07:00</published><updated>2010-09-11T11:34:46.863-07:00</updated><title type='text'>Republican Lobbyist Edwina Rogers Wraps Gifts in Money</title><content type='html'>&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xXj-oQm-NbE?fs=1&amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/xXj-oQm-NbE?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=xXj-oQm-NbE"&gt;http://www.youtube.com/watch?v=xXj-oQm-NbE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have no further comments... But there was one of note on Reddit: "The poor can dig the wrapper out of the trash later. This is called trickle down economics."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-328410550245813032?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/328410550245813032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=328410550245813032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/328410550245813032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/328410550245813032'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/09/republican-lobbyist-edwina-rogers-wraps.html' title='Republican Lobbyist Edwina Rogers Wraps Gifts in Money'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7066933780572064614</id><published>2010-09-11T11:16:00.000-07:00</published><updated>2010-09-11T11:17:05.418-07:00</updated><title type='text'>Court dismisses torture lawsuit because it "might expose state secrets"</title><content type='html'>"While the alleged abuses occurred during the Bush administration, the ruling added a chapter to the Obama administration’s aggressive national security policies. &lt;br /&gt;&lt;br /&gt;Its counterterrorism programs have in some ways departed from the expectations of change fostered by President Obama’s campaign rhetoric, which was often sharply critical of former President George W. Bush’s approach. &lt;br /&gt;&lt;br /&gt;Among other policies, the Obama national security team has also authorized the C.I.A. to try to kill a United States citizen suspected of terrorism ties, blocked efforts by detainees in Afghanistan to bring habeas corpus lawsuits challenging the basis for their imprisonment without trial, and continued the C.I.A.’s so-called extraordinary rendition program of prisoner transfers — though the administration has forbidden torture and says it seeks assurances from other countries that detainees will not be mistreated."&lt;br /&gt;&lt;a href="http://www.nytimes.com/2010/09/09/us/09secrets.html?_r=4&amp;amp;hp=&amp;amp;adxnnl=1&amp;amp;pagewanted=all&amp;amp;adxnnlx=1284220860-JSOfEHxr+sgBSLlDU9nJSA"&gt;http://www.nytimes.com/2010/09/09/us/09secrets.html?_r=4&amp;amp;hp=&amp;amp;adxnnl=1&amp;amp;pagewanted=all&amp;amp;adxnnlx=1284220860-JSOfEHxr+sgBSLlDU9nJSA&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It looks like I am voting for a third party candidate in the next election season...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7066933780572064614?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7066933780572064614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7066933780572064614' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7066933780572064614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7066933780572064614'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/09/court-dismisses-torture-lawsuit-because.html' title='Court dismisses torture lawsuit because it &quot;might expose state secrets&quot;'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-5803291402721415456</id><published>2010-09-07T23:57:00.001-07:00</published><updated>2010-09-07T23:57:42.974-07:00</updated><title type='text'>120 miles per galon... absolutely unbelievable!</title><content type='html'>&lt;a href="http://jalopnik.com/5628752/from-canada-to-mexico-on-one-tank-of-diesel"&gt;http://jalopnik.com/5628752/from-canada-to-mexico-on-one-tank-of-diesel&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-5803291402721415456?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/5803291402721415456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=5803291402721415456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5803291402721415456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/5803291402721415456'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/09/120-miles-per-galon-absolutely.html' title='120 miles per galon... absolutely unbelievable!'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-808357423836246043</id><published>2010-09-03T08:37:00.000-07:00</published><updated>2010-09-03T08:58:15.977-07:00</updated><title type='text'>Governor of Arizona</title><content type='html'>&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xUPKKbmWMZ8?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/xUPKKbmWMZ8?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;...and here's the explanation of this phenomenon from Reddit...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TIEbCM8HqCI/AAAAAAAAApo/0FtMmwMcat8/s1600/AZ.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TIEbCM8HqCI/AAAAAAAAApo/0FtMmwMcat8/s640/AZ.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-808357423836246043?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/808357423836246043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=808357423836246043' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/808357423836246043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/808357423836246043'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/09/governor-of-arizona.html' title='Governor of Arizona'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VsIB2Nr2f1c/TIEbCM8HqCI/AAAAAAAAApo/0FtMmwMcat8/s72-c/AZ.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-433443723500838554</id><published>2010-08-30T20:57:00.000-07:00</published><updated>2010-08-30T20:59:12.635-07:00</updated><title type='text'>Israel: Your tax dollars at work</title><content type='html'>Looks like another terrorist is down.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.guardian.co.uk/world/2005/nov/16/israel2?CMP=twt_gu"&gt;http://www.guardian.co.uk/world/2005/nov/16/israel2?CMP=twt_gu&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;From the watchtower&lt;/strong&gt; "It's a little girl. She's running defensively eastward." &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;From the operations room&lt;/strong&gt; "Are we talking about a girl under the age of 10?"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Watchtower&lt;/strong&gt; "A girl about 10, she's behind the embankment, scared to death."&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Watchtower&lt;/strong&gt; "I think that one of the positions took her out."&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Captain R&lt;/strong&gt; "I and another soldier ... are going in a little nearer, forward, to confirm the kill ... Receive a situation report. We fired and killed her ... I also confirmed the kill. Over."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-433443723500838554?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/433443723500838554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=433443723500838554' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/433443723500838554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/433443723500838554'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/israel-your-tax-dollars-at-work.html' title='Israel: Your tax dollars at work'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7362707952518098125</id><published>2010-08-30T20:50:00.000-07:00</published><updated>2010-08-30T20:50:27.988-07:00</updated><title type='text'>How to make a sniper rifle. Table of contents.</title><content type='html'>Part 1: Introduction&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 2: Buying a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-2-buying.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-2-buying.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 3: Cleaning a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-3.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-3.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 4: Disassembling a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-4.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-4.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 5: Accurizing a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-5.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-5.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 6: Selecting a scope mount&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-6.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-6.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 7: Mounting a side rail on the Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-7-scope.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-7-scope.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7362707952518098125?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7362707952518098125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7362707952518098125' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7362707952518098125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7362707952518098125'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html' title='How to make a sniper rifle. Table of contents.'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8995080688246932584</id><published>2010-08-27T00:29:00.000-07:00</published><updated>2010-08-30T20:51:38.762-07:00</updated><title type='text'>How to make a sniper rifle. Part 7: Mounting a side rail on the Mosin Nagant</title><content type='html'>[This is the last part of the series. Table of contents: &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;As described in the previous post, the best - and the priciest, and the hardest to install&amp;nbsp;- scope mount is the Dragunov side rail.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THSZh69sIUI/AAAAAAAAAmM/xtYMekZ71Ec/s1600/Dragunov+scope+mount+close.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THSZh69sIUI/AAAAAAAAAmM/xtYMekZ71Ec/s640/Dragunov+scope+mount+close.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This post describes how to install it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Preserving the original rifle&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Most Mosin Nagant rifles made during WWII in Russia have no historical value. Majority were rebuilt in Russian arsenals after the war from a smorgasbord of non-matching parts, sealed in cosmoline, and put away. You can safely treat these rifles as a LEGO set - it is OK to permanently modify it.&lt;br /&gt;&lt;br /&gt;And modified it will be&amp;nbsp;- the stock will have to be dremeled to create an opening for the side rail, and the bolt handle will be replaced.&lt;br /&gt;&lt;br /&gt;If, however, your rifle has matching numbers (especially if bayonet number matches as well!), have been made before the war, and is in excellent shape, you might want to buy extra parts instead of modifying the originals. Preserving original stock and bolt body would allow you to restore your rifle to its exact original shape easily.&lt;br /&gt;&lt;br /&gt;Note: I think modifying a pre-revolutionary Mosin Nagants in any way, shape, or form is an act of pure barbarism. There are not so many of them left! If you are a lucky owner of a pre-1917 rifle, and want one with the scope, please let me know and I will be happy to trade a finished one - with the rail installed, and bolt bent - for it. Or two unfinished ones :-).&lt;br /&gt;&lt;br /&gt;If you want to preserve the original parts, you will need to procure the parts you will modify - the stock and the bolt body - separately. The stock is easy to buy, for example, &lt;a href="http://www.buymilsurp.com/"&gt;http://www.buymilsurp.com/&lt;/a&gt; has a whole lot of them in various conditions. Since you can reuse the metallic part, you will have to refinish the stock (see below), and you do not need the handguard (it only makes the rifle less accurate), you can buy a cheaper part. For example, as of this writing, there were plenty of very acceptable variants in the $25 range.&lt;br /&gt;&lt;br /&gt;On the other hand, procuring the bolt body is very, very hard. You only need the bolt body, not the entire bolt. In fact, because you probably do not have a headspace gauge, you will need to reuse the rest of the components of the original bolt because it matches the rifle (to learn more about headspace, and what can go wrong if you don't pay attention to it, read this: &lt;a href="http://www.surplusrifle.com/shooting/headspace/index.asp"&gt;http://www.surplusrifle.com/shooting/headspace/index.asp&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Bolt body is the part to which the handle is attached.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THSiMfT9dBI/AAAAAAAAAmU/7TZJB_Oberg/s1600/Bolt+body.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="422" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THSiMfT9dBI/AAAAAAAAAmU/7TZJB_Oberg/s640/Bolt+body.jpg" width="640" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;There currently is not a good place where bolts or bolt bodies can be purchased. The cheapest, but an unreliable source is your local gun show - there typically would be a few available for $10-$12. Unless you are in Seattle area, because I bought up every one that was available locally :-).&lt;br /&gt;&lt;br /&gt;An unknown type of the already bent bolt body is sold here: &lt;a href="http://www.tngunparts.com/m9130.htm"&gt;http://www.tngunparts.com/m9130.htm&lt;/a&gt;. See below (in the Bolt Body section) for precaution - the bolt handle needs&amp;nbsp;to be replaced, not just bent.&lt;br /&gt;Failing that, look for ads for surplus rifle parts in Shotgun News, there usually is a place or two where you can get complete bolts for $25-$40 a piece. I bought quite a few there.&lt;br /&gt;&lt;br /&gt;Check &lt;a href="http://www.ebay.com/"&gt;http://www.ebay.com/&lt;/a&gt; or &lt;a href="http://www.auctionarms.com/"&gt;http://www.auctionarms.com/&lt;/a&gt;, the parts occasionally show up there.&lt;br /&gt;&lt;br /&gt;Boltman (&lt;a href="http://www.mosinnagant.net/Boltman/Boltman.html"&gt;http://www.mosinnagant.net/Boltman/Boltman.html&lt;/a&gt;) sometimes has them in stock, but more often he does not. If he does, the price quoted on the page above ($55 for the whole thing) is very, very attractive.&lt;br /&gt;&lt;br /&gt;Failing all that, you can buy a rifle in a very poor shape and cannibalize it. If you have a C&amp;amp;R license, you can often find them on the Internet for less than $40.&lt;br /&gt;&lt;br /&gt;Failing everything else, the bolt bodies can be purchased for $34 from Numrich store at &lt;a href="http://www.gunpartscorp.com/catalog/Products.aspx?catid=3258"&gt;http://www.gunpartscorp.com/catalog/Products.aspx?catid=3258&lt;/a&gt;. Yes, this is ridiculous considering that the price of a gun was ~$100.&lt;br /&gt;Remember the headspace, however - do not move the entire bolt from rifle to rifle!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Project inventory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You will need the following things for the project.&lt;br /&gt;&lt;br /&gt;(1) The rail from &lt;a href="http://www.kalinkaoptics.com/"&gt;http://www.kalinkaoptics.com/&lt;/a&gt;. $25 plus a ridiculous shipping price. Tough luck: this is the only place where this particular component can be found. On their web site, Browse Category -&amp;gt; Firearm Accessories -&amp;gt; Side Rails (&lt;a href="http://www.kalinkaoptics.com/firearm-accessories/side-rails.html"&gt;http://www.kalinkaoptics.com/firearm-accessories/side-rails.html&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THSmArAPNTI/AAAAAAAAAmc/Cgl9NKUd-d0/s1600/Rail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="420" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THSmArAPNTI/AAAAAAAAAmc/Cgl9NKUd-d0/s640/Rail.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Be careful not to buy the undrilled side rail&amp;nbsp;for $15 - it is too thin and will not stick enough to protrude above the stock surface.&lt;br /&gt;&lt;br /&gt;(2) "Original BP-02 SVD, PSL, Tigr Low Profile Centered Side Mount to Weaver Rail" from &lt;a href="http://www.kalinkaoptics.com/"&gt;http://www.kalinkaoptics.com/&lt;/a&gt;, $53 (plus the above "arm and leg" for shipping. Combine with (1) and it will be slightly less offensive). "Low profile" part is very important. This can be found in Browse Category -&amp;gt; Mounts -&amp;gt; SVD, Tigr, Romak-3 (&lt;a href="http://www.kalinkaoptics.com/mounts/svd-psl-tigr-romak-3.html"&gt;http://www.kalinkaoptics.com/mounts/svd-psl-tigr-romak-3.html&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THSnry5sZhI/AAAAAAAAAmk/_ueoux1UTJo/s1600/bracket.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="448" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THSnry5sZhI/AAAAAAAAAmk/_ueoux1UTJo/s640/bracket.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;(3) Stock that you will feel OK modifying (see "Preserving the original rifle" above).&lt;br /&gt;&lt;br /&gt;(4) Bolt body that you will feel OK modifying (see "Preserving the original rifle" above).&lt;br /&gt;&lt;br /&gt;(5) Drill bit #11, drill bit #21, 10-32 tap, T-wrench to hold the tap, and 2 10-32 x 1/2" screws. This is available in the local hardware store (for example, ACE). Get the ones that are the best quality, designed for hardened steel. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THXu-mT-P7I/AAAAAAAAAoQ/NG7GDx4ymVc/s1600/tap+and+t+wrench.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="432" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THXu-mT-P7I/AAAAAAAAAoQ/NG7GDx4ymVc/s640/tap+and+t+wrench.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;(6) Cutting oil. This is a bit hard to find, but I tracked it down in Lowe's and in ACE. Home Depot does not have it. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;(7) Drill press. Local hardware store, $120-$180.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THS-GfnGozI/AAAAAAAAAms/pWwD6Jz1N6g/s1600/Drill+Press.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THS-GfnGozI/AAAAAAAAAms/pWwD6Jz1N6g/s640/Drill+Press.jpg" width="425" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;(8) Drill press vise. Home Depot, $16. A few large matching&amp;nbsp;bolts, nuts, and washers&amp;nbsp;to fix it to the drill press table, same source. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXcnfLOYfI/AAAAAAAAAnM/mmEjpHZX0vI/s1600/drill+press+vise.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXcnfLOYfI/AAAAAAAAAnM/mmEjpHZX0vI/s640/drill+press+vise.jpg" width="626" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;(9) Small bulls eye level. Home Depot. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THXixHDpDRI/AAAAAAAAAns/E1V8R_H2RRs/s1600/bulls+eye+level.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THXixHDpDRI/AAAAAAAAAns/E1V8R_H2RRs/s320/bulls+eye+level.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;(10) Paint stripper, for example, Citristrip (&lt;a href="http://citristrip.com/"&gt;http://citristrip.com/&lt;/a&gt;). Sand paper (coarse and fine), steel wool (fine). Two brushes. Gloves, paper towels, 2 wood blocks, old newspapers. Local hardware store.&lt;br /&gt;&lt;br /&gt;(11) Wood stain of your choice. You should defer picking the color until you have stripped the stock of its current paint.&lt;br /&gt;&lt;br /&gt;(12) A rotary tool like Dremel.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THaX_08yaAI/AAAAAAAAAoY/1u79tn7FxEs/s1600/dremel.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THaX_08yaAI/AAAAAAAAAoY/1u79tn7FxEs/s400/dremel.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;(13) A gun vise or an inexpensive shooting rest. &lt;a href="http://www.midwayusa.com/"&gt;http://www.midwayusa.com/&lt;/a&gt;, $20-$60, depending on whether you want to have something you can use for shooting, or just mounting the gun for cleaning and scope alignment.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THdP_4QmlGI/AAAAAAAAApI/nr9txeoVHbE/s1600/shooting+rest.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THdP_4QmlGI/AAAAAAAAApI/nr9txeoVHbE/s640/shooting+rest.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;(14) A laser boresighter. &lt;a href="http://www.midwayusa.com/"&gt;http://www.midwayusa.com/&lt;/a&gt;. There is no picture here because I really cannot recommend any particular model - the choice is between an expensive and crappy one ($150 LaserLyte Kryptonyte Green Laser Boresighter 22 to 75 Caliber), and a less expensive but equally crappy one ($30 Sightmark Laser Bore Sight 243, 308 Winchester, 260, 7mm-08 Remington). Price/performance of the Sightmark is better. The above-referenced caliber (243) works for 7.62x54r, although the bolt does not close. This is OK, the bolt does not close in 308 rifles either.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Bolt body&lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;To work with any scope mount other than the scout mount, the bolt handle needs to be turned down. This is because when the bolt is open, it's handle sticks upwards and interferes with the scope. There are several ways this can be accomplished. First, there is an ATI bolt handle kit that costs around $20 on eBay and contains the replacement handle, the drill bit, the tap, and the screw. The result does not look amazing, and requires notching the stock because the handle extends directly down when the bolt is closed. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;The picture below looks nicer than the reality.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXWGJlro4I/AAAAAAAAAm0/eY1fU00pNtY/s1600/Bolt+turned+with+ATI+kit+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="420" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXWGJlro4I/AAAAAAAAAm0/eY1fU00pNtY/s640/Bolt+turned+with+ATI+kit+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;As of this writing, a bolt body with the handle turned down can be bought from here: &lt;a href="http://www.tngunparts.com/m9130.htm"&gt;http://www.tngunparts.com/m9130.htm&lt;/a&gt;&amp;nbsp;for $54. I have not used them, so I do not know how exactly is the bent handle manufactured,. Sometimes they simply bend the handle down without adding to the length of it. The result is not that good, there simply is not&amp;nbsp;enough handle to grab it when opening and closing&amp;nbsp;the action:&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXZN2RIxPI/AAAAAAAAAm8/MIv_ygflTig/s1600/Numrich+bent+bolt.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="336" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXZN2RIxPI/AAAAAAAAAm8/MIv_ygflTig/s640/Numrich+bent+bolt.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;(the part above is available here, &lt;a href="http://www.gunpartscorp.com/catalog/Detail.aspx?pid=291700&amp;amp;catid=3258"&gt;http://www.gunpartscorp.com/catalog/Detail.aspx?pid=291700&amp;amp;catid=3258&lt;/a&gt;&amp;nbsp;for $34) &lt;br /&gt;&amp;nbsp; &lt;br /&gt;eBay has a number of people sell bolt bending as a service: you mail them your body, they modify the handle for you, and mail it back. I used Marvin Burrows (eBay: mellbee) several times, and he does excellent job for around $46, including shipping. This is his eBay ad: &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXbXNmb3zI/AAAAAAAAAnE/24MiA6yihHQ/s1600/Bent+bolt+ebay+ad.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXbXNmb3zI/AAAAAAAAAnE/24MiA6yihHQ/s640/Bent+bolt+ebay+ad.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;And this is the result: &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXeE0U4YAI/AAAAAAAAAnU/v--U38rJfGQ/s1600/Bolt+turned+by+Marvin+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="340" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THXeE0U4YAI/AAAAAAAAAnU/v--U38rJfGQ/s640/Bolt+turned+by+Marvin+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;The turnaround time is about 2 weeks including the mailing time. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;If you are really adventurous, you can try doing it yourself using the instructions here: &lt;a href="http://www.gswagner.com/mosin-nagant/bolt/mnbolt.html"&gt;http://www.gswagner.com/mosin-nagant/bolt/mnbolt.html&lt;/a&gt; &lt;br /&gt;...or here: &lt;br /&gt;&lt;a href="http://www.opticstalk.com/topic12364.html"&gt;http://www.opticstalk.com/topic12364.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Side Rail&lt;/span&gt; &lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;This is the "mechanical" part of the project. You will need to drill and tap 2 holes in the receiver to attach the side rail.&lt;br /&gt;&amp;nbsp; &lt;br /&gt;To do this, you need to attach the side rail to the receiver temporarily to drill the very first hole. It goes on the left part of the receiver so that its top is close to flush with the opening in the action. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THXga2J3OuI/AAAAAAAAAnc/DbNsbcHqu6A/s1600/Scope+mount+dragunov+side+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="326" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THXga2J3OuI/AAAAAAAAAnc/DbNsbcHqu6A/s640/Scope+mount+dragunov+side+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THXgkpDjnpI/AAAAAAAAAnk/ESr1btgPpMU/s1600/Scope+mount+dragunov+side+2+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="412" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THXgkpDjnpI/AAAAAAAAAnk/ESr1btgPpMU/s640/Scope+mount+dragunov+side+2+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;This time I suggest you remove the trigger group by unscrewing the single screw that holds it on the receiver. Mounting the receiver in the vise is hard as it is, without extra parts sticking out. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Before you mount the receiver, ensure that the drill table is horizontal by using a level. You will need this to align the receiver surface to be perfectly horizontal afterwards. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Place the rail in the side of the receiver. I do not know if there is "the" right spot. The receiver is curved, and on all 3 rifles on which I put the side rail the scope ended up pointing up and to the left relative to the barrel axis. This is OK: the problem will be corrected by shimming the mounting bracket. See the couple of pictures above for approximately right location. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;The legs on the rail should obviously hug the receiver and not hang out through the action's opening. &lt;br /&gt;&lt;br /&gt;Fix the side rail in place. You can use either a very small clamp, or wrap it tightly using electrical or duct tape. Make sure that neither cover the opening which you will drill.&lt;br /&gt;&amp;nbsp; &lt;br /&gt;Plug the chamber with a tight wad of paper towel to ensure that the metallic debris from drilling does not end up in the chamber or the barrel. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Place the drill table vise on the drill table. Do not yet attach it with the bolts. Place the receiver on the vise, tighten the vise&amp;nbsp;as little as necessary so that the receiver does not slide. Guide the system so that the hole in the side rail is approximately below the drill's chuck, and at the same time all four of the mounting openings in the vise intersect with the mounting openings on the drill table. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Adjust the drill table to a height where the drill bit can be lowered sufficiently to drill through the receiver. &lt;br /&gt;&lt;br /&gt;Put the bolts through the mounting holes. Use the washers on both sides, and screw them down so that the whole system can move about with some friction. Now place the bulls eye level on the side rail, reopen the vise jaws just a little bit so that receiver can be reoriented, and move it slightly so that the bubble of air in the level is right in the center. Reclose the vise jaws and tighten them, while monitoring the bubble - when jaws are closed the receiver might shift and the leveling action will have to be repeated.&lt;br /&gt;&amp;nbsp; &lt;br /&gt;Now that the system is aligned horizontally, put the larger drill bit in the chuck. Tighten. Do not turn the drill on yet, but lower the chuck to see where it would touch the metal. By moving the vise slightly ensure that the drill bit goes exactly through the hole in the side rail. The larger drill bit should fit tightly through that hole. When it's in, rotate it around to make sure that the system is perfectly aligned and the drill bit does not scrape the metal of the side rail. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Tighten the bolts that fix the vise on the drill table. Lower the chuck again to make sure the position did not shift. Rotate it around again. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Put the eye protection on, turn on the drill and lower the larger bit just enough to make a small crater, just the diameter of the drill but not deeper than necessary, on the steel of the receiver. Raise the chuck and replace the drill bit with the smaller one. Lower the chuck to ensure that the system is still aligned. The drill bit should touch the metal right in the middle of the crater left by the bigger drill.&lt;br /&gt;&lt;br /&gt;If the drill has an adjustable RPM, set it to medium low (800-1200). Place a drop of the cutting oil on the receiver where it will be drilled. Note that cutting oils are toxic, do not let it anywhere near your exposed skin. Use gloves! &lt;br /&gt;&lt;br /&gt;Drill slowly, raising the chuck to clear the metal debris out of the hole often. Do not apply a force that is more than 20lb (100N). This is very important, or the drill bit can break and stick in the hole, and it might be impossible to remove it! When the hole is drilled&amp;nbsp;though, remove the receiver from the vise, and remove the side rail from the receiver. Using paper towel (and gloves!) clean all metal debris from the receiver. &lt;br /&gt;&lt;br /&gt;Put another drop of cutting oil (gloves!) on the tap. Rotate it and guide it in the hole, maintaining perpendicular angle to the receiver. Go lightly, reversing the direction, cleaning the debris and reoiling frequently. A broken tap is a disaster - it is made of a hard alloy and if broken is next to impossible to remove. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;When the thread is cut (the widest part of the tap is through the hole), remove the tap, clean the receiver and the new thread using paper towels. You can now screw the side rail to the receiver using the newly made hole and one of the screws, and repeat the process for the next hope. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Useful hint: when tapping the second hole, keep the side rail in place (but clean the drilling debris out!), it will help guide the tap. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;span style="font-size: large;"&gt;Stock&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the last part of the project. Now that we have a rail on the side of the receiver, the stock will not fit and a cut out needs to be made to accommodate the part that is sticking out. Also, the height of the side rail is somewhat smaller than the thickness of the stock, so a small layer of wood needs to be removed from the left side of the stock so that the rail is exposed enough.&lt;br /&gt;&lt;br /&gt;Because quite a bit of finish will be removed to accommodate the rail, we will need to refinish the stock. If you have done this before, just go with what you know, not what I write here. I am a complete novice to wood finishing, and the results I personally achieved are functional, but not beautiful.&lt;br /&gt;&lt;br /&gt;First, use the paint remover to get the current finish off. You will need a brush, a paint stripper, steel wool and sand paper for this.&lt;br /&gt;&lt;br /&gt;Citristrip is a paint stripper that can be used indoors, other must be used outside. Make sure that the weather is right! Vast majority of them are health hazard so be cautious and read the instructions before starting. I found that a combination of Citristrip followed by the classic stain remover works well.&lt;br /&gt;&lt;br /&gt;Although most of the paint/wax/whatever it is will come off, some coloring will still remain.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THadA8jtjuI/AAAAAAAAAog/hjbJ9TqFPg4/s1600/Stripped+stock.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THadA8jtjuI/AAAAAAAAAog/hjbJ9TqFPg4/s640/Stripped+stock.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You can probably get closer to clean wood by sanding it off with sandpaper.&lt;br /&gt;&lt;br /&gt;After you got as much previous stain off as you think is practical, pick the stain that will (1) survive outdoors, and (2) will either match the previous stain&amp;nbsp;closely&amp;nbsp;or be dark enough to cover the remaining traces of the older stain. I chose the later route, so that's what you see in the pictures.&lt;br /&gt;&lt;br /&gt;Place the barrel in the receiver and mark the places where the stock interferes with the side rail. Using the rotary tool and the sanding band...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THdJUXkYDFI/AAAAAAAAAoo/9gPtt3DJz2c/s1600/dremel+sanding+attachment.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THdJUXkYDFI/AAAAAAAAAoo/9gPtt3DJz2c/s320/dremel+sanding+attachment.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...remove the side of the stock about 1/2 of the width of the rail. Use the cutting attachment...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THdJrmCwtkI/AAAAAAAAAow/J9X4fLZzsLA/s1600/dremel+cutter+attachment.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THdJrmCwtkI/AAAAAAAAAow/J9X4fLZzsLA/s320/dremel+cutter+attachment.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...to take care of the corners. Replace the receiver to see how much the opening needs to be deepened. Keep doing this until the screwed down receiver can go into the stock all the way and the side rail still does not touch the stock.&lt;br /&gt;&lt;br /&gt;Now take the scope or the mounting bracket and try to slide it onto the rail. You will see that the side of the stock prevents it from engaging. Again, using the rotary tool keep removing thin layers of the side until the scope mount can slide onto the rail.&lt;br /&gt;&lt;br /&gt;Take a look at the picture below and note the depression cut out on the stock to accommodate the externalities of the scope mount.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THdLOnzDJnI/AAAAAAAAAo4/GE2SyRvFUlg/s1600/Dragunov+scope+mount+with+bracket+close.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THdLOnzDJnI/AAAAAAAAAo4/GE2SyRvFUlg/s640/Dragunov+scope+mount+with+bracket+close.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;After the barreled receiver fits (do not forget to screw it in and tighten the screws before ensuring that the rail does not touch the stock), and the scope mounting bracket fits on the rail, you are ready to apply the stain to the stock.&lt;br /&gt;&lt;br /&gt;Disassemble the rifle back. Using the instructions for your stain and working in an open space (the fumes are toxic!), apply a coat of stain, let it dry, then repeat twice, applying the total of 3 layers.&lt;br /&gt;&lt;br /&gt;After the stain dries completely (this will take a day), reassemble the rifle fully.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Adjusting the scope mount&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As I said above, the side rail will not be precisely aligned with the barrel axis. In all my mounts "out of the box" the scope will point high and to the left. This misalignment may or may not be correctable by the scope's internal adjustment mechanism, but it is much better to instead adjust the scope mount so that the scope's natural axis is in alignment with the barrel.&lt;br /&gt;&lt;br /&gt;There are a few reasons for aligning the mount instead of adjusting the scope.&lt;br /&gt;&lt;br /&gt;First, the mount is probably pointing high. Even if you can adjust the elevation on the scope, your scope will be close to out of the adjustment range pointing down. So when you would want to move it down for shooting at 200/300 meters, it is very likely that you will not be able to do it because scope's adjustment range will already have been used to compensate for the rail.&lt;br /&gt;&lt;br /&gt;Second, scopes near the edge of their adjustment ranges tend to not keep zero as well as they do when they are centered.&lt;br /&gt;&lt;br /&gt;Adjusting the Dragunov-type mount is actually very easy. The bracket's top rail is attached to the middle part by two screws, and the middle part attaches to the part that goes on the side rail with 4 screws. The windage (horizontal) adjustment is achieved by putting shims between the middle and the bottom part, and the vertical adjustment is achieved by shimming the rail.&lt;br /&gt;&lt;br /&gt;I use aluminum strips from soda cans for shims - they can be stacked to achieve exactly the necessary thickness.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THdaC3TU8tI/AAAAAAAAApY/sYZdgZFlniw/s1600/Scope+mount+dragunov+shim+1+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THdaC3TU8tI/AAAAAAAAApY/sYZdgZFlniw/s640/Scope+mount+dragunov+shim+1+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THdaLpc9OVI/AAAAAAAAApg/Jg9r3ObTPuY/s1600/Scope+mount+dragunov+shim+2+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="420" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THdaLpc9OVI/AAAAAAAAApg/Jg9r3ObTPuY/s640/Scope+mount+dragunov+shim+2+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Attach the scope to the mount. Ensure that the scope's optical axis is centered. To do this, loosen the scope in the rings and rotate it while observing the cross hairs through the eyepiece. If the scope axis is centered, the impact point will be the same while the scope rotates. Use windage and elevation adjustments to center the scope. When the scope is centered, tighten the rings.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Turn the laser boresighter on and put it into the chamber. Put the gun in a vise and point it to the wall some distance away (10 meters or more, depending on the minimum distance at which your scope still focuses). Note where the scope's cross hairs are, relative to the laser beam. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Turn the boresighter off. You will need to make several measurements, and the batteries are only good for minutes (despite what the instructions claim). &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Disassemble the scope mount, and measure the sizes of the holes and distances between them. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Cut off several rectangular pieces of aluminum foil from the side of a soda can. Initially make them much larger than is really needed. For the top shims you will need to drill one big and one very small hole next to each other. For the bottom shim, you will need two holes of the same size. The drill press will help here. &lt;br /&gt;&lt;br /&gt;It is easier to drill the holes when multiple layers of the aluminum are bunched together. After the holes are done (plan to waste a few pieces to practice) you can cut around them to size.&lt;br /&gt;&lt;br /&gt;Add a few shim pieces, reassemble the mount and replace the scope. Turn the laser boresighter on and observe the new impact point.&lt;br /&gt;&lt;br /&gt;The goal is to have the cross hairs about 1"-1.5" ABOVE the laser mark at 10 meters. The actual scope axis is about 2" above the barrel axis, but you want to make the centered scope point a little bit DOWN so that it does not run out of DOWNWARD alignment when shooting at distances beyond 100 meters (to track the bullet trajectory the scope gets turned down as the target is farther away).&lt;br /&gt;&lt;br /&gt;You will have to do a few passes to get the scope almost right. It does not have to be completely on target - the last final touches are worked out using the scope's internal adjustment mechanisms. Do not spend too much time on it until you get to the range though - the accuracy of the laser boresighter is only within 10" at a 100 meters, if even that. It will get you on paper and you will use the scope's controls to get on target from there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8995080688246932584?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8995080688246932584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8995080688246932584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8995080688246932584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8995080688246932584'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-7-scope.html' title='How to make a sniper rifle. Part 7: Mounting a side rail on the Mosin Nagant'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_VsIB2Nr2f1c/THSZh69sIUI/AAAAAAAAAmM/xtYMekZ71Ec/s72-c/Dragunov+scope+mount+close.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-9049404867516714972</id><published>2010-08-21T13:30:00.000-07:00</published><updated>2010-08-30T20:52:14.327-07:00</updated><title type='text'>How to make a sniper rifle. Part 6: Selecting a scope mount.</title><content type='html'>[This is the part 6 of the series. Table of contents: &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Mounting a scope is by far the most challenging issue when dealing with Mosin Nagants. The rifle was designed before scopes were used in combat, and made before they became accessible to an average soldier. In WWII rifle scopes were present on only a tiny percentage of weapons specifically designated as sniper rifles.&lt;br /&gt;&lt;br /&gt;This is why, unlike a typical modern military or hunting rifle,&amp;nbsp;a Mosin you can buy today has no way of mounting a scope - the exception being "sniper" variants which I will discuss below. To mount a scope the rifle will need to be modified to various degrees, some scope mounts requiring more, and some less.&lt;br /&gt;&lt;br /&gt;In this post I discuss various mounting options&amp;nbsp;in detail.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;"Authentic" military mounts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have already pointed out, in the buying section that you can get a "sniper" version of Mosin Nagant with the scope pre-installed for $400-$500. These are not actually true sniper rifles from WWII, but rather standard issue Mosin Nagants with a reproduction scope&amp;nbsp;added recently. Judging from what I have seen at the range, these rifles can be spectacularly inaccurate (the dispersions I've seen with people shooting them were as bad as&amp;nbsp;10 inches at a 100 yards).&lt;br /&gt;&lt;br /&gt;There is a small number of authentic sniper rifles on the market with real WWII scopes. You should expect to pay around $800-$1200 for them.&lt;br /&gt;&lt;br /&gt;There are two types of military scopes&amp;nbsp;for Mosin Nagant. The first one, used mostly in the late 1930s,&amp;nbsp;was called PE. It has a 4x magnification, a German post reticle, a design that is similar to a modern rifle scope, and mounted directly on top of the receiver.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THASThQnq0I/AAAAAAAAAi8/s2TA7kGQ9gE/s1600/PEM+mount.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THASThQnq0I/AAAAAAAAAi8/s2TA7kGQ9gE/s400/PEM+mount.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The mount itself was attached to the receiver with 6 screws. After the mount was attached, the iron sights could no longer be used.&lt;br /&gt;&lt;br /&gt;During the WWII this scope was replaced by a side-mounted PU scope. It has a slightly lower magnification of 3.5, and a "flat" design where the diameter of the scope tube is the same as the diameter of the objective.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THATJ_Z2NWI/AAAAAAAAAjE/61sJ8GWpd1Y/s1600/Mosin+Ukrainean+sniper.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="403" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THATJ_Z2NWI/AAAAAAAAAjE/61sJ8GWpd1Y/s640/Mosin+Ukrainean+sniper.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;While PE mount can be used with more modern scopes (with 30 mm tube diameter) - provided that the bell fits, since the mount is low, - the PU scope design depends on the scope's objective being the same diameter as the tube, since the scope band is one piece and only has tightening screws on one side:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAVGBqcgLI/AAAAAAAAAjM/p5jY0Rv_-IM/s1600/Scope+mount+PU+mount.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="464" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAVGBqcgLI/AAAAAAAAAjM/p5jY0Rv_-IM/s640/Scope+mount+PU+mount.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So it really only works with the original scope. The advantage of PU mount is the side rail which allows quick removal of the scope. Also, the mount allows the use of iron sights even when the scope is attached. However, installing the side rail requires modifying the stock.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAV-ZL-yCI/AAAAAAAAAjU/mo35PG6Q1bw/s1600/Scope+mount+PU+rail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAV-ZL-yCI/AAAAAAAAAjU/mo35PG6Q1bw/s640/Scope+mount+PU+rail.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Both mount types require the use of a special "turned down" bolt, since when opened, the bolt handle sticks upwards and would interfere with the scope. This is true for any scope mount, except the scout mount discussed below.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAWmkCebZI/AAAAAAAAAjc/767PkWCjUv4/s1600/Bolt+turned+by+Marvin+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="340" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAWmkCebZI/AAAAAAAAAjc/767PkWCjUv4/s640/Bolt+turned+by+Marvin+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Full overview of Soviet military scopes can be found here: &lt;a href="http://www.mosinnagant.net/sniper%20section/snipertext1.asp"&gt;http://www.mosinnagant.net/sniper%20section/snipertext1.asp&lt;/a&gt;&lt;br /&gt;While "authentic" scopes can be interesting as historical pieces of militaria (unless, of course, you install them yourself using reproduction parts), they have many disadvantages when it comes to actual shooting. &lt;br /&gt;&lt;br /&gt;First, they have very low magnifications (3.5&amp;nbsp; for PU and 4 for PE). While it might be sufficient for human targets in the war, I hope that most people today would be shooting at paper, and you won't be able to even see a 1 inch target dot at a 100 meters with only 4x magnification.&lt;br /&gt;&lt;br /&gt;Second, when the scope is sighted to adjust for the difference in the direction of the scope mount and the barrel, since even a tiny level of non-collinearity will lead to large difference in point of impact, in&amp;nbsp;a modern scope the field moves and the cross-hair stays centered. In these older designs the cross-hair moves, so you end up with it off-center, sometimes significantly off-center.&lt;br /&gt;&lt;br /&gt;And even if by magic your horizontal axis is the same, when you are shooting long distance you have to compensate for the bullet drop, so you will end up with this:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAY6CNjdxI/AAAAAAAAAjk/9ZlZp29BT8s/s1600/PEM+reticule+adjusted.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAY6CNjdxI/AAAAAAAAAjk/9ZlZp29BT8s/s400/PEM+reticule+adjusted.jpg" width="355" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;For these reasons I do not recommend using PU/PE scopes and instead go with more modern alternatives.&lt;br /&gt;&lt;br /&gt;NOTE: There are after-market brackets that replace the very top of the PU mount with&amp;nbsp;rings that can hold the standard 1" tube available on eBay. This allows using a modern scope with the PU scope mount.&lt;br /&gt;&lt;br /&gt;HOWEVER, the mount was designed for a small, light scope, and so the base of the scope (the distance between the rings) is rather small. Mounting a large, heavy modern scope on these rings, coupled with a very heavy recoil of Mosin's 7.62x54r cartridge would almost certainly exert a very high stress on the scope tube, the scope will shake excessively, and will be more likely to fail.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Scout mount&lt;/span&gt;&lt;br /&gt;Scout scopes have a very long eye relief - the distance between the eyepiece and the eye&amp;nbsp;- so the scope can be mounted forward of the receiver.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAbTFfVY1I/AAAAAAAAAjs/DfMdnbxd-D8/s1600/Scope+mount+scout+installed.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAbTFfVY1I/AAAAAAAAAjs/DfMdnbxd-D8/s640/Scope+mount+scout+installed.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;For Mosin Nagant this setup is extremely convenient. The scout scope does not interfere with the bolt handle, so it does not need to be modified. It replaces the iron sights and is mounted using the hardware that goes into the iron sight mount - so there is no need to drill anything or cut the stock. The mount itself is just a cheap piece of metal and can be had for $12-$14 on ebay.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAcT6bploI/AAAAAAAAAj8/7hJITpQcfcE/s1600/Scope+mount+scout+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="190" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAcT6bploI/AAAAAAAAAj8/7hJITpQcfcE/s640/Scope+mount+scout+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Despite the ease of installation, I do not recommend it for the following reasons.&lt;br /&gt;&lt;br /&gt;First, the maximum magnification that is available in scout scopes is 7x. At this magnification most of 1" dot is covered by the cross-hairs at 100 yards, so getting to below 1 MOA is very challenging.&lt;br /&gt;&lt;br /&gt;Second, only very few scout scopes are available, mostly the cheaper ones, and the cheap scopes are known to not hold the impact point very well.&lt;br /&gt;&lt;br /&gt;Third, the mount itself holds on friction from several adjusting screws, and tends to come loose. It will certainly come loose after the first couple of shots, and you will have to remove the scope (because the adjusting screws on the mount are directly below it), retighten the screws, and remount the scope. This has to be done several times, and even after that I have doubts about how good the mount is capable of holding zero.&lt;br /&gt;&lt;br /&gt;Finally, the iron sights are removed with this mount and are not usable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Metal band retainer&lt;/span&gt;&lt;br /&gt;This type of the scope is produced by an individual, not&amp;nbsp;a company, and occasionally pops up on eBay for $80-$90. It consists of a base that is held on top of the receiver by a metal band wrapping around the receiver. This is another example of so called "no gunsmithing required" scope mount kits, the first being the scout mount.&lt;br /&gt;&lt;br /&gt;This is&amp;nbsp;what it looks:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THAfBYo1vwI/AAAAAAAAAkE/J_4zaEjSQAY/s1600/Scope+mount+band+1+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="420" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THAfBYo1vwI/AAAAAAAAAkE/J_4zaEjSQAY/s640/Scope+mount+band+1+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;...and...&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAfJ4LlmmI/AAAAAAAAAkM/iqR4iYxB9Nk/s1600/Scope+mount+band+2+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="628" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAfJ4LlmmI/AAAAAAAAAkM/iqR4iYxB9Nk/s640/Scope+mount+band+2+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Here is how it gets installed:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAfWRI2x6I/AAAAAAAAAkU/RuU4pYlFIyU/s1600/Scope+mount+band+installed+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="298" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAfWRI2x6I/AAAAAAAAAkU/RuU4pYlFIyU/s640/Scope+mount+band+installed+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The only modification necessary for this mount is dremmeling out a tiny amount of wood from inside the stock to make space for the band.&lt;br /&gt;&lt;br /&gt;You still do need to modify the bolt handle because the scope mount hangs directly over the bolt, and interferes with it when the bolt handle is raised. I will write more about turning the bolt handle in the following article.&lt;br /&gt;&lt;br /&gt;This mount is easy to install and allows using any modern scope. However, it does not work. &lt;br /&gt;&lt;br /&gt;When the receiver heats up when the rifle is fired, the expansion coefficient of the receiver metal is different from that of the retaining band. So the band gets stretched a little bit, and when the rifle cools back, it comes loose, so the screws that hold the band need to be retightened constantly. With every tightening the base slides alongside the receiver a little bit, and the impact point moves.&lt;br /&gt;&lt;br /&gt;I do not recommend using this scope mount at all.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;ATI scope mount&lt;/span&gt;&lt;br /&gt;ATI kit requires drilling the receiver and replacing the bolt handle to install the scope. This is relatively demanding project, but it results in a mount that is better than any discussed previously. With this mount I have gotten pretty close to my 1 MOA goal.&lt;br /&gt;&lt;br /&gt;The kit consists of a bracket that gets screwed on top of the receiver, the bolt handle, and the hardware (drill bits, a tap, and screws) to get everything installed. It costs in the vicinity of $40.&lt;br /&gt;&lt;br /&gt;This is the bracket piece from the side...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAmJ08Gv2I/AAAAAAAAAkc/MrSk14e_VJs/s1600/Scope+mount+ATI+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="210" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAmJ08Gv2I/AAAAAAAAAkc/MrSk14e_VJs/s640/Scope+mount+ATI+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...the top...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAmQE-BAAI/AAAAAAAAAkk/1hV-v-Rvmlk/s1600/Scope+mount+ATI+top+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="170" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAmQE-BAAI/AAAAAAAAAkk/1hV-v-Rvmlk/s640/Scope+mount+ATI+top+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...and installed.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAmkr-mFyI/AAAAAAAAAks/Tq76AQkggr8/s1600/Scope+mount+ATI+installed+2+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="324" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAmkr-mFyI/AAAAAAAAAks/Tq76AQkggr8/s640/Scope+mount+ATI+installed+2+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAmr6fBroI/AAAAAAAAAk0/SwsFecwfC_4/s1600/Scope+mount+ATI+installed+3+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="226" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAmr6fBroI/AAAAAAAAAk0/SwsFecwfC_4/s640/Scope+mount+ATI+installed+3+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The receiver is drilled on top to screw the base in as follows:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAnsUpTg9I/AAAAAAAAAlE/P8jK7h9a3Ok/s1600/Scope+mount+ATI+drilled+holes+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAnsUpTg9I/AAAAAAAAAlE/P8jK7h9a3Ok/s640/Scope+mount+ATI+drilled+holes+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The bracket hangs very low over the receiver (which is a good thing, because the distance between the optical axis of the scope and the axis of the barrel is best minimized) so the standard turned down bolts do not work, and you need to use ATI bolt handle.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAnKT2cnGI/AAAAAAAAAk8/gcS3X4P7NHs/s1600/Bolt+turned+with+ATI+kit+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="420" ox="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/THAnKT2cnGI/AAAAAAAAAk8/gcS3X4P7NHs/s640/Bolt+turned+with+ATI+kit+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The result does not look amazingly beautiful, but it does work. Because the bolt handle is turned down almost at the right angle and almost at the base of the bolt, the stock needs to be notched a bit to let the bolt close.&lt;br /&gt;&lt;br /&gt;The drill press is absolutely required to drill both the handle and the receiver - do not even think about doing this with a hand drill!&lt;br /&gt;&lt;br /&gt;Advantages of this kit:&lt;br /&gt;(1) It is relatively cheap.&lt;br /&gt;(2) It provides reasonable base that minimizes the momentum exerted on the scope during the recoil.&lt;br /&gt;(3) It requires minimum modification of the stock.&lt;br /&gt;(4) The result is reasonable stable and holds zero well.&lt;br /&gt;&lt;br /&gt;Disadvantages:&lt;br /&gt;(1) Aligning the bracket to the top of the receiver is very, very hard. Ideally, the bracket should be collinear to the barrel, but there is no way to actually measure this. Also, the top of the receiver is not necessarily symmetric, or aligned with the barrel, so the contact between the bottom of the bracket and the receiver will orient it in a direction you might not be able to control.&lt;br /&gt;&lt;br /&gt;When I installed mine, it was misaligned so much that I had to use adjustable rings to compensate (Millet, $30). The problem with these rings is that because of the ring design one cannot remove and reinstall them without losing zero, so the scope has to be permanently affixed to the rifle.&lt;br /&gt;&lt;br /&gt;This is the reason why I eventually gave up on this way of mounting the scope.&lt;br /&gt;&lt;br /&gt;(2) You have to have a drill press. A cheap one (~$120) will do, but it is absolutely required.&lt;br /&gt;&lt;br /&gt;(3) Aligning receiver in the vise on the drill press is hard. It has to be exactly perpendicular to the drill bit, and because&amp;nbsp;it is curved, it is a non-trivial exercise.&amp;nbsp;Drilling requires cutting oil which is not widely available (I was finally able to find it&amp;nbsp;in Lowe's).&lt;br /&gt;&lt;br /&gt;(4) Take extra care when tapping the receiver. If you turn too hard, or don't use cutting oil, the tap bit will break and you will end up with the hole that is plugged by a bit of hardened instrumental steel which is impossible to extricate.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAsN_5oC-I/AAAAAAAAAlM/qroJv7i5OeY/s1600/Broken+tap+-+front+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAsN_5oC-I/AAAAAAAAAlM/qroJv7i5OeY/s640/Broken+tap+-+front+clipped.jpg" width="596" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Overall, the ATI kit is an acceptable way to mount the scope IF you do not require removing and reinstalling the scope frequently (or you are extremely lucky and the shape of your receiver aligns with the barrel perfectly).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Dragunov side rail&lt;/span&gt;&lt;br /&gt;This is by far the most expensive and the hardest to install scope mount, but it gives the best overall results.&lt;br /&gt;&lt;br /&gt;Side rail installs on the side of the receiver as follows:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THAu_22fl2I/AAAAAAAAAlU/tzVSwGfFoFw/s1600/Scope+mount+dragunov+side+clipped.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="326" ox="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/THAu_22fl2I/AAAAAAAAAlU/tzVSwGfFoFw/s640/Scope+mount+dragunov+side+clipped.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It does require not only drilling and tapping the receiver, but extensive modification of the stock, including refinishing.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAvr9AgWRI/AAAAAAAAAlc/fS3unziBA60/s1600/Dragunov+scope+mount+close.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAvr9AgWRI/AAAAAAAAAlc/fS3unziBA60/s640/Dragunov+scope+mount+close.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Once installed, however, a wide variety of scopes and scope&amp;nbsp;mounts designed for Dragunov (and its AK clones such as PSL54c and Zastava M76) will work for your rifle.&lt;br /&gt;&lt;br /&gt;For example, this is a bracket that allows installation of any scope with Weaver rings:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAwy4nxF7I/AAAAAAAAAlk/K2_n67WQaOk/s1600/Dragunov+scope+mount+with+bracket+close.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAwy4nxF7I/AAAAAAAAAlk/K2_n67WQaOk/s640/Dragunov+scope+mount+with+bracket+close.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...or a Romanian LPS scope (4x, ~$100 currently at &lt;a href="http://www.jgsales.com/"&gt;http://www.jgsales.com/&lt;/a&gt;)...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAxTp99wZI/AAAAAAAAAls/8g12isD23rM/s1600/Dragunov+scope+mount+with+romanian+scope+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/THAxTp99wZI/AAAAAAAAAls/8g12isD23rM/s640/Dragunov+scope+mount+with+romanian+scope+1.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAxjFoYfVI/AAAAAAAAAl0/ri4ug9omRh0/s1600/Dragunov+scope+mount+with+romanian+scope+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAxjFoYfVI/AAAAAAAAAl0/ri4ug9omRh0/s640/Dragunov+scope+mount+with+romanian+scope+2.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...and finally Russian POSP scope from &lt;a href="http://www.kalinkaoptics.com/"&gt;http://www.kalinkaoptics.com/&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAyEVUXv5I/AAAAAAAAAl8/_FH6paUlqHU/s1600/Dragunoiv+scope+mount+with+POSP+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAyEVUXv5I/AAAAAAAAAl8/_FH6paUlqHU/s640/Dragunoiv+scope+mount+with+POSP+1.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAySZ6LbKI/AAAAAAAAAmE/dWZH4cKxnM8/s1600/Dragunov+scope+mount+with+POSP+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" ox="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/THAySZ6LbKI/AAAAAAAAAmE/dWZH4cKxnM8/s640/Dragunov+scope+mount+with+POSP+2.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As I pointed out above, this is the hardest to install mount, but is preferred as far as quality and versatility of the outcome goes. I will cover the installation, including procuring all the parts, in the next post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-9049404867516714972?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/9049404867516714972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=9049404867516714972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/9049404867516714972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/9049404867516714972'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-6.html' title='How to make a sniper rifle. Part 6: Selecting a scope mount.'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_VsIB2Nr2f1c/THASThQnq0I/AAAAAAAAAi8/s2TA7kGQ9gE/s72-c/PEM+mount.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-8861094014582281543</id><published>2010-08-10T08:47:00.000-07:00</published><updated>2010-08-30T20:53:05.819-07:00</updated><title type='text'>How to make a sniper rifle. Part 5: Accurizing a Mosin Nagant</title><content type='html'>[This is the part&amp;nbsp;5 of the series. Table of contents: &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;When it comes to any rifle's accuracy, excluding the optics and the ammunition, there are&amp;nbsp;5 attributes of the rifle itself:&lt;br /&gt;1) Rigidity of the barrel&lt;br /&gt;2) Quality of the bore&lt;br /&gt;3) Weight of the trigger&lt;br /&gt;4) Contact between the receiver and the stock&lt;br /&gt;5) Contact between the barrel and the stock&lt;br /&gt;&lt;br /&gt;We don't have any control over #1, the rigidity of the barrel was fixed when the gun was designed.&lt;br /&gt;&lt;br /&gt;We can only control #2 when we buy the rifle. Make sure you inspect the bore carefully when you buy in at the retail store, or pay extra $30 to J&amp;amp;G Sales so they do it for you when you buy it on the internet.&lt;br /&gt;&lt;br /&gt;#3, the weight of the trigger is the force with which the trigger needs to be pulled for the rifle to go off. A typical military rifle has a 8lb trigger weight. a typical benchrest rifle's trigger pull is measured in ounces. The heavier the trigger, the more the rifle is deflected by the finger pulling the trigger, the more variance on the impact point and the wider is the group.&lt;br /&gt;&lt;br /&gt;A Mosin trigger is an extremely simple system, it is typically very heavy, and has no support for adjustment. You can lighten it somewhat by shimming it with thin pieces of aluminum (e.g. cutouts from the soda cans) by putting them between the receiver and the base of the trigger spring, but unless you are ABSOLUTELY SURE&amp;nbsp;that the rifle will only be loaded at the range and only when pointing towards the target, I STRONGLY recommend against doing it. A trigger modified in this way can go off on its own - or if the rifle is struck - at any point, which makes the rifle extremely dangerous.&lt;br /&gt;&lt;br /&gt;So it is #4 and #5 that an amateur (and not so amateur) gunsmith can control to improve the accuracy of his or her rifle. This is what I am going to describe here.&lt;br /&gt;&lt;br /&gt;The rules around the stock are extremely easy: you should avoid having barrel touch the stock at all costs; conversely, the receiver should contact the stock as tightly as possible. The techniques that ensure that are called "free floating the barrel" and "glass bedding the receiver".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Free floating the barrel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Given a very long stock that goes almost all the way to the muzzle this is hard to do without cutting off much of the forward section of the stock. Instead of doing this, you can sand a thin layer from the internal channel of the bottom part, remove the hand guard, and put a piece of cork board between the barrel and the tip of the stock:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGFtgdROI6I/AAAAAAAAAiM/Lku8SAmy-f8/s1600/Mosin+stock+barrel+channel+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="242" mx="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGFtgdROI6I/AAAAAAAAAiM/Lku8SAmy-f8/s640/Mosin+stock+barrel+channel+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGFtmoyjhaI/AAAAAAAAAiU/4Luftl9BrdY/s1600/Mosin+stock+shimmed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" mx="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGFtmoyjhaI/AAAAAAAAAiU/4Luftl9BrdY/s640/Mosin+stock+shimmed.jpg" width="494" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To test that there is no contact between the stock and the barrel, put a dollar bill between the stock and the barrel forward of the corkboard shim and slide it towards the receiver. The paper should slide freely.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Glass bedding the receiver&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the shot group has a wide (2"-3") dispersion in the vertical axis the culprit is almost always the bad contact between the stock and the receiver. To fix this, the receiver is "bedded" into the stock with a layer of epoxy. Alongside free floating the barrel, this is the best way to improve the accuracy of an existing gun.&lt;br /&gt;&lt;br /&gt;To do this, the bottom layer of the receiver is covered with a release agent to make sure that epoxy does not glue it to the stock, the layer of epoxy is then placed on the stock near the recoil lug (the front part of the receiver), and the rear screw.&lt;br /&gt;&lt;br /&gt;The receiver is screwed in lightly, the layer of the epoxy that squeezes out from the sides is removed, and it is left to sit for a period of time.&lt;br /&gt;&lt;br /&gt;When the epoxy hardens, the receiver is lifted out of the stock, the release agent is cleaned off. Then the gun is put back together using normal (high) tension on the screws, and left alone for another 4-5 days until the epoxy cures completely.&lt;br /&gt;&lt;br /&gt;The results should look something like the following.&lt;br /&gt;&lt;br /&gt;1) Recoil lug&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGFz97A8mNI/AAAAAAAAAis/mHCTT7-oUu8/s1600/Mosin+glass+front+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="310" mx="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGFz97A8mNI/AAAAAAAAAis/mHCTT7-oUu8/s640/Mosin+glass+front+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;2) Rear screw&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGF0ErHRwoI/AAAAAAAAAi0/sLoViptsJ5I/s1600/Mosin+glass+rear+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="328" mx="true" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGF0ErHRwoI/AAAAAAAAAi0/sLoViptsJ5I/s640/Mosin+glass+rear+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;A few tips...&lt;br /&gt;&lt;br /&gt;1) I have used both the Acraglas Gel (you can find it at &lt;a href="http://www.brownells.com/"&gt;http://www.brownells.com/&lt;/a&gt;) and JB Weld (the technique is described here: &lt;a href="http://www.theboxotruth.com/docs/edu75.htm"&gt;http://www.theboxotruth.com/docs/edu75.htm&lt;/a&gt;) and the results seem to be the same with JB Weld being much cheaper ($6 vs. $25).&lt;br /&gt;&lt;br /&gt;2) If you do use Acraglas, be sure to use the car wax as a release agent (again, see here: &lt;a href="http://www.theboxotruth.com/docs/edu75.htm"&gt;http://www.theboxotruth.com/docs/edu75.htm&lt;/a&gt;&amp;nbsp;for the pictures), the release agent that ships with the kit does not work very well.&lt;br /&gt;&lt;br /&gt;3) Less is more in this case. You can always repeat the process if you put too little, but if you put too much, you will have sticky goo all over your stock, the barrel, and the receiver that will be hard to get off.&lt;br /&gt;&lt;br /&gt;4) Remove a 2-3 mm layer of wood saturated with oil and lacquer from the bedding area using a Dremmel tool. If you don't, the epoxy mold may not stick, or you will have contact problems between the bedding and the wood.&lt;br /&gt;&lt;br /&gt;5) If you use Acraglas, be sure to read the manual completely before starting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-8861094014582281543?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/8861094014582281543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=8861094014582281543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8861094014582281543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/8861094014582281543'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-5.html' title='How to make a sniper rifle. Part 5: Accurizing a Mosin Nagant'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGFtgdROI6I/AAAAAAAAAiM/Lku8SAmy-f8/s72-c/Mosin+stock+barrel+channel+clipped.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-377264823769901560</id><published>2010-08-09T22:50:00.000-07:00</published><updated>2010-08-30T20:53:43.907-07:00</updated><title type='text'>How to make a sniper rifle. Part 4: Disassembling a Mosin Nagant</title><content type='html'>[This is the part&amp;nbsp;4 of the series. Table of contents: &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;Note: I will use a sniperized version of Mosin Nagant. It has the top handguard removed, the side rail for the scope installed, and the bolt handle turned down. The disassembly of the rifle is exactly the same.&lt;br /&gt;&lt;br /&gt;1) Open the action by rotating the bolt handle up and pulling it all the way back.&lt;br /&gt;&lt;br /&gt;2) Depress the trigger and continuing to&amp;nbsp;pull the bolt back remove it from the rifle.&lt;br /&gt;&lt;br /&gt;3) Pull the metal bands that hold the top hanguard in place around the barrel up towards the muzzle and remove the handguard. The barrel bands will not come off, so just leave them hanging around the barrel.&lt;br /&gt;&lt;br /&gt;4) There are two screws that hold the stock and the rifle together. One is at the bottom middle of the rifle, the other is at the top rear of the receiver.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDXkOU0mhI/AAAAAAAAAgc/itxg7ADeO6Y/s1600/Mosin+screws.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="592" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDXkOU0mhI/AAAAAAAAAgc/itxg7ADeO6Y/s640/Mosin+screws.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Unscrew them and the barrel, the receiver, and the magazine will come apart.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDbEGHJYhI/AAAAAAAAAgk/CkWClo2xGi0/s1600/Mosin+disassembled.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDbEGHJYhI/AAAAAAAAAgk/CkWClo2xGi0/s640/Mosin+disassembled.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;5) For extra credit, you can remove the trigger by unscrewing the retaining screw at the bottom of the receiver, and the ejector from the left side.&lt;br /&gt;&lt;br /&gt;6) To disassemble the magazine, press on the retaining lip at the very bottom of it and the floor plate will drop off.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDcEQsN9rI/AAAAAAAAAgs/mm4BehzFlLw/s1600/Mosin+Mag+with+open+floor+plate.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDcEQsN9rI/AAAAAAAAAgs/mm4BehzFlLw/s640/Mosin+Mag+with+open+floor+plate.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Squeeze the spring and the floor plate together...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDdLffYVNI/AAAAAAAAAg0/BbgNOan3dKQ/s1600/Mosin+mag+depressed+spring.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDdLffYVNI/AAAAAAAAAg0/BbgNOan3dKQ/s640/Mosin+mag+depressed+spring.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;... and you can remove it out of the magazine housing...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDdiaqcghI/AAAAAAAAAg8/40KuoRMTLzI/s1600/Mosin+mag+squeezing+spring.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDdiaqcghI/AAAAAAAAAg8/40KuoRMTLzI/s640/Mosin+mag+squeezing+spring.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is the fully disassembled magazine:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDeDkYrSTI/AAAAAAAAAhE/a3BYXzaFzZA/s1600/Mosin+mag+removed+spring.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDeDkYrSTI/AAAAAAAAAhE/a3BYXzaFzZA/s640/Mosin+mag+removed+spring.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;7) On to the bolt. The bolt I am using is a sniper bolt, it has the handle turned in so it does not interfere with the scope. It is exactly identical to an ordinary bolt in all other respects.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDfrr5nCSI/AAAAAAAAAhM/Eb4H-3EaMjc/s1600/Mosin+sniper+bolt+assembled.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDfrr5nCSI/AAAAAAAAAhM/Eb4H-3EaMjc/s640/Mosin+sniper+bolt+assembled.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;First, note the notch on the rear of the bolt. It indicates the exact position to which the pin will need to be screwed upon reassembly.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDgsQqZJ2I/AAAAAAAAAhc/m4CtQp3nALk/s1600/Mosin+sniper+bolt+note+the+notch+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="556" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDgsQqZJ2I/AAAAAAAAAhc/m4CtQp3nALk/s640/Mosin+sniper+bolt+note+the+notch+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Then grab the body of the bolt (the part of the bolt that houses the handle) and the rear part of the bolt, pull them apart sligtly, and rotate the head counterclockwise relative to the body 90 degrees. The spring will relax, and both the connector and the bolt head will come off: Before taking the head off, however, note how it aligns with the bolt body - it will help you put it back on.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDhmrJVx7I/AAAAAAAAAhk/8o4WntZDk04/s1600/Mosin+sniper+bolt+state+1+disassembly+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="316" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDhmrJVx7I/AAAAAAAAAhk/8o4WntZDk04/s640/Mosin+sniper+bolt+state+1+disassembly+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Now take the connector (the longish metal piece with the forked end) and using the forked end against the pin, start unscrewing the pin from the body. DO NOT POINT THE PIN END TO ANYTHING LIVING OR BREAKABLE - when the thread ends the pin will fly out propelled by the spring. Hold on to both the bolt body and the connector tightly.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDiWU5jKqI/AAAAAAAAAhs/AgyN-3RN6bg/s1600/Mosin+sniper+bolt+pin+screwing+unscrewing.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="640" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDiWU5jKqI/AAAAAAAAAhs/AgyN-3RN6bg/s640/Mosin+sniper+bolt+pin+screwing+unscrewing.JPG" width="426" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When the pin is unscrewed, the bolt will come apart (and it may come apart violently, so be prepared!)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDiy8IyKnI/AAAAAAAAAh0/Hh0NmrG5-5Y/s1600/Mosin+sniper+bolt+disassembled.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDiy8IyKnI/AAAAAAAAAh0/Hh0NmrG5-5Y/s640/Mosin+sniper+bolt+disassembled.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To reassemble the bolt, put together the cocking piece (the part of the bolt with the notch into which the pin screws in) against the bolt body. Insert the spring, then, holding the pin by the forked end of the bolt connector, push the pin into the the bolt body and towards the cocking piece.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDiWU5jKqI/AAAAAAAAAhs/AgyN-3RN6bg/s1600/Mosin+sniper+bolt+pin+screwing+unscrewing.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="640" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDiWU5jKqI/AAAAAAAAAhs/AgyN-3RN6bg/s640/Mosin+sniper+bolt+pin+screwing+unscrewing.JPG" width="426" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When the end of the pin and the cocking piece meets, rotate it so that the threads engage. Then continue using the connector to screw the pin in until the notches on the cocking piece and the pin align back again.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDgsQqZJ2I/AAAAAAAAAhc/m4CtQp3nALk/s1600/Mosin+sniper+bolt+note+the+notch+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDgsQqZJ2I/AAAAAAAAAhc/m4CtQp3nALk/s320/Mosin+sniper+bolt+note+the+notch+clipped.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Then insert the connector so that the forking piece aligns with the ledge on the cocking piece.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDnLUjgxnI/AAAAAAAAAh8/n1I89NRt7kE/s1600/Mosin+sniper+bolt+connector+alignment+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="388" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDnLUjgxnI/AAAAAAAAAh8/n1I89NRt7kE/s640/Mosin+sniper+bolt+connector+alignment+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Then put the bolt head back on...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDnixH-U0I/AAAAAAAAAiE/XFbs7ra-CbA/s1600/Mosin+sniper+bolt+head+in+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="428" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDnixH-U0I/AAAAAAAAAiE/XFbs7ra-CbA/s640/Mosin+sniper+bolt+head+in+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;...and rotate it so that the slots on the body and the head are properly aligned.&lt;br /&gt;&lt;br /&gt;Now take the cocking piece and the body, and pull them apart while rotating 90 degrees clockwise, compressing the spring and locking the head and connector into the body.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDfrr5nCSI/AAAAAAAAAhM/Eb4H-3EaMjc/s1600/Mosin+sniper+bolt+assembled.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDfrr5nCSI/AAAAAAAAAhM/Eb4H-3EaMjc/s640/Mosin+sniper+bolt+assembled.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Your bolt is back to assembled!&lt;br /&gt;&lt;br /&gt;After you do it two or three times you will be able to completely disassemble and reassemble you Mosin Nagant, bolt and all, in the space of barely five minutes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-377264823769901560?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/377264823769901560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=377264823769901560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/377264823769901560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/377264823769901560'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-4.html' title='How to make a sniper rifle. Part 4: Disassembling a Mosin Nagant'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDXkOU0mhI/AAAAAAAAAgc/itxg7ADeO6Y/s72-c/Mosin+screws.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-7812126311984388267</id><published>2010-08-09T21:18:00.000-07:00</published><updated>2010-08-30T20:54:15.948-07:00</updated><title type='text'>How to make a sniper rifle. Part 3: Cleaning a Mosin Nagant.</title><content type='html'>[This is the part&amp;nbsp;3 of the series. Table of contents: &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;To properly clean a rifle, any rifle, you need the following tools:&lt;br /&gt;&lt;br /&gt;1) A coated single-piece cleaning rod. Avoid rods with exposed metal surface, and especially multi-segment aluminum rods that need to be screwed together: they can damage the rifling in the bore. You need a .270 caliber and up, at least 36". For example, "Bore Tech V-Stix 1-Piece Cleaning Rod 270 Caliber 36" Coated Steel" can be had from &lt;a href="http://www.midwayusa.com/"&gt;http://www.midwayusa.com/&lt;/a&gt;&amp;nbsp;for ~$25 as of this writing.&lt;br /&gt;&lt;br /&gt;2) A nylon brush and a nylon or coated patch puller. Do not use brass, it does not work well with the cleaning solution I will recommend below! ~$2 per accessory. Also, &lt;a href="http://www.midwayusa.com/"&gt;http://www.midwayusa.com/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDKIow9qJI/AAAAAAAAAfk/khPwQKs9KZ8/s1600/Rod+end+accessories+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDKIow9qJI/AAAAAAAAAfk/khPwQKs9KZ8/s320/Rod+end+accessories+clipped.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;3) A bore guide. This implement inserts into the rifle chamber and guides the rod so that it goes into the bore parallel to the symmetry axis and does not damage the rifling near the entry point. ~$20-25. Note: I have not found the bore guide that fits Mosin Nagant perfectly. I reuse mine from other .308 rifles that I have, but to fit it in I have to remove the handle. Consider buying it from a local gun shop so you could bring the rifle in and ensure that it does fit.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDL0yQH8hI/AAAAAAAAAf0/uVTkA_zcY5Q/s1600/Bore+guide+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDL0yQH8hI/AAAAAAAAAf0/uVTkA_zcY5Q/s320/Bore+guide+clipped.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;4) .30 caliber cleaning patches. You can either buy them or make them yourself from an old bed sheet.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDLKvIzNgI/AAAAAAAAAfs/vgAwgMoioGI/s1600/Patches.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDLKvIzNgI/AAAAAAAAAfs/vgAwgMoioGI/s320/Patches.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;5) Cleaning fluid. Of all I've used, the BoreTech Eliminator and BoreTech C4 Carbon Remover are by far - by far! the best. Buy the biggest bottles you can find. $22 and $18, &lt;a href="http://www.midwayusa.com/"&gt;http://www.midwayusa.com/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDOPr3RzmI/AAAAAAAAAgM/kFh1HDPIbUs/s1600/Bore+Tech.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDOPr3RzmI/AAAAAAAAAgM/kFh1HDPIbUs/s320/Bore+Tech.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;6) Oil. Break Free CLP is the best. Buy a 16 oz bottle.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDQfIRRp_I/AAAAAAAAAgU/-3xjiPL5NdA/s1600/Break+Free+CLP.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TGDQfIRRp_I/AAAAAAAAAgU/-3xjiPL5NdA/s320/Break+Free+CLP.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Overall, the cleaning supplies will set you back just around $100. Amazingly expensive for a $100 rifle, but you can reuse them for a different gun as well.&lt;br /&gt;&lt;br /&gt;To clean the gun:&lt;br /&gt;1) Turn the bolt up...&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDM-BlIMLI/AAAAAAAAAf8/2kFIuuz4lFs/s1600/Mosin+hex+action+handle+raised+from+the+side.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TGDM-BlIMLI/AAAAAAAAAf8/2kFIuuz4lFs/s640/Mosin+hex+action+handle+raised+from+the+side.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;2) ...then move it back all the way. When it stops moving, depress the trigger and, continuing moving it, pull it out of the rifle.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDNeRqREFI/AAAAAAAAAgE/1fjqA8kzCJk/s1600/Mosin+hex+action+open.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="424" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TGDNeRqREFI/AAAAAAAAAgE/1fjqA8kzCJk/s640/Mosin+hex+action+open.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;3) Put the bore guide into the chamber. The handle on a bore guide imitates the bolt handle, and can be screwed in or out a little bit making the body slide along the tube. You will need to find exactly the right position so that the tube is inserted all the way, and the handle of the bore guide is locked in just like the bolt of the gun would be. Depending on the bore guide, the handle may have to be removed for the tube to fit.&lt;br /&gt;&lt;br /&gt;4) First use the C4 remover. Follow instructions on the bottle, you may have to go through 5-6 cycles before the patch is coming out relatively clean.&lt;br /&gt;&lt;br /&gt;5) Dry the bore out with 3-4 clean patches.&lt;br /&gt;&lt;br /&gt;6) Switch to the Eliminator and do another 5-6 cycles with that until the blue hue (mostly) disappears.&lt;br /&gt;&lt;br /&gt;7) Dry the bore out with 3-4 more clean patches.&lt;br /&gt;&lt;br /&gt;8) Cover a patch with the liberal amount of Break Free CLP and run it through the bore.&lt;br /&gt;&lt;br /&gt;9) Remove the bore guide.&lt;br /&gt;&lt;br /&gt;10) Using a clean patch in a patch holder, push it into the chamber and rotate the rod back in forth so the leaks of the Bore Tech products are cleaned out. Repeat with the patch covered in Break Free CLP.&lt;br /&gt;&lt;br /&gt;11) Using a patch covered in Break Free CLP, wipe the metal parts of the gun. The metal should be slightly oily, but not wet with oil. Excessive amount of oil will damage the stock and make the gun less accurate because of lessening the contact between the stock and the receiver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-7812126311984388267?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/7812126311984388267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=7812126311984388267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7812126311984388267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/7812126311984388267'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-3.html' title='How to make a sniper rifle. Part 3: Cleaning a Mosin Nagant.'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_VsIB2Nr2f1c/TGDKIow9qJI/AAAAAAAAAfk/khPwQKs9KZ8/s72-c/Rod+end+accessories+clipped.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-340015660520539930</id><published>2010-08-09T00:51:00.000-07:00</published><updated>2010-08-30T20:55:02.663-07:00</updated><title type='text'>How to make a sniper rifle. Part 2: Buying a Mosin Nagant</title><content type='html'>[This is the part&amp;nbsp;2 of the series. Table of contents: &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-table-of.html&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;You can buy a Mosin Nagant either in a local store, or on the internet.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Buying from the store&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Big 5 has periodic sales on them for $89-$99, and Cabela's usually has them at $150, or $99 on sale. Stocks in these stores are typically limited to guns built in 1942-1944, which is right in the middle of the war when Soviet factories were churning them out by the million. Considering the rush to production, I would venture a guess that these are not the best rifles. However, the first rifle I bought was from the store, and was made in 1937, so exceptions do exist. Also, rifles sold through the stores are more likely to have the numbers on the receiver, the stock, and the bolt match.&lt;br /&gt;&lt;br /&gt;If you do buy your rifle in the store, consider bringing a flexible LED light with you, so you can illuminate the inside of the barrel from the receiver side and take a good look inside. The barrel should have strong and uniform rifling, no rust, and be at least gunmetal gray - the best bores are mirror-like shiny. There should be no pitting on the metal.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TF-cOzW-keI/AAAAAAAAAe0/FQV0zuKGrQs/s1600/Bore+lights+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="400" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TF-cOzW-keI/AAAAAAAAAe0/FQV0zuKGrQs/s400/Bore+lights+clipped.jpg" width="328" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Look at the crown (the muzzle side of the barrel). It should be symmetric and rifling next to the crown should be present and not damaged. On some rifles you might find a condition called "counterboring" - the rifling in the vicinity of the crown being removed. This is done when the rofling at the muzzle is damaged. Stay away.&lt;br /&gt;&lt;br /&gt;This is what an acceptable crown should look like:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-cbg-kTwI/AAAAAAAAAe8/plgL0fd2_Go/s1600/Mosin+crown+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="612" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-cbg-kTwI/AAAAAAAAAe8/plgL0fd2_Go/s640/Mosin+crown+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;If the crown is not exactly round, or there are chips or scratches on it, as the bullet is leaving the bore the gas will exit around it unevenly and deflect the bullet.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;A note about the gun shows...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Gun shows can be great for running into a unique piece of antique weaponry by accident, but they are not good at all for aquiring run of the mill guns. I've gone to quite a few in the recent years, and the prices were atrociously high - a PSL 54c, for example, which can be had - new - for under $600 in most internet shops would consistently go for $800 or more on a gun show. The prices on all other guns - AKs ($600 for something that's $350 on the Internet), Garands ($800 for a $500 gun), and, yes, Mosins, were similarly higher than on the Internet - or in a retail store. Unfortunately I&amp;nbsp;found the same to be true for everything else - from reloading equipment to optics to components to ammunition, so I quit going there a few months ago.&lt;br /&gt;The best way to buy Mosin Nagants is on the internet. This is where you get the best prices, and the widest selection. There is one complication though: weapons cannot ship to an individual, they must arrive at the licensed firearms dealer. So you have to go to a local gun shop, pay them the transfer fee of around $40 (in Seattle area), and have the gun ship to them instead of you.&lt;br /&gt;&lt;br /&gt;Paying $50 for transfer and the shipping cost of a $70 rifle is extremely painful, and there is a relatively easy way around it: you can get a so-called C&amp;amp;R (collectables and relics) license that allows individual gun collectors buy certain classes of weapons remotely and having them shipped directly. Mosin Nagants, along with almost all other WWII weapons,&amp;nbsp;qualify as a C&amp;amp;R purchase.&lt;br /&gt;&lt;br /&gt;The license costs $30 for 3 years, and pays for itself on the very first transaction. Furthermore, it allows you to buy weapons and other gun-related at dealers-only prices at some distributors. It allows certain other benefits, for example, being able to buy guns though Civilian Marksmanship Program. I highly recommend getting it.&lt;br /&gt;&lt;br /&gt;The only disadvantage is that it takes quite a while (a couple of months) to get. Even getting the form takes forever, since it arrives by snail mail - there is no internet download. So start early.&lt;br /&gt;&lt;br /&gt;Here is how to get it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Getting a C&amp;amp;R license&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Go here: &lt;a href="http://www.atf.gov/forms/dcof/index.htm"&gt;http://www.atf.gov/forms/dcof/index.htm&lt;/a&gt;. Enter your name, email, the phone number (xxx-xxx-xxxx, the form checks this format!) and the mailing address.&lt;br /&gt;&lt;br /&gt;Then on the right side of the form select "F 7CR (5310.16) - Application for License (Collector of Curios and Relics) Under 18 U.S.C. Chapter 44, Firearms" and click the "Add" button above. Get a couple of copies in case you spoil the first one. Click the Submit button for the form.&lt;br /&gt;&lt;br /&gt;Then wait. When you receive the form, fill it out (it is not very complicated) and send it in.&lt;br /&gt;&lt;br /&gt;When you get your license, make several copies. Sign each copy individually (NOT the original), because you will need to send copies with your original (not copied) signature to the internet stores.&lt;br /&gt;&lt;br /&gt;For the reference, here's the best article on C&amp;amp;R license. The links on it are obsolete, but the information is useful: &lt;a href="http://www.surplusrifle.com/shooting2005/howtogetyourcurionrelicffl03/index.asp"&gt;http://www.surplusrifle.com/shooting2005/howtogetyourcurionrelicffl03/index.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Buying on the Internet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now that you are able to buy on the internet, the horizons are much wider. You are no longer limited to what's available in the store, so - what should you buy?&lt;br /&gt;&lt;br /&gt;As I said previously, I would stay away from rifles made during the war. Unfortunately, most of the internet stores do not allow you to pick a year of manufacture. You can, however, - and I strongly recommend that you do - ensure that the rifle was made before the war by buying one with a hex receiver - they were not making guns with hex receivers during WWII.&lt;br /&gt;&lt;br /&gt;This is an example of a hex action:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-tf7lnYbI/AAAAAAAAAfE/NQkDPT-WSFY/s1600/Mosin+hex+action+from+top.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-tf7lnYbI/AAAAAAAAAfE/NQkDPT-WSFY/s640/Mosin+hex+action+from+top.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There are 3 basic choices of manufacturers for Mosin Nagants - Tula, Izhevsk, and two factories in Finland.&lt;br /&gt;&lt;br /&gt;The differences between Tula and Izhevsk are not huge, although Tula rifles are considered to be marginally better. I don't think the difference is material.&lt;br /&gt;&lt;br /&gt;Finn rifles are typically better quality, and shoot better, but they are more expenisve than Russian (usually in $200-$300 range vs. &amp;lt;$100), and their bore is narrower - a proper .308 caliber vs .311 that is the case with Russian guns. &lt;strong&gt;Which means that if you shoot any factory 7.62x54R ammo (surplus OR newer production) in them, you will have ruined the rifle.&lt;/strong&gt; Stay away from Finn rifles unless you know what you are doing!&lt;br /&gt;&lt;br /&gt;Finally, there are so-called "sniper" rifles that you will frequently encounter on the 'Net. There are two types of them.&lt;br /&gt;&lt;br /&gt;First, the "ex-sniper" rifles with the scope rail removed, and the screws which were used to attach it filled. The reason they are "ex" is because they no longer shoot well enough to qualify as a sniper rifle, so I do not recommend buying them.&lt;br /&gt;&lt;br /&gt;Second, there are "sniper" rifles with the scope, in $400-$450 price range. Read the fine print - they are not really sniper rifles. They are just regular Mosins with a reproduction WWII scope added to them recently. They don't shoot any better than your average rifle, the scope rings only allow for one particular scope - they do not support modern scopes - and that scope's maximum magnification is only 2.5. That was good enough during the WWII, given the infinite supply of the gun fodder, but not today. You can do far, far better for the money.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TF-x8aFiP0I/AAAAAAAAAfc/FYnO7LlU-lw/s1600/Mosin+Ukrainean+sniper.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="404" src="http://1.bp.blogspot.com/_VsIB2Nr2f1c/TF-x8aFiP0I/AAAAAAAAAfc/FYnO7LlU-lw/s640/Mosin+Ukrainean+sniper.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When a store offers you a choice of hand selection for an extra fee, pay the fee, otherwise you will be getting the rifle which the hand selection process have rejected. Most of the stores pre-sort their rifles by quality, rather than really selecting them at the time of shipping the order. For extra $10 you will ensure that your rifle is in the top 10%.&lt;br /&gt;&lt;br /&gt;One "disadvantage" of buying on the internet is that very likely you will be getting a rifle with the numbers that either do not match, or the numbers on the stock, the bolt, and the magazine were removed and a cheap-looking electric pencil record was made instead to match the barrel. In my opinion, this is OK since we will be modifying the rifle anyway. It would be a shame to destroy a perfectly preserved specimen, whereas these rifles have little to no historical value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TF-uRtBKrcI/AAAAAAAAAfU/iQWzLERGJEo/s1600/Mosin+forced+match+clipped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="220" src="http://2.bp.blogspot.com/_VsIB2Nr2f1c/TF-uRtBKrcI/AAAAAAAAAfU/iQWzLERGJEo/s640/Mosin+forced+match+clipped.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Here's a roundup of the best internet sources of Mosin Nagants.&lt;br /&gt;&lt;br /&gt;J&amp;amp;G Sales, &lt;a href="http://www.jgsales.com/"&gt;http://www.jgsales.com/&lt;/a&gt;. This is by far the best place, because they offer, for an extra $30, hand selection for the bore quality. This service is worth its cost and then some - the rifles I got from them had absolutely perfect bores.&lt;br /&gt;&lt;br /&gt;SOG International (AKA Southern Ohio Gun Distributors), &lt;a href="http://southernohiogun.com/"&gt;http://southernohiogun.com/&lt;/a&gt;. They have the cheapest rates, and the worst web site with no browse function. To look for Mosin Nagants, search for MN. Because of the terrible website layout things that would be gone in a day from other stores linger here, so you can occasionally find a diamond in the rough, for the price of a cubic zirconia.&lt;br /&gt;&lt;br /&gt;Century Arms International, &lt;a href="http://centuryarms.biz/"&gt;http://centuryarms.biz/&lt;/a&gt;. You have to have a C&amp;amp;R to even see their prices, and the prices are not even that great. They are the main importer of these rifles, everyone else merely distributes them, and so you'd expect that the prices and the quality at the source is great, but it's not. The one big advantage here is that shipping is free. They do occasionally have sales where you can buy 5 rifles inexpensively.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-340015660520539930?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/340015660520539930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=340015660520539930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/340015660520539930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/340015660520539930'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-2-buying.html' title='How to make a sniper rifle. Part 2: Buying a Mosin Nagant'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://www.solyanik.com/images/sergeys.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VsIB2Nr2f1c/TF-cOzW-keI/AAAAAAAAAe0/FQV0zuKGrQs/s72-c/Bore+lights+clipped.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3554166144204741789.post-4944030757673272384</id><published>2010-08-08T22:30:00.000-07:00</published><updated>2010-08-30T20:56:31.914-07:00</updated><title type='text'>How to make a sniper rifle. Part 1: Introduction</title><content type='html'>One of the interesting outcomes of the collapse of the Soviet Union was flooding of international gun markets with old Russian weapons, among them hundreds of thousands of Mosin Nagant rifles.&lt;br /&gt;&lt;br /&gt;Mosin Nagant was the workhorse of Russian and then Soviet armies for over half a century. The first model was standardized on in 1891 (Трехлинейная винтовка образца 1891 года), then went through a gradual redesign through 1920s which culminated in what is now called M91/30. One could say that M91/30 won WWII because it was by far the dominant infantry weapon in the Red Army until the introduction of AK-47 in 1950s. (I am leaving out a lot of history; if you are interested in full details click here: &lt;a href="http://en.wikipedia.org/wiki/Mosin-Nagant"&gt;http://en.wikipedia.org/wiki/Mosin-Nagant&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Over the decades there were 17 millions or so of these rifles made, and quite&amp;nbsp;a bit of them were packed up in cosmoline and left to sit in crates in Soviet arsenals until the fall of the Iron Curtain. Now the contents of these arsenals are turning up in gun shops across the US, and because of the sheer volume the prices are extremely low - you can buy a complete rifle in good condition, with accessories (bayonet, the oil bottle, the tool kit, and the ammo pouch) for under $70 on the internet.&lt;br /&gt;&lt;br /&gt;When I first seen it in store (it was in now defunct GI Joe's Sporting Goods, and it cost $89) I was floored. Really? I can own a WWII rifle for less than a hundred dollars? So of course I bought one on the spot, but also started looking for them on the internet. Pretty soon I found quite a few places with fantastic prices, and ended up with a large number of these rifles, some of more, some of less historical value.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-RiqOUDZI/AAAAAAAAAek/xOfnn7oFFjA/s1600/Mosin+assembled.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-RiqOUDZI/AAAAAAAAAek/xOfnn7oFFjA/s640/Mosin+assembled.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And now that I had some that were not that unique and so could be shot or even modified, I started wondering whether I could make them shoot really well. Thus the Mosin Nagant Sniper project was born, and the next several posts will document my experience with building an accurate rifle out of an M91/30.&lt;br /&gt;&lt;br /&gt;Before we go into details, however, I need to clarify what "accurate" means for the purpose of this project, and what the motivations for building an "accurate" Mosing Nagant should - and should not - be.&lt;br /&gt;&lt;br /&gt;Accuracy of a rifle is measured by the angular dispersion of the shots. The standard unit is MOA, a "minute of an angle" (1/60 of 1 degree, or pi/(180 * 60) rad). At 100 meters it is then 100 * tan(pi/10800) = 29.1mm, or almost exactly 1 inch&amp;nbsp;at a distance of&amp;nbsp;100 yards in imperial units. So if a 5-shot group fired at a target at 100 yards all lies inside a circle with the diameter of 1 inch, the rifle's accuracy is 1 MOA.&lt;br /&gt;&lt;br /&gt;Note that the actual impact point does not matter - only the dispersion of the group. The (average) impact point is easy to move by adjusting the scope if the dispersion is small. Here, for example, I shot 4 groups off target, then clicked the scope 0.5" up and 0.5" to the right and shot the next 4 groups on target.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-SF917M7I/AAAAAAAAAes/LBMI4ULidh4/s1600/Savage+LRPV+target+100m+77gr+Federal+Match.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="426" src="http://4.bp.blogspot.com/_VsIB2Nr2f1c/TF-SF917M7I/AAAAAAAAAes/LBMI4ULidh4/s640/Savage+LRPV+target+100m+77gr+Federal+Match.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;(This was shot using a borrowed Savage 12 LRPV at a 100 yards)&lt;br /&gt;&lt;br /&gt;A typical modern Savage rifle with the price range of $600-$1000 should easily shoot 1 MOA 5-shot groups, and the size shrinks to 0.5 MOA towards the $1000 end of the spectrum. A typical benchrest rifle would be around 0.25MOA. Current benchrest shooting records are all below (way below) 0.1MOA.&lt;br /&gt;&lt;br /&gt;Interestingly, military sniper rifles are nowhere near the performance of good commercial rifles. Dragunov is designed to shoot around 0.7MOA, as are most US and European police and military sniper rifles. And even that performance was only achieved relatively recently - WWII sniper rifles on all sides were shooting far, far worse.&lt;br /&gt;&lt;br /&gt;Which means that even "accurised" Mosin Nagant will never be a match of an accurate modern rifle such as Savage 10FP, Savage 12LRPV, or Remington 700P. They have a very long (28") thin barrel which is not very rigid, a fairly heavy trigger that can be adjusted only so far, and the build tolerances that are far below the modern standards. I got the one rifle that I completed and tested down to 1-1.5MOA, and I think this is the limit to which a Mosin can be taken.&lt;br /&gt;&lt;br /&gt;So if you want a really accurate gun, don't do what I did, go buy one of these, and you will not be disappointed:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TF-Ih6bWXtI/AAAAAAAAAec/mTp039ecCaQ/s1600/LRPV.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" height="640" src="http://3.bp.blogspot.com/_VsIB2Nr2f1c/TF-Ih6bWXtI/AAAAAAAAAec/mTp039ecCaQ/s640/LRPV.jpg" width="627" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Of course, if you do shoot 1.5MOA, you will still be doing much better than 95% of the people on the range. Most AKs, AR-15s, and Berettas&amp;nbsp;that I've seen around our shooting range produce 3-5MOA groups, and "out of the box" Mosin would do even worse.&lt;br /&gt;&lt;br /&gt;However, to get to 1.5MOA you would have to make your own ammo.&lt;br /&gt;&lt;br /&gt;There is plenty of surplus ammunition coming from the same sources as the rifles which is extremely inexpensive. For example, Bulgarian surplus rounds can be had for under $80 for a tin of 440, which makes the price only $0.18 per round. By comparison, modern match ammunition is usually $2+ per round, and modern "cheap" ammo is almost never below $0.50.&lt;br /&gt;&lt;br /&gt;Unfortunately, surplus ammo is very innacurate. I tried all the brands - Bulgarian, Russian, and Hungarian - and could never get groups below 3MOA, even with the "sniperised" gun.&lt;br /&gt;&lt;br /&gt;There is sligtly more accurate modern production Russian ammunition, but even that would not shoot below 2.5MOA, and it is no longer cheap at $0.90/round. There is, however, absolutely no match-grade ammunition.&lt;br /&gt;&lt;br /&gt;More about ammo in one of the follow-up posts.&lt;br /&gt;The other disadvantage of owning a Mosin Nagant is the fact that the barrels are relatively hard to replace: it is simply not worth it. Buying the barrel-receiver combination is actually cheaper than having a gunsmith replace a barrel in the receiver, so there are very little barrels available for Mosins. The barrel will last for 3000-5000 shots, maximum, and after that the whole rifle is gone. You can replace the barrel and the receiver, but quite a few accurising operations will then have to be repeated.&lt;br /&gt;&lt;br /&gt;What are the motivations for owning and accurising a Mosin Nagant then?&lt;br /&gt;&lt;br /&gt;First, it's an extremely simple, cheap, and practically indestructible&amp;nbsp;rifle, and as such is an excellent platform on which you can learn about firearms.&lt;br /&gt;&lt;br /&gt;Second, there is a source of cheap ammunition which, although inaccurate, can still be used for mundane tasks such as tuning the scope without breaking the bank.&lt;br /&gt;&lt;br /&gt;Third, accurising it is a relatively inexpensive and fun mechanical project that produces tangible results almost immediately.&lt;br /&gt;&lt;br /&gt;Still with me? On to the actual work...&lt;br /&gt;&lt;br /&gt;Part 2: Buying a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-2-buying.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-2-buying.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 3: Cleaning a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-3.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-3.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 4: Disassembling a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-4.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-4.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 5: Accurizing a Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-5.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-5.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 6: Selecting a scope mount&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-6.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-6.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Part 7: Mounting a side rail on the Mosin Nagant&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-7-scope.html"&gt;http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle-part-7-scope.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3554166144204741789-4944030757673272384?l=1-800-magic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://1-800-magic.blogspot.com/feeds/4944030757673272384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3554166144204741789&amp;postID=4944030757673272384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4944030757673272384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3554166144204741789/posts/default/4944030757673272384'/><link rel='alternate' type='text/html' href='http://1-800-magic.blogspot.com/2010/08/how-to-make-sniper-rifle.html' title='How to make a sniper rifle. Part 1: Introduction'/><author><name>Sergey Solyanik</name><uri>http://www.blogger.com/profile/03811112928687191837</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumb
