Configuration.json

{
“ReRoutes”: [
{
“DownstreamPathTemplate”: “/api/values”,
“DownstreamScheme”: “http”,
“DownstreamHostAndPorts”: [
{
“Host”: “localhost”,
“Port”: 5000
}
],
“UpstreamPathTemplate”: “/values”,
“UpstreamHttpMethod”: [ “Get” ],
“QoSOptions”: {
“ExceptionsAllowedBeforeBreaking”: 3,
“DurationOfBreak”: 10,
“TimeoutValue”: 5000
}
},
{
“DownstreamPathTemplate”: “/api/values/{id}”,
“DownstreamScheme”: “http”,
“DownstreamHostAndPorts”: [
{
“Host”: “localhost”,
“Port”: 5000
}
],
“UpstreamPathTemplate”: “/values/{id}”,
“UpstreamHttpMethod”: [ “Get” ],
“QoSOptions”: {
“ExceptionsAllowedBeforeBreaking”: 3,
“DurationOfBreak”: 10,
“TimeoutValue”: 5000
}
},
{
“DownstreamPathTemplate”: “/api/values”,
“DownstreamScheme”: “http”,
“DownstreamHostAndPorts”: [
{
“Host”: “localhost”,
“Port”: 5500
}
],
“UpstreamPathTemplate”: “/values2″,
“UpstreamHttpMethod”: [ “Get” ],
“QoSOptions”: {
“ExceptionsAllowedBeforeBreaking”: 3,
“DurationOfBreak”: 10,
“TimeoutValue”: 5000
}
}
],
“GlobalConfiguration”: {
“RequestIdKey”: “OcRequestId”,
“AdministrationPath”: “/administration”
}
}

Who is using port 80 ?

If you are a programmer working in any technology that required a web server then you must have come across this scenario where you get an error “Port 80 is in use by other process”.

The firs step you do is to find out which process are using port 80 and our good old netstat command comes into picture which is kinda cool but doesn’t always show you which process is responsible

NetStat

 

You can save lot of time by executing command “net Stop Http”.

This will stop all Http operations using port 80 as well as show you list of services using port 80 which you can disable if not needed.

 

netstop

Hope this helps :)

Tips for people wanting to learn new technologies but don’t know how to start

Search for online documentation and whitepapers .

Most technology providers publishes documentation and whitepapers which contain everything related to new/existing features in technology.

e.g.

https://docs.microsoft.com/en-us/aspnet/core/

https://reactjs.org/docs/hello-world.html

Follow relevant people on social media platforms:

Requires a bit of research. Search for blogs and groups on twitter, Facebook, linked in and try to connect/follow people to get first hand new regarding technology.

https://www.hanselman.com/

https://weblogs.asp.net/scottgu

E-Learning Platforms :

You should invest in yourself. Subscribe to e-leaning platforms where you get first-hand video tutorials to jump-start your learning. There are many e-learning platforms which provide you trial subscriptions and offers from time to time. Some of these are:

Pluralsight

Udemy

Microsoft Virtual Academy

Next Step :

All above can give you good knowledge about subject but most of time they lack in practical scenarios and problems you might face and off-course you need to build up your social media profile to show-case your skills as most companies now a days look for social media presence to judge your skills.

Subscribe to Forums:

I believe in reaching out to problems rather than problems reaching out to me and you can find real world problems on online forums. Based on topic of interest you can subscribe to relevant forums and try reading about problems people are facing, as well as try to provide answers. Initially you might need to google about issues to gain knowledge but with time you will be ready with your own answers.

Create GitHub Account:

With time you will start gaining knowledge and start creating customized solutions to help other people in forums. Compile all your code into a GitHub repository but make sure all code is of high quality as you might be judged by a recruiter or future employer based on quality of code you are sharing on GitHub.

Start a forum:

Learning is sharing. Don’t keep knowledge to yourself. Start a blog and share information with others , build a following and who know you might un-earth an author in yourself and with time create a parallel career in training, consulting or freelancing.

Installing Python Robot Framework on Windows

Once python is installed on your machine. If not installed already please follow my other article Visual Studio Code – Getting Started with Python here . First step is to download and install pip.
To install pip, securely download get-pip.py from here
Then run the following:
python get-pip.py

Once pip is installed, you can install robot framework by running below commands

python -m pip install robot framework

 

pip install docutils

 

Once robot framework is installed, make sure to set up path variable to point to python installation directory’s scripts folder, In most cases its

C:\Users\<user>\AppData\Local\Programs\Python\Python36\Scripts

After installations, you need to download a certain release or grab the latest content and extract the package somewhere.

After installations you can run the demo on the command line by using the robot command:

robot QuickStart.rst

Classes in ECMA Script 6

JavaScript is object based programming language where most of the work is done using functions. A function can act like a class or a function due to its prototypical nature. From the outset people felt a need for classes and used various framework which wraps class like functionality into the language. As has been a trend with all my tutorials first of all I will try to explain how to create classes with methods, properties etc. using prototype programming model and later we will jump to new way of programming classes which resembles most of the existing and old programming languages.

Let’s create a class in JavaScript with some variables like we do in other languages

<script type="text/javascript">

          //A simple class with id property
          function myClass(id){
              var id;

              function helloWorld(){

              }
          }

          //Usage . As you can see we create object using new and pass any 
          //required parameters into constructor 
          var objMyClass = new myClass(1);         
             
          console.log(objMyClass.id);
          console.log(objMyClass.helloWorld());
       

        </script>

Continue reading

Destructuring in ECMA Script 6

In application programming its very common to come across cases where we get return values as objects or arrays from an API call and then for logic sake we need to store them into variables.so basically deconstruction steps require:

  • Declare appropriate variables
  • Access data from array or objects and assign to respective variables

Automatic Deconstruction feature in ES-6 helps in overcoming lot of this redundant coding stuff. As the name suggest we need to deconstruct a complex object say array or object into variables. Let’s compare the old way of deconstruction versus the new way

Old Style Deconstruction

<script type="text/javascript">

            function returnComplexObject(){
                return {id : 1 , name:"test"};
            }

            function returnArray(){
                return [1,2,3];
            }

            //Fetch Data
            var data = returnComplexObject();
            var id = data.id;
            var name = data.name;

            console.log(id);
            console.log(name);

            var arrayData = returnArray();
            var value1 = arrayData[0];
            var value2 = arrayData[1];
            var value3 = arrayData[2];
            console.log(value1);
            console.log(value2);
            console.log(value3);

        </script>


style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-5021110436373536"
data-ad-slot="9215486331">

Continue reading

Default and Rest Parameters in ECMA Script 6

Another handy feature that has been existing in most advanced programming languages but added into JavaScript by ES-6 enhancements is the concept of default arguments.
We already discussed a lot about functions and arguments in previous article of this series here and we have already seen that you can pass any number of parameters to a function which might be accepting one , two or n number or parameters.
We already know that a function can have either named arguments which can hold the values passed to a function or arguments object containing all the arguments passed to a function.
Let’s try to handle default values for parameters in they are not passed explicitly by developer but required by program to run.

Continue reading

Constant Variables in ECMA Script 6

ES-6 introduced the support for immutable variables or constant variables. Constant variables are not a new concept in programming and have been in existence in most of the programming languages of today.
If while programming you come across a scenario where you don’t want somebody to change value of a variable then it makes sense to declare the variable as constant. You must understand that you cannot reassign a constant variable to a new value but in case of objects you can still be able to modify the property of objects.
Some rules accompanying a constant variable:
a.) Must be declared using const keyword
b.) Must be initialized at time of declaration
c.) Cannot change value of const once assigned
Let’s try to understand with examples

Continue reading

Arrow functions

Arrow functions provide lot of new enhancement apart from providing syntactic sugar to already existing JavaScript functions.
As you might already be aware, JavaScript is prototypical in nature and there are many ways you can add a function to a class. A JavaScript function itself can act like a class or a function. Here is how we can define a function

A normal function in JavaScript

Continue reading

Scoping in JavaScript – Var vs Let keyword

As a seasoned JavaScript developer, you might already be aware of nuances of var keyword. JavaScript has been a loose language unless used in strict mode.

  • You don’t need to declare a variable before using it, unlike other programming languages that provide better compile time support and syntactic sugar. Variables that are not declared are hoisted to global scope.
  • JavaScript Hoists the locally declared variable using var keyword inside a method i.e. no matter where you declare a variable inside your method its always hoisted to top of method and available to all code branches within the method.
  • You can declare global functions as well using var keyword by defining them outside a method.
  • Since var creates a function scoped variable it can cause unexpected results with loops.

Continue reading

Introduction to ECMA Script

Introduction to ECMA Script

As a web or mobile application developer you might already be aware of JavaScript. JavaScript has been a programmer’s favorite and lifesaver when it comes to changing Html on the fly since it runs directly on the browser. Now days, you are hearing a lot on JavaScript and corresponds frameworks that have popped up and wondering where to start with. JavaScript is evolving and is no longer object based language and you can see in new versions you can create classes, interfaces just like Java.

All the core features of JavaScript are defined in a standard widely known as ECMA-262.The ECMA-262 standards are defined in a language called ECMAScript. You should keep track of this language since most of the current programming languages are inheriting lot of features from ECMAScript. JavaScript and Node.js uses all the core features of ECMAScript and adds lot of other features on top of those feature to be as powerful a language.
The current version of ECMAScript at the time of writing the article is known as ES-2015 or ES-6. JavaScript as a language has seen lot of improvement over a course of ECMAScript upgrades. The biggest upgrade came in ES4.0 which apart from other smaller features includes the major ones like a new syntax, modularity, classes support, inheritance support, private access modifier etc.

style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-5021110436373536"
data-ad-slot="9215486331">


There has been lot of improvements since then and if you want to learn any of the modern-day frameworks like Angular.Js, React.Js or Vue.js it’s a must to get started with learning ECMAScript.
In this article series, I will try to explain new features of ECMAScript and also will try to refer which features are adopted in which programming language.

Some of the features of ES-6 that we are going to discuss are:
• Scoped Variables (let vs var keyword)
• Arrow functions
• Constant Variables
• Default parameters
• Spread operators
• Rest Parameters
• Template Literals
• Destructuring
• Modules
• Classes
• Symbols
• Iterators
• Generators

Visual Studio Code – Getting Started with Python

Introduction

Python is one of the powerful languages of today and has gained wide acceptance as a tool to create machine learning applications due to its simple yet powerful syntax compared to other popular languages like C++, C#, Java etc.

Python was created in late 1980’s by Guido van Rossum and is developed under OSI-approved open source license by The Python Software Foundation.

Installation

Python can be downloaded for your choice of operating system from here

Continue reading

Visual Studio Code – Setup Python Environment variable

If python command is not working in visual studio code’s terminal window. You can follow below steps to setup PATH variable

 

Step 1:

Set up Path variable only for this visual studio code session. Run below command in visual studio code terminal where “C:\Program Files\Python36” is python install directory. You can choose a different one based on python version installed .

 

$env:path=“$env:Path; C:\Program Files\Python36″

  Continue reading

New Feature in C# 7.1 – Inferred tuple element names

From past few years I have been keeping a close watch on ECMA scripts and seems C# is running neck to neck in importing features of ES-6

I have explained about Tuples in older Blog article here

C# 7.1 introduces a small feature enhancement to Tuple de-structuring.

To run below sample you need to install System.ValueTuple Nuget package


style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-5021110436373536"
data-ad-slot="9215486331">


Continue reading