<?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:blogger='http://schemas.google.com/blogger/2008' 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-1705508798207446456</id><updated>2026-06-16T18:02:24.490+01:00</updated><category term=".NET"/><category term="c#"/><category term="MS CRM"/><category term="Microsoft Dynamics CRM"/><category term="jmeter"/><category term="testlink"/><category term="Selenium"/><category term="db2"/><category term="CRM"/><category term="Performance test"/><category term="Visual Studio 2010"/><category term="tcl"/><category term="trac"/><category term="windows"/><category term="Automation"/><category term="Remote Desktop"/><category term="Visual Studio"/><category term="Visual Studio web test"/><category term="CRM Plugins"/><category term="Load test"/><category term="MS VS 2010"/><category term="SQL Server"/><category term="WCF"/><category term="excluding resources"/><category term="mysql"/><category term="regular expression extractor"/><category term="reports"/><category term="vhdl"/><category term="ASP NET C# Javascript escape single quote in server side script"/><category term="BLOGGER BUG"/><category term="Breakpoint"/><category term="CRM4"/><category term="Changing Business Unit"/><category term="CollectionAssert"/><category term="Comma separated parameter"/><category term="Compare"/><category term="Control Center"/><category term="Custome Data Field"/><category term="Customization"/><category term="DB2 .NET Data Provider"/><category term="Dynamic Columns"/><category term="Extraction Rule"/><category term="GCD"/><category term="GroupBox Control"/><category term="JDBC"/><category term="Keyboard shortcuts"/><category term="MMU"/><category term="MacBook"/><category term="Miller Rabin"/><category term="MissingMethodException"/><category term="Multiple connections to a server or shared resource by the same user"/><category term="Preparing Test Data"/><category term="Primality Test"/><category term="RSA"/><category term="Response Assertion"/><category term="Retrieving Articles"/><category term="Serialize"/><category term="Stored Procedure"/><category term="Symantec Endpoint"/><category term="TabControl"/><category term="Test Data"/><category term="Toad"/><category term="Transparent Frame"/><category term="Trigger"/><category term="TryParse"/><category term="UnitTestFrameWork"/><category term="Viewstate"/><category term="Visual Studio Web Test Random unique parameters"/><category term="Windows Forms"/><category term="XML"/><category term="algorithms"/><category term="automatic creation of folders"/><category term="automation test"/><category term="backup"/><category term="best practices"/><category term="best practices for coded UI tests"/><category term="bulk update"/><category term="c++"/><category term="coded web test"/><category term="codedUI test"/><category term="combinations"/><category term="custom view"/><category term="custome report"/><category term="data structures"/><category term="enum"/><category term="error"/><category term="error accessing shared resource"/><category term="export test plan"/><category term="extended euclidean"/><category term="extracting"/><category term="hidden files"/><category term="ibm"/><category term="iframe"/><category term="import database"/><category term="isim"/><category term="java service"/><category term="new report"/><category term="parameters from CSV"/><category term="partition recovery"/><category term="passing parameter in query string"/><category term="phpmysql"/><category term="query string"/><category term="recover files"/><category term="recycling data"/><category term="results"/><category term="results by tester"/><category term="reversing characters"/><category term="simulation"/><category term="spring webflow"/><category term="test case"/><category term="testcase"/><category term="timeout"/><category term="trac testlink integration"/><category term="updating hidden fields"/><category term="updating readonly fields"/><category term="username token"/><category term="validate regular expression extractor"/><category term="vectors"/><category term="view host shared folders"/><category term="visual studio coded UI test"/><category term="vmware"/><category term="web test"/><category term="ws-security"/><category term="xmlrpc"/><title type='text'>Software engineer notes</title><subtitle type='html'>Here in this blog i am writing notes related to my work, sometimes i need to review something i did before, or i need to do it one more time. Also it might be helpful for anyone looking for an answer for situations similar to the ones i faced before</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>103</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-6363393569844893611</id><published>2020-01-10T16:38:00.004+00:00</published><updated>2020-01-10T16:38:39.562+00:00</updated><title type='text'>Import-Module Azure fails </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Import-Module : The specified module &#39;Azure&#39; was not loaded because no valid module file was found in any module&lt;br /&gt;
&lt;br /&gt;
Download the latest PowerShell SDK from&amp;nbsp;&lt;a data-linktype=&quot;external&quot; href=&quot;https://www.microsoft.com/web/handlers/webpi.ashx/getinstaller/WindowsAzurePowershellGet.3f.3f.3fnew.appids&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/6363393569844893611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2020/01/import-module-azure-fails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6363393569844893611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6363393569844893611'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2020/01/import-module-azure-fails.html' title='Import-Module Azure fails '/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-2200549086817732120</id><published>2020-01-09T14:45:00.003+00:00</published><updated>2020-01-10T10:26:50.859+00:00</updated><title type='text'>Delete all node_modules folders recursively</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In bash&lt;br /&gt;
&lt;br /&gt;
List&lt;br /&gt;
find . -name &quot;node_modules&quot; -type d -prune -print | xargs du -chs&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
find . -name &#39;node_modules&#39; -type d -prune -print -exec rm -rf &#39;{}&#39; \;&lt;br /&gt;
&lt;br /&gt;
Delete all bin/package folders&lt;br /&gt;
&lt;br /&gt;
List:&lt;br /&gt;
find . -path &quot;*/bin/package&quot; -type d&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
find . -path &quot;*/bin/package&quot; -type d -prune -print -exec rm -rf &#39;{}&#39; \;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/2200549086817732120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2020/01/delete-all-nodemodules-folders.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2200549086817732120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2200549086817732120'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2020/01/delete-all-nodemodules-folders.html' title='Delete all node_modules folders recursively'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-8418954370389582620</id><published>2019-12-03T14:04:00.002+00:00</published><updated>2019-12-04T15:08:49.340+00:00</updated><title type='text'>node-gyp build errors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If you get npm errors like:&lt;br /&gt;
&lt;br /&gt;
node_modules\crypt3\crypt3.cc(5,10): fatal error C1083: Cannot open include file: &#39;unistd.h&#39;: No such file or directory&amp;nbsp; node_modules\crypt3\build\crypt3.vcxproj&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
There are so many articles about resolving node-gyp errors. The one that worked for me and the easiest is&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: rgba(27 , 31 , 35 , 0.05); color: #24292e; font-family: , &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , monospace; font-size: 13.6px;&quot;&gt;npm install --global --production windows-build-tools&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
From:&lt;br /&gt;
&lt;a href=&quot;https://github.com/nodejs/node-gyp#on-windows&quot;&gt;https://github.com/nodejs/node-gyp#on-windows&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules&quot;&gt;https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/8418954370389582620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2019/12/node-gyp-build-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8418954370389582620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8418954370389582620'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2019/12/node-gyp-build-errors.html' title='node-gyp build errors'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-2949837865575651748</id><published>2019-10-07T17:40:00.001+01:00</published><updated>2019-10-08T15:49:24.631+01:00</updated><title type='text'>The file is locked by NET Core Host error</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Error&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MSB3027&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Could not copy &quot;obj\Debug\netcoreapp3.0\Project.Tests.dll&quot; to &quot;bin\Debug\netcoreapp3.0\Project.Tests.dll&quot;. Exceeded retry count of 10. Failed. The file is locked by: &quot;.NET Core Host (35124)&quot;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Project.Tests&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;4206&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Open task manager, find the Visual Studio process, like in the image below.&lt;br /&gt;
Locate the sub process .NET Core Host and terminate it.&lt;br /&gt;
This solved the building problem with me.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRzk7s6zHUX8xqmP7VsfOEJs-OPiWp_auBLSvBkvlZmcLHTudc6JC83hABf4sTw78USxN6Xgb0KnIMIxefNhU_hQUN-64PWNIuXxV5XBCCmkNYOgGA2PcTmiH-7d9atZIjbLa-Dc_ysPux/s1600/core.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;925&quot; data-original-width=&quot;1115&quot; height=&quot;529&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRzk7s6zHUX8xqmP7VsfOEJs-OPiWp_auBLSvBkvlZmcLHTudc6JC83hABf4sTw78USxN6Xgb0KnIMIxefNhU_hQUN-64PWNIuXxV5XBCCmkNYOgGA2PcTmiH-7d9atZIjbLa-Dc_ysPux/s640/core.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
It could appear separately as well&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWwC0Ibk_F1vgpSsBRw7dicJFfFHps53gzIWp0-vzcaCzvY5C_gWGYeCFujOTw0t6O2QjsUkFwVVxZxGTo99nfZAxYBRiBMIMQe-7C6y0TPe8e3Y7muC2iKkVZqDyOFooGeLoLDjMRybI2/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;162&quot; data-original-width=&quot;1109&quot; height=&quot;92&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWwC0Ibk_F1vgpSsBRw7dicJFfFHps53gzIWp0-vzcaCzvY5C_gWGYeCFujOTw0t6O2QjsUkFwVVxZxGTo99nfZAxYBRiBMIMQe-7C6y0TPe8e3Y7muC2iKkVZqDyOFooGeLoLDjMRybI2/s640/2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/2949837865575651748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2019/10/the-file-is-locked-by-net-core-host.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2949837865575651748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2949837865575651748'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2019/10/the-file-is-locked-by-net-core-host.html' title='The file is locked by NET Core Host error'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRzk7s6zHUX8xqmP7VsfOEJs-OPiWp_auBLSvBkvlZmcLHTudc6JC83hABf4sTw78USxN6Xgb0KnIMIxefNhU_hQUN-64PWNIuXxV5XBCCmkNYOgGA2PcTmiH-7d9atZIjbLa-Dc_ysPux/s72-c/core.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-4366101977730170624</id><published>2018-04-20T14:25:00.002+01:00</published><updated>2018-04-20T14:25:48.672+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MacBook"/><title type='text'>The reasones why i changed my mac book pro to a windows lapop</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Everybody loves MacBooks, i was curious and happy to get a MacBook with touch bar at work, but once i got it, my hate to it started and built up and was increasing day after day.&lt;br /&gt;
&lt;br /&gt;
I finally decided to ex-change it with a windows laptop for the below reasons:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Gets very hot most of the time, with just chrome and slack running.&lt;/li&gt;
&lt;li&gt;Keyboard is awful, key press distance is very little, noisy as well.&lt;/li&gt;
&lt;li&gt;Touch bar means that i need to do 2 steps for simple tasks like changing the volume or brightness.&lt;/li&gt;
&lt;li&gt;Touch bar place makes it easy to touch its buttons unintentionally, i found myself touching the mute button or the Siri multiple times when pressing the backspace button.&lt;/li&gt;
&lt;li&gt;The Siri button is really annoying, i have disabled it and still it comes up with a pop every time it is touched.&lt;/li&gt;
&lt;li&gt;Touch pad is too big, lots of times my hand was resting on it while i was using it.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;I heard it is very stable, but mine was crashing every couple of days. Lots of times i start it to find that it is actually restarting instead of resuming from sleep.&lt;/li&gt;
&lt;li&gt;Mostly annoying: I need my USB ports, not every thing is Type C. I had a hard drive that i couldn&#39;t connect, simply because i left the converter at my office. In addition to USB headphones, etc...&lt;/li&gt;
&lt;li&gt;OSX lacks lots of simple tasks, coming from a windows. I had to do some tweaks to have some of them. Like: Locking the machine with keyboard shortcut, arranging windows and moving between different screens with keyboard shortcut, Minimising windows, etc...&lt;/li&gt;
&lt;li&gt;I wasn&#39;t able to login multiple time after woking form sleep.&lt;/li&gt;
&lt;li&gt;Software updates were very frequent and always asking for restart.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
What i liked:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Display is amazing.&lt;/li&gt;
&lt;li&gt;Speakers are amazing.&lt;/li&gt;
&lt;li&gt;Touch pad gestures are nice.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/4366101977730170624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2018/04/the-reasones-why-i-changed-my-mac-book.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4366101977730170624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4366101977730170624'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2018/04/the-reasones-why-i-changed-my-mac-book.html' title='The reasones why i changed my mac book pro to a windows lapop'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-6409626527893012897</id><published>2017-07-21T22:58:00.001+01:00</published><updated>2017-07-21T22:58:58.634+01:00</updated><title type='text'>Importing all pfx certificates in a folder</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Assuming all pfx have the same password&lt;br /&gt;
&lt;br /&gt;
forfiles /p &quot;E:\Certificates&quot; /m *.pfx /c &quot;cmd /c CERTUTIL -f -p &quot;password&quot; -importpfx @file&quot;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/6409626527893012897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/07/importing-all-pfx-certificates-in-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6409626527893012897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6409626527893012897'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/07/importing-all-pfx-certificates-in-folder.html' title='Importing all pfx certificates in a folder'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-7050559588732279600</id><published>2017-07-11T22:20:00.002+01:00</published><updated>2017-07-19T22:40:53.573+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithms"/><category scheme="http://www.blogger.com/atom/ns#" term="data structures"/><title type='text'>Sort the odd numbers in array</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Given an array of numbers, it is required to sort ascending odd numbers but even numbers must be on their places.&lt;br /&gt;
&lt;br /&gt;
ex:&lt;br /&gt;
{ 5, 3, 2, 8, 1, 4 } should give { 1, 3, 2, 8, 5, 4 }&lt;br /&gt;
{ 5, 3, 1, 8, 0 } should give { 1, 3, 5, 8, 0 }&lt;br /&gt;
&lt;br /&gt;
Algorithm:&lt;br /&gt;
define sorted list&lt;br /&gt;
define another list to save the odd number indexes&lt;br /&gt;
Iterate through the array for each item&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;if item is even skip it&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;if item is odd:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;add it to the sorted list&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;add the item index to indexes list&lt;br /&gt;
loop through the indexes list, for each index&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;save the item from the sorted list into the the numbers array at the that index&lt;br /&gt;
&lt;br /&gt;
Note: the sorted list should support duplicate items&lt;br /&gt;
&lt;br /&gt;
Example implementations&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Using a list&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Linq;&lt;br /&gt;
using Microsoft.VisualStudio.TestTools.UnitTesting;&lt;br /&gt;
&lt;br /&gt;
namespace sortOdd&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public class Program&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&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; CollectionAssert.AreEqual(new int[] { 1, 3, 2, 8, 5, 4 }, Program.SortArray(new int[] { 5, 3, 2, 8, 1, 4 }));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollectionAssert.AreEqual(new int[] { 1, 3, 5, 8, 0 }, Program.SortArray(new int[] { 5, 3, 1, 8, 0 }));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollectionAssert.AreEqual(new int[] { }, Program.SortArray(new int[] { }));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static int[] SortArray(int[] array)&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; var result = new int[array.Length];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;int&amp;gt; sortedOdd = new List&amp;lt;int&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var indexes = new List&amp;lt;int&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; array.Length; i++)&lt;br /&gt;
&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; if (array[i]%2 == 0)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result[i] = array[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&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; int index = sortedOdd.BinarySearch(array[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (index &amp;lt; 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; sortedOdd.Insert(~index, array[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&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; sortedOdd.Insert(index, array[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; indexes.Add(i);&lt;br /&gt;
&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; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; indexes.Count; i++)&lt;br /&gt;
&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; result[indexes.ElementAt(i)] = sortedOdd.ElementAt(i);&lt;br /&gt;
&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; return result;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Using sorted list&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
using System;&lt;/div&gt;
&lt;div&gt;
using System.Collections.Generic;&lt;/div&gt;
&lt;div&gt;
using System.Linq;&lt;/div&gt;
&lt;div&gt;
using Microsoft.VisualStudio.TestTools.UnitTesting;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
namespace sortOdd&lt;/div&gt;
&lt;div&gt;
{&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; public class Program&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&lt;/div&gt;
&lt;div&gt;
&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; CollectionAssert.AreEqual(new int[] { 1, 3, 2, 8, 5, 4 }, Program.SortArray(new int[] { 5, 3, 2, 8, 1, 4 }));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollectionAssert.AreEqual(new int[] { 1, 3, 5, 8, 0 }, Program.SortArray(new int[] { 5, 3, 1, 8, 0 }));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollectionAssert.AreEqual(new int[] { }, Program.SortArray(new int[] { }));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static int[] SortArray(int[] array)&lt;/div&gt;
&lt;div&gt;
&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; var result = new int[array.Length];&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sortedOdd = new SortedSet&amp;lt;int&amp;gt;(new DuplicateKeyComparer&amp;lt;int&amp;gt;());&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var indexes = new List&amp;lt;int&amp;gt;();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; array.Length; i++)&lt;/div&gt;
&lt;div&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; if (array[i]%2 == 0)&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; result[i] = array[i];&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &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; &amp;nbsp; &amp;nbsp; sortedOdd.Add(array[i]);&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; indexes.Add(i);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &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; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; indexes.Count; i++)&lt;/div&gt;
&lt;div&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; result[indexes.ElementAt(i)] = sortedOdd.ElementAt(i);&lt;/div&gt;
&lt;div&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; return result;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; public class DuplicateKeyComparer&amp;lt;TKey&amp;gt;:IComparer&amp;lt;TKey&amp;gt; where TKey : IComparable&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int Compare(TKey x, TKey y)&lt;/div&gt;
&lt;div&gt;
&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; int result = x.CompareTo(y);&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; if (result == 0)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 1; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return result;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/7050559588732279600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/07/sort-odd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/7050559588732279600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/7050559588732279600'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/07/sort-odd.html' title='Sort the odd numbers in array'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-7556057390737567617</id><published>2017-07-10T13:38:00.003+01:00</published><updated>2017-07-10T14:25:07.083+01:00</updated><title type='text'>Level order traversal in spiral form</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Printing tree in spiral form, or a zigzag form&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguj6NhYf8O96sNAOe4Lk_ETACKPMrtiyxrBmyynTCNJwQGWbiR4C-5Uv-vIE7NS8qeKiU5ldq-nRpaYwpzx0r7KSlP5bXz-3VBhh7zCrShjMkCw7FsNpZzIx4w1eZKOh1SjuivBR2nrD-P/s1600/chrome_2017-07-10_13-37-07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;146&quot; data-original-width=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguj6NhYf8O96sNAOe4Lk_ETACKPMrtiyxrBmyynTCNJwQGWbiR4C-5Uv-vIE7NS8qeKiU5ldq-nRpaYwpzx0r7KSlP5bXz-3VBhh7zCrShjMkCw7FsNpZzIx4w1eZKOh1SjuivBR2nrD-P/s1600/chrome_2017-07-10_13-37-07.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
would print 1 2 3 4 5 6 7&lt;/div&gt;
Algorithm&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #e0e0e0; border-radius: 10px; border: 1px solid rgb(237, 237, 237); font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 10px; overflow: auto; padding: 10px; text-align: justify; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;printSpiral(tree)&lt;/strong&gt;
  set level = tree root
  while level contains nodes
     printLevel(level, ltr)
     set level = getNextLevel(level)
     ltr == !ltr 
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, Helvetica, Arial, Verdana, sans-serif; font-size: 15px !important; line-height: 1.71429; margin-bottom: 10px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Function to get next level&lt;/div&gt;
&lt;pre style=&quot;background-color: #e0e0e0; border-radius: 10px; border: 1px solid rgb(237, 237, 237); font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 10px; overflow: auto; padding: 10px; text-align: justify; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;getNextLevel(level)&lt;/strong&gt;
set nextLevel as empty list
foreach node in level
     if(node.left!=null) nextLevel.add(node.left)
     if(node.right!=null) nextLevel.add(node.right)&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &amp;quot;Open Sans&amp;quot;, Helvetica, Arial, Verdana, sans-serif; font-size: 15px !important; line-height: 1.71429; margin-bottom: 10px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Function to print all nodes at a given level&lt;/div&gt;
&lt;pre style=&quot;background-color: #e0e0e0; border-radius: 10px; border: 1px solid rgb(237, 237, 237); font-family: Consolas, Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size: 12px; line-height: 1.51429; margin-bottom: 10px; overflow: auto; padding: 10px; text-align: justify; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;printLevel(level, ltr)&lt;/strong&gt;
if(!ltr)
    reverse level
foreach node in level
    print node.data&lt;/pre&gt;
&lt;br /&gt;
Example code in Java&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #2B2B2B; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;package &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;com.algorithms.treespiral&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&lt;br /&gt;
import &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;java.util.ArrayList&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
import &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;java.util.Collections&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&lt;br /&gt;
public class &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Main {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;/* Driver program to test the above functions */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;public static void &lt;/span&gt;&lt;span style=&quot;color: #ffc66d; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(String[] args)&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; BinaryTree tree = &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;BinaryTree()&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node(&lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;System.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.println(&lt;/span&gt;&lt;span style=&quot;color: #6a8759; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;&quot;Spiral order traversal of
Binary Tree is &quot;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;tree.printSpiral(tree.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;int &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public &lt;/span&gt;&lt;span style=&quot;color: #ffc66d; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;Node&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;int &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;d)&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; &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;data &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= d&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;BinaryTree&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Node &lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;/* print spiral order traversal of a tree&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;void &lt;/span&gt;&lt;span style=&quot;color: #ffc66d; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;printSpiral&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(Node node)&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; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;boolean &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ltr = &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ArrayList&amp;lt;Node&amp;gt; layer = &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ArrayList&amp;lt;&amp;gt;()&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;layer.add(node)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(layer.size() != &lt;/span&gt;&lt;span style=&quot;color: #6897bb; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&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; printLevel(layer&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ltr)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;layer = getNextLevel(layer)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ltr = !ltr&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;/* gets the next layer in the tree */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ArrayList&amp;lt;Node&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #ffc66d; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;getNextLevel&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(ArrayList&amp;lt;Node&amp;gt; node) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList&amp;lt;Node&amp;gt; nextLayer =
&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ArrayList&amp;lt;&amp;gt;()&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(Node n:node) {&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;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(n.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;!= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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; nextLayer.add(n.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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; if&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(n.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;!= &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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; nextLayer.add(n.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&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; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;nextLayer&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;/* prints tree level taking direction into account
*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;void &lt;/span&gt;&lt;span style=&quot;color: #ffc66d; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;printLevel&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(ArrayList&amp;lt;Node&amp;gt; node&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;, boolean &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;ltr) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;if &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(ltr != &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&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; Collections.&lt;i&gt;reverse&lt;/i&gt;(node)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;for &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;(Node n:node) {&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; System.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;out&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;.print(n.&lt;/span&gt;&lt;span style=&quot;color: #9876aa; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;data &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;+ &lt;/span&gt;&lt;span style=&quot;color: #6a8759; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #cc7832; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #a9b7c6; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-GB;&quot;&gt;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/7556057390737567617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/07/level-order-traversal-in-spiral-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/7556057390737567617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/7556057390737567617'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/07/level-order-traversal-in-spiral-form.html' title='Level order traversal in spiral form'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguj6NhYf8O96sNAOe4Lk_ETACKPMrtiyxrBmyynTCNJwQGWbiR4C-5Uv-vIE7NS8qeKiU5ldq-nRpaYwpzx0r7KSlP5bXz-3VBhh7zCrShjMkCw7FsNpZzIx4w1eZKOh1SjuivBR2nrD-P/s72-c/chrome_2017-07-10_13-37-07.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-5454967263482958709</id><published>2017-06-21T13:58:00.001+01:00</published><updated>2017-06-30T14:24:45.408+01:00</updated><title type='text'>IIS problems</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Some commands to help troubleshoot windows hosted web applications&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;URL reservations:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
netsh http show urlacl&lt;br /&gt;
netsh http delete urlacl url=https://+:443/&lt;br /&gt;
netsh http add urlacl url=https://+:443/ user=everyone&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Firewall&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
netsh advfirewall firewall add rule name=&quot;IISExpressWeb&quot; dir=in protocol=tcp localport=443 remoteip=any action=allow&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Certificates&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Show certificates&lt;br /&gt;
netsh http show sslcert ipport=0.0.0.0:44347&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
delete cert&lt;br /&gt;
netsh http delete sslcert ipport=0.0.0.0:44347&lt;br /&gt;
&lt;br /&gt;
Add cert&lt;br /&gt;
netsh http add sslcert ipport=0.0.0.0:44347 certhash=d4e23174e12ec96e8d3b7cacf7a4f83da9c08e12 appid={214124cd-d05b-4309-9af9-9caa44b2b74a}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Network&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
netstat -a -n -o | findstr 443&lt;br /&gt;
netstat -ab &amp;nbsp;| findstr 443&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Apppool&lt;/b&gt;&lt;br /&gt;
Look at the app pools status&lt;br /&gt;
c:\Windows\System32\inetsrv\appcmd.exe list apppools&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check event viewer&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In my case i found the following error&lt;br /&gt;
&lt;b&gt;An error occurred while using SSL configuration for endpoint 127.0.0.1:443. &amp;nbsp;The error status code is contained within the returned data.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/5454967263482958709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/06/debugging-ssl-problems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/5454967263482958709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/5454967263482958709'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/06/debugging-ssl-problems.html' title='IIS problems'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-2457906198520270320</id><published>2017-06-12T13:43:00.002+01:00</published><updated>2017-07-20T11:26:16.146+01:00</updated><title type='text'>Git tips</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;git config push.default current&lt;/b&gt;&lt;br /&gt;
Pushing to the server with he same branch name automatically&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Some usefull aliases&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
git config --global alias.co checkout&lt;br /&gt;
git config --global alias.br branch&lt;br /&gt;
git config --global alias.cob checkout -b&lt;br /&gt;
git config --global alias.st status&lt;br /&gt;
git config --global alias.unstage &#39;reset HEAD --&#39;&lt;br /&gt;
git config --global alias.df &#39;difftool&#39;&lt;br /&gt;
git config --global alias.mf &#39;mergetool&#39;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/2457906198520270320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/06/git-tips.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2457906198520270320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2457906198520270320'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/06/git-tips.html' title='Git tips'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-4102476967281352680</id><published>2017-06-04T23:32:00.000+01:00</published><updated>2017-06-16T16:42:18.686+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><title type='text'>DateTime parsing in .NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Good percentage of bugs and test failures comes from the way date is parsed.&lt;br /&gt;
Popular example, a unit test is created, runs on local machine without any problems, then on the test agents, sometimes it passes, and other times fails.&lt;br /&gt;
Usually this happens when there is a date stored in UTC for example, then we parse it without specifying date kind, which may change the time value in some cases.&lt;br /&gt;
&lt;br /&gt;
Example below for different ways to parse date, and the effect of that on a time comparison.&lt;br /&gt;
Whenever the parsed date kind is local, and the time is adjusted, the comparison is not as we expect.&lt;br /&gt;
In the below examples, i am comparing the dates checking if less than 8:40 and expecting all to be true. Some of the them the comparison was giving false, due to time adjustment.&lt;br /&gt;
&lt;br /&gt;
namespace DateParsing&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; using System.Globalization;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; using System.Xml;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; class Program&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&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; Parse(&quot;2017-06-01T08:33:49Z&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Parse(&quot;2017-06-01T08:33:49&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Parse(&quot;2017-06-01T08:00:00.0000000Z&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ParseByFormat(&quot;2017-06-01 08:33:49&quot;, &quot;yyyy-MM-dd HH:mm:ss&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.ReadKey();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static void Parse(string dateString)&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; Console.WriteLine(&quot;========== input string is: {0} ===============&quot;, dateString);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date1 = DateTime.Parse(dateString);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date1, &quot;Using parse, no date style&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date2 = DateTime.Parse(dateString, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date2, &quot;Using parse, Adjust to universal style&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date3 = DateTime.Parse(dateString, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date3, &quot;Using parse, Assume universal style&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date4 = XmlConvert.ToDateTime(dateString, XmlDateTimeSerializationMode.Utc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date4, &quot;Using XmlConvert, SerializationMode UTC&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static void ParseByFormat(string dateString, string format)&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; Console.WriteLine(&quot;========== input string is: {0} ===============&quot;, dateString);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date1 = DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date1, &quot;Using parse exact, no date style&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date2 = DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date2, &quot;Using parse exact, Adjust to universal style&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date3 = DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date3, &quot;Using parse exact, Assume universal style&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date4 = XmlConvert.ToDateTime(dateString, format);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintDate(date4, &quot;Using XmlConvert, SerializationMode not specified&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void PrintDate(DateTime date, string format)&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; DateTime x = new DateTime(2017, 06, 01, 08, 40, 00);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;Date is {0}, date kind is {1}, {2}&quot;, date, date.Kind, format);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(&quot;{0} &amp;lt; than {1} is {2} &quot;, date, x, date &amp;lt; x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
========== input string is: 2017-06-01T08:33:49Z ===============&lt;br /&gt;
Date is 01/06/2017 09:33:49, date kind is &lt;span style=&quot;background-color: yellow;&quot;&gt;Local&lt;/span&gt;, Using parse, &lt;span style=&quot;background-color: yellow;&quot;&gt;no date style&lt;/span&gt;&lt;br /&gt;
01/06/2017 09:33:49 &amp;lt; than 01/06/2017 08:40:00 is &lt;span style=&quot;background-color: yellow;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Utc, Using parse, Adjust to universal style&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
Date is 01/06/2017 09:33:49, date kind is &lt;span style=&quot;background-color: yellow;&quot;&gt;Local&lt;/span&gt;, Using parse, Assume universal style&lt;br /&gt;
01/06/2017 09:33:49 &amp;lt; than 01/06/2017 08:40:00 is &lt;span style=&quot;background-color: yellow;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Utc, Using XmlConvert, SerializationMode UTC&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
&lt;br /&gt;
========== input string is: 2017-06-01T08:33:49 ===============&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Unspecified, Using parse, no date style&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Unspecified, Using parse, Adjust to universal style&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
Date is 01/06/2017 09:33:49, date kind is &lt;span style=&quot;background-color: yellow;&quot;&gt;Local&lt;/span&gt;, Using parse, Assume universal style&lt;br /&gt;
01/06/2017 09:33:49 &amp;lt; than 01/06/2017 08:40:00 is &lt;span style=&quot;background-color: yellow;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Utc, Using XmlConvert, SerializationMode UTC&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
&lt;br /&gt;
========== input string is: 2017-06-01T08:00:00.0000000Z ===============&lt;br /&gt;
Date is 01/06/2017 09:00:00, date kind is &lt;span style=&quot;background-color: yellow;&quot;&gt;Local&lt;/span&gt;, Using parse, &lt;span style=&quot;background-color: yellow;&quot;&gt;no date style&lt;/span&gt;&lt;br /&gt;
01/06/2017 09:00:00 &amp;lt; than 01/06/2017 08:40:00 is &lt;span style=&quot;background-color: yellow;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
Date is 01/06/2017 08:00:00, date kind is Utc, Using parse, Adjust to universal style&lt;br /&gt;
01/06/2017 08:00:00 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
Date is 01/06/2017 09:00:00, date kind is &lt;span style=&quot;background-color: yellow;&quot;&gt;Local&lt;/span&gt;, Using parse, &lt;span style=&quot;background-color: yellow;&quot;&gt;Assume universal style&lt;/span&gt;&lt;br /&gt;
01/06/2017 09:00:00 &amp;lt; than 01/06/2017 08:40:00 is &lt;span style=&quot;background-color: yellow;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
Date is 01/06/2017 08:00:00, date kind is Utc, Using XmlConvert, SerializationMode UTC&lt;br /&gt;
01/06/2017 08:00:00 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
&lt;br /&gt;
========== input string is: 2017-06-01 08:33:49 ===============&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Unspecified, Using parse exact, no date style&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Unspecified, Using parse exact, Adjust to universal style&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;br /&gt;
Date is 01/06/2017 09:33:49, date kind is &lt;span style=&quot;background-color: yellow;&quot;&gt;Local&lt;/span&gt;, Using parse exact, &lt;span style=&quot;background-color: yellow;&quot;&gt;Assume universal style&lt;/span&gt;&lt;br /&gt;
01/06/2017 09:33:49 &amp;lt; than 01/06/2017 08:40:00 is &lt;span style=&quot;background-color: yellow;&quot;&gt;False&lt;/span&gt;&lt;br /&gt;
Date is 01/06/2017 08:33:49, date kind is Unspecified, Using XmlConvert, SerializationMode not specified&lt;br /&gt;
01/06/2017 08:33:49 &amp;lt; than 01/06/2017 08:40:00 is True&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/4102476967281352680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/06/datetime-parsing-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4102476967281352680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4102476967281352680'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/06/datetime-parsing-in-net.html' title='DateTime parsing in .NET'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-213446913712744423</id><published>2017-05-31T12:39:00.000+01:00</published><updated>2017-05-31T12:40:04.948+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><title type='text'>string.Format with params trap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Lately i have seen this code&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void LogError(string error, params object[] details)&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; var message = string.Format(error, details);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
The code compiles and runs without problems, and if p is passed as a single string, would work fine. If someone knows that it should be a single string.&lt;br /&gt;
If someone else is using the same method he might fall into a trap assuming that the params is optional, which would also compile but would give exception during runtime.&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&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; var message = &quot;Error occurred, details: {0}&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LogError(message, &quot;details&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LogError(message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void LogError(string error, params object[] details)&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; var message = string.Format(error, details);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
It would compile and run, but would give an error&lt;br /&gt;
&lt;br /&gt;
An unhandled exception of type &#39;System.FormatException&#39; occurred in mscorlib.dll&lt;br /&gt;
&lt;br /&gt;
Additional information: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.&lt;br /&gt;
&lt;br /&gt;
Another developer might assume that he can pass multiple params, which would only take the first one and ignore the others&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main(string[] args)&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; var message = &quot;Error occurred, details: {0}&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LogError(message, &quot;details&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LogError(message, &quot;details&quot;, &quot;more details &quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void LogError(string error, params object[] details)&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; var message = string.Format(error, details);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.WriteLine(message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Would output:&lt;br /&gt;
Error occurred, details: details&lt;br /&gt;
Error occurred, details: details&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/213446913712744423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/05/stringformat-with-params-trap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/213446913712744423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/213446913712744423'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/05/stringformat-with-params-trap.html' title='string.Format with params trap'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-5275432256071629184</id><published>2017-05-31T12:20:00.001+01:00</published><updated>2017-05-31T12:20:47.494+01:00</updated><title type='text'>Registering all ocx files</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;I had an old app that is using windows controls ocx libraries, like&amp;nbsp;&lt;span style=&quot;background-color: white; color: #333333;&quot;&gt;comctl32.ocx,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333;&quot;&gt;comdlg32.ocx&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333;&quot;&gt;And others&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The program was complaining about missing comctl32.ocx, then i did register it with the below command, running it in elevated command prompt&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333;&quot;&gt;regsvr32 c:\Windows\SysWOW64\comctl32.ocx&lt;/span&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;Starting the app again it complained about another missing ocx.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;In that case it might be better to register all the ocx files in the SysWOW64 folder by running the below command&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;forfiles /p &quot;c:\Windows\SysWOW64&quot; /m *.ocx /c &quot;cmd /c regsvr32 @file&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/5275432256071629184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/05/registering-all-ocx-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/5275432256071629184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/5275432256071629184'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/05/registering-all-ocx-files.html' title='Registering all ocx files'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-8519357388941158741</id><published>2017-01-16T15:07:00.003+00:00</published><updated>2017-01-16T15:07:47.879+00:00</updated><title type='text'>Namespace and extending twitter bootstrap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Using customized bootstrap styles can sometimes conflict with other bootstrap styles that are not customized, for example this could happen if you have a frame and you are loading a web component inside of it inside a page.&lt;br /&gt;
&lt;br /&gt;
Possible solution to avoid conflicts is to namespace twitter bootstrap&lt;br /&gt;
&lt;br /&gt;
Lets take example html with bootstrap styling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;My Twitter Bootstrap example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;bootstrap.css&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;ul class=&quot;nav nav-pills&quot; role=&quot;tablist&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li role=&quot;presentation&quot; class=&quot;active&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Home &amp;lt;span class=&quot;badge&quot;&amp;gt;42&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li role=&quot;presentation&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Profile&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li role=&quot;presentation&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Messages &amp;lt;span class=&quot;badge&quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;js/bootstrap.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To namespace bootstrap styles:&lt;br /&gt;
Create a new less file, and paste the below inside. &quot;mybt&quot; below is the custom namespace i am using&lt;br /&gt;
&lt;br /&gt;
.mybt {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @import &quot;bootstrap-3.3.7/less/bootstrap&quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
After that compile this less file&lt;br /&gt;
lessc mybt.less mybt.css&lt;br /&gt;
&lt;br /&gt;
And now after referencing mybt.css the html would use mybt and the bootstrap styles like below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;My Twitter Bootstrap example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;mybt.css&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;ul class=&quot;mybt nav nav-pills&quot; role=&quot;tablist&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li role=&quot;presentation&quot; class=&quot;mybt active&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Home &amp;lt;span class=&quot;mybt badge&quot;&amp;gt;42&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li role=&quot;presentation&quot; class=&quot;mybt&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Profile&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li role=&quot;presentation&quot; class=&quot;mybt&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Messages &amp;lt;span class=&quot;mybt badge&quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;js/bootstrap.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option is to extend bootstrap styles&lt;br /&gt;
to extend it, create new less file with below:&lt;br /&gt;
&lt;br /&gt;
@import &quot;bootstrap-3.3.7/less/bootstrap&quot;;&lt;br /&gt;
&lt;br /&gt;
.my-nav:extend(.nav) {}&lt;br /&gt;
.my-nav-pills:extend(.nav-pills) {}&lt;br /&gt;
.my-badge:extend(.badge) {}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Extending will work if you have only few styles that you are using.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/8519357388941158741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/01/namespace-and-extending-twitter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8519357388941158741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8519357388941158741'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/01/namespace-and-extending-twitter.html' title='Namespace and extending twitter bootstrap'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-4336938691213599162</id><published>2017-01-08T23:00:00.001+00:00</published><updated>2017-01-08T23:00:43.054+00:00</updated><title type='text'>Setup Blocked By Group Policy</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was trying to setup my printer, cannon MG3650 on my computer, everything was going well, setup has finished, but i wasn&#39;t able to print.&lt;br /&gt;
I opened printers, to find the status of the printer as following &quot;&lt;b&gt;Setup Blocked By Group Policy&lt;/b&gt;&quot;&lt;br /&gt;
Searching online i found couple of posts to change the group policy and how to check the resultant policy.&lt;br /&gt;
I checked the group policy setting by doing the below&lt;br /&gt;
Start &amp;gt; Run, type in gpedit.msc and press OK. Go to Computer Configuration &amp;gt; Administrative templates &amp;gt; System &amp;gt; Device Installation &amp;gt; Device Installation Restrictions&lt;br /&gt;
Made sure that all was not configured.&lt;br /&gt;
I then checked the resultant policy&lt;br /&gt;
Start &amp;gt; Run, type in rsop.msc and there the device restriction was set as enabled.&lt;br /&gt;
I searched on how to change this policy, couldn&#39;t find a place to change it.&lt;br /&gt;
&lt;br /&gt;
Then i looked into the registry. by doing Start &amp;gt; Run, type in regedit and press Ok. I found the below key:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceInstall\Restrictions&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
And i found a key inside called &lt;b&gt;DenyUnspecified&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I removed this key, then checked the resultant policy, the restriction wasn&#39;t enabled. Repeated the printer setup again, and this time it finished successfully and it worked fine after.&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/4336938691213599162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2017/01/setup-blocked-by-group-policy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4336938691213599162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4336938691213599162'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2017/01/setup-blocked-by-group-policy.html' title='Setup Blocked By Group Policy'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-4716357000022019465</id><published>2016-12-16T22:06:00.000+00:00</published><updated>2016-12-19T11:45:46.521+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><title type='text'>Custom cast support for objects</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;link href=&quot;https://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;https://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt; 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
We are working with Hashtables a lot in a project, where we need to convert objects into hashtable and from hashtables&lt;br /&gt;
&lt;br /&gt;
A way to do this is by adding custom casting in the class to the class type, and to add a method to convert to hashtable.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;&amp;nbsp; &amp;nbsp;public class MyClass
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public string Name;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int Id;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public string Description;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static explicit operator MyClass(Hashtable hashtable)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyClass mt = new MyClass();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mt.Description = hashtable[&quot;Description&quot;].ToString();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mt.Id = int.Parse(hashtable[&quot;Id&quot;].ToString());
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mt.Name = hashtable[&quot;Name&quot;].ToString();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return mt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Hashtable ToHashtable()
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var hashtable = new Hashtable();
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hashtable[&quot;Name&quot;] = &quot;name&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hashtable[&quot;Id&quot;] = 1;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hashtable[&quot;Description&quot;] = &quot;description&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return hashtable;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Then simply we can do something like:&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;Hashtable hashtable = myClass.ToHashtable();
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;MyClass casted = (MyClass) hashtable;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Example usage:&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;        static void Main(string[] args)
        {
            MyClass myClass = new MyClass
            {
                Description = &quot;description&quot;,
                Id = 1,
                Name = &quot;name&quot;
            };

            Hashtable hashtable = myClass.ToHashtable();
            Console.WriteLine(&quot;Hashtable: &quot;);
            Console.WriteLine(hashtable[&quot;Name&quot;]);
            Console.WriteLine(hashtable[&quot;Id&quot;]);
            Console.WriteLine(hashtable[&quot;Description&quot;]);


            MyClass casted = (MyClass) hashtable;
            Console.WriteLine(&quot;MyClass: &quot;);
            Console.WriteLine(casted.Id);
            Console.WriteLine(casted.Description);
            Console.WriteLine(casted.Name);

            Console.ReadKey();
        }
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/4716357000022019465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2016/12/custom-cast-support-for-objects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4716357000022019465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/4716357000022019465'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2016/12/custom-cast-support-for-objects.html' title='Custom cast support for objects'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-8190216154087878427</id><published>2016-12-14T12:50:00.000+00:00</published><updated>2016-12-14T12:50:30.056+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><title type='text'>Error CA2000 call System.IDisposable.Dispose on object</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
My code looked like&lt;br /&gt;
&lt;br /&gt;


&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
 {font-family:&quot;Cambria Math&quot;;
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
 {font-family:Consolas;
 panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin-top:0cm;
 margin-right:0cm;
 margin-bottom:8.0pt;
 margin-left:0cm;
 line-height:107%;
 font-size:11.0pt;
 font-family:&quot;Calibri&quot;,sans-serif;}
.MsoChpDefault
 {font-family:&quot;Calibri&quot;,sans-serif;}
.MsoPapDefault
 {margin-bottom:8.0pt;
 line-height:107%;}
 /* Page Definitions */
 @page WordSection1
 {size:612.0pt 792.0pt;
 margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
 {page:WordSection1;}
--&gt;
&lt;/style&gt;





&lt;br /&gt;
&lt;div class=&quot;WordSection1&quot;&gt;

&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Consolas; font-size: 9.5pt;&quot;&gt;client&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Setup&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(mock =&amp;gt; mock.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;PostAsync&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;It&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;IsAny&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;IEnumerable&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;ids&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&amp;gt;())).&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Returns&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;FromResult&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;HttpResponseMessage&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Net&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;HttpStatusCode&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Consolas; font-size: 9.5pt;&quot;&gt;OK&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;)));&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
and i was getting the below style cop error&lt;br /&gt;
&lt;br /&gt;
Severity&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Code&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Description&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Project&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;File&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Line&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Suppression State&lt;br /&gt;
Error&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CA2000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;In method &#39;MyMethod()&#39;, call System.IDisposable.Dispose on object &#39;new HttpResponseMessage(HttpStatusCode.OK)&#39; before all references to it are out of scope.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Catalog.Common.UnitTests&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;code.cs&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;72&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Active&lt;br /&gt;
&lt;br /&gt;
To overcome this, if it is in single method, you can suppress the error&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;SuppressMessage&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Microsoft.Reliability&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                 &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;CA2000:DisposeObjectsBeforeLosingScope&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                 &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Justification&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Your reasons go here&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
OR you can change the code to be like below&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Consolas; font-size: 9.5pt;&quot;&gt;client&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Setup&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(mock =&amp;gt; mock.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;PostAsync&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;It&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;IsAny&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;IEnumerable&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;ids&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&amp;gt;())).&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Returns&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Task&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkcyan; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Run&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(() =&amp;gt; { return&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;HttpResponseMessage&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;Net&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;HttpStatusCode&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.&lt;/span&gt;&lt;b style=&quot;font-family: Calibri, sans-serif; font-size: 14.6667px;&quot;&gt;&lt;span style=&quot;color: purple; font-family: Consolas; font-size: 9.5pt;&quot;&gt;OK&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;); }));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/8190216154087878427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2016/12/error-ca2000-call-systemidisposabledisp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8190216154087878427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8190216154087878427'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2016/12/error-ca2000-call-systemidisposabledisp.html' title='Error CA2000 call System.IDisposable.Dispose on object'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-6458861964075637915</id><published>2015-03-11T22:00:00.000+00:00</published><updated>2015-03-11T22:00:34.983+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="partition recovery"/><title type='text'>Recovering partition after initializing by mistake</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I recently re installed windows, i have 2 drives, i have removed the second drive to keep the data safe.&lt;br /&gt;
After the installation i have connected my hard drive. I didn&#39;t find the drive appearing in file explorer. When i opened Computer Management-&amp;gt; Disk Management, i received message saying that the drive is not initialized, so i followed the steps to initialize it, thinking that this will restore the drive and the data, then i found that the drive now has the state of un-allocated and the next available options is to create volumes, then i realized that i may have destroyed my data.&lt;br /&gt;
Looking online i found some forums talking about something similar and that MiniTool Partition wizard have recovery wizard that can recover the drive&lt;br /&gt;
&lt;a href=&quot;http://www.sevenforums.com/hardware-devices/288692-disk-1-unknown-not-initialized-unallocated.html&quot;&gt;http://www.sevenforums.com/hardware-devices/288692-disk-1-unknown-not-initialized-unallocated.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I gave it a try, downloaded the free tool from&amp;nbsp;&lt;a href=&quot;http://www.partitionwizard.com/download.html&quot;&gt;http://www.partitionwizard.com/download.html&lt;/a&gt;, then selected the drive, started the recovery wizard, did the quick scan, and voila, the partition was recovered. That was really great tool that saved my data.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/6458861964075637915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2015/03/recovering-partition-after-initializing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6458861964075637915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6458861964075637915'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2015/03/recovering-partition-after-initializing.html' title='Recovering partition after initializing by mistake'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-3080194680129453703</id><published>2015-01-18T23:11:00.001+00:00</published><updated>2015-01-18T23:12:54.804+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Remote Desktop"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Remote desktop connection: Authentication error has occurred (Code: 0x80004005)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Usually i connect to my other machine without any problems, one time suddenly i was receiving this error:&lt;br /&gt;
&lt;br /&gt;
Authentication error has occurred (Code: 0x80004005)&lt;br /&gt;
&lt;br /&gt;
And here is my experience with it, searching for it found this &lt;a href=&quot;https://social.technet.microsoft.com/Forums/en-US/ee4353f6-1977-47b4-a521-60a26986b361/authentication-error-has-occurred-code-0x80004005?forum=winserverTS&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt; saying that it could because of third party software or antivirus. Then i remembered that sometimes when i had fiddler open on my machine, i get authentication errors from outlook and some other clients that are unable to connect with the server on secure connections, i figured out that this could be the reason, that i have fiddler open in my machine and it is blocking the authentication.&lt;br /&gt;
&lt;br /&gt;
So i needed to shut down fiddler on my remote machine, i remember that PsTools allows executing commands on remote machine, Then i found this &lt;a href=&quot;http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx&quot; target=&quot;_blank&quot;&gt;article&lt;/a&gt; on steps to run PsKill to kill process on remote machine.&lt;br /&gt;
&lt;br /&gt;
All i needed to do is:&lt;br /&gt;
- Download &lt;a href=&quot;http://download.sysinternals.com/files/PSTools.zip&quot; target=&quot;_blank&quot;&gt;PsTools&lt;/a&gt;, then extract it&lt;br /&gt;
- Start command prompt in elevated mode (run as administrator)&lt;br /&gt;
- Go to PsTools extracted folder on run the command&lt;br /&gt;
&lt;br /&gt;
pskill.exe \\MachineName -u username -p password Fiddler&lt;br /&gt;
&lt;br /&gt;
Should take some time and come back with&lt;br /&gt;
&lt;br /&gt;
Process Fiddler killed on MachineName&lt;br /&gt;
&lt;br /&gt;
Trying to remote connect to my machine after that, worked as usual.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/3080194680129453703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2015/01/remote-desktop-connection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/3080194680129453703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/3080194680129453703'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2015/01/remote-desktop-connection.html' title='Remote desktop connection: Authentication error has occurred (Code: 0x80004005)'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-7688515159693724003</id><published>2014-12-17T22:48:00.000+00:00</published><updated>2015-01-18T23:13:19.293+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Windows 8 apps opening problem</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;On my work PC i had this issue, domain account on windows 8, and whenever i tried to open any of windows 8 apps, it is opened and disappears and the window is not displayed.&lt;br /&gt;When i searched i found lots of articles taking about windows apps issues, but all didn&#39;t help. I found helpful articles when i searched with the error i found in event viewer like:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 13px;&quot;&gt;Activation of app windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel failed with error: This app does not support the contract specified or is not installed. See the Microsoft-Windows-TWinUI/Operational log for additional information.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I found the solution in couple of articles&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;a href=&quot;http://answers.microsoft.com/en-us/windows/forum/windows_8-winapps/i-cant-open-any-windows-8-apps-including-pc/aaa88b5e-98c6-4958-a896-b991b924e4f0?rtAction=1407081231306&quot; target=&quot;_blank&quot;&gt;I can&#39;t open any Windows 8 apps including PC Settings and Store&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small; font-weight: normal;&quot;&gt;&lt;a href=&quot;http://programount.blogspot.ie/2014/08/fix-windows-81-cannot-launch-pc.html&quot; style=&quot;font-family: Georgia, serif; font-weight: normal; line-height: 1.4em;&quot; target=&quot;_blank&quot;&gt;Fix Windows 8.1 Cannot Launch “PC Settings” or “Store” Problem&lt;/a&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Running the below commands solved the problem&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.7999992370605px;&quot;&gt;
&lt;em&gt;powershell -ExecutionPolicy Unrestricted Add-AppxPackage -DisableDevelopmentMode -Register $Env:SystemRoot\camera\AppxManifest.xml&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.7999992370605px;&quot;&gt;
&lt;em&gt;powershell -ExecutionPolicy Unrestricted Add-AppxPackage -DisableDevelopmentMode -Register $Env:SystemRoot\FileManager\AppxManifest.xml&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.7999992370605px;&quot;&gt;
&lt;em&gt;powershell -ExecutionPolicy Unrestricted Add-AppxPackage -DisableDevelopmentMode -Register $Env:SystemRoot\ImmersiveControlPanel\AppxManifest.xml&lt;/em&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/7688515159693724003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2014/12/windows-8-apps-opening-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/7688515159693724003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/7688515159693724003'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2014/12/windows-8-apps-opening-problem.html' title='Windows 8 apps opening problem'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-2189878203126824893</id><published>2014-10-20T13:53:00.000+01:00</published><updated>2014-10-20T13:53:52.449+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Remote Desktop"/><title type='text'>Enabling remote desktop on remote computer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I went home and forgot to enable remote desktop on my PC at my office, luckily i found couple of articles that is talking about enabling remote desktop remotely.&lt;br /&gt;
&lt;br /&gt;
I followed the steps from &amp;nbsp;&lt;a href=&quot;http://www.techrepublic.com/blog/the-enterprise-cloud/remotely-enable-or-disable-remote-desktop-on-a-windows-server/&quot;&gt;here&lt;/a&gt;&amp;nbsp;and did a restart for the remote machine, but it didn&#39;t work, then i figured that since i did it through registry, firewall rules wasn&#39;t updated to allow it, while if i enabled remote desktop connections through the UI, it is updated automatically.&lt;br /&gt;
&lt;br /&gt;
I found another &lt;a href=&quot;http://mediarealm.com.au/articles/2013/03/remotely-enable-remote-desktop-in-windows-7/&quot;&gt;article&lt;/a&gt; that has the same steps plus updating the firewall to enable remote desktop connections with a command line that is executed remotely. Another &lt;a href=&quot;https://rowell.dionicio.net/unable-to-remote-desktop-into-windows-server-2012-r2-core/&quot;&gt;article&lt;/a&gt; for opening the firewall for remote desktop connections from command line.&lt;br /&gt;
&lt;br /&gt;
The only thing that i have done extra is that i started the elevated command prompt for &quot;psexec&quot;, the normal one didn&#39;t do the job.&lt;br /&gt;
&lt;br /&gt;
Brief of the steps:&lt;br /&gt;
1- From the registry, connect to the remote computer&lt;br /&gt;
2- Change the key&amp;nbsp;&lt;strong style=&quot;color: #2a2a2a;&quot;&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\&lt;/strong&gt;&lt;strong style=&quot;color: #2a2a2a;&quot;&gt;fDenyTSConnections &lt;/strong&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;from 1 to 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2a2a2a;&quot;&gt;3- Restart the remote machine by&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #2a2a2a;&quot;&gt;shutdown -m \\Machine&lt;i&gt;Name&lt;/i&gt;&lt;/strong&gt;&lt;span style=&quot;color: #2a2a2a;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #2a2a2a;&quot;&gt;-r&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2a2a2a;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;4- Update the firewall rules on the remote machine by downloading &lt;a href=&quot;http://download.sysinternals.com/files/PSTools.zip&quot;&gt;psexec&lt;/a&gt;&amp;nbsp;and running the below from elevated command prompt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;psexec \\remote_machine_name cmd&lt;/em&gt;&lt;br /&gt;
&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; line-height: 28.1599998474121px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Then after it connects&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: border-box; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/2189878203126824893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2014/10/enabling-remote-desktop-on-remote.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2189878203126824893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2189878203126824893'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2014/10/enabling-remote-desktop-on-remote.html' title='Enabling remote desktop on remote computer'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-5308559451310158888</id><published>2014-06-26T12:44:00.000+01:00</published><updated>2014-06-26T12:45:35.514+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><title type='text'>.NET C#: Running command line in CMD and waiting for it to finish</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I had a script that i should call with command line interface, then other tasks that should be done after that.&lt;br /&gt;
I used the Process and ProcessStartInfo as below, but the problem i had is that the script was taking some time, and the program execution was failing after that since the script is not finished yet.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (Process process = new Process())&lt;br /&gt;
&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; var startInfo = new ProcessStartInfo(&quot;cmd&quot;)&lt;br /&gt;
&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; RedirectStandardInput = true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RedirectStandardOutput = true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WindowStyle = ProcessWindowStyle.Normal,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UseShellExecute = false,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CreateNoWindow = false&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.StartInfo = startInfo;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.OutputDataReceived += (sender, e) =&amp;gt; Console.WriteLine(e.Data);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.Start();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.StandardInput.Write(&quot;script&quot;+ process.StandardInput.NewLine);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.Close(); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
I wanted to make sure that the program execution waits till the script finishes.So instead of using Close method, i added WaitForExit, and i am manually sending exit command to the command line after the script finishes, like below&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (Process process = new Process())&lt;br /&gt;
&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; var startInfo = new ProcessStartInfo(&quot;cmd&quot;)&lt;br /&gt;
&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; RedirectStandardInput = true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RedirectStandardOutput = true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WindowStyle = ProcessWindowStyle.Normal,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UseShellExecute = false,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CreateNoWindow = false&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.StartInfo = startInfo;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.OutputDataReceived += (sender, e) =&amp;gt;&amp;nbsp;Console.WriteLine(e.Data);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.Start();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.StandardInput.Write(&quot;script&quot;+ process.StandardInput.NewLine);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.StandardInput.Write(&quot;exit&quot; + process.StandardInput.NewLine);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; process.WaitForExit(); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
This worked for me and the program execution waited till the script finishes.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/5308559451310158888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2014/06/net-c-running-command-line-in-cmd-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/5308559451310158888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/5308559451310158888'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2014/06/net-c-running-command-line-in-cmd-and.html' title='.NET C#: Running command line in CMD and waiting for it to finish'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-2675032074802659254</id><published>2014-06-18T11:04:00.000+01:00</published><updated>2014-06-18T11:04:54.556+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><title type='text'>Clicking problems with IE and Selenium</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
We were facing couple of problems with selenium tests running on IE, when running the tests locally, we don&#39;t have these issues. After adding more logs to the code, i found that sometimes it is failing after sending the click event in different steps.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Looking online for similar issue, i found that there are clicking issues with IE, as sometimes the element being clicked on will receive the focus, but the click will not be processed by the element.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Browser_Focus&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
To workaround this, i am setting the focus manually to the browser using the below line of code&lt;br /&gt;
&lt;br /&gt;
Driver.SwitchTo().Window(Driver.CurrentWindowHandle);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/2675032074802659254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2014/06/clicking-problems-with-ie-and-selenium.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2675032074802659254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/2675032074802659254'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2014/06/clicking-problems-with-ie-and-selenium.html' title='Clicking problems with IE and Selenium'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-6425514389898665404</id><published>2013-12-22T13:22:00.001+00:00</published><updated>2013-12-22T18:13:56.155+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tcl"/><title type='text'>tcl: dumping tablelist data</title><content type='html'>&lt;p&gt;For the &lt;a href=&quot;http://www.nemethi.de/tablelist/tablelist.html&quot;&gt;tablelist&lt;/a&gt; widget I created a function to dump the table content to a file&lt;/p&gt;  &lt;div id=&quot;scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:30061864-c0f3-4a07-8da1-15d28864d278&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px&quot;&gt;&lt;pre class=&quot;brush: javascript;&quot;&gt;proc dumpTableListToFile { tree { file preview.txt } } { &lt;br /&gt;    set rowCount [$tree size]&lt;br /&gt;    set file_writer [open $file  w+]&lt;br /&gt;    for { set i 0 } { $i &amp;lt; $rowCount } { incr i } {&lt;br /&gt;	set rowData [$tree get $i]&lt;br /&gt;	puts $file_writer $rowData &lt;br /&gt;    }&lt;br /&gt;    close $file_writer&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;parameters: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;tree, is the table widget, file is the file name, optional.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/6425514389898665404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2013/12/tcl-dumping-tablelist-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6425514389898665404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/6425514389898665404'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2013/12/tcl-dumping-tablelist-data.html' title='tcl: dumping tablelist data'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1705508798207446456.post-8187628276384341177</id><published>2013-12-16T17:14:00.001+00:00</published><updated>2013-12-16T17:21:05.336+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tcl"/><title type='text'>tcl: find widget recursively</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was doing some testing for multi container application, and same widget could exist in different containers and could have variable parent name, I created a function to find the widget recursively by the last portion of the widget name&lt;br /&gt;
The function I initially created &lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; proc findWidgetByName { wname {widget .mainwindow} } {    &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt;     set pattern &lt;span style=&quot;color: #006080;&quot;&gt;&quot;*.${wname}&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;     #puts $widget    &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;     set all &lt;span style=&quot;color: #006080;&quot;&gt;&quot;[winfo children $widget]&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; child $all  { &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;         #puts &lt;span style=&quot;color: #006080;&quot;&gt;&quot;$child&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; { [winfo viewable $child] &amp;amp;&amp;amp; [&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; match $pattern $child] } { &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt;                 #puts $child &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;                 &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; $child            &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;         } &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; { &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; [findWidgetByName $wname $child]        &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;         } &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;     } &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; 0 &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060;&quot;&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
Testing the above function, it was taking the first child in each “for loop” and returning without checking other childs, with the help of my colleague, we changed it to working version&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; proc findWidgetByName { wname {widget .mainwindow} } {    &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt;     set pattern &lt;span style=&quot;color: #006080;&quot;&gt;&quot;*.${wname}&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;     #puts $widget    &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;     set all &lt;span style=&quot;color: #006080;&quot;&gt;&quot;[winfo children $widget]&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; child $all  { &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;         #puts &lt;span style=&quot;color: #006080;&quot;&gt;&quot;$child&quot;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; { [winfo viewable $child] &amp;amp;&amp;amp; [&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; match $pattern $child] } { &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt;                 #puts $child &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;                 &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; $child            &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;         } &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; { &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;             set x [findWidgetByName $wname $child]        &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; {  $x !=0 } { &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; $x ;            &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt;             } &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060;&quot;&gt;  15:&lt;/span&gt;         } &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum16&quot; style=&quot;color: #606060;&quot;&gt;  16:&lt;/span&gt;     } &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum17&quot; style=&quot;color: #606060;&quot;&gt;  17:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; 0 &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum18&quot; style=&quot;color: #606060;&quot;&gt;  18:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
When using for loops with recursion we need to put some condition when to break the for loop execution&lt;br /&gt;
I have created also another version to find widgets by label, in case of buttons or labels&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; proc findWidgetByLabel { label {widget .mainwindow} } {       &lt;/pre&gt;
&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060; font-size: 8pt; line-height: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;2:&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;     set all &lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&quot;[winfo children $widget]&quot;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; child $all  {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;         #puts &lt;span style=&quot;color: #006080;&quot;&gt;&quot;$child&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; {([winfo &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; $child]== &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Label&quot;&lt;/span&gt; || [winfo &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; $child]== &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Button&quot;&lt;/span&gt; ) &amp;amp;&amp;amp; [winfo viewable $child] &amp;amp;&amp;amp; [$child cget -text]==$label } {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;                 #puts $child&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;                 &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; $child            &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt;         } &lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;             set x [findWidgetByLabel $label $child]        &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; {  $x !=0 } {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;                 &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; $x ;            &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;             }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060;&quot;&gt;  15:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; 0&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum16&quot; style=&quot;color: #606060;&quot;&gt;  16:&lt;/span&gt; }&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
Same can be applied to find widget by any property&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://amir-shenodua.blogspot.com/feeds/8187628276384341177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amir-shenodua.blogspot.com/2013/12/tcl-find-widget-recursively.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8187628276384341177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1705508798207446456/posts/default/8187628276384341177'/><link rel='alternate' type='text/html' href='http://amir-shenodua.blogspot.com/2013/12/tcl-find-widget-recursively.html' title='tcl: find widget recursively'/><author><name>Amir Shenouda</name><uri>http://www.blogger.com/profile/07148999334821169720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>