Bayesian - Markov Chain Analysis and Typos#

I was doing a Bayesian network assignment for school, minding my own business, when I encountered the following typo (screenshot below). This eventually pushed me over the edge to rant out this blog post you are reading now. Well, I agree that typos happen, we all know about HTTP 1.1 standard specs "Referer" and how that happened, but there is more to it, it's about competition and excel in innovative drive. Heck if Scobelizer can do it, I can do it too.


(Notice the netowrk?.  Yes, it's an old app, I didn't conveniently forgot about it)

No serious; lets see what Joel Spolsky mentioned a while back.

"Look at how Google does spell checking: it's not based on dictionaries; it's based on word usage statistics of the entire Internet, which is why Google knows how to correct my name, misspelled, and Microsoft Word doesn't"...

Competition is always good; but we have to keep the creative ingenious high, right? That's why imagination is more important than Knowledge I assume.

Joel further says

"Like A very senior Microsoft developer who moved to Google told me that Google works and thinks at a higher level of abstraction than Microsoft. "Google uses Bayesian filtering the way Microsoft uses the if statement," he said."

Google's practice of academia and industry coherence is thrilling. I remember reading Bill Gates' interview a while back in which he mentioned the importance of being vigilant at the top. He said that anytime there could be a competitor which can challenge MS's might. At that time there weren't many big players around to stand Microsoft's fierce competition which made me think that it's just something cool to say but later on time proved the statement to be correct. Windows Live and Office Live are cool starters but there is some serious catching up to do for several missing opportunities. "Microsoft is different" excuses aren't good enough.  I love Microsoft, it's products, innovation, ease of use and ingenuity it offers but like it's being said:

"Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things."

-Winston Churchill

and

"Criticism is something we can avoid easily by saying nothing, doing nothing, and being nothing"
-Aristotle


11/30/2005 9:17:04 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Social Networking...the Microsoft Research Way#

From Microsoft Research website...

SNARF, the Social Network and Relationship Finder, developed by Microsoft Research and available for download , is designed to help computer users cope with precisely such scenarios. SNARF, a complement to e-mail programs such as Outlook, filters and sorts e-mail based on the type of message and the user’s history with an e-mail correspondent. The result: a collection of alternative views of your e-mail that can help you make sense of the deluge

Read more


11/30/2005 8:39:25 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Generics Class Types - O'Reilly way#

I found a good Generics  example in C# Cookbook and thought should share. It demonstrate a good use of strong typing and inner classes. I think I'm in compliance with  O'Reilly Policy on Re-Use of Code Examples from Books

Understanding generic class types

            public static void TestGenericClassInstanceCounter()
            {
                  // regular class
                  StandardClass A = new StandardClass(5);
                  Console.WriteLine(A);
                  StandardClass B = new StandardClass(5);
                  Console.WriteLine(B);
                  StandardClass C = new StandardClass(5);
                  Console.WriteLine(C);

                  // generic class
                  
GenericClass<bool> gA = new GenericClass<bool>(5);
      
            Console.WriteLine(gA);
                  GenericClass<int> gB = new GenericClass<int>(5);
                  Console.WriteLine(gB);
                  GenericClass<string> gC = new GenericClass<string>(5);
                  Console.WriteLine(gC);
                  GenericClass<string> gD = new GenericClass<string>(5);
                  Console.WriteLine(gD);

            bool b1 = true;
            bool b2 = false;
            bool bHolder = false;
            // add to the standard class (as object)

            A.AddItem(b1);
            A.AddItem(b2);

            // add to the generic class (as bool)

            gA.AddItem(b1);
            gA.AddItem(b2);

            Console.WriteLine(A);
            Console.WriteLine(gA);

            // have to cast or get error CS0266: 
            // Cannot implicitly convert type 'object' to 'bool'...

            bHolder = (bool)A.GetItem(1);
            // no cast necessary
            bHolder = gA.GetItem(1);

            int i1 = 1;
            int i2 = 2;
            int i3 = 3;
            int iHolder = 0;

            // add to the standard class (as object)
            B.AddItem(i1);
            B.AddItem(i2);
            B.AddItem(i3);

            // add to the generic class (as int)
            gB.AddItem(i1);
            gB.AddItem(i2);
            gB.AddItem(i3);

            Console.WriteLine(B);
            Console.WriteLine(gB);

            // have to cast or get error CS0266: 
            // Cannot implicitly convert type 'object' to 'int'...

            iHolder = (int)B.GetItem(1);

            // no cast necessary
            iHolder = gB.GetItem(1);

            string s1 = "s1";
            string s2 = "s2";
            string s3 = "s3";
            string sHolder = "";

            // add to the standard class (as object)
            C.AddItem(s1);
            C.AddItem(s2);
            C.AddItem(s3);

            // add an int to the string instance, perfectly OK
            C.AddItem(i1);

            // add to the generic class (as string)
            gC.AddItem(s1);
            gC.AddItem(s2);
            gC.AddItem(s3);

            // try to add an int to the string instance, denied by compiler
            // error CS1503: Argument '1': cannot convert from 'int' to 'string'

            //gC.AddItem(i1);

            Console.WriteLine(C);
            Console.WriteLine(gC);

            // have to cast or get error CS0266: 
            // Cannot implicitly convert type 'object' to 'string'...

            sHolder = (string)C.GetItem(1);

            // no cast necessary

            sHolder = gC.GetItem(1);

            // try to get a string into an int, error
            // error CS0029: Cannot implicitly convert type 'string' to 'int'

            //iHolder = gC.GetItem(1);
        }

        public class StandardClass
        {
              // static counter hangs off of the Type for 
              // StandardClass

              static int _count = 0;

            // create an array of typed items

            int _maxItemCount;
            object[] _items;
            int _currentItem = 0;

            // constructor that increments static counter

            public StandardClass(int items)
              {
                _count++;
                _maxItemCount = items;
                _items = new object[_maxItemCount];
              }

            /// <summary>
            /// Add an item to the class whose type 
            /// is unknown as only object can hold any type            
            ///
</summary>
            /// <param name="item">item to add</param>
            /// <returns>the index of the item added</returns>

            public int AddItem(object item)
            {
                
               if (_currentItem < _maxItemCount)
                {
   
                _items[_currentItem] = item;
                    return _currentItem++;
                }
                else
                  throw new Exception("Item queue is full");
            }

            /// <summary>
            /// Get an item from the class
            /// </summary>
            /// <param name="index">the index of the item to get</param>
            /// <returns>an item of type object</returns>

            public object GetItem(int index)
            {
                Debug.Assert(index < _maxItemCount);
                if (index >= _maxItemCount)
                    throw new ArgumentOutOfRangeException("index");
                return _items[index];
            }

            /// <summary>
            /// The count of the items the class holds
            /// </summary>

            public int ItemCount
            {
                get { return _currentItem; }
            }

            /// <summary>
            /// ToString override to provide class detail
            /// </summary>
            /// <returns>formatted string with class details</returns>

            public override string ToString()
              {
                return "There are " + _count.ToString() +
                    " instances of " + this.GetType().ToString() +
                    " which contains " + _currentItem + " items of type " +
                    _items.GetType().ToString() + "...";

            }

        }

        public class GenericClass<T>
        {
             // static counter hangs off of the 
              // instantiated Type for 
              // GenericClass
              static int _count = 0;

            // create an array of typed items
            int _maxItemCount;
            T[] _items;
            int _currentItem = 0;

            // constructor that increments static counter
              public GenericClass(int items)
              {
                _count++;
                _maxItemCount = items;
                _items = new T[_maxItemCount];
            }

            /// <summary>
            /// Add an item to the class whose type 
            /// is determined by the instantiating type
            /// </summary>
            /// <param name="item">item to add</param>
            /// <returns>the zero-based index of the item added</returns>
            public int AddItem(T item)
            {
                
               if (_currentItem < _maxItemCount)
                {
                    _items[_currentItem] = item;
                    return _currentItem++;
                }
                else
                    throw new Exception("Item queue is full");
            }

            /// <summary>
            /// Get an item from the class
            /// </summary>
            /// <param name="index">the zero-based index of the item to get</param>
            /// <returns>an item of the instantiating type</returns>

            public T GetItem(int index)
            {
                Debug.Assert(index < _maxItemCount);
                if (index >= _maxItemCount)
                    throw new ArgumentOutOfRangeException("index");
                return _items[index];
            }

            /// <summary>
            /// The count of the items the class holds
            /// </summary>

            public int ItemCount
            {
                get { return _currentItem; }
            }

            /// <summary>
            /// ToString override to provide class detail
            /// </summary>
            /// <returns>formatted string with class details</returns>
              public override string ToString()
              {
                    return "There are " + _count.ToString() +
                    " instances of " + this.GetType().ToString() + 
                    " which contains " + _currentItem + " items of type " +
                    _items.GetType().ToString() + "...";
              }
        }


11/30/2005 8:41:49 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

VS.NET Must-Have Add-Ins#

James Avery in December 2005 issue of MSDN Magazine  talks about Must-Have VS.NET Add-Ins. Following is his list; pretty impressive.

I'd probably add Koders IDE Plugin as well.

Related Articles:

NET Tools: Ten Must-Have Tools Every Developer Should Download Now


11/29/2005 10:39:13 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

XMLSerializer and XPath#

I say working with smart people always pays off; For instance last week when I was encountered a particular web service response which wasn't getting parsed by usual XPATH query.

Dim child As XmlNode = doc.SelectSingleNode("/<node>")

As it later turned out, it was because there was no namespace prefix to it. XMLNamespace manager didn't help so Jeremy, our architect with honorary title of "King of RegEx and XPath" suggested using the following:

child.SelectSingleNode("node()[name() = '<node>']").InnerText.Equals(String.Empty)

which no need to mention, worked like charm. He also demonstrated string concatenation has the easiest overload for adding nodes to a DOM tree instead of doing an XMLNode instantiation exercise.

Also, there is gold in these framework class libraries. For instance the following XMLSerializer code snippet always comes in handy for (de)serialization.

Dim StringWriter As New System.IO.StringWriter
Dim XmlSerializer As New System.XML.Serialization.XmlSerializer(<responseObject>.GetType, String.Empty)XmlSerializer.Serialize(StringWriter, <responseObject>.)

Some Links:
XML Serialization in the .NET Framework (Extreme XML)
XML Path Language (XPath)
XPath Tutorial


11/26/2005 9:36:09 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Book Review :: Visual C# 2005: A Developer's Notebook#

My review of Jesse Liberty's "Visual C# 2005: A Developer's Notebook" is published on Los Angeles .NET Developers group website.

It's an excellent delta book on C#, a must read for those who wants to learn the C#'s new features without spending much time on stuff they already know.


11/25/2005 6:06:37 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Thanksgiving with La Vie Boheme#

I’m sure you have noticed that I’ve updated my dasBlog from 1.6 to current release (1.8.5223.2) which provides lots of cool updates. Thanks for the Omar Shahine, Scott Hanselman and Clemens Vasters for putting together this easy to follow upgrade document and this excellent software; it works like a charm.

 

In other news, I’m not sure if it was L-Tryptophan or Rent was just a totally awesome experience! After a filling thanksgiving dinner, we saw the movie version of the rent musical at Paseo, directed by Chris Columbus. The original stage musical is by Jonathan Larson, directed by Michael Greif. With tracks like Seasons Of Love, One Song Glory, Rent and Tango: Maureen, the movie was a knock out.

 

Thomas B. "Tom" Collins: [sung] In truths that she learned, or in times that he cried. In bridges he burned, or the way that she died!

 

Rent Sound Track @ Yahoo Music


11/25/2005 12:38:42 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Post Dev Connections Goodies#

Thanks everyone for sharing their presentations, slides and experiences. As Owen Arthur said “Often, we are too slow to recognize how much and in what ways we can assist each other through sharing such expertise and knowledge.”

Following is the list of presentations, slides and notes compiled by participants and speakers.

 

 

Brandon Satrom’s Mindmaps; excellent mind manager notes, will make you feel like you were almost there.

 

 

Michele Leroux Bustamante

 

Brian Noyes

Paul Litwin’s
(Thanks for the custom assemblies additional slides Paul, congrats on getting Microsoft Ace award!)

 

 

Steven Smith

Markus' Avalon (WPF) Examples

 

Dan Wahlin

New XML Features in .NET Version 2

Work with RSS Feeds using the System.Xml Assembly

Asynchronous Web Service Options in .NET V2

 

And the following non sequitur links on security

 

Twenty Most Critical Internet Security Vulnerabilities.

Security Practices: ASP.NET 2.0 Security Practices at a Glance

 

For latest, keep an RSS on DevConnections blog


11/24/2005 5:22:25 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

BizTalk Server 2006 Beta 2#

BizTalk Server 2006 Beta 2 has been launched by Microsoft and is downloadable via Microsoft Beta Home.

BizTalk Adapters for Enterprise Applications ODBA (Orechestration Designer for Business Analyst) beta 2 can also be downloaded from here.


11/24/2005 1:26:41 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

.NET User Groups Dinner- Post Launch Session#

After the MSDN Launch event for Visual Studio.NET 2005 and SQL Server 2005 in Pasadena, Bernard Wong, Southern California's Developer Community Champion and his team organized a get together with user group organizers in Pasadena Hilton. It was a nice event; Bernard and his developer events team casually discussed the role of community and user groups in developer training. Members from various Southern California user groups (Los Angles .NET Developers Group, Los Angles SQL Server Professionals Group, Southern California .NET Developers Group)  were there (Let me know if I missed someone)   to share the experience and knowledge with us newbies.

Valuable lessons were learned about user groups organization, getting good speakers, INETA, community development best practices etc. Thanks to the DCC and his team for this effort.

 

 


11/19/2005 11:58:09 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

MCP Exams for $35#

Via MCPMag

“Microsoft is giving a big break to students who obtain training through IT Academy schools in the U.S., with a significant discount on MCP exams. Exams will be available for $35; original exam prices for IT Academy students is $60.“

Read More


11/17/2005 9:32:37 PM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

MSDN Launch Event in Pasaden