25 July 2014

How to: process SSAS database via C# code

There are several ways to process a database, but if you'd like to use C# code, then this is the way:

using Microsoft.AnalysisServices;


void main()
{
            try
            {
             
                Server OlapServer = new Server();
                Database db = null;
                OlapServer.Connect("Provider=MSOLAP;Data Source=ServerName;");
                db = OlapServer.Databases.FindByName("");
             
                db.Process(ProcessType.ProcessFull );
             
                OlapServer.Disconnect();
            }
            catch (Exception eex)
            {
                System.Diagnostics.Trace.TraceInformation(eex.Message);
            }
}


You can make changes to the Process Type by changing the Process Type enumeration.

Good luck!

04 July 2014

The difference between A/B testing and the Facebook experiment

I assume you've heard about the Facebook experiment in which they've changed the feed of news for random people in order to affect their mood. Many people are outraged. Some say: "well, what are you so surprised about, it's a simple A/B testing and people in marketing and advertisement had been doing this for years?"
And I say: "yes, it's a simple A/B testing. but what did they try to achieve?"
A/B testing is posting the same message in different wordings, or changing the font/layout, in order to...

  • produce more clicks
  • engage your audience
  • create more sales 
And they are fine with me because I assume I know what's the interest is. Yes, the car company would like me to purchase their car (or that I would recommend it to my friend). Yes, the newspaper wants me to read their news. Yes, the twitter marketer would like me to follow their tweets. Yes, the people in twitter would love me to invoke my sleeping account. No surprises here. 
But what is Facebook's agenda?
Are they trying to make me more engaged? are they trying to sell me something? would they like me to start a revolution? No, they're trying to see how the feed affects my mood, in order to make sure that I won't shy away from FB if everything is sad around me, or that I wouldn't be depressed if everyone around me are going on holidays, which is a common theme in my feed around Christmas time.
Which is obviously rubbish, since if let's say it's the December 8th, 1980, and John Lennon had just been shot, I assume if I'd turn to FB I wouldn't find many smiling faces. Would that make me shy away from my Social Network?
And if (as it happened) I happen to have two new nieces in a gap of one month, it's not that bad to look at new photos of them in my feed, is it?
So they are a bunch of manipulative jerks. What a surprise. My ex is a network researcher in FB. I'm happy that as far as I found out he wasn't involved in this experiment, but I wouldn't be too surprised. Yes, I still own an account on FB.

And now to the classic question:
How do we protect ourselves?

If it's an advertisement we know what the hidden agenda is. If we read the newspaper we know what they want. And if we read a "news" article which is simply hidden my marketing we have learnt to protect ourselves from that as well. My solution? Shy away from FB. Make sure to keep you social network social, not only in the network.