<?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>Blog of developer Mikkel Ovesen &#187; visual studio</title>
	<atom:link href="http://blog.ovesens.net/tag/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ovesens.net</link>
	<description>My thoughts, stuff I need to remember or things I just want to share with the world</description>
	<lastBuildDate>Thu, 19 Jan 2012 11:55:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>My attempts at installing Umbraco via NuGet</title>
		<link>http://blog.ovesens.net/2011/11/my-attempts-at-installing-umbraco-via-nuget/</link>
		<comments>http://blog.ovesens.net/2011/11/my-attempts-at-installing-umbraco-via-nuget/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 13:19:20 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[nuget]]></category>
		<category><![CDATA[umbraco]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://blog.ovesens.net/?p=461</guid>
		<description><![CDATA[I often use Umbraco as a CMS for my web projects, and NuGet for referencing other libraries. This made me wonder whether Umbraco could be deployed via Nuget. The short answer is, it is possible, but it does not work &#8230; <a href="http://blog.ovesens.net/2011/11/my-attempts-at-installing-umbraco-via-nuget/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I often use <a href="http://umbraco.com/">Umbraco</a> as a CMS for my web projects, and NuGet for referencing other libraries. This made me wonder whether Umbraco could be deployed via Nuget. The short answer is, it is possible, but it does not work very well. Here is my experience.</p>
<p>I started to read the <a href="http://docs.nuget.org/">NuGet docs</a> to figure out what a NuGet package actually is.</p>
<h2>NuGet package</h2>
<p>A NuGet package is a file that makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework. A NuGet package is comprised by these three things:</p>
<ul>
<li><strong>tools</strong> &#8211; The tools folder of a package is for powershell scripts and programs accessible from the Package Manager Console. After the folder is copied to the target project, it is added to the `$env:Path (PATH) environment variable.</li>
<li><strong>lib</strong> &#8211; Assemblies (.dll files) in the lib folder are added as assembly references when the package is installed.</li>
<li><strong>content</strong> &#8211; Files in the content folder are copied to the root of your application when the package is installed.</li>
</ul>
<div><em><span style="font-size: small;"><span class="Apple-style-span" style="line-height: 24px;">The above is from the <a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package">NuGet docs</a>.</span></span></em></div>
<p>The documentation also indicate that NuGet was not designed for a project like Umbraco with so many files and such a complex web.config file. But I wanted to try and see how and if it was actually possible.</p>
<h2>The strategy</h2>
<p>The Umbraco project consists of libraries/assemblies and content, so it should be rather easy to create the NuGet package.</p>
<p>The first step was to download Umbraco 4.7.1 and go through the required assemblies and web.config. Initially I located assemblies that could already be found on NuGet and added these dependencies to the NuGet package. It later showed, that there would be versioning problems which I was not able to fix.</p>
<p>So instead of using dependencies to other NuGet packages as NuGet was actually intended, I  just added all the assemblies released with Umbraco 4.7.1.</p>
<h2>Assemblies</h2>
<p>The assemblies that gave me the most trouble was ClientDependency and ICharpCode.SharpZipLib.</p>
<p>ClientDependency was actually already in the NuGet feed, but the configuration transformation made from that NuGet package combined with the web.config transformation from the Umbraco package, yilded an invalid web.config file.  ClientDependency was therefor provided as an assembly directly from the Umbraco package and not as an external dependency.</p>
<p>The assembly ICSharpCode.SharpZipLib was also found in the NuGet feed, but Umbraco 4.7.1 required a specific version (0.85.5.452) that NuGet could not provide, and this assembly was as such also added as a part of the Umbraco package.</p>
<h2>Web.config</h2>
<p>The web.config configuration file for Umbraco is long and rather complex, and that makes merging of multiple web.config files difficult. The configuration transformation features in NuGet are limited, so you should expect problems when adding the Umbraco package to an existing website. The best results I achieved was when the package was added to an empty website or web application.</p>
<p>But even though a web.config file is almost empty, you should still prepare for some clean up.</p>
<h2>Content</h2>
<p>The <a href="http://umbraco.codeplex.com/releases/view/73692">Umbraco 4.7.1 binary release</a> containes more than 1500 files. NuGet was not designed for this number of files and does not handle it very well. A complete package installation can take up to 5-10 min. depending on you machine and SSD/HDD configuration.</p>
<h2>Example</h2>
<p>The following describes the steps I used to run the Umbraco NuGet package against a web application project and the problems that arose.</p>
<p>1. Open Visual Studio 2010 and create an empty C# web application project</p>
<p>2. Open the NuGet Package Manager Console</p>
<p>3. Write:</p>
<pre>Install-Package "Umbraco" -Source "c:\[NuGetPackageFolder]"</pre>
<p><em>NuGetPackageFolder: Replace with the path to the folder containing the Umbraco.4.7.1.nupkg file. <strong>Important do not give the full path to the file, just the folder</strong></em></p>
<p>4. Hit [ENTER] and wait for NuGet to do its work</p>
<p>5. Wait for the following two messages:</p>
<pre>Successfully installed 'Umbraco 4.7.1'.
Successfully added 'Umbraco 4.7.1' to WebApplication1.</pre>
<p>6. Compile and receive an error from web.config. (Multiple System.Web -&gt; Compilation sections are present)</p>
<p>7. Remove the first and compile and run again</p>
<pre class="brush: xml;">&lt;compilation debug="true" targetFramework="4.0" /&gt;</pre>
<p>8. At this point everything worked and I was able to follow the usual Umbraco installation steps <img src='http://blog.ovesens.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Conclusion</h2>
<p>Umbraco is a fantastic CMS and NuGet is very cool, but together is not a good idea.</p>
<p>My goal was to find a way for installing Umbraco to a web project via NuGet, and that is not impossible, but I would not recommend it. I find it a lot easier to simply download the Umbraco released ZIP, and then extract and drag all files to my web application project. So that is what I will do <img src='http://blog.ovesens.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But if you still wants the Umbraco NuGet file, you can download it <a href="/wp-content\uploads/2011/11/Umbraco.4.7.1.nupkg.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2011/11/my-attempts-at-installing-umbraco-via-nuget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook Pro BootCamp/Windows keyboard schema</title>
		<link>http://blog.ovesens.net/2011/11/macbook-pro-bootcampwindows-keyboard-schema/</link>
		<comments>http://blog.ovesens.net/2011/11/macbook-pro-bootcampwindows-keyboard-schema/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 20:37:16 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bootcamp]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[resharper]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://blog.ovesens.net/?p=370</guid>
		<description><![CDATA[Visual Studio 2010 + Resharper Key Description FN+ALT+[Right arrow] Go to sub types FN+ALT+[Left arrow] Go to super types ALT+SHIFT+F12 Find usages of variable CTRL+SHIFT+F11 Go to type of variable CTRL+SHIFT+R Refactor this CTRL+SHIFT+T Go to file CTRL+T Go to &#8230; <a href="http://blog.ovesens.net/2011/11/macbook-pro-bootcampwindows-keyboard-schema/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Visual Studio 2010 + Resharper</h2>
<table>
<thead>
<tr>
<th>Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>FN+ALT+[Right arrow]</td>
<td>Go to sub types</td>
</tr>
<tr>
<td>FN+ALT+[Left arrow]</td>
<td>Go to super types</td>
</tr>
<tr>
<td>ALT+SHIFT+F12</td>
<td>Find usages of variable</td>
</tr>
<tr>
<td>CTRL+SHIFT+F11</td>
<td>Go to type of variable</td>
</tr>
<tr>
<td>CTRL+SHIFT+R</td>
<td>Refactor this</td>
</tr>
<tr>
<td>CTRL+SHIFT+T</td>
<td>Go to file</td>
</tr>
<tr>
<td>CTRL+T</td>
<td>Go to type</td>
</tr>
<tr>
<td>FN+ALT+[ENTER]</td>
<td>Generate</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2011/11/macbook-pro-bootcampwindows-keyboard-schema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 Package load errors</title>
		<link>http://blog.ovesens.net/2011/10/visual-studio-2010-package-load-errors/</link>
		<comments>http://blog.ovesens.net/2011/10/visual-studio-2010-package-load-errors/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 07:11:35 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://blog.ovesens.net/?p=439</guid>
		<description><![CDATA[My Windows 7 installation on my laptop broke down, and I then had to completely reinstall Windows 7, Visual Studio etc. Besides it being a long and tedious process it seemed to go fine. But I started to get the &#8230; <a href="http://blog.ovesens.net/2011/10/visual-studio-2010-package-load-errors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My Windows 7 installation on my laptop broke down, and I then had to completely reinstall Windows 7, Visual Studio etc.</p>
<p>Besides it being a long and tedious process it seemed to go fine. But I started to get the following error messages when Visual Studio 2010 was launched:</p>
<blockquote><p>The &#8216;RadLangSvc.Package, RadLangSvc.VS, Version = 10.0.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91&#8242; failed to load</p></blockquote>
<blockquote><p>VSTS for Database Professionals Sql Server Data-tier Application did not load</p></blockquote>
<p>and some other VSTS packages that was unable to load.</p>
<p>I followed the steps described <a href="http://techsolutions-at-desk.blogspot.com/2011/04/radlangsvcvs-version-10000-culture.html">here</a>, and it worked <img src='http://blog.ovesens.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The steps are also described below:</p>
<ol>
<li>Close all running instances of Visual Studio 2010</li>
<li>Install the following MSI packages from the installation CD of VS2010, in the folder  \WCU\DAC</li>
<li>DACProjectSystemSetup_enu.msi</li>
<li>TSqlLanguageService_enu.msi</li>
<li>DACFramework_enu.msi</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2011/10/visual-studio-2010-package-load-errors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cuda v3.2 template project using C++</title>
		<link>http://blog.ovesens.net/2011/05/cuda-v3-2-template-project-using-cpp/</link>
		<comments>http://blog.ovesens.net/2011/05/cuda-v3-2-template-project-using-cpp/#comments</comments>
		<pubDate>Wed, 18 May 2011 16:59:27 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[cuda]]></category>
		<category><![CDATA[gpgpu]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">http://blog.ovesens.net/?p=388</guid>
		<description><![CDATA[Important The tutorial is missing some compilation, linker, library settings steps. However you can download the template project, it works and has everything setup. Introduction Download template project source Download executable I am a developer who has been developing software &#8230; <a href="http://blog.ovesens.net/2011/05/cuda-v3-2-template-project-using-cpp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Important</h2>
<p>The tutorial is missing some compilation, linker, library settings steps. However you can download the template project, it works and has everything setup.</p>
<h1>Introduction</h1>
<ul>
<li><a href="/wp-content/uploads/2011/05/CudaTemplate_Cuda_3.2.zip">Download template project source</a></li>
<li><a href="/wp-content/uploads/2011/05/CudaTemplate_exe_Cuda_3.2.zip">Download executable</a></li>
</ul>
<h2><span style="font-size: 16px; color: #444444; line-height: 24px;">I am a developer who has been developing software using .NET and C# for several years. I have never used C or C++, and it has never been required.</span></h2>
<p>I like to investigate new technologies, mainly because I am curious, but also because it could make my daily development work easier or smarter.</p>
<p>Recently my focus has been directed towards GPGPU on the Nvidia Cuda platform.</p>
<p>The programming language for Cuda is called &#8220;Cuda C&#8221;. The name implies that knowledge of C indeed is required for using GPGPU on the Cuda platform.</p>
<p>I discovered that there exist .NET bindings to the Cuda platform and drivers. However, I find their usage complicated and insufficient, and further more kernel development will still have to done in Cuda C.</p>
<p>These fact made me realise that I would have to learn a bit of C and C++ to use Cuda as it was actually intended by Nvidia. Nvidia provides many samples and suggest that a Cuda development environment on Windows could use Visual Studio and Nvidia Parallel NSight for debugging, profiling etc.</p>
<p>As my knowledge of C and C++ development was severely limited, so was the setting up and configuration of Visual Studio 2008 for Cuda C development.</p>
<p>I have read &#8220;Cuda by example&#8230;&#8221; (<a href="http://developer.nvidia.com/object/cuda-by-example.html">http://developer.nvidia.com/object/cuda-by-example.html</a>), &#8220;Programming Massively Parallel Processors&#8230;&#8221; (<a href="http://www.nvidia.com/object/io_1264656303008.html">http://www.nvidia.com/object/io_1264656303008.html</a>) and &#8220;C Programming Language, 2. edition&#8221; (<a href="http://www.pearsonhighered.com/educator/product/C-Programming-Language/9780131103627.page">http://www.pearsonhighered.com/educator/product/C-Programming-Language/9780131103627.page</a>). These books have given me the foundation to start developing using Cuda C and GPGPU.</p>
<p>Setting up Visual Studio 2008 and making the compiler work required some work, but here is what I did.</p>
<h2>1. Download and install driver and toolkit</h2>
<p>Download Cuda toolkit and the developer driver and install. A restart is probably required. (<a href="http://developer.nvidia.com/object/gpucomputing.html">http://developer.nvidia.com/object/gpucomputing.html</a>)</p>
<h2>2. Start Visual Studio 2008, and create a new project of type Win32 Console Application</h2>
<p>Give the project and solution a name (here called Cuda_Template).</p>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_2_create_project..png"><img class="alignnone size-full wp-image-389" title="Step 2 - Create solution and project" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_2_create_project..png" alt="" width="804" height="572" /></a></p>
<h2>3. Click Next</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_3_click_next.png"><img class="alignnone size-full wp-image-398" title="Step 3 - Click next" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_3_click_next.png" alt="" width="625" height="530" /></a></p>
<h2>4. Select Console application and check the empty project, then click Finish</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_4_project_settings.png"><img class="alignnone size-full wp-image-399" title="Step 4 - Project settings" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_4_project_settings.png" alt="" width="625" height="530" /></a></p>
<h2>5. Add new item called main.cpp of type C++ File</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_5_create_cpp_file.png"><img class="alignnone size-full wp-image-400" title="Step 5 - Create C++ file" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_5_create_cpp_file.png" alt="" width="804" height="514" /></a></p>
<h2>6. Add the following code the file</h2>
<pre class="brush: cpp;">#include &lt;stdio.h&gt; 

int main() {

    printf("Hello world...\n);
    return 0;

}</pre>
<h2>7. Build and try to run the exe file. The output should be</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_7_exe_output.png"><img class="alignnone size-full wp-image-404" title="Step 7 - Hello world output" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_7_exe_output.png" alt="" width="709" height="359" /></a></p>
<h2>8. Select Project -&gt; Custom Build Rules&#8230;</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_8_custom_build_rules.png"><img class="alignnone size-full wp-image-405" title="Step 8 - Custom build rules" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_8_custom_build_rules.png" alt="" width="1280" height="760" /></a></p>
<h2>9. Select Cuda Runtime API build rule (v3.2)</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_9_cuda_build_rules.png"><img class="alignnone size-full wp-image-406" title="Step 9 - Cuda build rule" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_9_cuda_build_rules.png" alt="" width="676" height="433" /></a></p>
<h2>10. Add a new file called kernel.cu</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_10_create_kernel.png"><img class="alignnone size-full wp-image-407" title="Step 10 - Create kernel" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_10_create_kernel.png" alt="" width="804" height="514" /></a></p>
<h2>11. Add the following to the file kernel.cu</h2>
<pre class="brush: c;">/* power: raise base to n-th power; n &gt;= 0 */
__device__ int devicePower(int base, int n) {

    int p = 1;

    for (int i = 1; i &lt;= n; ++i) {
        p = p * base;
    }

    return p;
}

__global__ void power( int *base, int *n, int *output, int threadMax ) {

    int tid = threadIdx.x + blockIdx.x * blockDim.x;

    if (tid &lt; threadMax) {
        output[tid] = devicePower(base[tid], n[tid]);
    }

}</pre>
<h2>12. Right click the newly created file and select properties</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_12_kernel_properties.png"><img class="alignnone size-full wp-image-414" title="Step 12 - Kernel properties" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_12_kernel_properties.png" alt="" width="1280" height="760" /></a></p>
<h2>13. Set the &#8220;Exclude From Build&#8221; and make sure that the project still builds</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_13_kernel_exclude_from_build.png"><img class="alignnone size-full wp-image-415" title="Step 13 - Exclude kernel from build" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_13_kernel_exclude_from_build.png" alt="" width="759" height="531" /></a></p>
<h2>14. Create a new file called call_kernel.cu</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_14_create_kernel_call_file..png"><img class="alignnone size-full wp-image-416" title="Step 14 - Create C++ kernel calling file" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_14_create_kernel_call_file..png" alt="" width="804" height="514" /></a></p>
<h2>15. Add the following to the file call_kernel.cu</h2>
<pre class="brush: c">#include &lt;cuda_runtime_api.h&gt;
#include "main.h"

// includes, kernels
#include &lt;kernel.cu&gt;

void call_kernel_power(int *base, int *n, int *output, int elementCount) {

    int *dev_base, *dev_n, *dev_output;
    int gridX = (elementCount+ThreadsPerBlock-1)/ThreadsPerBlock;

    cudaMalloc( (void**)&amp;dev_base, elementCount * sizeof(int) );
    cudaMalloc( (void**)&amp;dev_n, elementCount * sizeof(int) );
    cudaMalloc( (void**)&amp;dev_output, elementCount * sizeof(int) );

    cudaMemcpy( dev_base, base, elementCount * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy( dev_n, n, elementCount * sizeof(int), cudaMemcpyHostToDevice);

    power&lt;&lt;&lt;gridX,ThreadsPerBlock&gt;&gt;&gt;(dev_base, dev_n, dev_output, elementCount);

    cudaMemcpy( output, dev_output, elementCount * sizeof(int), cudaMemcpyDeviceToHost);

    cudaFree( dev_base );
    cudaFree( dev_n );
    cudaFree( dev_output );
}</pre>
<h2>16. Create a new header file called main.h</h2>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_16_create_main_header.png"><img class="alignnone size-full wp-image-419" title="Step 16 - Create header main.h file" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_16_create_main_header.png" alt="" width="804" height="514" /></a></p>
<h2>17. Add the following content to the file</h2>
<pre class="brush: cpp">#define ThreadsPerBlock 128

#include &lt;stdio.h&gt;

void call_kernel_power(int *base, int *n, int *output, int elementCount);</pre>
<h2>18. Update the main.cpp file with the following:</h2>
<pre class="brush: cpp">#include "main.h"

#define N   80000

int main() {

    printf("Power Cuda kernel test from C++\n");
    printf("Testing %d elements\n", N);

    int base[N], n[N], output[N];

    for(int i = 0; i &lt; N; i++) {
          base[i] = 2;
          n[i] = i+1;
          output[i] = 0;
      }

    call_kernel_power(base, n, output, N);

    for(int i = 0; i &lt; N &amp;&amp; i &lt; 15; i++) {

          printf("%d^%d = %d\n", base[i], n[i], output[i]);

      }

      printf("Done\n");

    return 0;
}</pre>
<h2>19. That should be it&#8230;</h2>
<p>You now have a template that you can work from. When you build the file and run it, I get this output:</p>
<p><a href="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_19_exe_output.png"><img class="alignnone size-full wp-image-417" title="Step 19 - Output" src="http://blog.ovesens.net/wp-content/uploads/2011/05/CudaTemplate_19_exe_output.png" alt="" width="661" height="487" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2011/05/cuda-v3-2-template-project-using-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manually start Visual Studio dev. web server</title>
		<link>http://blog.ovesens.net/2010/03/manually-start-visual-studio-dev-web-server/</link>
		<comments>http://blog.ovesens.net/2010/03/manually-start-visual-studio-dev-web-server/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 10:58:00 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs]]></category>

		<guid isPermaLink="false">http://blog.ovesens.net/?p=228</guid>
		<description><![CDATA[I needed to manually start the Visual Studio dev. web server for profililng purposes&#8230; The web server is located here: C:\Program Files (x86)\Common Files\microsoft shared\DevServer\9.0\WebDev.WebServer.EXE Arguments /port:&#60;port number&#62; Optional, an unused port number between 1 and 65535. /path:&#60;physical path&#62; A &#8230; <a href="http://blog.ovesens.net/2010/03/manually-start-visual-studio-dev-web-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed to manually start the Visual Studio dev. web server for profililng purposes&#8230;</p>
<pre>The web server is located here:
C:\Program Files (x86)\Common Files\microsoft shared\DevServer\9.0\WebDev.WebServer.EXE</pre>
<h2>Arguments</h2>
<table border="0" cellspacing="1" cellpadding="3">
<tbody>
<tr>
<td>/port:&lt;port number&gt;</td>
<td>Optional, an unused port number between 1 and 65535.</td>
</tr>
<tr>
<td>/path:&lt;physical path&gt;</td>
<td>A valid directory where the web application is rooted.</td>
</tr>
<tr>
<td>/vpath:&lt;virtual path&gt;</td>
<td>Optional, the virtual path or application root in the form of &#8216;/&lt;app name&gt;&#8217;.</td>
</tr>
</tbody>
</table>
<h2>Example</h2>
<pre>C:\Program Files (x86)\Common Files\microsoft shared\DevServer\9.0&gt;
WebDev.WebServer.EXE /port:8080 /path:"C:\Users\Administrator\Documents\Visual Studio 2008\Projects\WebApplication\Compiled" \vpath:"\"</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2010/03/manually-start-visual-studio-dev-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008 debugging and breakpoints</title>
		<link>http://blog.ovesens.net/2010/01/visual-studio-2008-debugging-and-breakpoints/</link>
		<comments>http://blog.ovesens.net/2010/01/visual-studio-2008-debugging-and-breakpoints/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 08:38:32 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">http://blog.ovesens.net/?p=207</guid>
		<description><![CDATA[My development tools are currently Visual Studio 2008, Resharper 4.5, Gallio and Testdriven.NET. But for as long as I have used these tools, my Visual Studio debugger has only worked partly. The problem When I inserted some breakpoints inÂ my code, &#8230; <a href="http://blog.ovesens.net/2010/01/visual-studio-2008-debugging-and-breakpoints/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My development tools are currently <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx" target="_blank">Visual Studio 2008</a>, <a href="http://www.jetbrains.com/resharper/index.html" target="_blank">Resharper 4.5</a>, <a href="http://www.gallio.org/" target="_blank">Gallio</a> and <a href="http://www.testdriven.net/" target="_blank">Testdriven.NET</a>. But for as long as I have used these tools, my Visual Studio debugger has only worked partly.</p>
<h2>The problem</h2>
<p>When I inserted some breakpoints inÂ my code, the first one was almost all the time hit. However, when I tried to step through the code, it worked fine for a bout 3-6 steps. But then Visual Studio debugger decided that was enough, and just completed the code.</p>
<p>The good thing was, it forced me to write many unit test cases, but sometimes I really think it is nice to visually see the state of your objects, in the code.</p>
<p>I have spoken to colleagues, and tested with different combinations of Gallio, Testdriven.NET and Re-sharper enabled, as I thought they cased the problem. But the debugger just kept bugging me. I had actually given up finding a solution to this problem, thinking that Visual Studio 2010 would fix it.</p>
<h2>The solution</h2>
<p>So finally, in a complete other context, I stumbled upon this page:</p>
<p><a href="http://code.msdn.microsoft.com/KB957912" target="_blank">http://code.msdn.microsoft.com/KB957912</a></p>
<p>And thought&#8230;. that title sounds interesting&#8230; I quickly moved to the <a href="http://support.microsoft.com/kb/957912" target="_blank">KB article</a>, and started to read. I thought, that sounds exactly as my problem.</p>
<p>With nothing to loose I installed the update, and started to test the debugger&#8230; until now it seems to work <img src='http://blog.ovesens.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>- please note, I do not use the debugger that often as I write very reliable code <img src='http://blog.ovesens.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2010/01/visual-studio-2008-debugging-and-breakpoints/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An Introduction to Native Concurrency in Visual Studio 2010</title>
		<link>http://blog.ovesens.net/2009/01/an-introduction-to-native-concurrency-in-visual-studio-2010/</link>
		<comments>http://blog.ovesens.net/2009/01/an-introduction-to-native-concurrency-in-visual-studio-2010/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 14:48:00 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">/post/2009/01/14/An-Introduction-to-Native-Concurrency-in-Visual-Studio-2010.aspx</guid>
		<description><![CDATA[Read this article: http://blogs.msdn.com/nativeconcurrency/archive/2009/01/12/an-introduction-to-native-concurrency-in-visual-studio-2010.aspx]]></description>
			<content:encoded><![CDATA[<p>
Read this article:
</p>
<p>
<a href="http://blogs.msdn.com/nativeconcurrency/archive/2009/01/12/an-introduction-to-native-concurrency-in-visual-studio-2010.aspx">http://blogs.msdn.com/nativeconcurrency/archive/2009/01/12/an-introduction-to-native-concurrency-in-visual-studio-2010.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2009/01/an-introduction-to-native-concurrency-in-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008 &#8211; ItemTemplatesCache missing</title>
		<link>http://blog.ovesens.net/2008/11/visual-studio-2008-itemtemplatescache-missing/</link>
		<comments>http://blog.ovesens.net/2008/11/visual-studio-2008-itemtemplatescache-missing/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 23:57:00 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs]]></category>
		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">/post/2008/11/11/Visual-Studio-2008-ItemTemplatesCache-missing.aspx</guid>
		<description><![CDATA[The issue&#160; My Visual Studio 2008 opened the solution file with no problem. However, when I was to add a new class, user control, aspx file or similar, I received the error: Could not find part of &#34;c:\Program Files\Microsoft Visual &#8230; <a href="http://blog.ovesens.net/2008/11/visual-studio-2008-itemtemplatescache-missing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1>The issue&nbsp;</h1>
<p>
My Visual Studio 2008 opened the solution file with no problem. However, when I was to add a new class, user control, aspx file or similar, I received the error:
</p>
<p>
Could not find part of &quot;c:\Program Files\Microsoft Visual Studio 9.0\&#8230;\ItemTemplatesCache&#8230;&quot;
</p>
<p>
[and the path to the ItemTemplatesCache in Visual Studio 2008 folder].
</p>
<h1>The solution</h1>
<p>
Well, one slution would be to reinstall or repair installation of Visual studio 2008. However, after searching for a while I found a solution that is much easier:
</p>
<ol>
<li>Open &quot;Visual Studio 2008 Command Prompt&quot; as an Administrator</li>
<li>Run the command: &quot;devenv /installvstemplates&quot;</li>
<li>That&#39;s it</li>
</ol>
<p>
&nbsp;
</p>
<p>
It takes a while but it completely rebuild your item template cache if it is corrupt or completely missing like me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2008/11/visual-studio-2008-itemtemplatescache-missing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How Do I: Debug ASP.NET AJAX Applications Using Visual Studio 2005?</title>
		<link>http://blog.ovesens.net/2007/09/how-do-i-debug-asp-net-ajax-applications-using-visual-studio-2005/</link>
		<comments>http://blog.ovesens.net/2007/09/how-do-i-debug-asp-net-ajax-applications-using-visual-studio-2005/#comments</comments>
		<pubDate>Sat, 29 Sep 2007 13:57:00 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs]]></category>
		<category><![CDATA[vs2005]]></category>

		<guid isPermaLink="false">/post/2007/09/29/How-Do-I-Debug-ASPNET-AJAX-Applications-Using-Visual-Studio-2005.aspx</guid>
		<description><![CDATA[Original post here: http://www.asp.net/learn/ajax-videos/video-167.aspx &#8212; In this video we learn how to use Visual Studio 2005 to debug ASP.NET AJAX applications. We are shown how the ScriptManager is used to access the JavaScript created by the ASP.NET AJAX server controls, &#8230; <a href="http://blog.ovesens.net/2007/09/how-do-i-debug-asp-net-ajax-applications-using-visual-studio-2005/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Original post here: <a title="http://www.asp.net/learn/ajax-videos/video-167.aspx" href="http://www.asp.net/learn/ajax-videos/video-167.aspx">http://www.asp.net/learn/ajax-videos/video-167.aspx</a></p>
<p>&#8212;</p>
<p>In this video we learn how to use Visual Studio 2005 to debug ASP.NET AJAX applications. We are shown how the ScriptManager is used to access the JavaScript created by the ASP.NET AJAX server controls, and we also see how to use the Sys.Debug class to insert a trace message and a breakpoint.</p>
<p>View video: <a href="/wp-content/uploads/archive/WinVideo-ASP-DebugAJAXApplicationsUsingVisualStudio2005.wmv">WinVideo-ASP-DebugAJAXApplicationsUsingVisualStudio2005.wmv (16.89 mb)</a></p>
<p><a href="/wp-content/uploads/archive/WinVideo-ASP-DebugAJAXApplicationsUsingVisualStudio2005.wmv"><img src="http://static.asp.net/asp.net/images/videos/video-167.png" alt="Play Video" width="264" height="156" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2007/09/how-do-i-debug-asp-net-ajax-applications-using-visual-studio-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using different Web.Config for development, test and production</title>
		<link>http://blog.ovesens.net/2007/09/using-different-web-config-for-development-test-and-production/</link>
		<comments>http://blog.ovesens.net/2007/09/using-different-web-config-for-development-test-and-production/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 14:34:59 +0000</pubDate>
		<dc:creator>Mikkel Ovesen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs]]></category>

		<guid isPermaLink="false">/post/2007/09/21/Using-different-WebConfig-for-development-test-and-production.aspx</guid>
		<description><![CDATA[Read more here: http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx &#xA0; Or here: http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx]]></description>
			<content:encoded><![CDATA[<p>Read more here:</p>
<p><a title="http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx" href="http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx">http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx</a></p>
<p><a href="http://weblogs.asp.net/scottgu/archive/2007/09/21/tip-trick-automating-dev-qa-staging-and-production-web-config-settings-with-vs-2005.aspx"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" alt="image" src="/wp-content/uploads/archive/WindowsLiveWriter/Usi.Configfordevelopmenttestandproductio_CD05/image_3.png" width="244" border="0" /></a> </p>
<p>&#xA0;</p>
<p>Or here:</p>
<p><a title="http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx" href="http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx">http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx</a></p>
<p><a href="http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="240" alt="image" src="/wp-content/uploads/archive/WindowsLiveWriter/Usi.Configfordevelopmenttestandproductio_CD05/image_6.png" width="244" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ovesens.net/2007/09/using-different-web-config-for-development-test-and-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

