September 2005 Entries

Happy Blogiversary!

Well, it's been a year since my second-first post.  I just hope that my random thoughts and rants have provided you, my three readers, with insightful information. I promise to keep up bloggin' good stuff for at least one more year!

posted @ Friday, September 30, 2005 8:25 PM | Feedback (623)

List<T>.ForEach

Lately, I’ve been working a lot in .NET 2.0; specially with generic collections.  After working with System.Collections.Generics.List, I’ve learned to appreciate its ForEach method.  Oh, how much it reminds me of the map procedure in Scheme.  Can you tell which code is faster? namespace GenericList{    using System;    using System.Collections.Generic;    using System.Diagnostics;    class Program    {        static void Main(string[] args)        {            string[] numbers = { "1", "2", "3", "4", "5"};            List<string> numberList = new List<string>(numbers);            // Create a watch to time the execution!            Stopwatch watch = new Stopwatch();            watch.Start();            // Old boring way!            foreach (string string1 in numberList)            {                Console.WriteLine("First For-Loop Value: {0}", string1);                foreach(string string2 in numberList)                {                    int n1 = Int32.Parse(string1);                    int n2 = Int32.Parse(string2);                    Console.WriteLine("\tSecond For-Loop Value: {0}+{1}={2}",                                        n1.ToString(), n2.ToString(),                                        (n1 + n2).ToString());                }            }            watch.Stop();            Console.WriteLine("For-loop time: {0} millisec(s)",                                 watch.ElapsedMilliseconds.ToString());            // One empty line for ease of read            Console.WriteLine();            watch.Reset();            // Get value of list without loop!            watch.Start();            numberList.ForEach(new Action<string>(                                        delegate(string s)                                        {                                            Console.WriteLine("First Delegate Value: {0}", s);                                            // Lets loop again!                                            numberList.ForEach(                                                new Action<string>(                                                    delegate(string s2)                                                     {                                                        // Convert to numbers                                                        int num1 = Int32.Parse(s);                                                        int num2 = Int32.Parse(s2);                                                        // Output the simple loop sum                                                        Console.WriteLine("\tSecond Delegate Value: {0}+{1}={2}",                                                                            num1.ToString(), num2.ToString(),                                                                             (num1 + num2).ToString());                                                    }                                                )                                            );                                        }                                    )                                );            watch.Stop();            Console.WriteLine("Delegate time: {0} millisec(s)",                                 watch.ElapsedMilliseconds.ToString());            watch.Reset();            Console.ReadLine();        }    }}

posted @ Thursday, September 29, 2005 11:22 PM | Feedback (614)

COM Interop: Three Heads Are Better Than One

[OverDuePost] While working with COM interop (VB6 client / .NET Server), our architecture team ran into some problems with returning typed arrays back to the client.  I had spent over two hours trying to get things working with the correct set of attributes, but I kept on getting “Type Mismatch” errors in VB6.  I had to leave early to meet up with my wife and Fred and Nick stayed after to help with more research.  This is our brain child: Domain object (and interface) that is used by VB6 to populate its UI namespace InteropLibrary{    using System;    using System.Runtime.InteropServices;    [InterfaceType(ComInterfaceType.InterfaceIsDual)]    [Guid("905816E8-9C73-42f0-A776-7117ACF633BD")]    public interface IPerson    {        [DispId(1)]        string FirstName        {            get;            set;        }        [DispId(2)]        string LastName        {            get;            set;        }        [DispId(3)]        string ID        {            get;            set;        }    }} namespace InteropLibrary{    using System;    using System.Runtime.InteropServices;    [ClassInterface(ClassInterfaceType.None),        ComDefaultInterface(typeof(IPerson)),        ProgId("Interop.Person"),        Guid("135983AB-8242-41fb-8ED8-FDE3383A2FDD"),        Serializable]    public class Person : IPerson    {        string firstName;        string lastName;        string id;        public Person ()        {            ID = Guid.NewGuid().ToString();        }        public string FirstName        {            get { return firstName; }            set { firstName = value; }        }        public string LastName        {            get { return lastName; }            set { lastName = value; }        }        public string ID        {            get { return id; }            set { id = value; }        }    }} Server object (and interface) used by VB6 to return either a single...

posted @ Saturday, September 24, 2005 11:25 AM | Feedback (616)

WinFX Beta1 to Beta2 (September CTP) Issues

Just wanted to mention that there are significant changes from Beta1 to Beta2 for Indigo (Windows Communication Foundation) that will make your beta1 applications not to work under the new version. Right now I’m trying to sort through all the big differences.  Thus far, I’ve found out the following: wsProfileBinding is no more.  wsHttpBinding is now it’s equivalent, also System.ServiceModel.IProxyChannel for your proxy client is no more. I will try to point out the big changes for the two versions of Indigo.

posted @ Thursday, September 22, 2005 11:22 PM | Feedback (533)

Working Late

Just working late on a project.  Here's the total thus far: Total Lines: 23, 133 Total Lines of Code: 16, 901 Almost there!

posted @ Tuesday, September 20, 2005 11:02 PM | Feedback (585)

New Indigo Article on MSDN

Clemens Vasters has a new article on MSDN entitled Introduction to Building Windows Communication Foundation Services.   The article gives you a nice run through the major parts of Indigo (WCF) and what it can do. Check it out when you have the time!

posted @ Sunday, September 18, 2005 11:58 AM | Feedback (611)

Nikhil On Atlas

Nikhil posts on the architecture of the Atlas framework.  I’ve downloaded Atlas but have yet to find time to play with it!  Curse these house chores!! Anyway, it appears that Atlas provides support for client and server (and things in between).  The thing I’m interested in finding out is how they create the dynamic JS proxies to interact with ASMX, Indigo and ASPX…

posted @ Thursday, September 15, 2005 7:30 PM | Feedback (611)

LINQ Whitepaper on MSDN

A LINQ (Language INtegrated Query) paper by Don Box and Anders Hejlsberg has been posted on MSDN.  I haven’t read all of it yet, but so far so good. The paper gives you a great deal of information of the functionality and features of the new framework.

posted @ Thursday, September 15, 2005 7:22 PM | Feedback (613)

WinFX CTPs Released

The WinFX September CTPs have been released.  Click the next links to get your fill of goodness. Runtime Components SDK VS Extensions

posted @ Wednesday, September 14, 2005 10:19 PM | Feedback (611)

Atlas PDC Keynote Code Posted

ScottGu has posted the code for the Atlas keynote.  Check it out, it’s pretty damn cool!

posted @ Wednesday, September 14, 2005 8:53 PM | Feedback (612)

WWF: Are you ready to orchestrate?

Ok, I know that was a stupid post title.  But you have find it amusing that Windows Workflow Foundation (WWF) ended up with that TLA. What is WWF?  Well, it builds workflow right into the operating system (Win Vista) so your applications can take advantage of it.  Will this replace Biztalk? You ask?  I don’t know and I don’t think so.  Matt Milner has some interesting things you should consider though in that issue.  Thanks Matt for your input!

posted @ Wednesday, September 14, 2005 8:50 PM | Feedback (611)

LINQ: More From Blogsphere

Kent Tegels chimes in about his impressions of LINQ.  Kent has a great set of points (and concerns) with the new framework.  I specially agree with his fourth point. Thanks Kent for your input!

posted @ Wednesday, September 14, 2005 8:42 PM | Feedback (548)

C# 3.0: LINQ Feature

Interesting observation: Has anyone else noticed that some of the features defined by the C-omega language (download) are being split between the 2.0 and 3.0 version of the language?  Don’t get me wrong, I think it’s awesome that the language is getting all of these awesome features.  I just find it a bit interesting that they waited this long to release all of the goodness… Here’s an excerpt from the article link above: C? includes a number of constructs from the SQL language as keywords. Operators for performing selection with projection, filtering, ordering, grouping, and joins are all built into C? If you look at the LINQ...

posted @ Tuesday, September 13, 2005 9:06 PM | Feedback (611)

Microsoft Max

I’ve only played with this for a few seconds and all I can say is that it’s pretty sweet…check it out!! What is it? it’s a pretty sweet implementation of Avalon and Indigo…can you imagine writing applications like this one?

posted @ Tuesday, September 13, 2005 8:48 PM | Feedback (611)

C# 3.0 and VB 9.0

This is awesome!  Read about C# 3.0 and Visual Basic 9.0 and their sweet features. C# 3.0 is going to be sweet…

posted @ Tuesday, September 13, 2005 8:45 PM | Feedback (611)

Atlas Released

Yes!  During a PDC keynote speech, ScottGu releaved the Atlas bits to developers!  If you’re as anxious to play with the technology as I am, you can learn more about it here. I can’t wait to start playing with it!

posted @ Tuesday, September 13, 2005 8:37 PM | Feedback (611)

Custom Item Templates In VS2005

Yet again, ScottGu posts on how you can take advantage of custom item templates in VS2005.  As Scott puts it, This feature enables developers to define common templates that they can re-use over and over when adding new pages/classes/controls into web projects or class libraries, and avoid repetitively typing standard content or code. All I have to say is “sweetness”…

posted @ Monday, September 12, 2005 8:49 PM | Feedback (611)

COM RCW Information

Eran Sandler posted some great information on Runtime Callable Wrappers (RCWs) for COM interop.  A good read for those COM oriented folks…

posted @ Monday, September 12, 2005 8:42 PM | Feedback (611)

ASP.NET Photo Album

Bertrand Le Roys posted his experience with Dmitri Robsman’s ASP.NET photo album handler.  The photo album is implemented as an HttpHandler and’s totally free to use and update. Check it out if you have the time.

posted @ Monday, September 12, 2005 8:34 PM | Feedback (611)

Anonymous Classes: Revisited

Someone asked about the support of anonymous classes within the .NET Framework yesterday at our monthly user group meeting.  At the time, I didn’t realize that I said that the .NET Framework does not support anonymous classes.  I apologize for this incorrect statement!!  The framework does support anonymous classes ONLY in J#.  Why?  Well, anonymous classes is a feature of the Java language. If you want to know more about how anonymous classes work, check out my earlier post.

posted @ Thursday, September 8, 2005 10:44 PM | Feedback (613)

Indigo Programming Models

Richard Turner posts information about the support for “RPC” and “Messaging” programming models within Indigo.  A quick read with good information.

posted @ Thursday, September 8, 2005 10:36 PM | Feedback (611)

Generic Code: Continued...

Ok, well first and foremost, I would like to apologize for my delay of this post. Lately work has been sucking my brain dry!! When I get home, I just want to stare at a wall and pretend the pain is gone.  Don’t get me wrong, I love what I’m doing right now, but I get so deep into it that it even haunts my dreams!! What is this haunting?  Well, it’s Enterprise Services.  I’ll get to the reason in just a bit.  The code I posted a while back asked a simple question, what does the code output?………Bueller? Bueller? Bueller?...any one?...

posted @ Tuesday, September 6, 2005 10:24 PM | Feedback (612)

Four Down, One To Go!

Today I passed my fouth exam, Analyzing Requirements and Defining Microsoft .NET Solutions Architectures (70–300) for becoming MCSD.NET certified.  The test was not hard, nor easy…it was right up the middle with a TON of reading!!  I recommend if you’re a slow reader, to start practicing on skimming useless business content for the tech-meat you crave when designing applications.  Doing so will make you better prepared for the test’s long case studies. Oh yeah, just a head’s up.  Biztalk Server is the answer to all your problems!

posted @ Tuesday, September 6, 2005 9:39 PM | Feedback (623)