Saturday, October 30, 2010

RE:Why is Microsoft suddenly so hot for HTML5? | Betanews

Last week, Gartner predicted that mobile would be a trillion-dollar industry by 2014. It\'s a market Microsoft doesn\'t want to be shut out of.

via Why is Microsoft suddenly so hot for HTML5? | Betanews.

This and my earlier post reinforce my belief that it is time to break the chains of Microsoft.  Meaning it is time for me to stop being a Mort.

Friday, October 29, 2010

RE: Microsoft: Our strategy with Silverlight has shifted | ZDNet

“Silverlight is our development platform for Windows Phone,” he said. Silverlight also has some “sweet spots” in media and line-of-business applications, he said.

But when it comes to touting Silverlight as Microsoft’s vehicle for delivering a cross-platform runtime, “our strategy has shifted,” Muglia told me.

via Microsoft: Our strategy with Silverlight has shifted | ZDNet.

I think it is time to move away from the Microsoft platform.  I'm getting tired of having to learn a new framework every year just to keep up with their changes.

I've been using Silverlight at work and I like it but if there is not going to be any support or they totally re-target the platform for just phones, whats the point?

Time for python - html5 - JavaScript stack.

Asynchronous Programming in C#

Making Asynchronous Programming Easy

Asynchronous Programming in C#

[csharp]public async void AsyncIntroParallel()
{
Task<string> page1 = new WebClient().DownloadStringTaskAsync(new Uri("http://www.weather.gov"));
Task<string> page2 = new WebClient().DownloadStringTaskAsync(new Uri("http://www.weather.gov/climate/"));
Task<string> page3 = new WebClient().DownloadStringTaskAsync(new Uri("http://www.weather.gov/rss/"));

WriteLinePageTitle(await page1);
WriteLinePageTitle(await page2);
WriteLinePageTitle(await page3);
}[/csharp]

Async CTP has been released. Note: This is not automatically Multi-Threading! From the CTP:

Merely sticking the "Async" modifier will not make a method run on the
background thread. That is correct and by design. If you want to run code on a
background thread, use TaskEx.Run(). Please read the overview for an explanation
of asynchrony.

When Does Hosting Your Website in the Cloud Make Sense?

When Does Hosting Your Website in the Cloud Make Sense?.

Discussion of when to use cloud vs own metal.  Short answer:

  • When you need that extra boost in bandwidth due to being slammed with requests.


Basically don't just jump to the cloud because it is 'cool', use the cloud if it saves you money.

Wednesday, October 27, 2010

UOW: FileHelpers

The utility of the week is FileHelpers, a .Net library that works with delimited and fixed length files. It helps to import and export data from files, strings or streams.

I found this recently as I needed to process several CSV files but I did not want to write by hand a parser. Been there, done that way too many times so I did a search and what do you know- someone smarter than me already did it.

What I like about it is the wizard that comes with the library that helps to build plain old c# classes to work with the data rows. In about twenty minutes I had a working CSV processing engine complete with intellisense.

The library isBSD License, GNU Library or Lesser General Public License (LGPL)

Threading AutoResetEvent Example

[csharp]public class Program
{
private static System.Threading.AutoResetEvent stopFlag = new System.Threading.AutoResetEvent(false);
public static void Main()
{
ServiceHost svh = new ServiceHost(typeof(ServiceImplementation));
svh.AddServiceEndpoint(
typeof(WCFSimple.Contract.IService),
new NetTcpBinding(),
"net.tcp://localhost:8000");
svh.Open();
Console.WriteLine("SERVER - Running...");
stopFlag.WaitOne();
Console.WriteLine("SERVER - Shutting down...");
svh.Close();
Console.WriteLine("SERVER - Shut down!");
}
public static void Stop()
{
stopFlag.Set();
}
}[/csharp]