Standing on the shoulders of giants. RSS 2.0
# Monday, October 06, 2008

Blog Bling BrainLast week the final (25) sessions were added to the PDC Session list, making it a total of 178 sessions. I’m not sure which sessions are new or updated, so this list will not be unfamiliar to regular readers of this blog (all 5 of you).

The sessions I will try to attend, if they can schedule around my wishes, are: sessions about “Oslo”, “Zermatt”,  CLR Futures, some language sessions (C#, F#, Dynamic Languages, XAML), “Dublin” and the Parallel Symposium.

Update: I had another look at the session list today and 10 more sessions were added, making it a total of 188.

Monday, October 06, 2008 7:38:07 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
Conference | PDC2008

Yesterday dasBlog 2.2 (2.2.8279.16125) was released on CodePlex. This release adds OpenID for comments (and admin login), support for IIS 7 and support for custom 404 pages.

As always you can download the web- and the full install from CodePlex or get the source from repository.

Monday, October 06, 2008 1:38:21 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
dasBlog
# Friday, October 03, 2008

AnnotatedTuringCover25In 1936 Alan Turing wrote a paper "On Computable Numbers, with an Application to the Entscheidungsproblem [0]". The most interesting result of this paper is not the conclusion, that there cannot be a general solution to the Entscheidungsproblem, but how Alan Turing reached that conclusion. In his paper he introduces a computing machine (a Turing machine) with a limited number of operations, by showing that such a machine can not determine the ultimate fate of all other machines, he proves there is not general solution.

In 2008 Charles Petzold wrote "The Annotated Turing", in this book he dissects the original paper from Alan Turing. This book not only presents the original paper (and the appendix and corrections) with numerous annotations and samples, but also is a biography of Alan Turing's life and an introduction to the mathematical background, required for understanding the paper. The book concludes with an overview how the Turing machines can be used to help understand the human mind and the universe.

This is a highly recommended book, which is very accessible for anyone with a general interest in computes and mathematics. And a must read for all developers, who want to understand why there can't be a general program which verifies all programs are error free.

[0] The Entscheidungsproblem asks for a general decision procedure with a finite number of steps to determine the provability of any given well-formed formula.

Friday, October 03, 2008 7:53:13 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
Reading
# Wednesday, October 01, 2008

The ‘normal’ use case for using templated databound controls like the listview control is to specify the control and the templates in declarative markup and bind the control in the code-behind.

 <asp:ListView runat="server" ID="listview">
     <LayoutTemplate>
        <ol><li runat="server" id="itemPlaceholder" />ol>
     LayoutTemplate>
     <ItemTemplate>
        <li><%#Eval("item") %>li>
     ItemTemplate>
 asp:ListView>

and in the code-behind:

listview.DataSource = ....
listView.DataBind();

But when you’re building a webpart or a composite control, this is generally not really an option. The way to define templates in the code-behind is to define two classes which implement the ITemplate interface and assign an instance of these classes to the LayoutTemplate and the ItemTemplate properties. (There are a lot more templates you can use, but these are used to show how the concept works.)

The Layout template is the simplest to define:

private class LayoutTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        var ol = new HtmlGenericControl("ol");
        var li = new HtmlGenericControl("li") { ID = "itemPlaceholder" };
        ol.Controls.Add(li);

        container.Controls.Add(ol);
    }
}

The only requirement is that it control with the ID itemPlaceHolder, the listview uses this ID to find the control to replace with the item template when databinding.

The InstantiateIn method in the item template is similar to that method in the layout template: a control is created (the same type as previously) and this is added to the container control, effectively replacing the child-control (with the itemPlaceHolder ID) from the layout template. The only difference is that we register for the databinding event of the childcontrol. In the databinding method a reference to the childcontrol is obtained (the sender parameter) and a reference to the current item from the bound collection.

private class ItemTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        var li = new HtmlGenericControl("li");

        li.DataBinding += DataBinding;
        container.Controls.Add(li);
    }

    public void DataBinding(object sender, EventArgs e)
    {
        var container = (HtmlGenericControl)sender;
        var dataItem = ((ListViewDataItem)container.NamingContainer).DataItem;

        container.Controls.Add( new Literal(){Text = dataItem.ToString() });
    }
}

Complete source: FibonacciControl.txt (1.88 KB)

Wednesday, October 01, 2008 3:47:00 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
ASP.NET
# Monday, September 29, 2008

As Dare Obasanjo writes, there are a number of things you have to give thought when implementing OpenID on your website.

The real question you’ll have to answer is: how easy do I make it for users to participate on my website and how hard do I make it for spammers to flood my website.

But by delegating authentication to an OpenID provider, your implicitly trusting that provider to do the right thing when authenticating a user. Since, as Tim Bray speculated, there is nothing stopping a provider from “succesfully authenticating” any user URL, you can’t blindly trust any OpenID provider. So depending on the requirements you have for the authentication of your users, you can white-list providers you trust (like HealthVault), or if you’re only worried about bots, you can ask them to solve a Captcha. So the consequence is: since you can’t really trust all OpenID providers, so you force your user to register for a specific one (making their OpenID no longer their single online id) or make them to jump through hoops (by proving they are human).

Does OpenID really make it easier for a user to use your site? Or does it make it easier for you (the developer), since you can drop in a control and think you don’t have worry about authentication.

See also: OpenID is too hard & The problem(s) with OpenID

 

 

Monday, September 29, 2008 7:14:58 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
Development | Security

Sample Diagram

Generate your own on the websequencediagrams site.

Monday, September 29, 2008 6:16:18 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
Development
# Tuesday, September 16, 2008

A nice method I discovered today:

System.Globalization.TextInfo.ToTitleCase(string)

This capitalizes the first letter of each word in the string, e.g. "hello world" becomes "Hello World".

Tuesday, September 16, 2008 7:30:19 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
Codesnippet
# Monday, September 15, 2008
public class Foo : IComparable<Foo>
{
    public Foo() { }

    public int Value { get; set; }

    public int CompareTo(Foo other)
    {
        if (other == null) { return 1; }

        return this.Value.CompareTo(other.Value);
    }
}

The trick is the line, which checks for the null comparison. Since null is always less than this, the method must return a value greater than zero (0).

Also see the remarks in the documentation:

Greater than zero: This object is greater than other.
...
By definition, any object compares greater than null (Nothing in Visual Basic), and two null references compare equal to each other.

Monday, September 15, 2008 8:55:47 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
Codesnippet
# Monday, September 08, 2008

55 more sessions have been added to an all ready full schedule making the current total 139 sessions and still more "secret" session will be announced at the PDC.

Highlights of the (new) sessions:

  • Parallel Symposium:
    • Addressing the Hard Problems with Concurrency
    • Application Opportunities and Architectures
    • Future of Parallel Computing
  • Services Symposium:
    • Enterprise Grade Cloud Applications
    • Expanding Applications to the Cloud
    • Projecting On Premises Applications to The Cloud
  • Service Bus Building Blocks: Connectivity, Messaging, Events, and Discovery
  • "Zermatt"
    • Deep Dive
    • Enabling Next Generation Identity
  • Windows CardSpace "2": Under the Hood

With the focus on "The Cloud", Parallel Computing and "Oslo" this looks like it will be a very interesting PDC. For more information about what "Oslo" is see both Don's and Doug's definitions.

[Current PDC08 Session List]

Monday, September 08, 2008 8:49:05 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
Conference | PDC2008
# Sunday, September 07, 2008

In the Managed Extensibility Framework source code on CodePlex is this 'preview' of the new Tuple class in the .NET Framework 4.0

// NOTE : this is a TEMPORARY and a very minimalistic implementation of Tuple'2,
// as defined in http://devdiv/sites/docs/NetFX4/CLR/Specs/Base Class Libraries/Tuple Spec.docx
// We will remove this after we move to v4 and Tuple is actually in there

[Via: Don Box's Spoutlet]

Sunday, September 07, 2008 10:55:08 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
BCL
Ads
About
© Copyright 2012
Paul van Brenk
Sign In
newtelligence dasBlog 2.3.2011.0
All Content © 2012, Paul van Brenk
DasBlog theme 'Business' created by Christoph De Baene (delarou)