<?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>Panterlo</title>
	<atom:link href="http://www.panterlo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.panterlo.com</link>
	<description>Panterlo specializes in virtualization infrastructure and software for micro-, small- and medium sized businesses</description>
	<lastBuildDate>Sat, 09 Apr 2011 09:20:49 +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>Visual Studio Error &#8211; Build failed without any error messages</title>
		<link>http://www.panterlo.com/2011/04/09/visual-studio-error-build-failed-without-any-error-messages/</link>
		<comments>http://www.panterlo.com/2011/04/09/visual-studio-error-build-failed-without-any-error-messages/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 09:20:49 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Programming and development]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=351</guid>
		<description><![CDATA[You are trying to compile your solution or a single project and Visual Studio responds back with build failed message but without any errors shown in the error list and checking the output messages no real clue is given for the reason to the error.]]></description>
			<content:encoded><![CDATA[<h4>Background</h4>
<p>You are trying to compile your solution or a single project and Visual Studio responds back with build failed message but without any errors shown in the error list and checking the output messages no real clue is given for the reason to the error.</p>
<h3>The solution</h3>
<p>The error is caused by something that is very hard to find which is that the path to one or more files exceeds the Windows limit of 260 characters. Take a further look into the MSDN documentation about Naming Files, Paths, and Namespaces <a href="http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx">here</a>. </p>
<p>Microsoft says:<br />
<em>In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is &#8220;D:\some 256-character path string<NUL>&#8221; where &#8220;<NUL>&#8221; represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)</em></p>
<p>The paths often grows very large because you may use the namespaces as path identifiers and normally VS stores projects and solutions in your document folder, so you can end up with this as an example:</p>
<p>C:\Users\username.netbiosdomainname\Documents\Visual Studio 2010\Projects\namespace.sub.sub\namespaceproject.sub.sub</p>
<p>As you can see it&#8217;s quite fast grows to many characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2011/04/09/visual-studio-error-build-failed-without-any-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Most forgotten tools RDP with Royal TS and RDMan</title>
		<link>http://www.panterlo.com/2010/11/17/most-forgotten-tools-rdp-with-royal-ts-and-rdman/</link>
		<comments>http://www.panterlo.com/2010/11/17/most-forgotten-tools-rdp-with-royal-ts-and-rdman/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 09:25:39 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[RDMan]]></category>
		<category><![CDATA[RDP]]></category>
		<category><![CDATA[Remote Deskop]]></category>
		<category><![CDATA[Royal TS]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=215</guid>
		<description><![CDATA[Every system administrator uses remote desktop which is a great protocol by Microsoft. When you are having a lot of clients and virtual/physical servers you often face a problem with organizing and keeping track of all the connections. To add even more complexity you may need to go trough remote desktop gateway to connect to the endpoint. Using Microsoft Remote Desktop's MMC (included in Windows Administration Kit) is often seen but the mmc snap-in lacks many functions and have it's issues. I will have a look at two forgotten tools that should always be included in your system administrator toolkit and used daily.]]></description>
			<content:encoded><![CDATA[<h4>Background</h4>
<p>Every system administrator uses remote desktop which is a great protocol by Microsoft. When you are having a lot of clients and virtual/physical servers you often face a problem with organizing and keeping track of all the connections. To add even more complexity you may need to go trough remote desktop gateway to connect to the endpoint. Using Microsoft Remote Desktop&#8217;s MMC (included in Windows Administration Kit) is often seen but the mmc snap-in lacks many functions and have it&#8217;s issues. I will have a look at two forgotten tools that should always be included in your system administrator toolkit and used daily.</p>
<p>So to the rescue comes two tools,</p>
<ul>
<li><a href="http://www.code4ward.net/main/">Royal TS</a></li>
<li><a href="http://www.google.se/search?q=remote+desktop+connection+manager&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=org.mozilla:en-US:official&#038;client=firefox-a">RDMan (Remote Desktop Connection Manager)</a></li>
</ul>
<h3>Royal TS</h3>
<p>First we check out three screenshots of both Royal TS and RDMan, this is just for getting a feeling how they look.</p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/11/RoyalTS1.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/11/RoyalTS1.png" alt="" title="RoyalTS1" width="614" height="457" class="alignnone size-full wp-image-314" /></a><br />
<small>Main page of Royal TS showing the added servers/clients</small></p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/11/RoyalTS2.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/11/RoyalTS2.png" alt="" title="RoyalTS2" width="614" height="457" class="alignnone size-full wp-image-315" /></a><br />
<small>Showing connection to server</small></p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/11/RoyalTS3.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/11/RoyalTS3.png" alt="" title="RoyalTS3" width="562" height="607" class="alignnone size-full wp-image-316" /></a><br />
<small>Settings page</small></p>
<div style="width: 40%; float:left;">
<b>Pros</b></p>
<ul>
<li>Full encryption of file and write protection function, you can share with colleagues</li>
<li>Nice and clean gui makes you find the server you are look for quickly</li>
<li>Search and filter features for finding the right server/servers</li>
<li>As a paid product you have support</li>
</ul>
</div>
<div style="width: 40%; float:right">
<b>Cons</b></p>
<ul>
<li>No inheritance support</li>
<li>No thumbnail overview of the servers</li>
</ul>
</div>
<div style="clear:both;"></div>
<p>Royal TS is a product from <a href="http://www.code4ward.net/">code4ward</a> and exists in both a free version and paid version. The free version only offers maximum 10 connections while the paid one has support for unlimited. The paid version costs 20 EURO when this article is written and it&#8217;s very small price for such a good product.</p>
<p>Royal TS is written i .NET using Microsoft&#8217;s Terminal Services Control Type Library along with AxMSTSCLib an ActiveX component. Around these Royal TS have built some goods features, grouping servers, attaching notes and settings for any remote desktop gateway (earlier called terminal server gateway) that should be used when connecting to the server.</p>
<p>There is one thing that this product is clearly is missing, inheritance. When having servers grouped it would be nice to be able to configure credentials and other data that propagate down the &#8220;tree&#8221;.</p>
<p>[EDIT 2010-11-18]:<br />
Currently you can use a bulk feature that allows you to quickly make changes to multiple configurations. I have also been informed that next version generation will have additional functionality in regards to this which currently is not offered by RDMan.</p>
<p>What&#8217;s is good is that Royal TS offers full encryption of the &#8220;database&#8221; which makes you able to use it by more than one person and having the credentials stored in the file.</p>
<p>Remember &#8211; personal note ! You should never store full administrator credentials, always use an account dedicated for your daily use with your custom security settings.</p>
<h3>RDMan</h3>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/11/RDMan1.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/11/RDMan1.png" alt="" title="RDMan1" width="614" height="531" class="alignnone size-full wp-image-311" /></a><br />
<small>Main page of RDMan showing the added servers/clients</small></p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/11/RDMan2.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/11/RDMan2.png" alt="" title="RDMan2" width="614" height="531" class="alignnone size-full wp-image-312" /></a><br />
<small>Showing connection to server</small></p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/11/RDMan3.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/11/RDMan3.png" alt="" title="RDMan3" width="614" height="531" class="alignnone size-full wp-image-313" /></a><br />
<small>Inheritance sample setting page</small></p>
<div style="width: 40%; float:left;">
<b>Pros</b></p>
<ul>
<li>Full inheritance support</li>
<li>Live thumbnails of servers, can be set in inheritance for smart-sizing</li>
<li>C++ written, fast and light</li>
</ul>
</div>
<div style="width: 40%; float:right;">
<b>Cons</b></p>
<ul>
<li>Grey and boring UI</li>
<li>No filter or search function makes it somewhat &#8220;a more clicking than in Royal TS&#8221;</li>
<li>Encryption only for local machine by DSAPI makes you unable to share stored credentials</li>
<li>Only encrypts credentials and not other data</li>
</ul>
</div>
<div style="clear:both;"></div>
<p>RDMan origins internally from Microsoft and is written in C++. One file. It uses the same Microsoft librarys that Royal TS is using but of course benefit from natively being COM in C++ while C# have to run over COM-interop.</p>
<p>RDMan is newly released from Microsoft to the public (11:th June 2010) and can be downloaded from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4603c621-6de7-4ccb-9f51-d53dc7e48047&amp;displaylang=en">here</a>. The Exchange team explained about the product <a href="http://msexchangeteam.com/archive/2010/06/11/455115.aspx">here</a>.</p>
<p>RDMan, abbreviation of Remote Desktop Connection Manager (which is a bad name because it easy to mix with the mmc-snapin called Remote Desktops) is clearly a technical product not being so well designed as Royal TS. It basically is just a grey &#8220;shell&#8221; but they functions they built-inside are amazing after have been using both products for a while now.</p>
<p>First of all RDMan has full inheritance in root, divided out in each forest down to the last endpoint &#8211; the server. Along with this is also ability to configure connections with remote desktop gateway as the proxy for your connections.</p>
<p>But this is not all, what&#8217;s even more interesting is the thumbnail feature. First I personally thought this was static thumbnails generated every n:th second or so but these are &#8220;real remote desktop connections&#8221; in miniature. What&#8217;s good is that you can set a root definition of the thumbnail size and then adjust the thumbnail size up or down in each forest or individual server. First you may not think what to use this for, but after a while you see this feature is great. Some administrative issues can be handled in thumbnailed sized, for example having 2 or 4 servers running in one window being able to install/upgrade and keeping track of the progress.</p>
<p>Even having thumbnails of 10 or more servers is great, a click on the title brings the server in it&#8217;s full screen.</p>
<p>So is there any bad things about RDMan ?, there is one thing: the credentials are only encrypted and they are encrypted by DSAPI as I see it (correct me anybody if I am wrong). DSAPI is local encryption for every machine meaning you can&#8217;t move around the RDMan file (which stores all the connections and settings) you made. Moving the file to another computer will get you a prompt saying can&#8217;t decrypt credentials.</p>
<p>But there is a solution which involves clicking a check box saying store as plain text, which is like saying shoot your self in the foot. I personally don&#8217;t recommend this approach ! Instead it&#8217;s better that every administrator keep their own copy and their own credentials settings.</p>
<p>Also remember that RDMan doesn&#8217;t offer any encryption for the remaining settings, like the servers you have added, their ip&#8217;s etc.</p>
<h3>Summary and my personal choice</h3>
<p>RDMan and RoyalTS are both two exceptional good tools and is a must for every system administrator. RoyalTS is a commercial product with a small price and offers good sharing possibilities if you are working as a team. RDMan on the other hand is brought from Microsoft internally and is more or less a non-commercial product but still have great features, both live thumbnails and inheritance. My personal choice is actually both of them, I myself bought Royal TS a while back since it&#8217;s easier to use if you ship the remote desktop files to teammates and/or customers where you can store everything encrypted in the file, this is not an option in RDMan.</p>
<p>Use RDMan for your internal business and use RoyalTS when you have external communication (teammates, partners and customers). </p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/11/17/most-forgotten-tools-rdp-with-royal-ts-and-rdman/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Exchange Synchronization Certificate Error</title>
		<link>http://www.panterlo.com/2010/10/31/windows-phone-7-exchange-synchronization-certificate-error/</link>
		<comments>http://www.panterlo.com/2010/10/31/windows-phone-7-exchange-synchronization-certificate-error/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 20:52:44 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[smartphone]]></category>
		<category><![CDATA[Windows 7 Mobile]]></category>
		<category><![CDATA[windows phone]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=292</guid>
		<description><![CDATA[Windows 7 Phone is here and many stores got their customers this weekend. But using Windows 7 Phone with corporate Exchange was a no-go for many users with a certificate error thrown back to the screen. Companies using their own PKI or self-signed certificates must install the root certificate in the phone before getting synchronization to work. Either publish it to your existing AIA distribution point or put the base64 on a webserver for public download. Remember Windows 7 Phone doesn't support binary certificate format.]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>The first mobile terminals with Windows Phone 7 has just started to appear in stores in Sweden this weekend. After one my friends got hold of a unit we detected an issue which will cause headache for companies, Windows 7 Phone doesn&#8217;t allow administrators to bypass the validation process for PKI&#8217;s not trusted by the phone&#8217;s trusted certificate authorities. But it&#8217;s an easy fix until Microsoft, I hope so, fixes this by just adding a warning box after adding the account saying that this certificate cannot be validated similar to the box in iPhone OS.</p>
<h3>Fix</h3>
<p>Companies having their PKI infrastructure typically have their root certificate published by aia distribution point meaning you basically point your browser to the url. In the example for our PKI customers use http://aia.panterlo.com/Panterlo CA Root.crt , but in Windows 7 Phone this won&#8217;t work because it doesn&#8217;t accept non base64 encoded certificates. This means you have two options:</p>
<ul>
<li> Emailing the root certificate in base64 format to the user if they have another e-mail account on their Windows 7 Phone handset. Remember that some e-mail filters classify certificates as malicious content.</li>
<li> Publish the base64 encoded certificate in the aia distribution point meaning users will be able to enter a simple http url to download the certificate. If you don&#8217;t are using an aia distribution point you can just the &#8220;cer&#8221;-file on a web-server somewhere and download it. Remember it needs to be in base64 format. So in our case http://aia.panterlo.com/Panterlo CA Root.cer. Also bear in mind that root aia&#8217;s typically just include binary formatted certificates for download which is unsupported in Windows 7 Phone.</li>
</ul>
<p>After installing the certificate you must restart the phone for the new root to be trusted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/10/31/windows-phone-7-exchange-synchronization-certificate-error/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google Interactive Charts get&#8217;s easy with classical ASP.NET and .NET MVC</title>
		<link>http://www.panterlo.com/2010/10/17/google-visualization-api-gets-easy-with-net-mvc/</link>
		<comments>http://www.panterlo.com/2010/10/17/google-visualization-api-gets-easy-with-net-mvc/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 10:58:01 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[Microsoft MVC]]></category>
		<category><![CDATA[Programming and development]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[google charts]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=247</guid>
		<description><![CDATA[Google Visualization API becomes a breeze in MVC and classical ASP.NET applications with the shiny new class library which today were released in github under GPL v3. As a ASP.NET and MVC programmer you now can create interactive charts easily in your controllers and support asynchronous query calls from the API.]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>Google Visualization API is the &#8220;larger chart package&#8221; from Google which offers interactive charts trough a JavaScript library. The other alternative is the static chart engine that Google offers check out the Google documentation here, http://code.google.com/apis/charttools/index.html, basically it renders out a static image that you reference in your html-page.<br />
To generate chart data for Google Visualization API as interactive charts you basically can do one of two things in MVC:</p>
<ul>
<li> Generate the chart data in the view using JavaScript, an example is shown on this blog <a href="http://deanhume.com/Home/BlogPost/mvc-and-the-google-visualization-api--datatable-/34">http://deanhume.com/Home/BlogPost/mvc-and-the-google-visualization-api&#8211;datatable-/34</a>. Basically you iterate trough the collection of your data constructing the needed Google Visualization Datatable. Courtesy to Dean for this sample.
<ul>
<li> <em>Some programmers may want this method but I believe it could be cumbersome when handling large quantity of chart data and if you need to construct asynchronous handling it becomes a pain and it cannot support the query functionality. Putting to must logic into the view is also a question for the programmer and designer to design but mostly programmers tend to have most of the logic in the controllers of course.</em></li>
</ul>
</li>
<li> Generate the chart data in the MVC controller, you have to parse the incoming request from the Google Visualization API (query) and make your decision what you should do. You then will have to pass back an JSON object matching the requirements of the specifications provided by Google Visualization API documentation. You also need to handle the error and warning etc.</li>
</ul>
<p>I therefore wrote a class library for this &#8220;controller handling&#8221; including a new GoogleVisualizationAttribute and GoogleVisualizationResponse. Of course you can use this class library also for traditional, classic ASP.NET pages. The package has today, 2010-10-17, been released into github as GPL v3, check here <a href="http://github.com/panterlo/v1s.GoogleVisualization">http://github.com/panterlo/v1s.GoogleVisualization</a>, and I hope others continue to use and contribute to this library to make Google interactive charting a breeze in ASP.NET and MVC.<br />
Let&#8217;s take a look at the basic MVC sample which is included in the source code. Please bear in mind that this sample doesn&#8217;t show the ErrorInfo and WarningInfo that easily could wrap exceptions and errors occurring in the context of the controller, being further handled by the Google Visualization API.</p>
<h3>MVC sample</h3>
<p>The MVC sample is included in the source and can be downloaded from git. Please visit http://github.com/panterlo/v1s.GoogleVisualization for further instructions from github.<br />
There is only one controller method of interest which is GetSomeGoogleVisualizationData located in the HomeController. This method get&#8217;s requested by the Google Visualization API when calling the query method.</p>
<pre class="brush: csharp; title: ;">

[GoogleVisualizationAttribute]
public GoogleVisualizationResult GetSomeGoogleVisualizationData(GoogleVisualizationRequest googleVisualizationRequest, int numRecords, string someParam)
{
// Let make the response, construct the response by passing the request
GoogleVisualizationResponse googleVisualizationResponse = new GoogleVisualizationResponse(googleVisualizationRequest);

// We need a Google Visualization DataTable to store the data
GoogleVisualizationDataTable dataTable = new GoogleVisualizationDataTable();

// Add a column representing date time
GoogleVisualizationDataTableColumn column1 = dataTable.AddColumn(GoogleVisualizationDataTableColumnType.DateTime, &quot;date&quot;);

// Add a column representing a number
GoogleVisualizationDataTableColumn column2 = dataTable.AddColumn(GoogleVisualizationDataTableColumnType.Number, &quot;Serie1&quot;);

// Now we need to add the data
Random random = new Random();

// Just use the now date plus 7 days for each iteration
DateTime dateTime = DateTime.Now;

// Fake some data records
for (int i = 0; i &lt; numRecords; i++)
{
// Add new row to the datatable
GoogleVisualizationDataTableRow row = dataTable.AddRow();

// Add cell by column parameter
List cells = dataTable.AddCellForColumn(row, column2,random.Next(10,100), null);

// But you can enter the column index instead when inserting cell values
cells[0].CellValue = dateTime;

// Add 7 days for next iteration
dateTime = dateTime.AddDays(7);
}

// Set the datatable in the response
googleVisualizationResponse.GoogleVisualizationDataTable = dataTable;

// Send back response
return new GoogleVisualizationResult(googleVisualizationResponse);
}
</pre>
<h3>Summary</h3>
<p>The v1s.GoogleVisualization class library provides you a ready-to-go package to start building interactive charts with Google Visualization API. On top of this you get access to all the features offered by the API but still you have to implement a query functionality against your data source if you wish you to use it in your asynchronous calls. I will continue to make more samples to show more about the features.</p>
<p>PS ! Do you wonder why the v1s namespace is used ? it&#8217;s the namespace of a product that we are currently building and we will release segments of this product under GPL v3 and v1s.GoogleVisualization is one of these libraries.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/10/17/google-visualization-api-gets-easy-with-net-mvc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.10 and Hyper-V R2</title>
		<link>http://www.panterlo.com/2010/10/10/ubuntu-10-10-and-hyper-v-r2/</link>
		<comments>http://www.panterlo.com/2010/10/10/ubuntu-10-10-and-hyper-v-r2/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 12:00:48 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[hyper-v r2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=228</guid>
		<description><![CDATA[Ubuntu 10.10 was today 2010-10-10 released which is great new for us working with Hyper-V R2. We now have access to all the new drivers that Microsoft donates to the Linux community. The earlier drivers available in Ubuntu 10.04 LTS lacked features such as integrated shutdown, heartbeat detection, problematic host and guest synchronization and unstable network drivers (network traffic died unexpectedly). With Ubuntu 10.10 we now have the sames features as the Linux Integration Components 2.1 from Microsoft which only enables us to use Red Hat, Cent OS or SuSE Enterprise where Cent OS is unsupported from Microsoft.]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>Ubuntu is a strong Linux distribution in the community due to it&#8217;s huge repository which often is very up-to date with the newest versions of different applications and the package system apt is also very pleasant.  I myself rather choose CentOS due to it&#8217;s mature and stable kernel but sometimes CentOS don&#8217;t offer up-dated repositories and you may have to wait until getting new features for the applications you are using. Of course you always have the option to compile the software your self. This is a short how-to how to active all the drivers and get Ubuntu 10.10 up and running in Hyper-V R2 in minutes.</p>
<h3>Enabling and loading drivers</h3>
<p>Make your installation of Ubuntu 10.10, in my case I used server amd64 (64-bit). In my case I compile the loading of the drivers in the ram drive (initramfs) so drivers get loaded early upon start up, similar to Hyper-V installation in CentOS but you can also load the drivers in the /etc/modules for late-stage loading. After finalizing your custom Ubuntu 10.10 installation simply do</p>
<pre class="brush: plain; title: ;">
root@ubuntu:~# nano /etc/initramfs-tools/modules

// Add

hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
hv_utils

root@ubuntu:~# update-initramfs -u
root@ubuntu:~# shutdown -r now

// After rebooting add the NIC, remember that nic names have changed back from sethX to ethX so

root@ubuntu:~# nano /etc/network/interfaces

// Add, in case of dhcp
auto eth0
iface eth0 inet dhcp

root@ubuntu:~# /etc/init.d/networking restart
</pre>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/10/Ubuntu10.10HyperVR2Drivers_1.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/10/Ubuntu10.10HyperVR2Drivers_1.png" alt="Ubuntu 10.10 running under Hyper-V R2 with drivers" title="Ubuntu 10.10 running under Hyper-V R2 with drivers" width="600" height="459" class="alignnone size-full wp-image-234" /></a></p>
<h3>Secure clock skew</h3>
<p>To secure the clock even better I suggest installing the adjtimex package which Microsoft recommends in their Linux Integration Components. And it&#8217;s available in Ubuntu repositories, so to install simply:</p>
<pre class="brush: plain; title: ;">
root@ubuntu:~# apt-get install adjtimex

// Wait until completed, takes around 70 seconds while comparing clocks
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/10/10/ubuntu-10-10-and-hyper-v-r2/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Hyper-V Linux Integration Components 2.1</title>
		<link>http://www.panterlo.com/2010/07/29/hyper-v-linux-integration-services-2-1-rtm/</link>
		<comments>http://www.panterlo.com/2010/07/29/hyper-v-linux-integration-services-2-1-rtm/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 22:21:18 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtulization]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=199</guid>
		<description><![CDATA[Microsoft today released the Linux Integration Service version 2.1 for Microsoft Windows Server 2008 Hyper-V R2. This package will get you new and improved features. Some of the most appreciated will be integrated shutdown,support for up to 4 virtual processors and better timesync. Please don't miss this package.]]></description>
			<content:encoded><![CDATA[<p>The Linux Integration Components version 2.1 was today released in final version, the beta was released a couple of weeks back. Here is the <a href="http://blogs.technet.com/b/virtualization/archive/2010/07/29/linux-integration-services-v2-1-now-available.aspx">offical post</a>.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&#038;FamilyID=eee39325-898b-4522-9b4c-f4b5b9b64551">Download the package from Microsoft here </a></p>
<p>You can download the bundled ReadMe file directly from here <a href='http://www.panterlo.com/wp-content/uploads/2010/07/Linux-Integration-Services-v2.1-Read-Me.pdf'>Linux Integration Services v2.1 Read Me</a></p>
<p>I am working on a longer article around Hyper-V and Linux which should be released the nearest week, until then enjoy this new release which offers great enhanchments for Linux in Hyper-V.</p>
<h4>Features</h4>
<p>The Linux Integration Services version 2.1 includes the following:</p>
<ul>
<li>Driver support for synthetic devices: Linux Integration Services supports the synthetic network controller and the synthetic storage controller that were developed specifically for Hyper-V.</li>
<li>Fastpath Boot Support for Hyper-V: Boot devices take advantage of the block Virtualization Service Client (VSC) to provide enhanced performance.</li>
<li>Timesync: The clock inside the virtual machine will remain synchronized with the clock on the host.</li>
<li>Integrated Shutdown: Virtual machines running Linux can be gracefully shut down from either Hyper-V Manager or System Center Virtual Machine Manager.</li>
<li>Symmetric Multi-Processing (SMP) Support: Supported Linux distributions can use up to 4 virtual processors (VP) per virtual machine.</li>
<li>Heartbeat: Allows the host to detect whether the guest is running and responsive.</li>
<li>Pluggable Time Source: A pluggable clock source module is included to provide a more accurate time source to the guest.</li>
</ul>
<h4>Features NOT available</h4>
<p>These features are NOT available in this release:</p>
<ul>
<li>Integration Services: Data Exchange, Volume Snapshot Backup</li>
<li>Networking: Jumbo Frames and TCP Offload</li>
<li>Storage: Hot Add/Remove (VHD‟s and Passthrough Disks)</li>
</ul>
<h4>Supported Operating Systems</h4>
<ul>
<li>SUSE Linux Enterprise Server 10 SP3 x86 and x64 (up to 4 vCPU)</li>
<li>SUSE Linux Enterprise Server 10 SP2 is no longer supported by Novell as of April 12, 2010. Novell recommends that users migrate to SUSE Linux Enterprise Server 10 SP3.</li>
<li>SUSE Linux Enterprise Server 11 x86 and x64 (up to 4 vCPU)</li>
<li>Users of SUSE Linux Enterprise Server 11 SP1 should contact Novell for a version of Linux Integration Services.</li>
<li>Red Hat Enterprise Linux 5.2, 5.3, 5.4, and 5.5 x86 and x64 (Up to 4 vCPU)</li>
</ul>
<p>Red Hat Enterprise Linux 5 x64 editions do not support using the Pluggable Time Source component. However, you can use the existing timesync component with the adjtimex RPM package (detailed in this document) to compensate for time drift.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/07/29/hyper-v-linux-integration-services-2-1-rtm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshoot Windows memory dump files</title>
		<link>http://www.panterlo.com/2010/07/12/troubleshoot-windows-memory-dump-files/</link>
		<comments>http://www.panterlo.com/2010/07/12/troubleshoot-windows-memory-dump-files/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 08:38:09 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Troubleshoot and debug]]></category>
		<category><![CDATA[analyze]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=161</guid>
		<description><![CDATA[When Windows encounters a serious error occur that leads to blue screen of death a memory dump file is created which can help you to debug and resolve issues quicker. To read and interpret the dump file you need the WinDbg(Windows Debugger) tools from Windows SDK. I will show you how-to get started with this tool.]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>When a serious error occur that leads to blue screen of death Windows creates a small dump file which contains</p>
<ul>
<li>A list of loaded drivers</li>
<li>The processor context (PRCB) for the processor that stopped</li>
<li>The process information and kernel context (EPROCESS) for the process that stopped</li>
<li>The process information and kernel context (ETHREAD) for the thread that stopped</li>
<li>The Kernel-mode call stack for the thread that stopped</li>
</ul>
<p>Windows gives each file a distinct, date-encoded file name. For example, Mini022900-01.dmp is the first memory dump file that was generated on February 29, 2000. Windows keeps a list of all the small memory dump files in the %SystemRoot%\Minidump folder. </p>
<h3>Tools to debug and intrepret the dump file</h3>
<p>To read and understand what went wrong you need the Windows SDK to install tools needed to read the dump files. This tutorial is for Windows 7 / Windows 2008 R2 so visit <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&#038;displaylang=en">this page</a> to download the SDK. Install the SDK, you don&#8217;t have to install everything if you would like to save space you can just install debugging tools.</p>
<h3>Steps to debug the dump file</h3>
<h4>Step 1</h4>
<p>Locate the installed debug tools in Start Menu &#8211; Debugging Tools for Windows (x??) (?? = 64 or 86), start WinDbg.<br />
<br class="fix" /><br />
<a href="http://www.panterlo.com/wp-content/uploads/2010/07/Debug1.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Debug_1.png" alt="" title="Debug_1" width="233" height="114" class="alignnone size-full wp-image-162" /></a></p>
<h4>Step 2</h4>
<p>Open debug file, File -> Open Crash Dump</p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Debug2.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Debug2.png" alt="" title="Debug2" width="600" height="461" class="alignnone size-full wp-image-163" /></a></p>
<h4>Step 3</h4>
<p>After opening the file you will get &#8220;an error saying that your debugger is not using the correct symbols&#8221;, hence meaning you are missing symbols for debugging the crash file.</p>
<p>From Wikipedia</p>
<blockquote><p>A debug symbol is information that expresses which programming-language constructs generated a specific piece of machine code in a given executable module. Sometimes the symbolic information is compiled together with the module&#8217;s binary file, or distributed in separate file, or simply discarded during the compilation and/or linking. This information enables a person using a symbolic debugger to gain additional information about the binary, such as the names of variables and routines from the original source code. This information can be extremely helpful while trying to investigate and fix a crashing application or any other fault.</p></blockquote>
<p>This error is easily fixed by going to menu File -> Symbol File Path. In this box enter SRV*c:\symbols*http://msdl.microsoft.com/download/symbols , this means that the debugger will load the symbols directly from Microsoft servers.<br />
<br class="fix" /><br />
<a href="http://www.panterlo.com/wp-content/uploads/2010/07/Debug3.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Debug3.png" alt="" title="Debug3" width="600" height="673" class="alignnone size-full wp-image-170" /></a><br />
<br class="fix" /><br />
<a href="http://www.panterlo.com/wp-content/uploads/2010/07/Debug4.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Debug4.png" alt="" title="Debug4" width="600" height="673" class="alignnone size-full wp-image-171" /></a></p>
<h4>Step 4</h4>
<p>Now to issue a full verbose analysis enter !analyze -v  in the small text box located in the bottom of the command window. Now the debugger tool will show you in detail what it think is the reason for the crash. In this case it indicates there may be an memory_corruption causing the exception.</p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Debug5.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Debug5.png" alt="" title="Debug5" width="600" height="600" class="alignnone size-full wp-image-166" /></a></p>
<h4>Step 5</h4>
<p>How to continue debugging depends on your exception/error message of course, in my case where memory corruption was indicated I decided to use Windows Memory Diagnostics to rule out some basic memory errors. To download this tool go to <a href="http://oca.microsoft.com/en/windiag.asp">http://oca.microsoft.com/en/windiag.asp</a>. To run this tool you need to make a floppy or CD, when starting the tool you are offered to save the ISO and then you can burn this to a CD. Booting the computer with this disc will get you directly into Windows Memory Diagnostics. </p>
<p>Also please note the information Microsoft gives, I am quoting this:</p>
<blockquote><p>Be aware that there may be problems with your RAM or other hardware that Windows Memory Diagnostic cannot detect. That is, if Windows Memory Diagnostic reports no errors, it is not proof that your hardware is working correctly. If Windows Memory Diagnostic reports no errors, but you continue to experience errors that might be caused by failing hardware, you should get technical assistance to troubleshoot your hardware more extensively. </p></blockquote>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Debug6.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Debug6.png" alt="" title="Debug6" width="600" height="319" class="alignnone size-full wp-image-173" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/07/12/troubleshoot-windows-memory-dump-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A quick look at Rittal TS 8 Server rack</title>
		<link>http://www.panterlo.com/2010/07/06/a-quick-look-at-rittal-ts-8-server-rack/</link>
		<comments>http://www.panterlo.com/2010/07/06/a-quick-look-at-rittal-ts-8-server-rack/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 08:55:42 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[IT-infrastructure]]></category>
		<category><![CDATA[19 inch]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[rittal]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=127</guid>
		<description><![CDATA[When building IT-infrastructure people often order their server racks and associated equipment from their server supplier, like Dell, HP, IBM etc. My assumption is that this is because they have an established relationship, pricing and guranteed compatiblity. But take a look at Rittal and maybe your next choice will be different.]]></description>
			<content:encoded><![CDATA[<h3>Rittal Background</h3>
<blockquote><p>Rittal is your top supplier worldwide for innovative enclosure and housing technologies from A to Z. 9,000 committed staff worldwide, 12 high-tech-production facilities around the world, 63 international subsidiaries. 40 international agencies. Over 10,000 standard products available immediately </p></blockquote>
<h3>Server racks</h3>
<p>Server racks are standardized in terms of height, width, number of &#8220;rack units&#8221; (abbreviated U), please read more about racks here <a href="http://en.wikipedia.org/wiki/19-inch_rack">http://en.wikipedia.org/wiki/19-inch_rack</a></p>
<h3>Meet Rittal TS 8</h3>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_TS8_black.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_TS8_black.png" alt="" title="Rittal_TS8_black" width="600" height="1554" class="alignnone size-full wp-image-141" /></a></p>
<p>Rittal TS 8 is Rittal&#8217;s &#8220;medium class server rack&#8221; solution system. They also have a cheaper system called TE 7000 and the expensiver version called flexRack (FR). For a deeper looker between the different versions go to <a href="http://www.rittal.com/products/it-solutions/index.html"> http://www.rittal.com/products/it-solutions/index.html</a>. Below you will find a quick compairsion between the different models, please also take a look from page 774 in the downloaded &#8220;catalogue&#8221; (can be downloaded <a href='http://www.panterlo.com/wp-content/uploads/2010/07/HB32.pdf' >here</a>).</p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Rital_Server_Rack_Compairsion.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Rital_Server_Rack_Compairsion.png" alt="" title="Rital_Server_Rack_Compairsion" width="388" height="586" class="alignnone size-full wp-image-134" /></a></p>
<p>When I first had the opportunity to work with Rittal products I was not aware of the &#8220;extreme number of accessories available&#8221;. It was when someone gave me the full Rittal catalogue with 1348 pages ! that I became impressed and understood that nobody is near Rittal when it comes to building IT-infrastructure. They virtually have everything you can imagine, innovative power systems, climate controls systems, control systems and the list can grow virtually to anything you can imagine.</p>
<p>In my case the TS 8 were a good fit. In addition to this server rack we decided to try using Rittal innovative power system, Power System Module (PSM). From Rittal sales text:</p>
<p>Power System Module PSM – Power solutions that connect<br />
● Contact hazard-proof busbar<br />
● Redundant configuration thanks to two separate circuits<br />
● Load capacity up to 2 x 16 A with singlephase infeed, and up to 192 A with 3-phase infeed<br />
● Modules may be retrofitted with the system operational<br />
● Active modules feature individual slot switching with SNMP/HTTP and user management<br />
● Max. 42 slots in one 2 m system<br />
● Optimised cable management<br />
Convincing benefits:<br />
● Flexible and redundant layout<br />
● Installation without loss of U<br />
● Modules may be retrofitted with the system operational<br />
● Remote monitoring</p>
<p>Take a look from page 789 and forward for all the possibilities for PSM, it&#8217;s an extremely cool and easy system to fit into your server rack. In my case we integrated a full PSM rail into the rack (2000 mm) and ordered some plugin-modules (page 790) along with cable locks and the &#8220;adapted&#8221; cables to ensure proper locking of cables. Please note that Dell and HP offers similar solutions.</p>
<p>Here is how the PSM system looks in it&#8217;s basic form</p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_PSM_1.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_PSM_1.png" alt="" title="Rittal PSM Rail with plug-in 6 sockets" width="600" height="800" class="alignnone size-full wp-image-145" /></a></p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_PSM_2.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_PSM_2.png" alt="" title="Rittal_PSM_2" width="600" height="800" class="alignnone size-full wp-image-146" /></a></p>
<p><a href="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_PSM_3.png"><img src="http://www.panterlo.com/wp-content/uploads/2010/07/Rittal_PSM_3.png" alt="" title="Rittal_PSM_3" width="600" height="800" class="alignnone size-full wp-image-147" /></a></p>
<h3>Pricing</h3>
<p>Rittal TS 8 (42 U) is it&#8217;s basic form costs around 1000 USD excluding side panels, including side panels around 1300 USD. The power system is around 600 USD if you buy a 2000 mm rail and fill it with &#8220;standard&#8221; sockets (cable clips etc) with a 3-phase connection glove. So for around 1800 USD you have a high-end server rack with the great PSM system and just don&#8217;t forget to check out range of server rack products that Rittal offers.</p>
<p>Download the catalogue from <a href='http://www.panterlo.com/wp-content/uploads/2010/07/HB32.pdf' >here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/07/06/a-quick-look-at-rittal-ts-8-server-rack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting raw values from performance counters</title>
		<link>http://www.panterlo.com/2010/07/01/getting-raw-values-from-performance-counters/</link>
		<comments>http://www.panterlo.com/2010/07/01/getting-raw-values-from-performance-counters/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 13:34:13 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Performance Counters]]></category>
		<category><![CDATA[Programming and development]]></category>
		<category><![CDATA[perfmon]]></category>
		<category><![CDATA[performance counter]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=93</guid>
		<description><![CDATA[Using Performance Counters as a system administrator is a very important tool. Understanding the dozens of performance counters that exists and their formula is not easy. Myself I were faced a problem when relogging performance counter data to SQL. You can use Data Counters in Performance Counters to store the data and then relog this to SQL (or store it directly to SQL). ]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>Using Performance Counters as a system administrator is a very important tool. Understanding the dozens of performance counters that exists and their formula is not easy. Myself I were faced a problem when relogging performance counter data to SQL. You can use Data Counters in Performance Counters to store the data and then relog this to SQL (or store it directly to SQL). Relogging them to SQL will the first time automatically create the needed tables, and one of these tables is CounterData, containing the counter data itself. This table has the following columns.</p>
<p><code><br />
[GUID] [uniqueidentifier] NOT NULL<br />
[CounterID] [int] NOT NULL<br />
[RecordIndex] [int] NOT NULL<br />
[CounterDateTime] [char](24) NOT NULL<br />
[CounterValue] [float] NOT NULL<br />
[FirstValueA] [int] NULL<br />
[FirstValueB] [int] NULL<br />
[SecondValueA] [int] NULL<br />
[SecondValueB] [int] NULL<br />
[MultiCount] [int] NULL<br />
</code><br />
The [CounterValue] column contains the calculated value based on the performance counters formula. This formula is different depending on performance counter. Sometimes this value can be some unit per some flown time but many times you may need the raw values to make your own calculations and I here I will show how these strange columns<br />
<code><br />
[FirstValueA] [int] NULL<br />
[FirstValueB] [int] NULL<br />
[SecondValueA] [int] NULL<br />
[SecondValueB] [int] NULL<br />
</code><br />
are intrepreted.</p>
<h3>How-to</h3>
<p>According to MSDN documentation the columns described above have these descriptions/definitions</p>
<ul>
<li>FirstValueA(int): Combine this 32-bit value with the value of FirstValueB to create the FirstValue member of PDH_RAW_COUNTER. FirstValueA contains the low-order bits.</li>
<li>FirstValueB(int): Combine this 32-bit value with the value of FirstValueA to create the FirstValue member of PDH_RAW_COUNTER. FirstValueB contains the high-order bits.</li>
<li>SecondValueA(int): Combine this 32-bit value with the value of SecondValueB to create the SecondValue member of PDH_RAW_COUNTER. SecondValueA contains the low-order bits.</li>
<li>SecondValueB(int): Combine this 32-bit value with the value of SecondValueA to create the SecondValue member of PDH_RAW_COUNTER. SecondValueB contains the high order bits.</li>
</ul>
<p>Going back to the school when I were learning bit manipulation creating a helper method to calculate the combined raw value (long integer, 64-bit) became easy. So to share with others here in the short method in C#.</p>
<pre class="brush: csharp; title: ;">
   private static long CalculateRawCounterValue(int valueA, int valueB)
        {
            long low = ((long)valueA &amp; 0x00000000FFFFFFFF);
            long high = ((long)valueB &lt;&lt; 32);
            long result = low | high;
            return result;
        }
</pre>
<p>Basically what happens is that we mask the &#8220;first low 32-bits&#8221; with a 64-bit mask, creating the lower part of the long. We then shift the &#8220;second higher 32-bits&#8221; into position by 32-bits left. When then combine the values (OR) to get the result.</p>
<p>I will continue in in a later post showing examples how these now long raw values can be used for custom formula handling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/07/01/getting-raw-values-from-performance-counters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A first look of ZingChart in MVC</title>
		<link>http://www.panterlo.com/2010/06/27/zingchart/</link>
		<comments>http://www.panterlo.com/2010/06/27/zingchart/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 08:29:59 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[Microsoft MVC]]></category>
		<category><![CDATA[Programming and development]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[zingchart]]></category>

		<guid isPermaLink="false">http://www.panterlo.com/?p=8</guid>
		<description><![CDATA[ZingChart is a new piece of software used to build flash and HTML5 charts. So if you are a using Microsoft MVC for your web solutions you may need some helpers to make the charting a breeze. Here I create a simple way of controlling the ZingChart in the controllers.]]></description>
			<content:encoded><![CDATA[<p><br class="fix" /></p>
<h3>Before we start</h3>
<p>I know that some people prefer to control the design of charts in the views because designing the charts can be a job for the designer but I belive as many times this occur it will be the same way around meaning the programmer needs to create charts easily and without having to move parameters around in the javascript code in the view. When it comes to using ZingChart there is a lot of parameters, I really mean a lot this time. So for me working with much backends I like to be able to create charts quickly from the data. This example will show you how you can overcome the &#8220;strongly untyped world&#8221; (Javascript) with your strongly typed world (MVC). Please look at the example as a start for making your own customization on top of ZingChart and also bear in mind that ZingChart is a new product and we all developers would love to see future examples of different implementations.</p>
<p><a href='http://www.panterlo.com/wp-content/uploads/2010/07/Panterlo.ZingChart_v1.zip'>Download Panterlo ZingChart version 1.0 (VS 2010 MVC 2 example)</a></p>
<h3>ZingChart story</h3>
<blockquote><p>The ZingChart project emerged out of the development of a deep Web analytics system that needed to add standard charts to the mix. Unfortunately, the state of the art Flash and canvas based graphing systems kept buckling under the volume of data provided and lacked the required flexibilty, so the Zingchart project was born in December 2008 and released about one year later.</p></blockquote>
<h3>How-To</h3>
<p>ZingChart needs data in the kind of an Json object.  Creating this object can be of course be done on the level of the view, filling in values where they should be. This approch would work and is even metioned in the ZingChart docs. Here is how it would be done in PHP (example taken from <a href="http://www.zingchart.com/learn/tutorials/ajax.php">http://www.zingchart.com/learn/tutorials/ajax.php</a>)</p>
<pre class="brush: php; title: ;">
&amp;lt;?php
$values  = &amp;quot;&amp;quot;;
for ($i=0;$i&amp;lt;20;$i++){
	if ($values != &amp;quot;&amp;quot;)
	   $values .= &amp;quot;,&amp;quot;;
    $values .= rand(0, 50);
}
?&amp;gt;
{
  &amp;quot;graphset&amp;quot; : [
  {
    &amp;quot;type&amp;quot; : &amp;quot;area&amp;quot;,
    &amp;quot;series&amp;quot; : [
     {
        &amp;quot;values&amp;quot; : [&amp;lt;?php echo $values; ?&amp;gt;]
     }]
  }]
}
</pre>
<p>My approach instead is in providing a generic way of responding back with the needed Json object from the MVC controller, the ZingChart calls this &#8220;controller methods&#8221; asynchronously. This example just show how it can be done easily without having to write custom Json &#8220;converters&#8221;. For this to happen we need a good Json library and why not using the library from James Newton King, <a href="http://james.newtonking.com/projects/json-net.aspx">http://james.newtonking.com/projects/json-net.aspx</a></p>
<p>Using this Json library we are able to decorate our classes and properties with attributes to control the Json output so in the case of the main head class we do:</p>
<pre class="brush: csharp; title: ;">
 [JsonObject(MemberSerialization.OptIn)]
    public class ZingChart
    {
        [JsonProperty(PropertyName = &amp;quot;graphset&amp;quot;)]
        public List&amp;lt;GraphSet&amp;gt; GraphSets { get; set; }

        [JsonProperty(PropertyName = &amp;quot;theme&amp;quot;, NullValueHandling = NullValueHandling.Ignore)]
        [JsonConverter(typeof(StringEnumConverter))]
        public Theme? Theme { get; set; }
    }
</pre>
<p>To start out I created the main needed classes and put them together into a very short MVC 2 project that you can download in the end of this post. By using this example you are able to create charts so easily from your controllers as in this example:</p>
<pre class="brush: csharp; title: ;">
public ZingChartActionResult MyChart()
{
// First we create the chart
ZingChart zingChart = new ZingChart();

// A chart can consists of one or more graphsets
zingChart.GraphSets = new List&amp;lt;GraphSet&amp;gt;();

// Let's make a graphset with some settings
GraphSet graphSet = new GraphSet();
graphSet.ChartType = ChartType.line;
graphSet.Title = new Title() { Text = &amp;quot;ZingChart&amp;quot;, FontSize = 9 };
graphSet.Series = new List&amp;lt;Serie&amp;gt;();
graphSet.LegendVisible = true;
graphSet.ScaleY = new Scale() { Label = new Label() { Text = &amp;quot;Unit&amp;quot; } };
graphSet.Plot = new Plot() { LineWidth = 3, ToolTip = &amp;quot;%v Unit&amp;quot; };
graphSet.PlotArea = new PlotArea();

graphSet.ScaleX = new Scale();
graphSet.ScaleX.Zooming = Zooming.Enable;
graphSet.ScaleX.Values = new List&amp;lt;object&amp;gt;() {   new DateTime(2010, 01, 01).ToShortDateString(),
new DateTime(2010, 01, 02).ToShortDateString(),
new DateTime(2010, 01, 03).ToShortDateString(),
new DateTime(2010, 01, 04).ToShortDateString(),
new DateTime(2010, 01, 05).ToShortDateString(),
new DateTime(2010, 01, 06).ToShortDateString(),
new DateTime(2010, 01, 07).ToShortDateString()
};
graphSet.ScaleX.Label = new Label() { Text = &amp;quot;Time&amp;quot; };

// Time to add the &amp;quot;data&amp;quot; to the graphset
graphSet.Series.Add(new Serie() { Values = new List&amp;lt;decimal&amp;gt;() { 1.2M, 2.2M, 1.5M, 3.0M, 0.3M, 10.1M, 7.1M }, Text = &amp;quot;Serie1&amp;quot;, Animate = 1, Effect = 1 });

zingChart.GraphSets.Add(graphSet);

return new ZingChartActionResult(zingChart);
}
</pre>
<h3>Result</h3>
<p>In the example project you can download you will find two views, ZingChartFlash and ZingChartHtml5 both are using the same controller method but they render their chart differently of course, the first in flash and the second with the help of html5.</p>
<p>Running the example will get you the same html5 chart as below.</p>
<div  id="zingchart"></div>
<p><br class="fix" /><br />
<a href='http://www.panterlo.com/wp-content/uploads/2010/07/Panterlo.ZingChart_v1.zip'>Download Panterlo ZingChart version 1.0 (VS 2010 MVC 2 example)</a></p>
<p><script type="text/javascript" src="http://www.panterlo.com/wp-content/uploads/2010/07/strokeText.js"></script><br />
<script type="text/javascript" src="http://www.panterlo.com/wp-content/uploads/2010/07/strokeText-ZC.js"></script><br />
<script type="text/javascript" src="http://www.panterlo.com/wp-content/uploads/2010/07/md5-min.js"></script><br />
<!--[if IE]><script type="text/javascript" src="http://www.panterlo.com/wp-content/uploads/2010/07/excanvas.compiled.js"></script><![endif]--><br />
<script type="text/javascript" src="http://www.panterlo.com/wp-content/uploads/2010/07/zingchart-html5beta-min.js"></script><br />
<script type="text/javascript">
$(document).ready(function() {
zingchart.render({
id          : 'zingchart',
width       : 600,
height      : 600,
dataurl:    '/wp-content/uploads/2010/07/data.txt'
});
    });
    </script>      </p>
]]></content:encoded>
			<wfw:commentRss>http://www.panterlo.com/2010/06/27/zingchart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

