MSDN Blog Postings

via RSS Feed

Archive for July, 2008

Database table naming conventions

Posted by on 31st July 2008

I was recently adding some tables to a database, and was presented with the silly problem of naming a table “User” or “Users.”  To me the table name should represent the entity, but on the flip side the table is holding a collection of those entities.


 Since I’m open to suggestion, what are your thoughts on table naming?


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

Cheezburger in Popfly

Posted by on 31st July 2008


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

What do you want to know about SDL threat modeling?

Posted by on 31st July 2008

Adam Shostack here. I’m working on a paper about “Experiences Threat Modeling at Microsoft” for an academic workshop on security modeling. I have some content that I think is pretty good, but I realize that I don’t know all the questions that readers might have.


So, what questions should I try to answer in such a paper? What would you like to know about? No promises that I’ll have anything intelligent to say, but I’d love to know the questions you’re asking. So please. Ask away!


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

Muenchian Grouping and Sorting in BizTalk Maps

Posted by on 31st July 2008

First, I’ll admit the title of this post isn’t entirely accurate, because you can’t do the grouping and sorting I’m about to show using the BizTalk mapper.  We’ll be overriding the XSLT for a BizTalk map, so therefore it might be more appropriate to call this "Muenchian Grouping and Sorting in XSLT."  But since I’m doing this from a BizTalk perspective, I can live with the subtle difference. :)

Let’s say I have a flat file schema to import sales order information.  Being a flat file, we can assume that it’s completely denormalized, meaning there won’t be defined relationships and we’ll have redundant data.  Let’s take a simplified flat file that looks something like this:

Order222|Item123
Order111|Item456Order222|Item789

Notice that for each line, we repeat the sales header info (in this case it’s just "OrderID," but typically this would include customer info, order date, etc.) again and again.  Our schema ends up looking like this:

source schema

However in our destination schema, we want to group the line data for each header, and we want to sort it, too.  Here’s the destination schema we need to use.

destination schema

Sounds like fun, right?  Great!  Let’s get started…

What I like to do first is to create a new BizTalk map, and then steal its XSLT to use as a template.  This way we know the namespaces and such are correct.  So I’ve created a new BizTalk map and added our OrdersFF as the source schema and our Orders schema as the destination.  Right-click on the map and choose "Validate," then steal the output ".xsl" file.  Then click on the functoid grid in the graphical map, and set the Custom XSL Path property to your saved .xsl file.

grid properties

Within the XSLT, we’re going to be using a method called the Muenchian Method to handle the grouping and sorting.  This method allows us to group and sort data very quickly (faster than some of the grouping options you can do with the graphical mapper, in fact).

Just below the <xsl:output> block of our XSLT, we’re going to create a key value for this grouping.  This creates an index which the transform engine can use to loop through each unique value of that key.

<xsl:key name="groups" match="Order" use="OrderID"/>

From there, at the top of where we’re going to start our /Orders branch, we can modify the "for-each" block to loop through our key instead of source nodes, like we might typically do.

<xsl:for-each select="Order[generate-id(.)=generate-id(key('groups',OrderID))]">

If we want to apply sorting, we can add:

<xsl:sort select="OrderID" order="ascending"/>

Finally we loop through the "groups" key we created before and output our data:

<xsl:for-each select="key('groups',OrderID)">

The whole /orders branch of our XSLT now looks something like this:

XSLT with grouping and sorting

And here’s the XML output:

xml output

Notice that the orders are now sorted, despite being unsorted in the source file, and the items are now grouped by order.  Nifty, huh?

Sample code:

 

Technorati Tags: ,


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

ADO.NET Data Services How Do I? Videos

Posted by on 31st July 2008

In case you’ve missed these, we already have some ‘How Do I?’ videos up on MSDN that cover ADO.NET Entity Framework and ADO.NET Data Services.


http://msdn.microsoft.com/en-us/data/cc300162.aspx


Enjoy!


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

Feedback Opportunity: MCP Program

Posted by on 31st July 2008

Hi. I have this note to post from my friend Sarah, she’s new to our team and is working on all things MCP. This is good news for you; she is smart and you’ll like her. If you have 5 minutes or so, she’d love to hear from the certification community in this little survey.

I told her you guys were shy, and probably wouldn’t have any opinion. But she wanted me to post this anyway…

 

Good day everyone! 

My name is Sarah Grant and I am new to the MCP Community Lead role here at Microsoft. I am just getting my feet wet (4 days and counting!)  and I am already hoping to gain feedback from the MCP community on a topic of discussion here internally. I know that, over the years, and before my time, there has been a lot of talk about our welcome kits, and whether they need some polishing. There are few ideas floating around, and we get a lot of feedback from different places about the best way to go. I wanted to get a gut check in a quick survey, here, too, to see what you think. While I cannot get 2.2 million MCP’s opinion’s, maybe I can get yours!  After all, your perception of the program is what keeps this program alive & kickin’ and still important in the IT sector.

Today, as you probably know, the first time you earn an MCTS, MCITP, and MCPD, you can order (for free—you just have to request it from the MCP site) a welcome kit. The welcome kit contains a nice folder, a paper certificate, a coupon for 20% off MCP gear at the MCPeStore and a wallet card. Then, each time you earn a subsequent certification (i.e. your second MCTS or second MCITP certification…), you can “order” a paper certificate. 

We want to know what you value and what you like when you receive your welcome kits and paper certificates. Things being discussed–could we/should we:

1) Do more with those first welcome kits and eliminating the subsequent certificates. By “do more”  by dressing  up the wallet card and certificate, maybe include something else you’d find helpful.

2) Add more relevant marketing material to help you understand the benefits given.

3) Make the online certificates we launched last year easier to use (this is where you can print certificates you’ve earned at your convenience)

I have sent up a short survey  for anyone who is interested in sharing their opinion with me.

Kind regards and I look forward to working with you all!

Sarah Grant


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

Microsoft Deployment Toolkit 2008 Releases New Update

Posted by on 31st July 2008

Hi All,

We are pleased to announce the release of our first update to Microsoft Deployment Toolkit 2008  (MDT 2008).  We have added two major features:  OEM preload scenarios for Lite Touch Installation and Zero Touch Installation with System Center Configuration Manager 2007 and a new management pack for System Center Operations Manager 2007 SP1.  Minor updates include bug fixes and design changes to override driver platforms as well as the ability to inject all drivers into Windows PE.

Get MDT 2008 Update 1 and the new Quick Start Guides from the Download Center. All of the latest documentation can be found within  updated and  searchable help files.  However, if you would like a full collection of the Word documents, download it here.

Nick.


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

This… is… Dynamic!

Posted by on 31st July 2008

Regarding our need to check-and-rethrow exceptions in IronPython, int19h asks “Shouldn’t exception filters do the trick without the need to rethrow explicitly?”

That’s a good question.  In fact, I had the exact same reaction when I first started looking into this issue.  So I changed IronPython’s MSIL generation to use filters, and my updated version was able to pass all of our tests.

Later, during my weekly face-to-face meeting with Shri, I described the work I had done and Shri was immediately able to identify a corner case that was now broken.

Results 1 - 10 of about 163 for “vb.net” “jan brady”

Before looking at some sample Python code that causes the problem, it’s worth digging a little into filters to learn something about their operation.  To do so, I’ll need to leave my comfort zone and enter the world of VB.NET — as C# doesn’t have any functionality that maps onto MSIL exception filters.

Consider the following code:

    Function CheckException(ByVal pos As Integer) As Boolean
        System.Console.WriteLine(“Filter {0}”, pos)
        CheckException = (pos = 0)
    End Function

    Sub Test(ByVal i As Integer, ByVal max As Integer)
        Try
            If i < max Then
                Test(i + 1, max)
            Else
                Throw New ApplicationException(“Exception Occurred”)
            End If
        Catch ex As Exception When CheckException(i)
        Finally
            System.Console.WriteLine(“Finally {0}”, i)
        End Try
    End Sub

    Sub Main()
        Try
            Test(1, 4)
        Catch ex As Exception When CheckException(0)
        End Try
    End Sub

This code is designed so that the exception filter in the Test() method will always return false while the one in Main() will return true.  As a side effect of calculating this value, the filter will give us a visual notification that it has run.

The exception handlers form a stack that will be traversed in reverse calling sequence, running the Finally block of each Test() invocation before continuing back up the chain.  Our natural expectation is that the filter will be executed just before the Finally, giving us output that looks like this:

Filter 4
Finally 4
Filter 3
Finally 3
Filter 2
Finally 2
Filter 1
Finally 1
Filter 0

But what we get when we run the code is output that actually looks like this:

Filter 4
Filter 3
Filter 2
Filter 1
Filter 0
Finally 4
Finally 3
Finally 2
Finally 1

So what happens instead is that the CLR actually walks the list of exception handlers twice.  The first time, it’s looking for a catch block that will handle the exception.  In the course of doing so, it needs to run any filter methods it encounters in order to identify whether or not that particular catch block is “the one”.  Only once it finds an exception handler does it go back and run all of the finally and fault blocks between the thrower and the catcher.

You fascinate me; tell me more!

This subtlety matters to us because of the dynamic nature of the Python language.  You can’t reliably evaluate any expression in the dynamic world until you reach that particular point in the code — because the meaning of just about anything is subject to change.

Here’s the Python code that demonstrates the problem:

x = RuntimeError
def test():
    global x
    try:
        raise x
    finally:
        x = SyntaxError

try:
    test()
except x:
    print ‘Match’
except:
    print ‘Mismatch’

In order for this to work correctly, the exception criteria “except x” at the top level must run after x is reassigned in the finally block of the test() method.  But if we use an exception filter to match the thrown exception against x, the filter will run before the value of x is set to SyntaxError and it will incorrectly report that it is the right handler for the job.

And even though this is an edge case, there’s nothing that actually distinguishes this code from the more usual example of “except RuntimeError” where we supply the type of the exception.  That’s because the meaning of the symbol can’t be determined until runtime no matter how familiar it may look to human eyes.  This is in sharp contrast to a statically typed language, where “catch (ArgumentException)” has to be resolvable to a definite type at build time or it’s an error.

This is part of what it means to be dynamic. Take the power and use it wisely.


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

Get your possums sorted

Posted by on 31st July 2008

Hullo. Are you going to these TechEds? I am.



  • TechEd Australia will have a certification test center, I understand, so start studying, you only have a month left. Note: The only other time I was in Australia, I was attacked by a possum (see Figure 1) at Manly beach. Australia: Please get your possums sorted in advance of my arrival, for once.

  • TechEd New Zealand is sold out! I’ve been told that our team arranged for some of those Certified hats for you guys, so bring your MCP wallet card. Not that you wouldn’t have it on you anyway, if you have a tiny shred of coolness in you at all. I hope to go to the Geek Girl dinner this time. They always sound interesting and fun.

It is very nice to be invited back, by ol’ Coatsie and Tania and Mary and team, thank you! I think I’ll be helping with certification-related stuff and maybe talking about certification at lunch time. Is there something you’d like to hear about?


Looking forward to seeing you all. Will be great. As.
Trika


Figure 1. Possum.


This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off

New Features for July

Posted by on 31st July 2008

Simplified Chinese and Spanish General Domain engines complete

Last time I blogged about launching the English to Spanish language pair using our own Microsoft technology - our team has made great progress since then.  We’ve completed the Spanish bidirectional pair with Spanish to English, and launching Simplified Chinese both to and from English.  We’re going to keep adding languages in the coming months as one of our top priorities, so keep an eye out on this blog for the languages you’re most interested in.  Let us know in the comments which languages you’re looking for! 

Coming soon: Windows Live Messenger TBot & Office Integration!
This post originated from and is provided by the MSDN Blogs RSS feed. The original post of the article can be found here.

Posted in MSDN Blogs | Comments Off