Delete All Empty Folders in SharePoint recursively


When you are using Sharepoint as document management system. More than often you get to the point where you need clean up of your document libraries. The code below will clean up all the empty directories in a given SharePoint list.

Latest Recommended Book for SharePoint

Posted by admin, 0 comments

What is MongoDB?

According to

“MongoDB¬†(from “humongous”) is an open-source document database, and the leading NoSQL database.”

Most of us are more familiar with a different type of databases called “Relational Databases” in which the data is saved in the form of tables and connected with “Relations”. Inside the tables the data is divided in to rows and columns and these tables have a defined schema and all records in that table should conform to the schema of that particular table. The schema is defined at the time of creation of the table. For an example:

If we wanted to create a table which could hold Post and its comments then in relation database we will create something like this.



But in case of MongoDb the structure will be like the one below.


“Post”:”this is a post”
“Comments”: [“Comment 1”,
“Comment 2”,…..


This format is known as BSON , which stands for Binary JSON because it closely resembles JSON format.


Posted by Sheraz Lodhi in database, database management system, databases, flat databases, mongodb, relational databases, 0 comments

Introducing “class”, “constructor” , “static”, “extends” & “super” keywords in JavaScript (ECMAScript 6)

Most devs are familiar with most of these keywords in their favorite languages. Now if your favorite language is JavaScript and you were missing these keywords ECMAScript 6 has introduced following new keywords with a bonus keyword “Constructor”, i think no other language has this keyword. Below are the new keywords

  • class
  • constructor
  • static
  • extends
  • super
Although they look very similar to other language constructs they are actually different and JavaScript is still supporting only prototype-based inheritance. Let’s discuss each of them


Class declarations are also a type of functions and the work almost the same way. A simple class can be defined as below:

Another way to create a class in javascript is by using class expressions as shown below


constructor is a method that is used in order to create the object by use of class keyword. You can only have one function using constructor in your class.


Same as in other languages(c#) this static method is used to create a function that can be run without instantiating the object of a class. They are mostly used to create utility functions.


This can be used to extend any javascript class. When I tried to create use this method to extend a class as shown below, I got an error:

Javascript ES6 class extend error “Uncaught ReferenceError: this is not defined”



In order to get rid of this error all I have to do was call a function super(); super method is used to call the functions of objects parent.

ES6 class constructors MUST call super if they are subclasses and want to access “this” keyword.

So, Just uncomment the super() method in above code and everything will work fine as shown below.

Posted by Sheraz Lodhi in ecmascript 6, ES6, extend error, Javascript, javascript class, javascript constructor, javascript extends, javascript static, javascript super, object oriented javascript, 0 comments

How to choose a JavaScript framework AngularJS vs Backbone.JS vs ember.js

The other day I had a look at the info-graphic below. I really liked the details that are provided just in one image. Let’s have a look at this


It is a daunting task to figure out which JavaScript framework you should choose for your project. And the above info graphic can provide just enough insight into current overall standings of these frameworks. It compares AngularJS, Backbone.JS and ember.js. As I had figured out after a look of research that AngularJS may be the right choice at this moment for my project , this info-graphic can help you conclude to this in just looking at the image. You can compare all the details side by side for each of the framework. Each framework has its own pros and cons and you should always give a good amount of your time to finalize the framework you want to choose so that it suits well to your project and you don’t suffer from any project delays or library related problems in the middle of your project. It is rightly said in the infographic that you are actually selecting your poison, as there are pros and cons for every framework and you should pick the poison for which you have developed immunity. We will call this #JavaScriptPoison
Posted by Sheraz Lodhi, 0 comments

Microsoft Visual Studio Code and Chrome’s developer tool??

I was recently using MS Visual Studio code and in order to format the code I used the shortcut control+shift+I and this is what i saw

You can see clearly that it opens Chrome’s developer tool (with Microsoft’s copyright)? I am unable to understand what relation does this Visual Studio Code has with Chrome’s developer tool?

I then tested it by adding an alert and yes that works too ūüėÄ

Anyone has an idea? do let me know.

Posted by Sheraz Lodhi, 0 comments

JavaScript full stack development (MEAN) using Newly announced Microsoft Visual Studio Code in Ubuntu

Microsoft recently launched Visual Studio Code A free cross-platform code editor for linux, Mac and Windows. I thought to give it a try on Ubuntu.

  • First of all let’s download Visual Studio Code from the¬†here
  • ¬†After downloading extract it.
  • Then copy it to a folder where you put your programs in Ubuntu. I copied it to /Programs/Code
  • After copying the folder now we want to be able to run VSCode by just typing Code in our terminal.
  • So, We will add this to bash.bashrc file by entering the following command in terminal.
  • after the file is opened you will add the path to your VSCode directory to PATH variable at the end of bash.bashrc file as shown in the image below
  • Now you are ready to open VSCode by entering just one command from your terminal. “Code” Please note that it is with capital “C” as the name of binary file name starts with capital “C”
  • Here you go. You now have Visual Studio Code setup on your Ubuntu and you can start developing.
  • I have started a sample MEAN(Mongodb, Express, AngularJs, Node.js) project and created it folder structure etc for full stack JavaScript development.

Posted by Sheraz Lodhi in full stack, Javascript, Microsoft Visual Studio Code, MS VS Code, Ubuntu, Visual Studio Code, VS Code, 0 comments

Amazing things about JavaScript

arguments object:
arguments is a default object which is always there for you even when you haven’t passed anything to your function. you still have arguments object. and that’s the reason why you can send any number of parameters to a JavaScript function with any number of arguments.
For example you can write the code below :
var sum = function(){
var sum=0;
sum += arguments[i]; 


Immediate function execution expressions are the functions which are executed as soon as they are declared.


There are many ways to create objects in Javascript

Literal Object Notation:
Yup this is so similar to Json because json is subset of Literal Object Notation ūüôā
var obj = {
  prop1: value1,
  prop2: value2

Object oriented JavaScript:  JavaScript is object oriented but in different ways than regular programming languages. An object in JavaScript can be initialized in the many ways. some are below
Using Constructor functions:
  • Constructor functions have one major difference that they members are accessed by using this keyword.
  • There name usually starts with an upper case letter.
  • after you create a constructor function all you have to do is to use “new” keyword to create object of that function
Using base Object function:
var obj = new Object();
obj.a= ‘val’;
obj.b= ‘val2’;

Using object.create Function:
using obect.Create is supported in major browsers but not in IE6 or 8

var a = Object.create(null, { a: { value: 1 }, b: { value: 2 }}); // no prototype
var b = Object.create({}, { a: { value: “a” }, b: { value: “b” }}); // prototype is an empty obj
var c = Object.create({}, { a: { value: true }, b: { value: false }}); // prototype is an empty obj

console.log(a.a); // outputs 1
console.log(a.b); // outputs 2
console.log(b.a); // outputs a
console.log(b.b); // outputs b
console.log(c.a); // outputs true
console.log(c.b); // outputs false

further read: 
Recommended Books
Posted by Sheraz Lodhi in arguments object, IFEE, Immediate function execution expressions, Javascript, JS, object oriented javascript, 0 comments

Node.js on Ubuntu : npm ERR! cb() never called! npm ERR! not ok code 0

While setting up Node.js on Ubuntu I encountered the error below

npm ERR! cb() never called!
npm ERR! not ok code 0

This occurred because when I ran the command
npm install
and stopped it abruptly in between. ¬†The solution that I found was to delete the folder “node_modules” that was created and then run the command below
npm cache clear
after this I ran the command nmp install again and all was working fine.


Recommended Books:
Posted by Sheraz Lodhi in cb() never called !, ERR!, Node, Node.js, npm, 0 comments

What’s new in ASP.NET 5 , discussion on .NET core, Unified BCL, Runtime Adaption Layer, .NET Native Runtime and CoreCLR

What’s new in ASP.NET 5?
ASP.NET 5 is the new version of ASP.NET. It is a lean version which is built upon the modular approach with minimum overhead. It also simplifies the hosting of ASP.NET website, as now supports XCOPY type deployments. Which means you just have to copy and paste your website and everything will work fine. You will not have to coordinate with IT department for dependencies as you don’t even need to install .Net framework. All the dependencies will be packaged with the web application built with ASP.NET 5.

ASP.NET has following new features, I will be discussing each, one by one.

  • What is .NET Core , a flexible, modular and cross platform run-time
  • Open Source In GitHub (
  • What is new HTTP request pipeline in ASP.NET 5
  • Cloud Ready
  • Unified programming model
  • Ability to see changes without re-building the project.
  • Ability to self host
.NET Core: 
.NET core is the Microsoft’s bid to control fragmentation of their .NET framework when you as a developer are targeting multiple verticals i.e you want to develop applications which target multiple devices for example you have a web back-end , web front end then you have a desktop application and also functionality exposed for mobile devices. Due to fragmentation you have to create separate projects as many of the API’s are different or in some cases not available across different verticals. In order to try to solve such issues shared project or portable class libraries were introduces.
.NET Core sits at the base of everything as shown in the image below. It is basically optimized version of .NET framework which is light weight and common across .NET Native and ASP.NET 5 and is available for windows, Linux and Mac.
Unified BCL as shown in the image is identical for both .NET Native and CoreCLR. What Microsoft has done is that they have created a unified Base class library and there is a layer named run-time Adaption layer which is specific to .NET run-time and has separate implementations for .NET Native Runtime and CoreCLR. According to Microsoft it contains types like String and Int32.

.NET Native Runtime is for devices like RT and Windows Store apps and CoreCLR is for ASP.NET 5.

On top of BCL there are app-model specific API’s one for Windows Store App Model and another for ASP.NET 5 App model.

Recommended Book
Posted by Sheraz Lodhi in .Net, .NET Core, ASP.NET 5, Microsoft, Microsoft .NET Framework, opensource, Unified BCL, 1 comment

What is memcached Client? Starting memcached

memcached: It is a general purpose, opensource and distributed caching system which is used to cache some data so that every time database is not hit. Memcached  can be considered as huge Hashtable that is distributed on multiple servers. Each data value can be pointed by a hash of that key to access that data.
Client-Server Architecture: 
Memcached is based on client-server architecture.The server maintains the large hashtable of key value pairs. The servers keep the values in the RAM and the if the RAM is full the server discards the older values. 

memcached Clients¬†access the server through different set of API’s, exposed by memcached server at port 11211, in order to request a particular object. memcached clients are responsible to create a hash of key, which tells the server to find a particular object value stored in the server memory. Here is a list of¬†memcached – Client API’s¬†.

Related Books:

Posted by Sheraz Lodhi in Books, Client Server Architecture, memcached, Recommended Books, 0 comments