Thursday, April 21, 2011

Guid.ToString(String) Documentation WTF?

From msdn (here is the link)

Guid.ToString(String) valid input:
'N' - 32 digits:
00000000000000000000000000000000

'D' - 32 digits separated by hyphens:
00000000-0000-0000-0000-000000000000

'B' - 32 digits separated by hyphens, enclosed in braces:
{00000000-0000-0000-0000-000000000000}

'P' - 32 digits separated by hyphens, enclosed in parentheses:
(00000000-0000-0000-0000-000000000000)

'X' - Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:
{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}

Supported .NET Framework: 4, 3.5, 3.0, 2.0, 1.1, 1.0
Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

But on my Windows Vista SP2 & .Net 4 the following code gives nice exception (not valid input):

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(Guid.NewGuid().ToString("N"));
            Console.WriteLine(Guid.NewGuid().ToString("D"));
            Console.WriteLine(Guid.NewGuid().ToString("B"));
            Console.WriteLine(Guid.NewGuid().ToString("P"));
            Console.WriteLine(Guid.NewGuid().ToString("X"));
        }
    }
}

Wednesday, April 13, 2011

Quote of The Day - 2011-04-12

This is first time then I decided to give link to whole article, because of so many great quotes used in it... enjoy!

P.S. Still I like the following one most:
“Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later. Again, you can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something—your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.”
-Steve Jobs

Thursday, April 7, 2011

I'll be celebrating 20 years of Linux with The Linux Foundation!

I'll be celebrating 20 years of Linux with
The Linux Foundation!

Quote of The Day - 2011-04-07 We are now faced with the fact, my friends, that tomorrow is today.

“We are now faced with the fact, my friends, that tomorrow is today. We are confronted with the fierce urgency of now. In this unfolding conundrum of life and history, there is such a thing as being too late. Procrastination is still the thief of time. Life often leaves us standing bare, naked, and dejected with a lost opportunity. The tide in the affairs of men does not remain at flood — it ebbs. We may cry out desperately for time to pause in her passage, but time is adamant to every plea and rushes on. Over the bleached bones and jumbled residues of numerous civilizations are written the pathetic words, “Too late.”

We all must move quickly. Your dreams are mine,
— Dr. Martin Luther King Jr.

Tuesday, April 5, 2011

EntityFramework 4.1 RC – Code first; review (link)

José F. Romaniello points out some problems with upcoming new release of Entity Framework (version 4.1)