<?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>Insidethe.com &#187; Programming</title>
	<atom:link href="http://www.insidethe.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.insidethe.com/blog</link>
	<description>It is my space, but better than myspace</description>
	<lastBuildDate>Mon, 30 Aug 2010 21:41:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>International Spectrum Article</title>
		<link>http://www.insidethe.com/blog/2010/04/international-spectrum-article/</link>
		<comments>http://www.insidethe.com/blog/2010/04/international-spectrum-article/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 19:53:17 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.insidethe.com/blog/?p=542</guid>
		<description><![CDATA[The company I work with contributes to International Spectrum. The publication serves the multi-value database community with news and new technologies. It was my pleasure to contribute an article. The second part of the two-part article was recently featured in the publication. The article demonstrates how BASIC-like languages can be extended using the object oriented programming [...]]]></description>
			<content:encoded><![CDATA[<p>The company I work with contributes to <a href="http://www.intl-spectrum.com" target="_blank">International Spectrum</a>. The publication serves the multi-value database community with news and new technologies. It was my pleasure to contribute an article. The second part of the two-part article was recently featured in the publication.</p>
<p>The article demonstrates how BASIC-like languages can be extended using the object oriented programming (OOP) concept of encapsulation to protect private variables. The article covers benefits and provides examples of how these modern concepts can further benefit non-OOP languages.</p>
<p><strong>First part</strong><br />
<a href="http://www.intl-spectrum.com/mag/MARAPR.2010/default.aspx">http://www.intl-spectrum.com/mag/MARAPR.2010/default.aspx</a></p>
<p><strong>Second part</strong><br />
<a href="http://www.intl-spectrum.com/mag/JANFEB.2010/default.aspx">http://www.intl-spectrum.com/mag/JANFEB.2010/default.aspx</a></p>
<p>The entire magazine is available for PDF download. No registration required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.insidethe.com/blog/2010/04/international-spectrum-article/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading Specific Versions of .NET Assemblies From the GAC Based on the Assembly Information in a .NET DLL &#8211; Visual Basic Example Code</title>
		<link>http://www.insidethe.com/blog/2010/03/loading-specific-versions-of-net-assemblies-from-the-gac-based-on-the-assembly-information-in-a-net-dll-example-code/</link>
		<comments>http://www.insidethe.com/blog/2010/03/loading-specific-versions-of-net-assemblies-from-the-gac-based-on-the-assembly-information-in-a-net-dll-example-code/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 23:49:39 +0000</pubDate>
		<dc:creator>jared</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.insidethe.com/blog/?p=494</guid>
		<description><![CDATA[By default the latest version of an assembly is loaded from the GAC (Global Assembly Cache) when the assembly is instantiated. While working on a side project the need arose to load older versions of the assembly without hard coding the assembly versions. The answer, load the existing assembly library from the assembly DLL and [...]]]></description>
			<content:encoded><![CDATA[<p>By default the latest version of an assembly is loaded from the GAC (Global Assembly Cache) when the assembly is instantiated. While working on a side project the need arose to load older versions of the assembly without hard coding the assembly versions. The answer, load the existing assembly library from the assembly DLL and interrogate it to find the assembly information. Then ask the GAC to provide a handle to the specific object. The result allows multiple versions of the same assembly to be loaded loaded at the same time.</p>
<p>The Visual Basic .NET example code below loads SampleAppV1\DotNetLibrary.DLL and AnotherSampleAppV2\DotNetLibrary.DLL which are different versions of the same assembly.</p>
<pre><span style="color: #008000;">'Load assembly using reflection from the file specified so we can get information about it</span>
<span style="color: #0000a0;">Dim</span> DLLAssemblyInfo <span style="color: #0000a0;">As</span> System.Reflection.Assembly
DLLAssemblyInfo = System.Reflection.Assembly.LoadFrom<span style="color: #c00000;">(</span><span style="color: #008080;">"\\\\appserver.company.int\\SampleAppV1\\DotNetLibrary.DLL"</span><span style="color: #c00000;">)</span>

<span style="color: #008000;">'Now load the assembly from the GAC using the information in the file. </span>
<span style="color: #0000a0;">Dim</span> GACDLL <span style="color: #0000a0;">As</span> System.Reflection.Assembly
GACDLL = System.Reflection.Assembly.Load<span style="color: #c00000;">(</span>AssemblyInfo.FullName, DLLAssemblyInfo.Evidence<span style="color: #c00000;">)</span></pre>
<pre><span style="color: #008000;">'Load the second version of the same assembly from the newer application
<span style="color: #000000;"><span style="color: #0000a0;">Dim</span> DLLAssemblyInfoV2 <span style="color: #0000a0;">As</span> System.Reflection.Assembly
DLLAssemblyInfoV2 = System.Reflection.Assembly.LoadFrom<span style="color: #c00000;">(</span><span style="color: #008080;">"\\\\appserver.company.int\\AnotherSampleAppV2\\DotNetLibrary.DLL"</span><span style="color: #c00000;">)</span></span></span></pre>
<pre><span style="color: #008000;">'Again, use the DLL information from the assembly file to load the assembly from the GAC</span>
<span style="color: #0000a0;">Dim</span> GACDLLv2 <span style="color: #0000a0;">As</span> System.Reflection.Assembly
GACDLLv2 = System.Reflection.Assembly.Load<span style="color: #c00000;">(</span>AssemblyInfoV2.FullName, DLLAssemblyInfoV2.Evidence<span style="color: #c00000;">)</span></pre>
<pre><span style="color: #008000;">'At this point in the code we have references to both assemblies loaded from the GAC. The next step is to instantiate an object from each of the references.</span></pre>
<pre><span style="color: #008000;">'Get an MyAssembly.Library from the old version and run the version method</span>
<span style="color: #0000a0;">Dim</span> GACDLLType <span style="color: #0000a0;">As Type</span> = GACDLL.GetType<span style="color: #c00000;">(</span><span style="color: #008080;">"MyAssembly.Library"</span><span style="color: #c00000;">)</span>
<span style="color: #0000a0;">Dim</span> MyLibV1 <span style="color: #0000a0;">As Object</span> = Activator.CreateInstance<span style="color: #c00000;">(</span>GACDLLType<span style="color: #c00000;">)</span>
<span style="color: #0000a0;">Dim</span> v1 <span style="color: #0000a0;">As String
<span style="color: #000000;">v1 = MyLibV1.Version</span></span></pre>
<pre><span style="color: #008000;">'Finally, do the same and get the new MyAssembly.Library</span>
<span style="color: #0000a0;">Dim</span> GACDLLTypeV2 <span style="color: #0000a0;">As Type</span> = GACDLLV2.GetType<span style="color: #c00000;">(</span><span style="color: #008080;">"MyAssembly.Library"</span><span style="color: #c00000;">)</span>
<span style="color: #0000a0;">Dim</span> MyLibV2 <span style="color: #0000a0;">As Object</span> = Activator.CreateInstance<span style="color: #c00000;">(</span>GACDLLTypeV2<span style="color: #c00000;">)</span>
<span style="color: #0000a0;">Dim</span> v2 <span style="color: #0000a0;">As String
<span style="color: #000000;">v2 = MyLibV2.Version</span></span></pre>
<p><span style="color: #0000a0;"><span style="color: #000000;"> </span></span></p>
<p><span style="color: #0000a0;"><span style="color: #000000;">The variables v1 and v2 were both retrieved from the MyAssembly.Library.Version() method but the variables will not contain the same value because different versions of the assembly were loaded from the GAC during the System.Reflection.Assembly.Load() call. </span></span></p>
<p>Why not just load the assembly from each of the DLL files instead of the GAC? Security restrictions prevented untrusted assemblies from being loaded over the network. A possible work around would be to trust the network location or sign the assemblies and trust the signer but that remains for another posting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.insidethe.com/blog/2010/03/loading-specific-versions-of-net-assemblies-from-the-gac-based-on-the-assembly-information-in-a-net-dll-example-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Launch a WSH VBScript as Administrator in Windows 7 and Vista</title>
		<link>http://www.insidethe.com/blog/2009/12/how-to-launch-a-wsh-vbscript-as-administrator-in-windows-7-and-vista/</link>
		<comments>http://www.insidethe.com/blog/2009/12/how-to-launch-a-wsh-vbscript-as-administrator-in-windows-7-and-vista/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 00:47:13 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.insidethe.com/blog/?p=358</guid>
		<description><![CDATA[The example below launches a VB script as administrator on Windows 7 and Vista regardless if the context menu contains the "Run as administrator" option. Registry tweaks exist to add the run as administrator option to the context menu for .vbs files but this creates complications if the script is distributed to other people. When [...]]]></description>
			<content:encoded><![CDATA[<p>The example below launches a VB script as administrator on Windows 7 and Vista regardless if the context menu contains the "Run as administrator" option. Registry tweaks exist to add the run as administrator option to the context menu for .vbs files but this creates complications if the script is distributed to other people.</p>
<p>When the script below is executed it checks to see if it was passed a command line argument named "elevated". If it is not found the script recursively calls itself passing the elevated command line argument and requests to be run as administrator. The user is prompted to confirm the action and the restricted script exits leaving the escalated administrator script running. When the user grants permission the elevated argument is found and the script changes back from the %System32% working directory to the script where the script is located.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">If WScript.Arguments.Named.Exists("elevated") = False Then</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>'Launch the script again as administrator</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>CreateObject("Shell.Application").ShellExecute "wscript.exe", """" &amp; WScript.ScriptFullName &amp; """ /elevated", "", "runas", 1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>WScript.Quit</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Else</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>'Change the working directory from the system32 folder back to the script's folder.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Set oShell = CreateObject("WScript.Shell")</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>oShell.CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>MsgBox "Now running with elevated permissions"</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">End If</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">'</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">'</div>
<pre><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">I</span>f WScript.Arguments.Named.Exists("elevated") = False Then</pre>
<pre><span style="white-space: pre;">	</span>'Launch the script again as administrator</pre>
<pre><span style="white-space: pre;">	</span>CreateObject("Shell.Application").ShellExecute "wscript.exe", """" &amp; WScript.ScriptFullName &amp; """ /elevated", "", "runas", 1</pre>
<pre><span style="white-space: pre;">	</span>WScript.Quit</pre>
<pre>Else</pre>
<pre><span style="white-space: pre;">	</span>'Change the working directory from the system32 folder back to the script's folder.</pre>
<pre><span style="white-space: pre;">	</span>Set oShell = CreateObject("WScript.Shell")</pre>
<pre><span style="white-space: pre;">	</span>oShell.CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)</pre>
<pre><span style="white-space: pre;">	</span>MsgBox "Now running with elevated permissions"</pre>
<pre>End If</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.insidethe.com/blog/2009/12/how-to-launch-a-wsh-vbscript-as-administrator-in-windows-7-and-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Give Google An Answer To Find the Question!?</title>
		<link>http://www.insidethe.com/blog/2009/10/give-google-an-answer-to-find-the-question/</link>
		<comments>http://www.insidethe.com/blog/2009/10/give-google-an-answer-to-find-the-question/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 15:57:27 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.insidethe.com/blog/?p=288</guid>
		<description><![CDATA[This is a anecdote of how Google gave the question to the answer I already had. Normally, people input questions and keywords into Google to find an answer. In my case the answer was known. Use caspol.exe with the -pub -file arguments to trust all the assemblies signed with my certificate. The MSDN caspol.exe documentation [...]]]></description>
			<content:encoded><![CDATA[<p>This is a anecdote of how Google gave the question to the answer I already had.</p>
<p>Normally, people input questions and keywords into Google to find an answer. In my case the answer was known. Use caspol.exe with the -pub -file arguments to trust all the assemblies signed with my certificate. The <a title="http://msdn.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx" href="http://" target="_blank">MSDN caspol.exe documentation</a> was helpful but the exact syntax for implementing the command was a little fuzzy.</p>
<p>When in doubt Google it. Behold, <a href="http://geekswithblogs.net/podwysocki/archive/2006/05/31/80262.aspx" target="_blank">the question to my answer</a> stated in a question:</p>
<blockquote><p>"What does this statement do? caspol -machine -addgroup All_Code -pub -file MyApp.exe FullTrust"</p></blockquote>
<p>Thanks to Matthew Podwysocki his question fit my answer and provided the syntax needed to complete my work with caspol.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.insidethe.com/blog/2009/10/give-google-an-answer-to-find-the-question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips to upgrade and maintain X-Cart PHP shopping cart</title>
		<link>http://www.insidethe.com/blog/2008/09/tips-to-upgrade-and-maintain-x-cart-php-shopping-cart/</link>
		<comments>http://www.insidethe.com/blog/2008/09/tips-to-upgrade-and-maintain-x-cart-php-shopping-cart/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 22:32:39 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.insidethe.com/blog/?p=111</guid>
		<description><![CDATA[During a recent shopping cart upgrade these three tips came to mind. Mostly when I failed to follow my own advice. The tips are in regards to manually patching files that have been customized. Comment, comment, comment. If you make a change to a PHP file or template that was supplied by the vendor make [...]]]></description>
			<content:encoded><![CDATA[<p>During a recent shopping cart upgrade these three tips came to mind. Mostly when I failed to follow my own advice. The tips are in regards to manually patching files that have been customized.</p>
<ol>
<li>Comment, comment, comment. If you make a change to a PHP file or template that was supplied by the vendor make a comment. Know what line the change started and where the change ends. When manually patching the file the comments will keep you from having to guess if a change is a patch from the vendor or a customization you made.</li>
<li>When making a customization, comment out the original code block using block comments (not line comments) and make your changes to a copy of the original code block. Eventually when the original code gets patched or updated by the vendor you will still have a reference to the original code and a utility like WinMerge will be able to help match up the changes to the original code.</li>
<li>For files that need manual patching use a utility such as <a href="http://www.winmerge.org/" target="_blank">WinMerge</a> to find and resolve conflicts. If you make ample comments and left original code blocks in place WinMerge will better be able to help you get the file patches and your customizations back in place.</li>
</ol>
<p>Good luck on patching your custom cart!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.insidethe.com/blog/2008/09/tips-to-upgrade-and-maintain-x-cart-php-shopping-cart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
