Label Cloud

Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Thursday, March 26, 2009

Windows Server 2008 R2 is 64bit only

Learned something new from Mark’s blog: Windows Server 2008 R2 is 64bit ONLY( The news is not new, but I only learned it tonight.) It will still support 32 bit applications, but only via OPTIONAL WoW64 functionality that is not added by default. I’ve heard about Microsoft stopping 32bit OS development a while back, but seeing this actually done…. This is BIG.

Technorati Tags: ,,


Share/Save/Bookmark

Thursday, March 19, 2009

Internet Explorer 8 is released – and I am using it

IE8 is now released and I’ve just upgraded my home laptop to it (I try not to mess around with betas on my main machine) So far so good. Speed of the browser is definitely something to brag about. I’ve also liked accelerators that come with IE. When you select a block of text with a mouse, a menu pops up that allows you to blog, email, search and even translate. Very useful functionality that can be extended by third-parties.

Download the new Internet Explorer at http://www.microsoft.com/windows/internet-explorer/default.aspx

Technorati Tags: ,


Share/Save/Bookmark

Wednesday, March 18, 2009

Linq Provider for Oracle Coherence – Pt 2

In previous post I published about a Linq for Oracle Coherence. Linq makes it very convenient to add functionality to a provider, however creating a functionally reach and complete provider is a very complicated process.

Latest functionality I’ve added was ability to use coherence extractors in the query. Linq does not allow you to change its keywords and syntax, however, all functions are converted to linq expressions and are passed to the ExpressionVisitor for evaluation. First thing is to create an extended function to provide the functionality

public static T Extractor<T>(this object obj, string Name)
{
    throw new NotSupportedException();
}
public static T ChainedExtractor<T>(this object obj, string Name)
{
    throw new NotSupportedException();
}

The functions themselves do not have any functionality and are used solely to be converted to a linq expression. I’ve created them as Generic functions to be able to strongly type against extracted data

In the QueryTranslator class VisitMethodCall() function, we add functionality to evaluate the expression

if (m.Method.DeclaringType == typeof(LinqFunctions))
{
    if (m.Method.Name == "Extractor")
    {
        this.Visit(m.Arguments[1]);
        string right = (string)globalFilter;
        globalFilter = new Tangosol.Util.Extractor.ReflectionExtractor(right);
        return m;
    }
    else if (m.Method.Name == "ChainedExtractor")
    {
        this.Visit(m.Arguments[1]);
        string right = (string)globalFilter;
        globalFilter = new Tangosol.Util.Extractor.ChainedExtractor(right);
        return m;
    }
}

m.Arguments[0] has the reference to the parent object. m.Arguments[0] contains the argument. This allows us to create a Coherence Extractor that is used in the filters higher in the expression tree.


A Note: I hope that the project gets some visibility and comments. Oracle Coherence is an excellent product with great .NET potential. Check out the project on google code: http://code.google.com/p/linqtocoherence


Share/Save/Bookmark

Tuesday, March 17, 2009

Linq provider for Oracle Coherence (Linq to Coherence)

I am very impressed with Coherence from Oracle. Coherence provides a distributed in-memory cache and processing fabric. However it is a lot more then just a cache. It can be used for everything from messaging to cross platform communication medium. There is too much to talk say about it, so read more information at Oracle: http://www.oracle.com/technology/products/coherence/index.html

Coherence works very nicely with .Net however, in the days of Linq, I wanted to write a Linq provider for it. My code is based largely on the Linq provider documentation on MSDN (http://msdn.microsoft.com/en-us/library/bb546158.aspx) and excellent series on creating a linq provider by Matt Warren (http://blogs.msdn.com/mattwar/pages/linq-links.aspx)

I am using Google Code to host the project under Artistic License. Please check out the full source code at http://code.google.com/p/linqtocoherence/.

Below is a rundown on two main classes. The main part of the code that deals with Coherence is in two classes CoherenceQueryProvider and CoherenceQueryTranslator.

CoherenceQueryProvider accepts a connection to the INamedCache – a reference to coherence cache that will be queried.

public class CoherenceQueryProvider  : IQueryProvider
{
   public INamedCache Cache { get; set; }
   public CoherenceQueryProvider ()
    {
    }

   public CoherenceQueryProvider(INamedCache cache)
   {
       Cache = cache;
   }

In the Execute method, CoherenceQueryProvider translates the Where clause to a Coherence Filter and executes the filter against the Cache objects to return array of values.

public object Execute(Expression expression)
{
  if (Cache == null)
      throw new InvalidOperationException("Cache is not properly set");

  // Find the call to Where() and get the lambda expression predicate.
  InnermostWhereFinder whereFinder = new InnermostWhereFinder();
  MethodCallExpression whereExpression = whereFinder.GetInnermostWhere(expression);
  LambdaExpression lambdaExpression = (LambdaExpression)((UnaryExpression)(whereExpression.Arguments[1])).Operand;

  // Send the lambda expression through the partial evaluator.
  lambdaExpression = (LambdaExpression)Evaluator.PartialEval(lambdaExpression);

  IFilter filter = new CoherenceQueryTranslator().Translate(lambdaExpression);

  object[] data = Cache.GetValues(filter);
  Type elementType = TypeSystem.GetElementType(expression.Type);
  return data;
}


CoherenceQueryTranslater uses the visitor pattern to convert the Linq Expression from the where clause to Coherence Filter. Coherence filters are nested to converting one to the other is relatively simple

protected override Expression VisitBinary(BinaryExpression b)
{
  this.Visit(b.Left);
  object lastGlobal1 = globalFilter;
  this.Visit(b.Right);
  object lastGlobal2 = globalFilter;
  switch (b.NodeType)
  {
      case ExpressionType.AndAlso:
          globalFilter = new AndFilter((IFilter) lastGlobal1, (IFilter)lastGlobal2);
          break;
      case ExpressionType.OrElse:
          globalFilter = new OrFilter((IFilter) lastGlobal1, (IFilter)lastGlobal2);
          break;

There is a lot more code in the classes to handle other filters, but a lot of it is pretty repetitive. The work on the linq provider is not done and I still have to implement some of the coherence functionality. Full code and usage sample is available on google code http://code.google.com/p/linqtocoherence/

Check it out and post your comments / suggestions.


Share/Save/Bookmark

Monday, January 19, 2009

CAPICOM.dll Removed from Windows SDK for Windows 7

Its not that often that I hear that of a system component of Windows SDK being removed from a future version of windows. As the matter of fact, this is the only time that I know off (I am sure it happened before)

Karin Meier from Windows SDK Team announced on his blog that CAPICOM is now considered to be depreciated and is providing alternatives at http://msdn.microsoft.com/en-us/library/cc778518(VS.85).aspx

Technorati Tags: ,


Share/Save/Bookmark

Thursday, June 26, 2008

Dropping Visual Studio Unit Testing for NUnit

Continuing with my adventures in porting java code to .Net, I am dealing with moving JUnit unit tests to .NET. My first move thought was to convert to Microsoft Unit Testing framework. However, after spending quite a bit of time to get it to work, I gave up and switched to NUnit.

Two things that are NOT supported by the Microsoft framework and forced me to switch

    • Per-Test StartUp/TearDown functions. [TestInitialize] and [TestCleanup] are not called for every [Test]. They are called when the Test class is initialized. That means its very hard to have a good Initialization and Cleanup routines for every test.
    • Lack of Test Inheritance. I a set of unit tests that test different implementations of an interface. The core test of the interface must be the same to make sure that all implementations handle the core identically. However, There might be special additional tests to validate extended functionality. Currently, you can not accomplish that with Inheritance.

Both are fully supported by NUnit.

Technorati Tags: , ,


Share/Save/Bookmark

Saturday, February 16, 2008

Windows Server 2008 will have an SP1 label

I came cross an interesting blog entry that said that Windows Server 2008 will have SP1 label already applied to it. Take a look at http://blogs.msdn.com/iainmcdonald/archive/2008/02/15/windows-server-2008-is-called-sp1-adventures-in-doing-things-right.aspx

Now, how will this effect people's rule not to install a Microsoft server, until SP1 is released (or did the rule implement this version scheme due to that rule :)

Technorati Tags: , ,


Share/Save/Bookmark

Friday, February 01, 2008

Sara Ford's WebLog : Did you know... You can use Shift+ESC to close a tool window - #142

Sara Ford's Tips Blog is an excellent source of tips. This one especially helpful for me.

Sara Ford's WebLog : Did you know... You can use Shift+ESC to close a tool window - #142

Technorati Tags: , , ,


Share/Save/Bookmark

Friday, January 25, 2008

WCFTestClient - a testing utility from Visual Studio 2008

I stumbled upon an excellent utility for WCF Testing that comes with Visual Studio 2008 - WCFTestClient.

The tool is an simple way to test WCF clients HTTP and TCP bindings. Some things are not supported, however, for basic WCF Testing, this definitely beats the old ASMX test page.

Note: Also check out the WCFSvcHost utility from Visual Studio to host an arbitrary WCF Service.


Share/Save/Bookmark

Thursday, January 17, 2008

.NET 3.5 Source is now available

Everyone's talking about it. The source for .NET 3.5 framework is available for debugging. Read full instructions on how to set it up here

http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx

Technorati Tags: , ,


Share/Save/Bookmark

Monday, January 07, 2008

Fixing WCF/WPF VS 2005 Extensions installation after installing VS 2008 or .NET 3.0 SP1

I've encountered a problem trying fix the WCF / WPF Visual Studio 2005 Integration components after I've installed Visual Studio 2008.

Installing a VS 2008 will install .NET 3.0 SP1 and remove the installation of .NET 3.0. When trying to install the WCF / WPF Extension, installation display's a message

Setup has detected that a prerequisite is missing. To use Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP you must have the .NET Framework 3.0 runtime installed. Please install the .NET Framework 3.0 runtime and restart setup

You really can't install .NET 3.0 since a newer version (.NET 3.0 SP1) is already installed.

I found a solution on the MS Forums http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2550726&SiteID=1

It involves either going creating a registry key to full the installers into thinking that SP1 is installed. To fix the issue, add the following value to the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{15095BF3-A3D7-4DDF-B193-3A496881E003}] "DisplayName"="Microsoft .NET Framework 3.0"

Thanks Erich for the solution.

Note: I got a comment that this can also be forced using command line: msiexec /i vsextwfx.msi WRC_INSTALLED_OVERRIDE=1

Thanks


Share/Save/Bookmark

Thursday, December 20, 2007

Compiling .NET 3.5 code to .NET 2.0 Works

This is something that is totally cool. You can use Visual Studio 2008 and a lot of the new functionality and cross compile it to .NET 2.0 and run it on the older framework. For Example, You can use Var objects, Simple Property Declarations, Property Constructors, Lambda expressions

Here's an example program that can be compiled with VS 2008 to the .NET 2.0 framework

static class Program
    {
        private class Client
        {
            public string Name { get; set; }
            public string Address { get; set; }
        }

        private static List<Client> clients = new List<Client>
        {
            new Client() {Name = "Name1", Address = "Address1" },
            new Client() {Name = "Name2", Address = "Address2" },
            new Client() {Name = "Name3", Address = "Address3" },
            new Client() {Name = "Name13", Address = "Address13" },
            new Client() {Name = "Name123", Address = "Address123" }
        };

        [STAThread]
        static void Main()
        {
            List<Client> ClientsWith1 = clients.FindAll(c => c.Name.Contains("1"));
            ClientsWith1.ForEach(c =>
            {
                var NewClient = new
                {
                    Name = c.Name,
                    Address = c.Address
                };
                Console.WriteLine(NewClient.ToString());
            });
            Console.ReadKey();
        }
    }
 
Here's the output

{ Name = Name1, Address = Address1 }
{ Name = Name13, Address = Address13 }
{ Name = Name123, Address = Address123 }

And it works without .NET 3.5 installed.

For those interested, Here's a Reflected code

internal static class Program
{
    // Fields
    private static List<Client> clients;
    [CompilerGenerated]
    private static Predicate<Client> CS$<>9__CachedAnonymousMethodDelegate2;
    [CompilerGenerated]
    private static Action<Client> CS$<>9__CachedAnonymousMethodDelegate3;

    // Methods
    static Program()
    {
        List<Client> <>g__initLocal4 = new List<Client>();
        Client <>g__initLocal5 = new Client();
        <>g__initLocal5.Name = "Name1";
        <>g__initLocal5.Address = "Address1";
        <>g__initLocal4.Add(<>g__initLocal5);
        Client <>g__initLocal6 = new Client();
        <>g__initLocal6.Name = "Name2";
        <>g__initLocal6.Address = "Address2";
        <>g__initLocal4.Add(<>g__initLocal6);
        Client <>g__initLocal7 = new Client();
        <>g__initLocal7.Name = "Name3";
        <>g__initLocal7.Address = "Address3";
        <>g__initLocal4.Add(<>g__initLocal7);
        Client <>g__initLocal8 = new Client();
        <>g__initLocal8.Name = "Name13";
        <>g__initLocal8.Address = "Address13";
        <>g__initLocal4.Add(<>g__initLocal8);
        Client <>g__initLocal9 = new Client();
        <>g__initLocal9.Name = "Name123";
        <>g__initLocal9.Address = "Address123";
        <>g__initLocal4.Add(<>g__initLocal9);
        clients = <>g__initLocal4;
    }

    [STAThread]
    private static void Main()
    {
        if (CS$<>9__CachedAnonymousMethodDelegate2 == null)
        {
            CS$<>9__CachedAnonymousMethodDelegate2 = delegate (Client c) {
                return c.Name.Contains("1");
            };
        }
        if (CS$<>9__CachedAnonymousMethodDelegate3 == null)
        {
            CS$<>9__CachedAnonymousMethodDelegate3 = delegate (Client c) {
                Console.WriteLine(new { Name = c.Name, Address = c.Address }.ToString());
            };
        }
        clients.FindAll(CS$<>9__CachedAnonymousMethodDelegate2).ForEach(CS$<>9__CachedAnonymousMethodDelegate3);
        Console.ReadKey();
    }

    // Nested Types
    private class Client
    {
        // Fields
        [CompilerGenerated]
        private string <Address>k__BackingField;
        [CompilerGenerated]
        private string <Name>k__BackingField;

        // Properties
        public string Address
        {
            [CompilerGenerated]
            get
            {
                return this.<Address>k__BackingField;
            }
            [CompilerGenerated]
            set
            {
                this.<Address>k__BackingField = value;
            }
        }

        public string Name
        {
            [CompilerGenerated]
            get
            {
                return this.<Name>k__BackingField;
            }
            [CompilerGenerated]
            set
            {
                this.<Name>k__BackingField = value;
            }
        }
    }
}
 
Technorati Tags: ,,,,


Share/Save/Bookmark

Monday, November 19, 2007

VS 2008 Wait is over

VS 2008 is RTM on November 19th

Get it now...

http://microsoft.com/vstudio/

Technorati Tags: , ,


Share/Save/Bookmark

Wednesday, November 07, 2007

Windows Live Writer is out of Beta

The excellent tool that I am using to write blog entries is finally out of beta. Get it now.

http://windowslivewriter.spaces.live.com/default.aspx

Technorati Tags: , ,


Share/Save/Bookmark

Wednesday, April 18, 2007

Excellent MSDN Managazine article on Parallel Data Structures and Algorithms

Last MSDN Magazine has an excellent article on Parallel Dat Structures and Algorithms. Article provides implementation source code and explains the following

  • Countdown Latch
  • Reusable Spin Wait
  • Barriers
  • Blocking Queue
  • Bound Buffer
  • Thin Event
  • Lock-Free LIFO Stack

Here is a link to the full article on MSDN: http://msdn.microsoft.com/msdnmag/issues/07/05/CLRInsideOut/

Related Arclie: "What Every Dev Must Know About Mulithreaded Apps" msdn.microsoft.com/msdnmag/issues/05/08/Concurrency


Share/Save/Bookmark

Monday, March 05, 2007

Update to Smart Client Software Factory

Blaine Wastell is writing about a soon to come out April Update to Smart Client Software Factory. The new functionality is extremely interesting:

  • WPF Interoperability
  • Offline Application Block (this was released a while back, but I didn't see support for it recently)
  • WCF Support
  • Possible support for WWF (Windows Workflow). This is 2nd priority, but that means it might be released in the future updates, if not in the April update.


Share/Save/Bookmark

Thursday, March 01, 2007

What's up with IE File Download

I was downloading the VM of the new Orcas distribution from MSDN. The download comes in 8 650MB files that have to be downloaded separately. To speed things up, I started 2 downloads in IE and 2 in Firefox. All of them were started within a few seconds of each other and where going with the same speed. After about 45 minutes of waiting for the numbers to get to 100% and hoping to start downloading the rest of the files, I saw an important difference between IE and Firefox. After 100%, Firefox was DONE. IE Showed a dialog box saying that will take another 10 minutes to save the file to the destination. Huhh... What's up with extra 25% "saving tax"? How did IE benefit from saving a file to the temporary space before saving it to the final destination? Why did it have to use my C: drive when my destination was my, much larger, E: drive? I just don't get it.


Share/Save/Bookmark

Wednesday, December 13, 2006

A VERY cool example of compiler optimization

http://blogs.msdn.com/abhinaba/archive/2006/12/13/why-can-we-only-use-constants-in-a-switch-case-statement.aspx

Reading Microsoft Blogs, I saw a great example of compiler optimization. Apparently, C# compiler is able to optimize case statement that is based on string constants. Once the number of cases reaches a specific level (example was with 7 cases including default) , the compiler switched from using if statement, to pre-populating values into a dictionary and doing a value lookup.

It really is amazing how good compilers are these day and proves once again

  • Do not try to outsmart the compiler
  • Do not over-optimize too early
  • Profile early, Profile Often


Share/Save/Bookmark

Sunday, October 22, 2006

Disable Security Warning in IE7

One of the new security futures available in IE7 is a warning to correct your security settings if they are not considered "Secure Enough"

Microsoft does not give a good way to disable a warning, and for a good reason. The warning can only be disabled via a registry setting usually set by the group policy.

Here's the setting:

Key: HKCU\Software\Microsoft\Internet Explorer\Security\DisableSecuritySettingsCheck KeyType: DWORD Value: 0x1


Share/Save/Bookmark

Friday, October 20, 2006

Using IE 7 and liking it, alot

Now that Internet Explorer 7 is finally released, I've tried it again as my main browser. I'm using it, and I'm liking it.

The UI is a bit different, and it takes me a few seconds to find the new STOP button. The menu is also in a different place. The interface is nice and clean. The tabs are finally an integrated part of the UI, instead of an ugly addon from MSN Toolbar.

Really no complains so far.


Share/Save/Bookmark
Directory of Computers/Tech Blogs