Sunday, November 03, 2013

C# Singleton Pattern by Jon Skeet

C# in Depth: Implementing the Singleton Pattern

Thread safety without locks

public sealed class Singleton {
    private static readonly Singleton instance = new Singleton();
    // Explicit static constructor to tell C# compiler           
    // not to mark type as beforefieldinit
    static Singleton() { }
    private Singleton() { }
    public static Singleton Instance { get { return instance; } }
}

Fully lazy instantiation:
public sealed class Singleton {
    private Singleton() { }
    public static Singleton Instance { get { return Nested.instance; } }
    private class Nested  {
        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static Nested() { }
        internal static readonly Singleton instance = new Singleton();
    }
}

C# in Depth: Articles
Cover of C# in Depth

C# Design Strategies - @ pluralsight

Git: Source Code Graph

Jim Webber declared, in his excellent Neo4j presentation @ InfoQ
A Little Graph Theory for the Busy Developer
that most of data could be represented as a graph.

For example, Git distributed source control system is using graph model,
instead of typical "linear".

Quick introduction to git internals for people who are not scared by words like Directed Acyclic Graph.
Git for Computer Scientists


Git is now in even in TFS and Visual Studio, so almost all of source code is a
Giant Global Graph ... Could be searched by Google's Knowledge Graph,
and even by Facebook's Social Graph Search :)





Android's "Photo Sphere"

This is one year old "news", where Android 4.2 included "Sphere" photo capture tool, along with standard Photo, Video and Panoramic.
But there is still no obvious way how to view such images outside of phone.
Google+ apparently has a tool for that.

Hands-on with Android 4.2's Photo Sphere: Connect:
"The easiest way to view your Photo Spheres on a computer is to upload them to your Google+ account. Click here and here to see our two samples from above on Google+.


Check out 24 of the best Photo Sphere shots so far | Android Central

Lockey McGrath - Google+ - :: when hurricane sandy hit NYC the other night I wondered…