Monthly Archives: June 2016

Developing C# Applications on Mac OS using VS Code

Developing C# Applications on Mac OS using VS Code

As we know we cannot run Visual Studio directly on Mac OS. So in order to develop applications targeting Microsoft .net framework, we need to rely on other tools including OmniSharp. Now we can also use Visual Studio Code to develop C# based applications.

Let’s first install Visual Studio Code. We can directly download OS compatible VS Code from the following link:

VSCode download

VSCode download

VSCode implements extensions based model. There are a number of extension available to develop applications targeting different platforms. Similarly, there is an extension available for C# development. The extension is provided by Microsoft.

Install C# extension

Install C# extension

We can directly install the above extension from Visual Studio. Press Command + P and select option from the drop down. The extension provides support for syntax highlight for C# statements.

ext_install_csharp

ext_install_csharp

In order to support complete debugging experience we need to install .net CLI tools. As soon as we install the above extension, it prompts for installation of .net CLI tool to support debugging.

.net cli tools

.net cli tools

We can download .net CLI tools directly but there is a pre-requisite installation of open ssl using home brew package manager. If home brew is not installed on your machine, it can be downloaded directly using Terminal.

brew install

brew install

But before installing the CLI tools, we need to first add support for secure connection by installing open ssl. Let’s run the following commands in the terminal window.

Now you can download .net cli tools directly using the following link:

https://go.microsoft.com/fwlink/?LinkID=798400

As soon as it is downloaded, you can run the installation wizard. It is a step-by-step guide to installation. Please remember that you need to have admin rights for this installation. If installation is successful, you should see the following:

cli installation successful

cli installation successful

The wizard also copies the tools in your PATH so you can run them directly through terminal. Here we have created a sample employeeApp using [dotnet new] command.

dotnet new

dotnet new

Here are the contents of the folder. It has a simple project.json file and Program.cs.

project.json

project.json

Yes, there is no csproj file for .net core based applications. This might change though as this is still Release Candidate. Here are the contents of project.json.

We can run it directly from the console using dotnet run command. This should compile and run the application.

dotnet run

dotnet run

Neo4j – An Introduction

Neo4j – An Introduction

A graph database allows data to be saved in terms of nodes and edges and their properties. This type of database suits the business cases where entities and their relationships defines the whole concept. They are faster to query too. In addition to storing data as nodes and relationships, they provide extra-ordinary query and visualization tool using non-sql query languages. So in that way, it can be regarded as a NoSQL database.

Neo4J is a graph analytics tool capable of analyzing extremely complex graph networks. The data stored as graphs can be queried using CYPHER.

Where to get Neo4J from?

Neo4J can be directly downloaded from neo4j.com.

Neo4J download

Neo4J download

There are a number of releases available for different platforms. Since I am running it on Mac, I am getting a Mac version. After downloading the dmg file, we can simply drop it to the application folder to install it like regular Mac apps.

There is a free community edition available which I found very useful for my studies but there is also an enterprise edition available for business customers. There is also a free trial for the enterprise edition.

Running Neo4J

On windows platform, Neo4J can run as a console application. It can also run as a windows service. The web server runs on port 7474 by default.

neo4j server launch

After running the server, you can simply launch the default client. It is a browser based application which can just be launched by clicking the link available on the server window above.

neo4j browser client

Learning Cypher

A very good introduction to CYPHER syntax is available on neo4j’s website. Please refer to the following:

learn_cypher

Importing Data to Neo4j

Let’s import some data. Here we have a simpleton comma separated file with data for an institute. It lists student and their course assignments.

Let’s use the following command to load data into Neo4j and hit execute.

If all data is loaded successfully, you should see the following view:

Data_Import

The data can be queried using match command in cypher. Here we are returning all students and courses with their relationships:

The result is provided both in text and visual format in different tabs. Here is how the data is provided in terms of nodes and their relationships.

data - graph view