Friday, May 4, 2007

The Most "Efficient" Brand

The potential of a Microsoft-Yahoo! deal is just too interesting to pass by, so I pulled together the data below from company filings and BusinessWeek's Top 100 Brands (Microsoft data is for the whole company because detailed numbers for its Online Services segment is not available, so it’s not exactly comparable to the other two).

To my surprise, Google’s biggest advantage in it’s profit margin comes from Sales & Marketing Expenses, at only 8% of revenue, compare to above 20% for both Microsoft and Yahoo!. Use BusinessWeek’s estimate, Google’s brand value is about 15 times its sales marketing expenses, while that number for Microsoft and Yahoo! are 6 and 5 respectively. This sure makes Google one of the most “Efficient” brand out there.

  Microsoft Yahoo! Google
Revenue 100% 100% 100%
Operating Expenses  
Cost of revenue 17% 42% 40%
R&D Expense 15% 13% 12%
Sales & Marketing 22% 21% 8%
G&A Expense 8% 8% 7%
Operating income 37% 15% 33%
   
BW Rank by Brand Value 2 55 24
Sales and Marketing Exp. 9,818 1,322 849
Brand Value 56,926 6,056 12,376
B.V./Sales & Marketing 5.80 4.58 14.58

If there is going to be a Microsoft-Yahoo! deal, would Microsoft be able to create synergy by cutting into Yahoo!’s marketing expenses?

Microsoft buying Yahoo?

Rumors are flying…

If you think about it, this deal makes a lot of sense: acquiring Yahoo! Inc, currently valued at approximately $44b, is a good use of Microsoft’s some $30b excess cash. According to SearchEngineWatch, this would give Microsoft a 38.6% share in Internet search business, putting it in a better position to compete with Google. The question is, given Google’s big lead, whether the regulators will still seek to block the MS YAHOO deal on the ground of anti-trust.

U.S. Online Searches by Engine, January 2007 and February 2007 (%)

January 2007 (B)
February 2007 (B)
Change
Total Internet population 100 100 N/A
Google 47.5 48.1 0.6
Yahoo 28.1 28.1 0.0
Microsoft 10.6 10.5 -0.1
Ask.com 5.2 5.0 -0.2
Time Warner 5.0 4.9 -0.1
Source: comScore Networks, 2007

M&A and LBO are still white hot (if not getting even hotter) in the U.S:

Thursday, May 3, 2007

Black Swan: The Impact of Highly Improbable

This book by Nicholas Nassim Taleb is currently ranked #5 on New York Times Bestseller List and #12 on Amazon’s Top Seller for All Books. This by itself is “highly improbable” consider the book about probability is very much quantitative oriented.

Read the author’s blog here.

Fun with Lambda.Compile: Code? Data?

Another very funky twist of C# 3.0 new features: in the following code snippet, tell what’s code (I.E. MSIL), what’s data (I.E. expression tree) and when the “data” gets compiled into “code”. (By the way, Today happens to be May 3rd, 2007).

Expression<Func<int,

    Expression<Func<int, int>>>> expr1

        = (a => (b => a + b * 3));

 

Expression<Func<int, int>> expr2 =

    expr1.Compile().Invoke(DateTime.Today.Day);

 

Func<int, int> func = expr2.Compile();

Console.WriteLine(func(10));

In case you have no clue, look into the structure of expr1 and expr2 might help:

No wonder LambdaExpression.Compile is Don Box’s favorite in C# 3.0.

Having fun…

SilverLight

Yet another exciting .NET feature to be released in the near future. Just like the .NET Compact Framework, SilverLight gives you access to a light version of the CLR (officially named DLR, Dynamic Language Runtime), especially the cool WPF stuff, to spice up the apparence of your webpage.

In order to run the demos, you need to install SilverLight plugin from here. (Notice that there is a download for Mac!!!!). Some fun demos:

And here is the Big Picture. I don’t know whether it’s just me: the logo looks very, en, Flashing…

Wednesday, May 2, 2007

Are the CEP guys looking at LINQ?

CEP (Complex Event Processing) has become a very hot topic in the capital market as Algorithmic Trading gains popularity. TIBCO and Apama are two of the biggest players in the CEP engine market. There are also a handful of other vendors, including Coral8, Gemfire, StreamBase, etc).

One problem in this domain is the standardization of front end language of choice: different products tend to choose different front end approaches, ranging from SQL-like syntax, OO class library to drag-n-drop visual user interface.

I wonder whether any of them are working towards using LINQ as its .NET front end.

Tuesday, May 1, 2007

Linq To Google Image 0.1

It seems getting to the bottom of LINQ isn't as difficult as I anticipated. With two days of experimenting, I have got a crude Linq To Google Image implementation, and have learnt quite a lot about Linq's inner working along the way.

I have put together a summary on CodeProject here. And you can download the source code (at your own risk) here.

I shall probably take one step back, get away from C# 3.0 for a while and take a quick look into WCF, as that's also of great interest to me and my knowledge is pretty much still stops two years short when it was still Indigo...

Monday, April 30, 2007

Google Linq

The ultimate way to understand LINQ, of course, is to write your own IQueryable magic. I have choosed Google Image as my first pet project for this: The reason for selecting Image over Web search is that Image results are more structured. For example, we can filter on size, type and color. Implementing all these would provide a more complete view of the inner working of LINQ/IQueryable.

Base on the principles of TDD, I shall first define the test cases for the project, for example:

var test = from img in

               MChen.Linq.Google.ImageSearch.Instance

           where img.Description.Contains("linq")

               && img.Size == ImageSize.Small

           select img;

I intend to define ImageSearch as a singleton because, well, there is only one Google… Obviously this can be further extended to Web, Group and Froogle in the future.

As the very first step, I have put togather a crude implementation of IQueryable that simply dumps the Expression tree in CreateQuery function. The output for the query expression above looks like:

Some references that are very useful along the way:

Thursday, April 26, 2007

More on DLINQ and Projection Operator

I posted my observation on DLINQ and Projection Operator on MSDN Forum and soon received a response from Keith J. Farmer at Microsoft.

The answer was somewhat expected: DLINQ intends to translate everything to SQL to avoid any type of client side query for performance reasons. I can understand this for where and orderby clause, but not for select and projection operator I was using.

On the other hand, Keith did recommend a practical solution: put the .Net method call in SQL/CLR so that it can be called as a user defined function in SQL. Then map the UDF in DLINQ so that it can be used from the query:

  • First, create a SQL Server Project in Visual Studio and create the UDF. This is really nothing new and can be done in VS2005.

        [Microsoft.SqlServer.Server.SqlFunction]

        public static SqlString StringFormat(

            SqlString format,

            SqlString o1,

            SqlMoney o2)

        {

            return new SqlString(string.Format(

                format.Value, o1.Value, o2.Value)

            );

        }

  • Deploy the UDF in SQL Server. This can be done inside VS2005 (Build -> Deploy [project name]) or manually (see this post for steps).
  • You probably don’t want to manually write the mapping code for the UDF this time. So use SqlMetal, which is provided as part of .NET 3.5 Beta, to generate the database mapping file:

    sqlmetal /server:localhost /database:northwind

             /code:northwind.cs /functions
             /namespace:MyDLinqTest

  • Now we have mapped the entire Northwind database with all functions, we can use its tables and UDFs in DLINQ query like this:

    Northwind db = new Northwind(ConnStr);

    var list = from p in db.Products

               where p.UnitPrice > 30

               select new {

                  p.ProductID,

                  Description 
                    = db.StringFormat("{0} - {1}",

                      p.ProductName, p.UnitPrice)

               };

Wednesday, April 25, 2007

DLINQ and Projection Operator

Seems I was impressed too early. Projection operation on DLINQ is giving me a bit of grief:

var list = from p in prods

       where p.UnitPrice > 30

       select new {

          p.ProductID,

          Description = string.Format("{0} - {1}",

              p.ProductName, p.UnitPrice)

      };

I got the following exception:

  

Yeah, I know String.Format can’t be translated to SQL, but I’m expecting it to be executed as .NET code. DLINQ is already using CodeDom to generate database access code anyway. Why can’t it generate the SQL that retrieves only directly mapped columns/fields, then produce the rest fields in the anonymous type, like this:

class _AnonymousType

{

    //map to database columns

    private int     _productID;

    private string  _productName;

    private decimal _unitPrice;

 

    //...

    //generate Description as

    public string Description {

        get {

            return string.Format("{0} - {1}",

              _productName,

              _unitPrice);

        }

    }

}

Sure, this would require the Projection Operator be part of the expression tree and the anonymous type being generated at runtime, rather than by the compiler, as it currently is. But limiting the projection in DLINQ to only these operations that can be translated in SQL is probably too much of a sacrifice… In the example above, we can change string.Format to:

     Description = p.ProductName + "-" + p.UnitPrice

 But what if the projection involves more complicated function calls?