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

<channel>
	<title>Ali Moeen's Blog</title>
	<atom:link href="http://moeen.com/blog/index.php/feed" rel="self" type="application/rss+xml" />
	<link>http://moeen.com/blog</link>
	<description>.NET and related topics</description>
	<lastBuildDate>Fri, 25 Mar 2011 20:43:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Hyper-V Migration and HAL</title>
		<link>http://moeen.com/blog/index.php/archives/76</link>
		<comments>http://moeen.com/blog/index.php/archives/76#comments</comments>
		<pubDate>Sun, 08 Aug 2010 03:14:26 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/index.php/archives/76</guid>
		<description><![CDATA[When a Windows 2003/XP virtual machine is migrated to Hyper-V, it is not easy to migrate it back to Virtual PC &#8211; or VirtualBox. The reason is Hyper-V changes HAL and it is not easy to change the HAL on 2003/XP machine. This issue is solved since windows Vista and up. Starting windows vista, Windows [...]]]></description>
			<content:encoded><![CDATA[<p>When a Windows 2003/XP virtual machine is migrated to Hyper-V, it is not easy to migrate it back to Virtual PC &#8211; or VirtualBox. The reason is Hyper-V changes HAL and it is not easy to change the HAL on 2003/XP machine. This issue is solved since windows Vista and up. Starting windows vista, Windows can detect and change HAL. The detect and change HAL option is available in MSConfig-&gt;Boot Tab-&gt;Advanced Options-&gt;Detect HAL </p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Detect HAL" border="0" alt="Detect HAL" src="http://www.moeen.com/blog/PostsImagesFiles/HyperVMigrationandHAL_146BD/clip_image002.jpg" width="389" height="384" /></p>
<p>Windows 2008 guest has built in support for Hyper-V; however, when a Windows 2008 image is migrated to Hyper-V, “Detect HAL” option should be selected or Hyper-V drivers won’t work. The following screenshot shows the symptoms of undetected HAL in a windows 2008 guest:</p>
<p><a href="http://www.moeen.com/blog/PostsImagesFiles/HyperVMigrationandHAL_146BD/clip_image004_3.jpg" target="_blank" rel="lightbox[76]" title="Undetected HAL Symptoms "><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Undetected HAL Symptoms " border="0" alt="Undetected HAL Symptoms " src="http://www.moeen.com/blog/PostsImagesFiles/HyperVMigrationandHAL_146BD/clip_image004_thumb.jpg" width="680" height="744" /></a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/76/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to start and wait for a SQL Server JOB &#8211; The feature should be added to sp_start_job</title>
		<link>http://moeen.com/blog/index.php/archives/110</link>
		<comments>http://moeen.com/blog/index.php/archives/110#comments</comments>
		<pubDate>Sat, 08 May 2010 20:34:00 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL sp_start_job agent]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/index.php/archives/110</guid>
		<description><![CDATA[There are straight forward options to start a SQL Server agent job. The options include sp_start_job and “Execute SQL Server Agent Job Task” in SSIS and Maintenance Plans. The issue is that there is no way to start a job and wait until the job is finished. That means the next TSQL or SSIS task [...]]]></description>
			<content:encoded><![CDATA[<p>There are straight forward options to start a SQL Server agent job. The options include sp_start_job and “Execute SQL Server Agent Job Task” in SSIS and Maintenance Plans. The issue is that there is no way to start a job and wait until the job is finished. That means the next TSQL or SSIS task starts right after.</p>
<p>I created with the following small stored procedure that becomes handy when it is required to start an Agent Job and wait until it finishes its work.</p>
<pre class="brush: sql; toolbar: true">CREATE PROC [dbo].[usbStartAndMonitorJob]
(
	@JobName	VARCHAR(200)
)
AS
BEGIN
	IF 1&lt;&gt;(SELECT COUNT(*)
		FROM
			OPENROWSET(
			'SQLNCLI', 'Server=localhost;Trusted_Connection=yes;',
			'EXEC MSDB.dbo.sp_help_job  ')
		WHERE name = @JobName)
	BEGIN
		PRINT 'CANNOT FIND JOB: ' + ISNULL(@JobName,'')
		RETURN -1
	END
	DECLARE @StartTime DATETIME
	DECLARE @JobStatus INT
	SET @JobStatus = 0
	SET @StartTime = GETDATE()
	PRINT 'Execute and wait: '+@JobName
	EXEC MSDB.dbo.sp_start_job @Job_Name = @JobName
	WAITFOR DELAY '00:00:03'

	SELECT TOP 1 @JobStatus=current_execution_status
		FROM
			OPENROWSET(
			'SQLNCLI', 'Server=localhost;Trusted_Connection=yes;',
			'EXEC MSDB.dbo.sp_help_job  ')
		WHERE name = @JobName
	-- This is just to flush the output messages while waiting
	RAISERROR ('', 10,1)  WITH NOWAIT
	WHILE @JobStatus &lt;&gt; 4
	BEGIN
		WAITFOR DELAY '00:00:03'
		SELECT @JobStatus=current_execution_status
			FROM
				OPENROWSET(
				'SQLNCLI', 'Server=localhost;Trusted_Connection=yes;',
				'EXEC MSDB.dbo.sp_help_job  ')
			WHERE name = @JobName
		PRINT 'Afert '+CAST(DATEDIFF(second,@StartTime , GETDATE()) AS VARCHAR)
			+' seconds, the status is: '+CAST(@JobStatus AS VARCHAR)
		-- This is just to flush the output messages while waiting
		RAISERROR ('', 10,1)  WITH NOWAIT 

	END
	PRINT 'Job executed ended'
RETURN 0
END</pre>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/110/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 10 Reasons Notepad Should Be Replaced With Notepad++ On Developer Machines</title>
		<link>http://moeen.com/blog/index.php/archives/68</link>
		<comments>http://moeen.com/blog/index.php/archives/68#comments</comments>
		<pubDate>Wed, 12 Aug 2009 22:16:14 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/index.php/archives/68</guid>
		<description><![CDATA[Text editors are essential part of our day to day work and there are many to choose. Perhaps, Visual Studio?s test editor is the first choice for .NET development. Besides that, usually we need a light and fast text editor for the rest of text editing work. Notepad++ (NPP) is my favorite.Here are my top [...]]]></description>
			<content:encoded><![CDATA[<p>Text editors are essential part of our day to day work and there are many to choose. Perhaps, Visual Studio?s test editor is the first choice for .NET development. Besides that, usually we need a light and fast text editor for the rest of text editing work. <a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank">Notepad++ (NPP)</a> is my favorite.Here are my top ten reasons why:</p>
<ol>
<li>NPP includes most standard features other text editors have (i.e regex search and replace, bookmarks, macros, multi document, multi view, accurate zoom, etc&#8230;)      </li>
<li>NPP does rectangular block text selection (Alt-Shift-Arrows or Alt-Mouse) and rectangular text clipboard operations. Rectangular operations becomes even more powerful when used with Edit-&gt;Column Editor      </li>
<li>NPP includes syntax highlight and auto complete for popular languages including XML. Also, NPP highlights brace { } [ ] ( ) and indent guideline.      <br /><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Highlighted Brace " border="0" alt="Highlighted Brace " src="http://www.moeen.com/blog/PostsImagesFiles/1f349d8d5302_F8FD/image.png" width="319" height="178" />       </li>
<li>NPP is slim, low foot print and fast. It is able to load and handle large files      </li>
<li>Includes many handy utilities including:
<ul>
<li>HTML and RTF syntax highlight export to file or clipboard </li>
<li>MIME tools and Base64 encode/decode </li>
<li>Converts DEC, HEX, OCT, Bin, Text, EBSDIC and ASCII to each other.          </li>
</ul>
</li>
<li>NPP includes a powerful hex/binary editor plug-in. The hex editor is flexible and offers many options. One key switches back and forth between text and HEX view/Edit:&#160;
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HexEditor" border="0" alt="HexEditor" src="http://www.moeen.com/blog/PostsImagesFiles/1f349d8d5302_F8FD/image_3.png" width="487" height="293" />       </li>
<li>NPP supports many text file format including Linux, Windows and Mac format:<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Formats" border="0" alt="Formats" src="http://www.moeen.com/blog/PostsImagesFiles/1f349d8d5302_F8FD/clip_image004.jpg" width="343" height="290" />       </li>
<li>NPP monitors file system and notifies user when another program modifies the file being edited      </li>
<li>XCopy is an option. It is included in <a href="http://portableapps.com/apps/development/notepadpp_portable" target="_blank">Portable Apps</a> as well       </li>
<li>The last but not least, <strong>It is free!</strong> </li>
</ol>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/68/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get details about svchost.exe entries in the task manager</title>
		<link>http://moeen.com/blog/index.php/archives/64</link>
		<comments>http://moeen.com/blog/index.php/archives/64#comments</comments>
		<pubDate>Mon, 01 Jun 2009 02:00:16 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[OS]]></category>
		<category><![CDATA[Windows OS]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/index.php/archives/64</guid>
		<description><![CDATA[We don?t get much information about bunch of svchost.exe entries in windows task manager. The KB314056 explains how to use Tasklist /SVC command line at the command prompt to get the details: The alternative method is adding the command line column to the task manager:]]></description>
			<content:encoded><![CDATA[<p>We don?t get much information about bunch of svchost.exe entries in windows task manager. The <a href="http://support.microsoft.com/kb/314056" target="_blank">KB314056</a> explains how to use <strong>Tasklist /SVC </strong>command line at the command prompt to get the details:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.moeen.com/blog/PostsImagesFiles/Howtogetdetailsa.exeentriesintaskmanager_13554/image_4.png" width="672" height="335" /> </p>
<p>The alternative method is adding the command line column to the task manager:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.moeen.com/blog/PostsImagesFiles/Howtogetdetailsa.exeentriesintaskmanager_13554/image_5.png" width="677" height="459" /></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invading classes&#8217; privacy with reflection</title>
		<link>http://moeen.com/blog/index.php/archives/34</link>
		<comments>http://moeen.com/blog/index.php/archives/34#comments</comments>
		<pubDate>Fri, 01 Jun 2007 19:37:42 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/?p=34</guid>
		<description><![CDATA[This is not a new technique, but I found it interesting. We can easily manipulate private or protected member of a class by using reflection. It shouldn&#8217;t be used in normal circumstances, but it could become a useful hack when we have to use an assembly developed by someone else and some minor manipulations are [...]]]></description>
			<content:encoded><![CDATA[<p>This is not a new technique, but I found it interesting. We can easily manipulate private or protected member of a class by using reflection. It shouldn&#8217;t be used in normal circumstances, but it could become a useful hack when we have to use an assembly developed by someone else and some minor manipulations are necessary;) Here is a sample: </p>
<pre class="brush: csharp; toolbar: true">

using System.Reflection; 

 namespace PrivateMembersExposed 

 {
     class Program
     {
        static void Main(string[] args)
        {
            ClassWithPrivateMembers c = new ClassWithPrivateMembers();
            c.PrintThePrivateString();
            FieldInfo fieldInfo;
            fieldInfo = c.GetType().GetField(&quot;privateString&quot;, BindingFlags.Instance | BindingFlags.NonPublic);
            fieldInfo.SetValue(c, &quot;Yes, I can!&quot;);
            c.PrintThePrivateString();
            System.Console.ReadKey();
        }
     }
     public class ClassWithPrivateMembers
     {
         public void PrintThePrivateString()
         {
             System.Console.WriteLine(privateString);
         }
         private string privateString = &quot;Can you aecess this?&quot;;
     }
 }
 </pre>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Visual Studio 2005 External Tools</title>
		<link>http://moeen.com/blog/index.php/archives/33</link>
		<comments>http://moeen.com/blog/index.php/archives/33#comments</comments>
		<pubDate>Mon, 23 Apr 2007 17:37:38 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[Visaul Studio]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/?p=33</guid>
		<description><![CDATA[Here are items I have in my Visual Studio external tools as little shortcuts: Refelctor the Compiled Assembly Gacutil the class library Put a strong name key in the project directory. Once I use the .snk file, I make it read-only so it won?t be over written by running this command again]]></description>
			<content:encoded><![CDATA[<p>Here are items I have in my Visual Studio external tools as little shortcuts:</p>
<ul>
<li>Refelctor the Compiled Assembly </li>
<li>Gacutil the class library </li>
<li>Put a strong name key in the project directory. Once I use the .snk file, I make it read-only so it won?t be over written by running this command again </li>
</ul>
<table border="0" cellspacing="0" cellpadding="5" width="100">
<tbody>
<tr>
<td><a href="http://farm1.static.flickr.com/179/469333789_50fa660418_o.jpg" rel="lightbox[vsplugin]" title="My Visual Studio 2005 External Tools">           <br /><img alt="Click to Enlarge" src="http://farm1.static.flickr.com/179/469333789_452e3347fb_m.jpg" />             <br /></a></td>
<td><a href="http://farm1.static.flickr.com/204/469318678_bd097f23a1_o.jpg" rel="lightbox[vsplugin]" title="My Visual Studio 2005 External Tools">           <br /><img alt="Click to Enlarge" src="http://farm1.static.flickr.com/204/469318678_1886b05c8a_m.jpg" />             <br /></a></td>
</tr>
<tr>
<td><a href="http://farm1.static.flickr.com/194/469333447_4fb8507461_o.jpg" rel="lightbox[vsplugin]" title="My Visual Studio 2005 External Tools">           <br /><img alt="Click to Enlarge" src="http://farm1.static.flickr.com/194/469333447_42f95e5bc5_m.jpg" />             <br /></a></td>
</tr>
</tbody>
</table>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/33/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This one is even better than Google Calculator!</title>
		<link>http://moeen.com/blog/index.php/archives/32</link>
		<comments>http://moeen.com/blog/index.php/archives/32#comments</comments>
		<pubDate>Fri, 20 Apr 2007 17:01:33 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[Windows User]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/?p=32</guid>
		<description><![CDATA[Google calculator works perfect. But when we don&#8217;t have internet connection or for some complex calculations javascript is the solution! Here is a sample: So you think it is not powerful enough? Copy and paste this line to your browser&#8217;s address bar (one line) : javascript:for (var x = 0; x &#60;= 4*Math.PI; x+=.5) document.write(&#34;********************&#34;.substr(0,5+5*Math.sin(x))+ [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
<!--
.Code {
	font-family: "Courier New", Courier, monospace;
	font-size: 12px;
	font-weight: bold;
	background-color: #CCCCCC;
	border: thin solid #999999;
}
-->
</style>
<p>Google calculator works perfect. But when we don&#8217;t have internet connection or for some complex calculations javascript is the solution! Here is a sample:<br />
  <img src="http://farm1.static.flickr.com/195/466282332_19cdcf9c9f_o.jpg"></p>
<p>So you think it is not powerful enough? Copy and paste this line to your browser&#8217;s address bar (one line) :</p>
<p class="Code">javascript:for  (var x = 0; x &lt;= 4*Math.PI; x+=.5)  document.write(&quot;********************&quot;.substr(0,5+5*Math.sin(x))+  &quot;&lt;br/&gt;&quot;);</p>
<p><p>It works in both IE and Firefox.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/32/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio&#8217;s Hidden Icon Library</title>
		<link>http://moeen.com/blog/index.php/archives/30</link>
		<comments>http://moeen.com/blog/index.php/archives/30#comments</comments>
		<pubDate>Wed, 18 Apr 2007 02:07:41 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[Visaul Studio]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/?p=30</guid>
		<description><![CDATA[When we add a ToolBar to a WonForm form, we can add a set of standard button to the toolbar. I searched my local hard drive for the icon files and I couldn?t find them. After a little investigation I fond that the Icon and Image Library is stored within a zip file at this [...]]]></description>
			<content:encoded><![CDATA[<p>When we add a ToolBar to a WonForm form, we can add a set of standard button to the toolbar. I searched my local hard drive for the icon files and I couldn?t find them. After a little investigation I fond that the Icon and Image Library is stored within a zip file at this location:</p>
<p>C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary\ VS2005ImageLibrary.zip</p>
<p>There are bunch of nice images and icons inside the zip file. Enjoy!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to audit HDD used space</title>
		<link>http://moeen.com/blog/index.php/archives/31</link>
		<comments>http://moeen.com/blog/index.php/archives/31#comments</comments>
		<pubDate>Tue, 10 Apr 2007 14:32:33 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[Windows User]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/?p=31</guid>
		<description><![CDATA[I ran out of HDD free space last week and I knew it can?t be for real. I used WinDirStat and in a snap I found I have couple of abandoned virtual machines somewhere on my hard drive. WinDirStat efficiently illustrates big files and folders and makes it easy to go through big folders and [...]]]></description>
			<content:encoded><![CDATA[<p>I ran out of HDD free space last week and I knew it can?t be for real. I used <a href="http://windirstat.info/">WinDirStat</a> and in a snap I found I have couple of abandoned virtual machines somewhere on my hard drive. WinDirStat efficiently illustrates big files and folders and makes it easy to go through big folders and inspect their contents:&#160;</p>
<p>&#160;</p>
<div align="center"><a href="http://farm1.static.flickr.com/214/466191244_1e1480b1e2_o.jpg" rel="lightbox[windirstat]" title="How to audit HDD used space">     <br /> <img alt="Click to Enlarge" src="http://farm1.static.flickr.com/214/466191244_1571c102a3_m.jpg" />      <br /> </a>     </div>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to take a copy of an assembly from GAC</title>
		<link>http://moeen.com/blog/index.php/archives/19</link>
		<comments>http://moeen.com/blog/index.php/archives/19#comments</comments>
		<pubDate>Fri, 01 Jul 2005 15:29:02 +0000</pubDate>
		<dc:creator>Ali Moeen</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://moeen.com/blog/?p=19</guid>
		<description><![CDATA[Putting an assembly into GAC is easy, but how about taking a copy of that assembly back? I needed to have Microsoft.Sharepoint.DLL on my development machine to compile a project and I had to take Microsoft.Sharepoint.DLL from the server?s GAC. Assemblies are stored in: C:\Windows\assembly\GAC\{assemblyname}\{version}__{publickey}\ The easiest way to access that location is using command [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>Putting an assembly into GAC is easy, but how about taking a copy of that assembly back? I needed to have Microsoft.Sharepoint.DLL on my development machine to compile a project and I had to take Microsoft.Sharepoint.DLL from the server?s GAC. Assemblies are stored in:</p>
<p> 
<p>C:\Windows\assembly\GAC\{assemblyname}\{version}__{publickey}\</p>
<p> 
<p>The easiest way to access that location is using command prompt.   </p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://moeen.com/blog/index.php/archives/19/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

