Completed ‘Søren Kierkegaard – Subjectivity, Irony and the Crisis of Modernity’ from Coursera

Completed ‘Søren Kierkegaard – Subjectivity, Irony and the Crisis of Modernity‘ course taught by Associate Professor Jon Stewart from University of Copenhagen. The course is offered through Coursera platform and ran for 8 weeks from 6st October 2014 through 1st December 2014.

Course consisted of weekly reading assignments from the works of Kierkegaard, followed by video lectures where Professor Jon provided the background of the text and explained the key points. Video lectures are shot at various locations in Copenhagen which are associated with the life of Kierkegaard. The course concluded with an assignment to write a shot essay on a given topic related to Kierkegaard’s ideas.

My essay was on ‘What did Kierkegaard learn from his study of Socrates? Why is this connection between Socrates and Kierkegaard still relevant in the world today?’.

Coursera Soren Kierkegaard Certificate

What did Kierkegaard learn from his study of Socrates? Why is this connection between Socrates and Kierkegaard still relevant in the world today?

I wrote the following piece as part of an assignment for online course on Kierkegaard from Coursera.

…..

Kierkegaard believes from his study that Socrates has a distinct methodology for teaching his audiences through his dialogues. This method of Socrates has a profound wisdom where it focuses on preparing his interlocutor for accepting and realizing the truth, rather than directly confronting him with it.

Socrates uses Irony to show contradictions in beliefs of his contemporaries. As Socrates engages in dialogue with a person, he praises his interlocutor and acknowledges his wisdom and social stature. He expresses the desire and willingness to learn from him and claims that he ignorant on the subject. The dialogue starts with Socrates asking questions and getting involved in an argument. As Socrates asks deeper questions or points out contradictions, the interlocutor finds him at a loss to answer. This bring about a realization that some of our deeply held beliefs cannot be defended so easily and may be questioned.

At this point, when the interlocutor cannot defend his position, Socrates doesn’t offer his own position on the subject. Instead, he leaves the dialogue without any conclusion, in a state of Aporia. It is a state of puzzlement where a person actively engaged with a riddle is left on his own to solve it.

Socrates don’t confront his interlocutors with truth. Instead, he felt that the real task is to direct one towards a path where he can find the truth for himself. This is important as we already have the truth within ourselves, just it is needed to be brought out. In this sense, Socrates believed that his role was like a midwife whose only assists in bringing out. This characteristic of Socratic Method is called Maieutics (midwifery).

Socratic Method takes into account the subjective aspect of truth i.e. an individual should have an inward realization of truth to really grasp it. It requires an effort, a journey on part of the seeker. Truth, rather than just being told or accepted based on some authority, should also be internalized. This does not mean that Socrates was a relativist, he was against Sophist who were the relativist of his time. He believed in the objectivity of truth but also acknowledged that it has a subjective aspect.

Socrates’s teachings are negative in the sense that they tear apart arguments and beliefs of his interlocutors. In this regard, Kierkegaard argues that Socrates’s teaching are completely negative and he doesn’t offer anything positive at all. For Kierkegaard, as opposed to Hegel, this shall not be taken as a deficiency in Socrates’s approach. It is due to the wisdom of Socrates that he never offers any positive doctrine but instead plays the role of a midwife. He assists the person in his journey to bring out the truth which he already have within himself.

Kierkegaard is deeply influenced by this Socratic Method and tries to follow this model throughout his scholarly career. This theme can be seen in all his works where Socrates and his wisdom props up from time to time.

. . . . .

Kierkegaard has influenced many later philosophers and thinkers, especially in our times. His ideas have been part of, and a source of inspiration for leading philosophical movements of 20th century like existentialism and post-modernism. His philosophy is still relevant as he was a highly original thinker and was one of first to perceive and predict the problems of modern era. It is difficult to classify him as being part of any of the modern philosophical movements, because he never attempted a systematic exposition of his views. Rather his writings shake and stimulate the reader to look for the truth which he can appropriate and which can become the purpose of his life.

Modern man suffers from the loss of moral innocence and a lack of meaning. There is a widespread feeling of alienation as old social structures give way to the modern way of life. Kierkegaard with his Socratic teaching is pertinent to this modern condition, it encourages us to question the excesses of our times and emphasizes the need to understand and appropriate truth for one’s self. The value of truth is not in the cogent set of arguments which prove its validity, its power lies in the giving us a purpose and making our life meaningful.

Kierkegaard died in 1855 but his ideas are still with us with the power to strike a chord within our heart and make our existence worth it.

 

Completed SAP BusinessObjects course on ‘BI Clients and Applications’ from openSAP

BI Clients and Applications - Record of Accomplishment

This is my first openSAP course where I managed to stick around till the end. Generally I found the content on openSAP to be a bit dull. At times it seems that you watching a marketing video rather an educational one. Anyway, there is a lot of useful content also.

This six-week online course was held from October 29 through December 17, 2014. Following topics were covered:

  • SAP HANA as an Analytics Platform
  • Self-Service
  • Dashboards and Applications
  • Semantic Layer and Reporting
  • Mobility and Cloud
  • User Experience Tools and Features

SAP BusinessObjects Universe: Using ANSI92 SQL syntax

When writing SQL queries, I prefer the JOIN clause syntax over (+) in where clause for creating table joins. It is more readable and maintainable as join logic is separated from the where clause.

BusinessObjects Universe can be configured to generate JOIN clause (ANSI92) syntax by setting a parameter in ‘Universe Parameters’ dialog available from File menu.

 

image

 

We get some extra benefits by using ANSI92 syntax, for instance:

Full Outer Join

The functionality to define Full Outer join is available with ANSI92 syntax only.

image

Advanced Join Properties

The Advanced Join Properties give additional control over the generation of SQL queries from the universe. It determines whether a conditional expression should be included in where clause or join/on clause. These options are only supported with ANSI92 syntax.

image

 

The above applies to ‘Universe Design Tool’ version 14.0.7.  More at Official SAP BusinessObjects Universe Design Tool Guide.

BusinessObjects Universe: Defining Complex Outer Join

A complex join contains more than one condition in the join expression. Consider the following expression where one line of sales order joins with a line on invoice,

INVOICE_LINE.ORDER_NUM=ORDER_LINE.ORDER_NUM
and INVOICE_LINE.ORDER_LINE_NUM=ORDER_LINE.ORDERLINENUM

If we define a complex join in BusinessObjects Universe Design Tool, than the option to make it outer becomes disabled.

clip_image002

There are three possible ways to get around this problem (that I found), which are described below.

 

1) Create two separate joins

Create two separate joins to split the complex expression into simple ones. This will enable the ‘Outer join’ check box. While creating the query, the universe will automatically combine the two joins into one complex expression.

clip_image006

 

2) Set the Outer Join first, then specify complex expression (ANSI92 only)

Change the expression to simple temporarily; this will enable the ‘Outer join’ checkbox. Select the ‘Outer join’ and change the join expression back to the designed complex expression. Universe Designer will not only remember that ‘Outer join’ flag but also generate the right query at runtime with outer join clause.

Note: This solution only works if ANSI92 parameter is set to ‘Yes’. That is, join/on clause syntax is used for creating SQL query.

clip_image004

The universe will generate SQL similar to the following:


SELECT DISTINCT
INVOICE_LINE.INVOICE_NUM,
INVOICE_LINE.INVOICE_LINE_NUM,
ORDER_LINE.ORDER_NUM,
ORDER_LINE.ORDERLINENUM
FROM
ORDER_LINE RIGHT
OUTER JOIN INVOICE_LINE
ON (INVOICE_LINE.ORDER_NUM=ORDER_LINE.ORDER_NUM(+)
and INVOICE_LINE.ORDER_LINE_NUM=ORDER_LINE.ORDERLINENUM(+))

 

3) Directly specifying the complex expression with (+) syntax

We can directly specify the complex join expression and make it outer by using (+) syntax. Off course, this will only work when ANSI92 parameter is set to ‘No’.

clip_image008

Generated SQL will be something like:


SELECT DISTINCT
INVOICE_LINE.INVOICE_NUM,
INVOICE_LINE.INVOICE_LINE_NUM,
ORDER_LINE.ORDER_NUM,
ORDER_LINE.ORDERLINENUM
FROM
INVOICE_LINE,
ORDER_LINE
WHERE
( INVOICE_LINE.ORDER_NUM=ORDER_LINE.ORDER_NUM(+)
and INVOICE_LINE.ORDER_LINE_NUM=ORDER_LINE.ORDERLINENUM(+) )

 

The above applies to ‘Universe Design Tool’ version 14.0.7.  More at Official SAP BusinessObjects Universe Design Tool Guide

Designing BusinessObjects Universe: Join problems in schema and resolution techniques

An essential aspect of creating a BusinessObjects universe is to define joins among tables in ‘Universe Design Tool’. Even if the joins are correctly defined from relational point of view, the universe might not generate the correct results in certain cases. There are few pitfalls to avoid which are specific to the business of designing universe.  These pitfalls, generally referred as join problems, come in three major varieties: loops, chasm traps and fan traps.

Loop

Loop is the existence of more than one join paths between two tables. In other words, if we move among tables following joins and we can reach back to the original table using a different path, then we have a loop.

Loops will cause less number of records to be returned than expected.

BO Universe Loop

The Universe Design Tool can automatically detect loops and suggest solutions (aliases and contexts).

Chasm Trap

We are in Chasm Trap when a table joins with two others in one-to-may relationship. Learn more about them here.

Chasm Trap

 

Fan Trap

Fan trap is a less severe problem than other two. It does *not* affect the number of records returned  from the query, rather it affects the aggregation of an attribute.

Consider, an invoice record with three lines. While summing invoice total if it gets accounted thrice (once for each invoice line), than we are in Fan Trap.

Fan Trap

Techniques for resolving join problems

As universe designer, the toolbox consists of following to overcome the join problems:

Alias

A table can be duplicated in schema by giving it an alias (Both table and its alias refers to the same underlying table in database). This is the most common way to resolve join problems. Use of an alias can break loops or undesirable join paths.

Contexts

Context is a set of joins. It divides the universe in overlapping sets of tables and joins. If your table is part of more than one context, the report designer tool might ask the user to select the context if it can’t be inferred.

Self Restricting Join

Join can be defined as condition on a single table that limits the records returned from it. Such a join (which is not actually a join at all) is called Self Restricting Join.

Derived Table

Derived Table is like a database view. It allows us to create new tables in Universe based on a SQL query.

Shortcut Join

As the name says, it is shortcut to a longer join path. It is important to identify a shortcut join, otherwise we may have a loop.

 

 

The above applies to ‘Universe Design Tool’ version 14.0.7.  More at Official SAP BusinessObjects Universe Design Tool Guide

Chasm Trap: Designing SAP BusinessObjects Universe

While designing SAP BusinessObjects universe with Universe Design Tool, Chasm Trap is one of the major join problems that one can come across.

We are in Chasm Trap when a table joins with two others in one-to-many relationship. Chasm Trap produces more data than expected.

Example

Consider the following ER diagram where DEPARTMENT is having 1-to-many relationships with EMPLOYEE and CONTRACT_STAFF tables.

Let’s assume we have following data in these tables.

image

BusinessObjects universe will produce something similar to the following query to join the above 3 tables:

select depart_name, employee_name, name "contract staff"
from department d
  inner join employee e on d.department_no = e.department_no
  inner join contract_staff c on c.department_no = d.department_no

Result of the query will have more rows than expected.

image

Resolution

Universe Design Tool doesn’t detect chasm traps automatically. They can be identified by visually inspecting the ER diagram.

Using Contexts

The recommended way of resolving Chasm Trap is to use contexts which will separate the two tables into separate contexts (employee and contract_stafff in our case). If both tables are used in the report, separate queries will be generated resulting in two tables in Web Intelligence report.

Using Derived Tables

Another approach which I have found handy in many cases is to use Derived Table functionality. Derived Table in universe designer can merge the two tables into one. Additional column containing record type can be introduced to still be able to tell the records apart (in our case, record type would be employee or contract_staff). This simplifies the design and avoids the Chasm Trap.

More at Official SAP BusinessObjects Universe Design Tool Guide

Git Push error: refusing to update checked out branch (Source Control)

Recently, I cloned a repository on my machine and made some changes to it. As I was pushing my changes back to the original repo, push failed with the error message:

“refusing to update checked out branch: refs/heads/master. By default, updating the current branch in a non-bare repository is denied…”

There are two things to note here in the error message. First the original repo is non-bare, secondly the push is to a branch which is currently checked out. Following are two possible ways to overcome the issue relating to bare repos and currently checked out branch.

Set Repository as ‘Bare’

Bare repositories do not have any working copy. Changes are not done directly to these repositories, rather changes are pushed from clones. Repositories hosted at GitHub are of this type.

One way to resolve the above issue is to make the repository ‘bare’. This can be done by running below command in original repo folder:

git config –bool core.bare true
 

Change the checked out branch

If you don’t want to convert your original repository to bare, another option is change the current branch. This can be done by:

git checkout
 

In case, there is only one branch in the repository, a temporary branch could be created and checked out:

git checkout -b temp
 

Once the push is executed, run the following commands to bring things back to original state:

git checkout master
git branch -d temp
 

Above will delete the temporary branch and checkout the master branch.

More at http://stackoverflow.com/questions/11117823/git-push-error-refusing-to-update-checked-out-branch

Async / Await and SynchronicationContext (C# .Net)

Following innocuous looking async / await code will cause deadlock.

private void button1_Click(object sender, EventArgs e)
{
  Task<string> task1 = LongRunningProcess();

  textBox1.Text = task1.Result;
}

public async Task<string> LongRunningProcess()
{
  string txt = await Task.Run(() =>
    {
      System.Threading.Thread.Sleep(5000);
      return "results";
    }
  );

  return txt;
}

To understand why, lets go into what await does in the above case.

1 Execution starts when the button is clicked and button1_Click event is fired on the UI thread.
2 The method, named LongRunningProcess, is invoked.
3 The lamda expression passed to Task.Run() executes in a separate thread (lets call it thread_B)
4 Now await keyword is encountered, rather than completing the rest of the method, control returns back to button1_Click event to continue execution after the call to long running method.
5 Calling task1.Result makes the current thread wait on thread_B to complete and provide the results. So UI thread is now waiting for thread_B to complete.
6 As thread_B completes the task, it has to run the remaining part of long running method. Run time ensures that this code executes on the right context. That is, if the initial part of long running method was executed on the UI thread, then remaining part will also be executed in the same thread context.
7 Therefore, thread_B now attempts to run the remaining part of long running method on UI thread, while UI thread is waiting for thread_B to finish.
8 As UI thread and thread_B are waiting for each other, this creates the deadlock.
How to avoid deadlock?

In this case, deadlock can be avoided by anyone of the following ways:

1- Use await keyword while calling long running method. This makes the button click event asynchronous also.

private async void button1_Click(object sender, EventArgs e)
{
  textBox1.Text = await LongRunningProcess();
}

2- Call ConfigureAwait(false), this will inform the run time that the remaining part of long running method doesn’t need to execute on the UI thread, it can continue running on the thread pool.

public async Task<string> LongRunningProcess()
{
  string txt = await Task.Run(() =>
    {
      System.Threading.Thread.Sleep(5000);
      return "results";
    }
  ).ConfigureAwait(false); //avoids the deadlock

  return txt;
}
Why thread contexts are synchronized?

Consider the UI Controls (Windows Forms or WPF), they are not thread safe. Therefore, any update to the UI controls must be done only from the UI thread. To take care of this, any remaining code after await keyword in an asynchronous method will also execute on the thread context which initiated the method call.

Similarly, in an ASP.Net application, running the code on same thread context is important because the Culture, Principal and other information of the request are stored in the thread.

How thread contexts are synchronized?

To manage all this tricky context synchronization, we have SynchronizationContext class in .Net. There are framework specific implementations (derived classes) for Windows Forms, WPF/Silverlight and ASP.Net which handle the SynchronizationContext in their own ways for the framework to function properly.

The Windows Forms implementation uses Control.Invoke method to accomplish this (more details here). For ASP.NET, execution takes place on a different thread but the context is captured and passed on to the new thread.

There is an excellent article on MSDN regarding the SynchronizationContext which I recommend for details.