Software Geek

March 19, 2008

Scott Guthrie presents at NDDNUG

Filed under: Software


Also see: Silverlight 2 Beta 1 Cross Domain Bug

Also see: The 2 Technology Magazines You Should Read

Also see: Never keep your emotions bottled up

Scott gave a whirlwind presentation to a standing room only crowd at the North Dallas Dot Net User Group tonight. A wide range of topics were covered from IDE tips and tricks to ASP.NET tips to MS AJAX to LINQ and DLINQ (I still like to call it DLINQ rather than LINQ to SQL). I’m still not sure how all this got packed into a little over 2 hours. :)

This was the first meeting that I’ve attended at the new Intuit location. It was quite an upgrade in venue from the previous SMU campus location. Lots of projector screens and flat panels so it was very easy to follow along even if you were in the nose bleed section.

While there’s a ton of cool things going on with AJAX, seeing LINQ in action again reminds me of just how revolutionary LINQ is.

So, thanks for the great presentation Scott and don’t be a stranger to Dallas! :)


http://weblogs.asp.net/dfindley/archive/2006/11/02/Scott-Guthrie-presents-at-NDDNUG.aspx

DevWeek 2008 Cross Platform Silverlight Demos

Filed under: Software


Also see: Is this the best NBA season ever ?

Also see: ReflectionTypeLoadException

Also see: Web Access for Visual Studio Team System

I just finished the Cross Platform.NET on Silverlight talk at DevWeek. Demos can be downloaded from http://www.interact-sw.co.uk/downloads/DevWeek2008XPlatDemos.zip

I’m all done at DevWeek for this year. But if you want to hear more about Silverlight, I’ll be teaching Pluralsight’s Applied Silverlight course in London later this month - running from 31st March. (And the following week I’ll be teaching our Applied WPF course, also in London.)


http://www.interact-sw.co.uk/iangblog/2008/03/12/devweek-xplat-demos

Determining Whether a File Is an Assembly

Filed under: Software


Also see: The 2 Technology Magazines You Should Read

A file is an assembly if and only if it’s managed and it contains an Assembly entry in its CLR metadata.

Determining by hand

A fast way to determine whether a file is an assembly is to run ildasm.exe on it. If it immediately gives an error saying that it may not be a PE file, then it’s not a managed file. But, if it is an assembly, then ildasm will show an entry for the Assembly definition (“.assembly“ in the MANIFEST window or at the bottom of the original window).

Determining programmatically

From unmanaged code, you can call GetAssemblyFromScope() on the IMetaDataAssemblyImport interface for the file. If it returns S_OK, it’s an assembly. If it returns CLDB_E_RECORD_NOTFOUND, it’s not an assembly.

From managed code, if AssemblyName.GetAssemblyName(), Assembly.Load*(), etc. succeeds when given that file, then it’s an assembly. If the load failed with a BadImageFormatException, then it may not be an assembly. There are other reasons, however, why that exception may have been thrown (maybe it’s an assembly but could not be loaded because it has an incorrect format). Coming soon in v2, if the hresult for BadImageFormatException is COR_E_ASSEMBLYEXPECTED, then it’s because it’s not an assembly. Catch the exception and call System.Runtime.InteropServices.Marshal.GetHRForException() to get its hresult to find out.

Note that this assumes that you are not concerned about performance. If you are concerned about that, then the way to op (more…)

A quick update on me.

Filed under: Software


Also see: Great new Silverlight Control Skins

It’s been over two years since I blogged.  Although I remain happily (perhaps even ecstatically) working at Microsoft, I left the CLR team and the Developer Division about a year ago.  I’m now on an incubation team, exploring evolution and revolution in operating systems.  This is a fascinating area that includes devices, concurrency, scheduling, security, distribution, application model, programming model and even some aspects of user interaction (where I am totally out of my depth).  And, as you might expect with my background, our effort also includes managed programming.< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Anyway, this blog will remain available indefinitely.  It continues to be useful for certain technical details which are unavailable elsewhere.

 

In the meantime, if any readers are interested in working on a deep systems incubation with me and a team of truly outstanding developers, please send me email (cbrumme).  We are holding to some very high standards for this effort in terms of insight, experience and hard work.  But if you are like me, I am confident you will find it a dream opportunity.

(more…)

Silverlight 2 Beta 1 Cross Domain Bug

Filed under: Software


Also see: Manual CRUD operations with the Telerik RadGrid control

I recently ran into what appears to be a bug in Silverlight 2 Beta 1’s handling of cross-domain web service access when using a clientaccesspolicy.xml file. I’m hoping this post might save a few other people the time it took me to work out what was going on here.

Here’s the executive summary: if the web service exposes resources whose URIs contain semicolons, you will not be able to access those resources cross-domain if you’re using clientaccesspolicy.xml. The workaround is to use crossdomain.xml instead.

Now for the more detailed version.

In case you’re not familiar with cross-domain web service access, here’s the basic idea. By default, a web browser won’t let client-side code go connecting to any old web site. Client-side code is allowed to make requests against the web site from which it was originally downloaded, and it should only have access to other sites if those sites opt in.

In pure AJAX sites, this is often achieved using a faintly smelly hack where web services return runnable script rather than simple data. Flash introduced a somewhat more formal mechanism by which a web site can declare that it’s happy to be accessed by client-side code from other domains. Silverlight now supports this feature as of v2 beta 1.

Here’s an example. If your web site offers a resource called /crossdomain.xml containing this:

<!DOCTYPE cross-domain-policy SYSTEM
 \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">
<cross-domain-policy>
 <allow-access-from domain=\"*\" />
</cross-domain-policy>

(more…)

C# 3.0 Lambdas and Type Inference

Filed under: Software


Also see: Degrees of optimism in projects

Daniel Cazzulino recently wrote a blog entry whose main focus was on building pipelines using iterators in C#. Towards the end he showed a slightly irritating problem in C# 3.0. He wanted to write this:

var transformer = x => new { Original = x, Normalized = x.ToLower() };

However, the C# compiler complains because it doesn’t have enough information to infer the type of the transformer variable. The problem it reports is “Cannot assign lambda expression to an implicitly-typed local variable”.

Daniel doesn’t present a working solution to this particular problem – he ends up structuring his program differently to avoid the issue entirely. But in his discussion of this problem, he proposes something that he describes as ugly, and which, as he points out, doesn’t work anyway:

Func<string, {string Original, string Normalized}> transformer =
 x => new { Original = x, Normalized = x.ToLower() };

This is a direct approach to the problem described in the compiler error message. Can’t assign the expression to an implicitly-typed variable? OK, let’s make the variable explicitly typed. Unfortunately, you can’t specify the type because the expression involves an anonymous type. And that’s the thing about anonymous types: they don’t have names.

(more…)

Win friends and influence your team

Filed under: Software

Do you know where your data is? If you’ve been involved with software at any point in the past two decades, chances are it’s in a database. It would seem silly to put data, especially frequently changing data, into code.

How about those business rules? Business rule engines haven’t been around as long as databases, but times are a-changin’. Imagine a world where the folks that come up with the rules can enter them, test them and even deploy them without having the development team so much as lift a finger. Costs are signifigantly lowered, deadlines are met, everyone gets bonuses and is promoted to figurehead VP positions.

Interested? Please stop by and check out our webcast next week:

Rules for Enterprise Agility: Webcast, March 15th, 11am CT
IT architects, application developers, business analysts and process owners will learn about best practices for rules-oriented architecture and application development, and how business rule engines can provide substantial benefits in consistent decision making, increased revenue and decreased operating costs.
Live Help Server: Jerry Messenger Server is Live Chat with Users on your websites.

Also see: Debugging an InvalidCastException

Also see: Reporting Services administration changes in Katmai (v.Next)

Featured speakers include industry analyst and veteran application development expert Dr. Adrian Bowles, and Larry Buettner, CIO of Wheels, Inc. and a member of ComputerWorld’s 2006 list of Premier 100 IT Leaders.More information: http://www.inrule.com/Event_Info.aspx


http://weblogs.asp.net/jkey/archive/2006/03/10/439991.aspx

Brad Abrams’ pixel8 Interview Podcast posted

Filed under: Software

I just noticed that the good folks at Pixel8 posted a podcast I did with them a while back.  It was a fun conversation about a bit of.NET history as well as where we are going. 

Landing Page   Download show

I’d love the hear what you think!


http://blogs.msdn.com/brada/archive/2008/03/15/brad-abrams-pixel8-interview-podcast-posted.aspx

Web Services with Spring 2.5 and Apache CXF

Filed under: Software

CXF is a recent initiative by the Apache foundation targeted at bringing together the features of XFire and Celtix under the same umbrella. This post explores the project in the context of Spring 2.5.

Also see: Reporting Services administration changes in Katmai (v.Next)


http://feeds.feedburner.com/~r/techtarget/tsscom/blogs/~3/247994251/thread.tss

Nothing says “holidays” like beer and raffles

Filed under: Software


Also see: UI design

Also see: Implied tags in the IE HTML parser and how that can be interesting.

Also see: Silverlight and WPF Control Developer Huddle at Mix08

Won’t you join us for some holiday cheer?

Place: Rock Bottom @ State & Grand in Chicago
Time: 6PM

Please note that this is next Thursday, December 15.

I’ll be giving away another JetBrains.NET Action Pack, consisting of ReSharper and dotTrace licenses (one each).

Happy Holidays!
http://weblogs.asp.net/jkey/archive/2005/12/08/432710.aspx

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com