I have been using the Microsoft Web Platform Installer or PI for a while now. It’s a great handy tool for ensuring that I have all the latest bits of Web platform tools like MVC, Web Matrix are installed. One of the other thing I like about Web Platform Installer is that the tool can self update itself. When a new version of the tool is released, it shows a dialog box to the user to install the latest version of the tool.
Recently I installed the PI version 3.0
Apart from the Spotlight tab showing the recent released, as usual the Products tab shows all the products. It can also the filtered into different category of downloads like Server, Framework, Tools etc.
I hope some day Microsoft would release a same type of tool for Windows developers also!
Lately I have been working in performance engineering and improvement of a big and complex enterprise class product for financial market. Typical to any product or app for financial market, this product also has to deal with high volume of data – so every second (actually millisecond) counts. While profiling the App with Ants Profiler I saw that one of the methods which is costly is spending considerable amount of time in .NET API File.Exists method. The method actually gets the last write time of a file using File.GetLastWriteTime(filePath) but before that it checks whether the file exists through File.Exists. The reason is to make sure to call File.GetLastWriteTime only when File exists so that it does not throw exception. Following was the code used –
So as I started looking I thought to check whether the assumption of using File.Exists is correct. To my surprise I found in MSDN that File.GetLastWriteTime does not throw an exception in case the file does not exist.
If the file described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.
So I re-wrote the code in the following way and was able to remove the call to File.Exists method which was costly –
Note that I had to compare the time in UTC as File.GetLastWriteTime returns 12:00 midnight, January 1, 1601 A.D. in UTC time.
Over the next few blog entries I would share some more performance improvement tricks. Happy Profiling!
One of the best new feature of ASP.NET 4.0 Web Form (yes it’s still alive) is the new Chart control. There have been a need for a Chart control for a long time – from version 1.0. Folks have used custom controls from various sources or written their own one. Now in ASP.NET 4.0 Microsoft have introduced a Chart control ultimately. This could be used in ASP.NET MVC also apart from Web Forms.
The Chart control provides all different type of charts like Column, Bar, Line, Area, Pie, Doughnut (to name a few). Following is an example of Chart with chart type Column.
To set up a basic chart control you have to set a few properties like XValueMember and YValueMembers. In the example I have displayed the Total Sales figure for few cities. Following is the page markup –
As you can see I’ve set XValueMemeber to City and YValueMembers to TotalSales – both of them are properties in my DTO –
The chart type could be set in markup or through code for the series –
chtSalesData.Series[“Series1”].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Bar;
I have been playing with Silverlight 4 for a while now. I know it’s too late probably to talk about some of the new features of Silverlight 4 since Scott Gu already have announced Silverlight 5 to be made available in early 2011, but I have been rather quite busy with my day job . Also I left Target India and joined Misys Software as Senior Architect – so as a whole on the professional front I have been little busy lately. Anyway, it never too late.
Among the many features included newly in Silverlight 4, max importance have been on enabling and adding features that would help use Silverlight for Business Application Development specially of Enterprise scale similar to other UI technologies like WPF, Win Forms (I know people are still using it for new enterprise business apps), ASP.NET Web Forms and ASP.NET MVC (both with and without Ajax).
Silverlight 4 now supports Web Browser control that was long present in Win Forms. The Web Browser control can load a HTML page – it’s truly a mini IE. Note that Web Browser control can show content only in Full Screen mode. When it’s running within a browser embedded it does not display any content –
Since Sliverlight 4 has started officially supporting Google Chrome (though earlier also it used to work) I thought of using Chrome for this post.
So to use Web Browser control, Silverlight 4 must have to run out of browser. To load a page/HTML content or any browsable content (that browser can interpret like ASP.NET web page), use the Source property of the Web Browser control –
<WebBrowser x:Name=”webBrowser” Source=”https://caniruddha.wordpress.com/” /> – XAML
webBrowser.Source = https://caniruddha.wordpress.com/; – code
You can also use the Navigate and NavigateToString methods. While Navigate accepts a sting for URL, NavigateToString accepts a Uri object –
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!