15 March 2019

CURL on WINDOWS: double quotes and other issues

I had to insert metadata information to Cloudera Navigator, and the CURL command didn't work for me. Specifically, I was struggling with this piece of code:

$ curl http://localhost:7187/api/v2/entities/ \
-u : \ -X POST -H "Content-Type: application/json" \ -d '{ "sourceId":"4fbdadc6899638782fc8cb626176dc7b", "parentPath":"myDatabase/myTable", "originalName":"newColumn", "name":"awesomeColumn", "description":"This is going to be an awesome column.", "tags":["fav"], "properties":{"priority":"medium"} }'

This code is copied from here: Cloudera Navigator API - update an entity to add new business metadata.

 and since I'm such a sweet person, here's how it works on Windows:

curl http://localhost:7187/api/v2/entities/ ^ -u : ^ -X POST -H Content-Type: application/json ^ -d "{ \"sourceId\":\"4fbdadc6899638782fc8cb626176dc7b\", \"parentPath":"myDatabase/myTable\", \"originalName":"newColumn\", \"name":\"awesomeColumn\", \"description":\"\This is going to be an awesome column."\, \"tags\":[\"fav\"], \"properties\":{\"priority\":\"medium\"} }"


So what do we get out of this?

  1. The "\" to the end of line is changed to ^
  2. No single quotes; they are all removed
  3. The JSON text is surrounded with double quotes, not single quotes
  4. The double quotes inside the JSON files are escaped with a backslash. 


You're welcome.

03 September 2017

American date or: Marital crisis

First of all, it's important to note the following: I live in Australia, and in Australia, like in most of the world, the date format is day - month - year.
My husband had asked me this week how should he change the format of the date and then get the day out of the data.
Simple, I said, use the TEXT function to change the format, and use the day () function on the date.
"I get #value! error" he winged, and I thought I needed to help him, only to find out that he was right (see below use of functions and results):
The formulas:

Excel date formulas


Excel date results



I thought maybe to use Google Spreadsheet, but unfortunately and surprisingly enough, they are not better:

Formulas are below:
Google docs formulas

Google Docs values

25 July 2017

So now they're killing Microsoft Paint

Ah, the pain is unbearable!
https://www.theguardian.com/technology/2017/jul/24/microsoft-paint-kill-off-after-32-years-graphics-editing-program
Lovely. So how exactly am I supposed to do a quick Print Screen without it?
And what's worse, if you'd like to give a nice photo of your right-click-mouse menu, that's near impossible without our beloved Paint.
Image result for right click
Of course, once Microsoft makes up their mind, there's not much you can do. We all remember how in the good-old-days you could easily create a menu and deploy it in MS-Access. Yes, you can do it in versions post 2003, but you'll have to use the Registry for that. Ouch!

15 June 2017

How to: Cut & Paste from Excel

I don't know if any of you have read the book "Copying & Pasting from Stack Overflow", but even if you copy from Excel you need to be aware of the following:
If you copy from an old file you might copy the connections & the names as well, not just the values. It's important to either select "values & formulas" after the copying, or alternatively, just clear the name manager:

05 June 2017

Partition by Half-a-year using windows functions

Let's say you're using Windows functions, and you want to partition by a quarter.
That's simple, you'd just do:

SELECT SUM ( [MyValue]) OVER (PARTITION BY [Employee], YEAR ([Valuation date]), DATEPART (qq,[Valuation date])  ORDER BY ROW_ID)

But what happens if you would like to run a sum by half a year? If it's just getting the value (first or second half of year), you'd play around with

SELECT CASE WHEN month < 7 THEN 1 ELSE 2 END AS [HalfAYear]

 or with

SELECT CASE WHEN DATEPART (qq, Valuation date)  < 3 THEN 1 ELSE 2 END AS [HalfAYear]

 and that would do.
But since we need a running sum per half a year, you'd like to use this code:

SUM ( [MyValue]) OVER (PARTITION BY [Employee], YEAR ([Valuation date]), YEAR (DATEADD(m, 6, [Valuation date]))  ORDER BY ROW_ID)

Using the YEAR for the first time gives me the current year, when I'm using YEAR over "add 6 month" I'm using the "Australian Financial Year", but this way I am partitioning by half a year. Please note that at the end of the day I don't know which half it is, but it doesn't matter, since I don't care about the label, I care about the results.

03 May 2017

Pointer to a function in SQL ?!

If you're coming from C then you would know that there's a thing called a  a function pointer.
It's good to put in a structure, and then whenever you need to "compare" you would call the function pointer. In the "sort" function call in one of the C's library you can see it, so you can compare apples to oranges to your heart's delight.
But what happens in SQL?
Let's say I have different funds (which I do) and they require different calculation according to their Fund type.
So funds A, B, C & D have calculation which is completely different the funds E, F & G.
Had I used a programming language like C I could say that a Fund could have a pointer to a function in their structure, and calculate of that. But how do I handle this in SQL?
I've designed a solution which would look like this:
I would add a field (column) to the Fund table called "CalcType" which would refer to the calculation type. Now, I can use the following code:


SELECT *
FROM PerformanceCalc1 (@param) --that's a function
INNER JOIN dbo.FUND
WHERE Fund.CalcType = 1
UNION ALL
SELECT *
FROM PerformanceCalc2 (@param) --that's a function
INNER JOIN dbo.FUND
WHERE Fund.CalcType = 2
UNION ALL
SELECT *
FROM PerformanceCalc3 (@param) --that's a function
INNER JOIN dbo.FUND
WHERE Fund.CalcType = 3



This calculation has its limitation: each Performance Calc functions run on all the funds, but the return set is limited to the appropriate Fund Type. The number of funds I have is as such that it doesn't really matter; if I had more it could have been an issue. Yet, what I like about this solution is that it is set based in its thinking, and not using Dynamics SQL (which requires elevated permissions of the end-user, if we want her to run it).

06 April 2017

Sub totals in Excel's Pivot Tables - which total should I sub?

This wonderful feature shows you why Pivot Tables (Power Query or other pivot table) wins hands-down vs Power BI, the much hyped MS app.
Let's say you have a Pivot Table (which I do, plenty of them).
And let's say they are summed by different values: Year, Quarter, and forecast vs. Actual (just an example). But you want to pick which columns (or rows) you want the sub totals to run on.
You can choose if you want to sub total all column or only few of them.
Let's look at an example:
This is what the header looks like:



Now I would like to have the total on the Year, but not on the Quarter.
First of all I need to go to PivotTalbe tools -> Design -> and pick the Subtotals that I want
( chose the Show all Sub Totals at the bottom of the group; you can pick top, but don't chose non).




I can go to the columns definition, right click the setting (FyQ, in my case) , choose the Field Settings, and then I have the choice of Subtotals: Automatic or None. So If I want it to be summed I would and if not then I don't.

The beauty here is that I don't need complicated MDX functions in order to design my Pivot table. Great!

23 March 2017

Rolling Average SQL

How many scripts you need to see for rolling average (AVG) in SQL? Well, it never hurts to see another one...
This is the beauty of Windows Functions, they take a complicated problem and put it in a simple script.

(BTW - I've taken the Sales numbers from here - a great webiste, but I believe it's for PostgresSQL, and then added the year 2016 and the extra numbers. I believe you'll be able to find the pattern.)

CREATE TABLE #temp  (StartDate DATE, Sales INT)

INSERT #temp (StartDate, Sales)
VALUES ('20150110', 5)
,('20150210', 3)
,('20150310', 7)
,('20150410', 8)
,('20150510', 2)
,('20150610', 3)
,('20150710', 6)
,('20160110', 8)
,('20160210', 6)
,('20160310', 10)
,('20160410', 11)
,('20160510', 5)
,('20160610', 6)
,('20160710', 9)



If you just want the rolling average (you can replace the AVG function with SUM, MIN, MAX as well) for all the time periods, you need to run the following code:


SELECT
StartDate,
AVG (sales) OVER ( order by StartDate ) AS AVGSales
FROM #temp


But if you want to partition by YEAR, for example, you'd better run the following code:


SELECT
StartDate,
AVG (sales) OVER (Partition  by YEAR (StartDAte) order by StartDate ) AS AVGSales
FROM #temp



Short & sweet!

(this is a simple example; I need to run this on a total assets for a fund. It's amazing how those extra digits get us confused!)

Don't forget :)

DROP TABLE #temp


25 January 2017

MDX with Excel - for future reference

Let's say you have data model that you want to enquire on. If you're using Power Query (in Excel) you might want to investigate a little further. In order to do that you need to unleash the power of MDX, which is complete and utterly crazy. The problem with MDX (unlike plain Excel functions) is that it's really hard to know what you're doing and there's very little documentation. Nevertheless it's important to read the documentation, and you'll get the hand of it - after a while.

So, how do I find out what was the last date in my cube that actually gave me some data?

My model consist of an SQL database, in which there's a table called dimPeriod, and measures which are stored in a Fact Table. The data is queried from Excel using Stored Procedures, and reported via PowerQuery. Obviously enough, the dimPeriod table includes days from the last couple of years to the next 20+ years. That's enough, and it's great as it warns me if I'm trying to enter the wrong date (yes, I'm using foreign keys to enforce the referential integrity).
Let's just say that [ALL ACP] is the table where there are measures. So I thought of using something like TopCount function to create a set. Unfortunately, it didn't give me the correct results:

=CUBESET("ThisWorkbookDataModel","TopCount([ALL ACP].[Datekey].Children,5)","Max Date Reported")


Explanation:
Cubeset - creates a cube set
"ThisWorkbookDataModel" - the data model that is stored in this workbook. That's true for Excel 2013, and basically, once you type the "Cubeset" function, open bracekts and the double qoute, it comes up with the name of the model.
TopCount - give you the first number
[All Acp] - the table that has measures in it
DateKey - yep, that's the datekey
Children - otherwise you'll get "all"
5 - just a number. I could (or should) have used 1, but 5 gives me a range of numbers to work with.

After inserting that set to a cell in Excel, all I needed was to enquire after that set:

=CUBERANKEDMEMBER("ThisWorkbookDataModel",$G$30,1)


G30 is where the code above is inserted.
A problem: I got the minimum date.
Solution:

=CUBESET("ThisWorkbookDataModel","BottomCount([ALL ACP].[Datekey].Children,5)","Max Date Reported")


Changing from TopCount to BottomCount gave me the latest date to come in. Please note that there are no measures in the query.

You have two options to query on the result, which is in DateKey format.
The first one is to query the relevant data member. Let's say, you're looking for FY Year, you would use the following code:

=CUBEMEMBER("ThisWorkbookDataModel","EXISTS([Dim Period].[FY Month Name].children, [Dim Period].[DateKey].["&G32&"])")

Where G32 is where you result is
Alternatively, just get out the year, the month and the date using:
Year

 =LEFT(G32,4)

Month:

=MID(G32,5,2)

Day:

=RIGHT(G32,2)

Combining the Excel Formulas with the MDX ones gives you lots of power to manipulate the end results.

23 July 2016

Why are all programming languages in English?

tl;dr
That's because English (or ASCII to be exact) is the computer's native language.

What does it mean?

ASCII is the simplest code page, since you need only 7 bit  to produce. Since it was defined in America in 1960, it is obviously in English. That's when space was limited, and therefore characters accents (which are necessary for French and German, for example) were simply not included. So if I want to create a new computer language that can be imported all round the world it *must* be in ASCII, therefore in English. As a standard, all computers produced must adhere to it. Every computer in the world must be able to produce these characters. Every keyboard in the world shows those characters clearly.
If you're asking yourself how come in the pre-Unicode era did people write in a non-English language, then the answer is that in the Extended ASCII code (for characters that sits in number 128-255) the alphabet of one other languages was included (depends on the code page attached). So there was a code page for Hebrew, Greek, French, Russian, Spanish and other languages with a "simple" alphabet (around 30 letters) which isn't represented by the English Alphabet.
That's also the difference between "varchar" (which assumes ASCII code, could be the extended page; that's good enough for only one extra language) to "nvarchar (which assumes Unicode code, and therefore could include all languages).

And yet, nowadays in the new Unicode days, the first 128 characters are still our dear-old-ASCII codes.


Is it difficult to learn programming in English, for a speaker of another language?

tl;dr: no.
Functional English (to be able to speak some basic phrases) consists of 1500-2000 words. The words in any computer language consists of much smaller vocabulary:
In C there are 32 reserved words
In Pascal there are 53 reserved words
And Basic leads with 174  reserved words.
So you just need to learn "those words" in order to write code, and to know where every key is on the keyboards. That's all. And I am speaking here from experience: I remember learning a bit of computing on my brother's commodore computer when I was around 11. As the commands in any computer language are quite short, the main words I remember (in Basic) were: 
PRINT 
IF
GOTO 
and LOOP. If you are short of a word you can always use a word in your native language written in English letters, so if you want to define an object named "tomato" but you don't know how to write tomato in English, you can always get away with "tomate" (Spanish, French), 
ntomáta (Greek), pomidor (Russian) or agavania (Hebrew).

(I've read that post in my Linked In feed, by somebody who obviously knew very little about computers or linguistics, and decided to answer her questions).

06 April 2016

pfhtreadpool.cpp, line 970, function PFThreadPool::QueueWorkItemMultiple

If you get this error it is very simple:
Your Power Query in Excel is tired.
Restart your computer (or at least, log off and log back on again)

31 March 2016

Adding Australian End of Financial Year in Power BI

Alright, it took me like forever to find, but once I've found it I decided to let the rest of the universe know.
If your financial year doesn't end on December 31st and you want to set it up on a different date, there is a way to cater for it in Power BI.
The DAX code for The Australian version, for a Fiscal year that ends on June 30th:
(According to https://msdn.microsoft.com/en-us/library/ee634245.aspx)

=ENDOFYEAR(DateTime[DateKey],"06/30/2004")
Having said that, I believe that if we're in Australia (or any other place which isn't US for that matter), maybe the code should be more in the lines of:

=ENDOFYEAR(DateTime[DateKey],"30/06/2004")

16 December 2015

Connection providers that Excel uses for Power Pivot and Power Query

For Power Query Excel (2013) uses Microsoft.Mashup.Oledb.1
If you don't have Power Query installed you'll get the following error message:

Microsoft.Mashup.OleDb.1 provider is not registered on the local machine





(Had anyone ever tried marking this message as "unhelpful"?)

In the Data ribbon, 

If you go to Existing Connections -> Select a Connection or Table -> Mark the connection and right click it -> Edit Connection Properties -> Definition Tab

you will see that the connection string starts with:

Provider=Microsoft.Mashup.OleDb.1


If you use only Power Pivot and you try to link to a connection, then the connection string looks like this:

Provider=SQLOLEDB.1;Integrated Security=SSPI;

Why is it mixed? Why are there two types of connection strings?


It depends on who started the Power Pivot query and when. There is also a difference if you have Power Query Installed on your machine or not. Unfortunately, if you installed Power Query and then upgraded office you might need to install Power Query again (or, at least, Repair it). 


As far as I'm concerned this is the main problem with Excel as a Reporting tool:

Excel is amazing. It could do many things, use many languages (DAX & MDX) but if you can't share it easily between people since it is flavor-dependent (are you using 2013 or 2010 or 2016 or Office 365? do you have Power Query installed or not?) then it causes huge problems. Ribbons disappearing, Queries have to be rewritten, connection strings have to be rewritten... Version control shouldn't be such a huge issue, IMHO.

27 November 2015

Updating source for Power Query In Excel after changing the table name

If you work with Excel 2013 and you create Power (either Power Pivot or Power Query) queries, and you had changed the name of the underlying SQL server database table,

you need to do the following in order to re connect :


First, go to the Power Query tab and then choose either Show Pane or Launch Editor

The Workbook Queries will appear on the right.
If you don't have Power Query tab in your ribbon (it appears after ADD-INS), you need to install it
(correctly).

You will see all the queries marked with yellow exclamation mark. You click on them and change them.
Once you double click on the Query in question the Query Editor will come up.

If you changed the database Choose in Applied Steps the Option of Source, and choose the name of the new database.

Go to Query Editor - View (last tab)
Choose Advance Editor:
And now you can change the table name to the desired name.

If you want to change it to a Stored Proc in Excel, type in the query details in the query name, like this:

And change the Source in the "Advanced Editor" as follows (
It is called M Programming language for Power Query)




So you don't need to name the type here, you just say it is the source, and that works!
No, I couldn't find any documentation for this thing, I just played around. 
I hope it helps :)

06 February 2015

Microsoft and R?

I've read here that Microsoft had acquired evolution Analytics, the company who provide open source distributions of R, alongside commercial “Enterprise” extensions for big data infrastructures.
Since I've decided to broaden my skills set lately by learning R, I believe these are exciting news for the following reasons. The writer of the post, Tony Davis, mentions that it must be to replace/extend SSRS; learning it for a short while, I believe that on top of SSRS, you can use R functionality for acquiring data, modeling, data mining and reporting. Essentially: everything BI, or SSIS, SSAS and SSRS.. Since R reads all the data into RAM, it can also replace/extend the in memory OLAP which exists nowadays in SQL Server 2012 (or the Tabular Model).
Another thing which is important to point out for the SQL developer who's keen to learn R, is the "thinking" of the language. As an SQL developer (especially MS, not necessarily Oracle), we're used to think in "Sets". We don't go row-by-row when we write code, but instead it's table-by-table. It was a type of thinking which is hard to get used to (it was difficult to learn normalization). And then when you need to learn BI, you had to "unlearn" the normalization part, but you're still going by rows. Writing code for regular programming languages (like C, Java, whatever) requires you to go row-by-row, one data (structure) after the other. 
In R you have to go row-by-row, while you could still query after a set of data. It requires a completely different type of thinking; if you tell me "data set", I immediately think "SELECT FROM WHERE". It doesn't work this way in R (though you could implement this type of syntax in R). So not only you can have many uses of R, but if might even use R instead of writing a cursor. 

So essentially I believe that Microsoft had purchased R in order to extend SQL in many good ways. Either way it makes sense to take the time and learn it!

15 January 2015

How to create a good professional website? 10 tips to improve your SEO

SEO, for those who don't know, are Search Engine Optimization. When Google looks up something, it ranks the entire search results by a certain algorithm. Here is a very simple list which describes how can a simple and humble non-IT professional improve their chances of being found on Google when somebody tries to look them up.
In my previous post I've said that not everybody need a website. If you're a lawyer (let's say) and your name is listed in all the leading listings possible, then you don't need a website. How do you check it?
Simple: Google your name + profession. If it is a very common name then add the location as well. If you can easily find yourself and you phone number in the list that's great. No need for a website, your job here is done.
If you don't find yourself easily, then you have a problem, even if you claim that no publicity is needed, that the word of mouth works very well; if  your friend wants to recommend you and since they last used your services they lost your card/mobile number/email address then you lost a potential connection, and that's a pity.
Maybe all you need is a good Social Media Professional Page: It could be either on LinkedIn, Facebook, Google+ or other. Depends on your preferences. If you need to choose only one (since you don't have the energy for more), then I think that for artistic people Facebook is preferred, while for the rest of us professionals LinkedIn is preferred. A Google Plus page is very useful as well.

But, assuming you have a website, and you do wish for people to find you quickly.

  1. The company has a name? Excellent. Make sure that it includes the main line of business in the title. Don't call yourself "surfboard" if your a lawyer. You're a lawyer that likes surfing? find something that composite of both words. "No-Shark Solicitor", for example.
  2. Nevertheless, don't make the name too generic. "Sydney Lawyers" won't help anyone. It really won't. Find a name that sticks and that you like. A bit of creativity is a good thing. 
  3. If you have more than one branch: Put the address of the main branch first. When your company is searched online via Google , Google puts the address of the first address that it finds first. It's not always the desired result.
  4. Yes, you do need a "main branch". Or at least "main location" or where this company had originated from.
  5. Good practice: add "opening hours" next to each branch name. 
  6. Good practice: have short profile listing of the people that work in your company. When you list the main professionals, it also makes your company easier to find. Let's say that I'm not sure that I spelled your company name correctly. I might Google one of the professionals in your company. If one of the first 5 listings is of your company, then your company would get more "hits" via Google and I can find the contact that I'm looking for.
  7. Good practice for listing your name or your contacts: list your name as well as the nickname. Robert (Bob) Smith, for example.
  8. Every now and then look at the website and make sure it is readable and that you can navigate in it easily. Read it through and make sure there are no typos, or any weird "computer marks" there. And make sure that the "Opening hours" (clause 5 above) and the "Our Team" (clause 6 above) are still correct and up-to-date.
  9. Make sure that the look is modern and up to date: look at your website on different devices, and make sure that even if you change the size of the browser (or even just tilt the smartphone) it is still readable.
  10. Have you changed your company name recently? Make sure that in your website it is stated clearly: "New Name", formerly known as "old name", and add the "old name" to the meta data of the website (your web developer knows what I'm talking about). "Recently", by the way, could mean even 10 years. I had to look up a company by the name it was listed in my company's database and the name had changed 7 years ago. 
  11. If you just purchased the domain, put a business card as your website while it is "under contraction". This way people can contact you even if your website isn't bright and flashy!
  12. The last tip here is the most important one:
    Since Google claims that more searches are done on the Mobile device than on the PC, you must make sure that your  website is mobile friendly!
And one last tip which is very important:

The point of this tips column is to make sure people can find you when they look you up online. 
I hope that this information had helped you. Any other very basic tips? Let me know about them in your comments!

13 December 2014

You don't really need a website

I was given a most horrible assignment of data entry. The task is basically to search up names of companies in Google. I could use my time more efficiently by using Sensis API and the likes but as it's not always possible I decided to look up the companies one by one.
And this is what I learned:
  1. All of these companies are unique, special and different. They all offer exceptional value and excellent service. They are all highly professional, experienced and have excellent customer service. 
  2. Other companies just have contact details in their website. Could you please make sure that it looks well? Maybe update the look of it once every ten years or so? 
  3. Small business owners don't always have a website. I know it sounds crazy, but you don't really need one if you don't have the time to manage it, or if your name isn't too generic. Just make sure that you can be found in Yellow pages and the professional listings. For example. Lawyer's listings or Accountant Listings, if you're a lawyer or an accountant. Artists and those who work with art can keep a Facebook page, it's also a good way to make sure that those who look for you can find you.
  4. If your name is generic ( or if you share it with someone else who is more famous then you) , then make sure that in LinkedIn your title includes your location as well as your profession. This way you're easily found without the hassle of maintaining a website. 
  5. If you do have a website, make sure that it is Mobile friendly.
Even if you prefer to say that you're not into being famous and increasing your workload, be aware that maybe an existing client would like to look you up (as they've lost their mobile or something like this). So having a clear listing is always important.
So you don't really need a website, just make sure that you can be easily found online.

27 November 2014

Remind me to never use access again....

I came back from Maternity Leave, all enthusiasm. It lasted of course only a few weeks, and then I was asked to help with a "Training Record System"; as an in-house developer, if they ask for something to record the training of the employees in the company, I said yes. It's called a "can do" attitude and people really appreciate it. And because I felt a little bit rusty, I decided to use Access as front end and SQL as the back end. I can do that with my eyes closed, right?
And then I was easily reminded of the joys of working with Access.
A basic form with two sub forms, and a combo box on top which is linked to them. The first sub form contains the details of the course, the second sub form contains the details of the participants. So when I first added details to the course sub form (the top one) (On new record) I would get the very descriptive

You can't assign a value to this object

with all sort of non relevat reasons.
And then I pressed "ok" and continued to edit the report.

It slightly help to add the following code to the sub form



And that resolved it temporarily.

So I managed to put all the course details without getting any annoying error messages, and then when I moved from the "course" part details to the "participants" part details, just to get the following error:

ODBC -- call failed
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented (#0)

So I looked this problem up and found myself on #2 in Google! Well, that only shows how rusty I am! I only needed to refresh the underlying table this time in order to sort out the problem (I knew it's not the ODBC driver as yesterday it worked...).



One more thing (basic but good to know):
If you get the
"The expression you entered has a function name that Microsoft Office Access can't find"
error. 
Sometime it is just due to the fact that a Macro must refer a Public function (not a Sub!) in a module. And the function's name should be different than the Module Name. And of course, make sure you've spelled the word correctly. For a Function that could be written as a sub just do this

Public Function Foo () AS Integer
'Do Something
      Foo = 1
End Function


I Also downloaded this
http://www.microsoft.com/en-us/download/confirmation.aspx?id=6627
in order to set up the Menu item. Ho, the good old MS Access 2003 days! You can find a code example of how to add a side menu to a report here. As for manipulating the Ribbon for better functionality; sorry, it requires messing with the Registry, an absolute no-no in my view. I really don't think it is even slightly necessary.



Another Example:

Working on an older database, running a trusted code and Receiving
Error: Record is deleted, (3167) encountered.
Apparently I needed to do Compact and Repair

Another Example:

I've placed a copy of an Access MDB file on the Network so everyone can share the joy.
So I run it and it doesn't let you run the product from the Network, you need to add it to the Trust Center.
So I go File -> Options -> Trust Center -> Trust Center Settings ->Trusted Locations
And I add a new location.

It tells me that I'm not allowed ("The remote or network path you have entered is not allowed by your current security settings.")
And I need to check the "check "Allow trusted locations on my network (not recommended)" 

So:
If you want to run Access from the Network is not recommended.
Which means that Access isn't a corporate product! Ask MS if you don't believe me!

The issues is this, but really, really, please:
How come that if I'm working on a Trusted product, Like SQL or C#, I rarely rarely google my problems, and I hardly ever get "weird" error messages, while 10 minutes into using MS-Access I Google like crazy?


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.