Monday, November 28, 2016

JavaScript, Comparison operators Tip

Reference to :  
JavaScript has both strict and type–converting comparisons.
1-  Strict comparison ( === ) : is True if the operands are of the same type and the contents match.
2- Type–converting comparisons ( == ) :  converts the operands to the same type before making the comparison. 

Briefly : 

== only compares values
=== compares values + type

0 == false   // true
0 === false  // false, because they are of a different type
1 == "1"     // true, automatic type conversion for value only
1 === "1"    // false, because they are of a different type
null == undefined // true
null === undefined // false
'0' == false // true
'0' === false // false

Wednesday, November 23, 2016

Play around With Visual Studio 2017 RC

Just playing around with Visual Studio 2017 RC , and i love it , and i want to share my using experience with you :

1- JavaScript support (IntelliSense) improvement:
    I like the scope feature and how you can scope your context to your searching type , also showing the Keyboard shortcut and Indent Guides.

2- Code Navigation 
    Just press CTRL + T to navigate to your file .

And other Cool stuff you can check it here :

Tuesday, November 22, 2016

Node.js Tools for Visual Studio

Node.js Tools for Visual Studio Turn Visual Studio into a powerful Node.js development environment.

Sunday, November 20, 2016

How to know the Website built On SharePoint and get the Version Number also

To figure out what technologies a site is built on :
A- General Ways.
B- Reading HTTP Response Header.
C- Specific For SharePoint , Using Service.

A- In General, To figure out what technologies a site is built on :
     - You could easy look at,  URLs, and file extensions like (Aspx, php, etc.)
     - View Html Source Code, to check Some special Keywords.
     - Using Tools like,

B- Reading HTTP response headers :
The most effective way to do this job , by reading the http response header of the web site using something like Fiddler , PostMan, etc.
You will get plenty of information about the web site ,
Example using PostMan :

You can see the SharePoint version 15 , that is mean SharePoint 2013,

SharePoint version list :

SP 2007: microsoftsharepointteamservices: 12

SP 2010: microsoftsharepointteamservices: 14

SP 2013: microsoftsharepointteamservices: 15

C- Specific For SharePoint , Using Service: 





Monday, November 14, 2016

Learn How to Develop the Next Generation of Applications for the Web

Amazing resources from google

Monday, November 7, 2016

Social Engineering ( Hack Without code ) The art Of Human Hacking

Wikipedia : Social Engineering, in the context of information security, refers to psychological manipulation of people into performing actions or divulging confidential information. A type of confidence trick for the purpose of information gathering, fraud, or system access, it differs from a traditional "con" in that it is often one of many steps in a more complex fraud scheme. 

Tuesday, November 1, 2016

VS Error: This is a higher version than the currently targeted framework

The primary reference XXX could not be resolved because it has an indirect dependency on the assembly XXX which was built against the ".NETFramework,Version=v4.5.1" framework.
This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5".

Resolution :

1- Edit Project File "myProject.csproj" in any text editor.
2- inside the <Project> element Add:
<PropertyGroup>  <ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>

Thursday, October 27, 2016

Google Dart Developer Summit 2016

Google Flutter is a new project to help developers build Mobile apps for iOS and Android.

Wednesday, September 14, 2016

Entity Framework Core Inside Class Library & Entity Framework Core DB Migration Inside Class Library

We are working in a project lately using .Net Core .

And Sure we separate our project into some layers , one of them is Domain Entities as separate class library using Entity Framework Core V 1.0.0 .

- We encounter some problems one of them is officially mentioned here :
"Could not invoke this command on the startup project '(your project name)'. This preview of Entity Framework tools does not support commands on class library projects in ASP.NET Core and .NET Core applications."

- And When you try to add "Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final"  inside  project.json "dependencies" you will get :
Package Microsoft.EntityFrameworkCore.Design 1.0.0-preview2-final is not compatible with netstandard1.6 (.NETStandard,Version=v1.6). Package Microsoft.EntityFrameworkCore.Design 1.0.0-preview2-final supports:
      - net451 (.NETFramework,Version=v4.5.1)
      - netcore50 (.NETCore,Version=v5.0)
      - netcoreapp1.0 (.NETCoreApp,Version=v1.0)
    One or more packages are incompatible with .NETStandard,Version=v1.6.

The complete Solution:

1 - Inside your Entity Class library Project open "project.json" file and replace with the following  :

  "title": "Entities",
  "version": "1.0.0-*",

  "buildOptions": {
    "emitEntryPoint": true
  "frameworks": {
    "netcoreapp1.0": {}
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    "Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0"
  "tools": {
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final"

2- Add you app start Point by adding new Class Library called "Program.cs" To your Entity Class library Project Contains :

namespace EntityProject
    public class Program
        public static void Main(string[] args)

3- Database Migration:
     A- Inside your Entity Class library Project Add "Startup.cs" File Contains :
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

namespace EntityProject
    public class Startup
        public void ConfigureServices(IServiceCollection services)
            var connection = @"Persist Security Info=True;Initial Catalog=DBForTest;Password=XX;User ID=XXX;Data Source=XXX";
            services.AddDbContext<DSContext>(options => options.UseSqlServer(connection));            
     B- Using Package Manager Console :
PM> Add-Migration MyDBMigration1
PM> Update-Database

4-  Inside The Project that use the Entities Class Library DLL , Be sure you add the connection string and register your Repository

5- You will Find the complete Solution Source Code @github/naadydev :

Twitter  /  Facebook  /  GitHub ->  @naadydev

Tuesday, August 23, 2016

Modern JS in a nutshell - ES6 Modules - Part 1 (What is ES6 Modules)

Recommended to read first posts :

- What is ECMAScript ? and the Relation Between ES and JavaScript
- JavaScript Module Pattern & Closures:

- Current JavaScript does not have built-in support for modules,
JavaScript has had modules for a long time. However, they were implemented via libraries, not built into the language. ES6 is the first time that JavaScript has built-in modules.

But The most important work-arounds:
  - Old school Module Pattern Or Closure :
  - CommonJS Modules
  - Asynchronous Module Definition (AMD)
         Writing Modular JavaScript With AMD, CommonJS & ES Harmony:

ES6 Modules to rescue:
- The new version of "EcmaScript 6" or "ES6", offers a number of new features that extend the power of the language.

ES 6 Modules Features
- Modules let you write componentized and shareable code.
- ES6 modules are stored in files. There is exactly one module per file and one file per module.
- Each module is a piece of code that is executed once it is loaded.
- A module can import things from other modules.
- This approach to modules avoids global variables

----------- Normal scripts versus modules -----------

Normal scripts 
ES6 Modules
Default mode
Top-level Variables
local to module
ES6 Modules are singletons. Even if a module is imported multiple times, only a single “instance” of it exists.


- ES6 is not widely supported in today's browsers, so it needs to be transpiled to ES5.
       Transpiling : is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction.

- ES6 Module Transpiler:
- You can choose between several transpilers.
The ES6 Module Transpiler is a tool that takes your ES6 module and compiles it into ES5 compatible code.
- We will Use Typescript
Install Using NPM -> "npm install -g typescript"
Compile           -> "tsc helloworld.ts"

-Note: TypeScript can be configured in two different ways: --target es6 or --target es5 --module commonjs.
  If TypeScript is set to target ES6 then it will output ES6 without transpilation. When set to target ES5 with CommonJS modules TypeScript will transpile your ES6 modules into a CommonJS format.

To be continued :)

Thursday, August 11, 2016

Git & Team Foundation (TFVC) Repo as cross platform Version Control With MS Team Services

- I guess We are All know the great VS Code , cross-platform development tool - supporting OS X, Linux, and Windows 
Visual Studio Code runs on Max OS X, Linux and Windows

- In VS Code you can find Visual Studio Team Services extension for Visual Studio Code :
This extension allows you to connect to Team Services

- Tutorial : Walkthrough of the Team Services extension for Visual Studio Code :

Team Foundation as cross platform Version Control:
Unfortunately VS Code Support Git Repo only , but you can use Team Foundation as cross platform Version Control by using Team Explorer Everywhere  

Team Explorer Everywhere , contains Cross Platform Command-line Client

Tutorial : Using TFS Online TFVC with command-line TFS utility on Mac

Some Helpful References For More Information :


Sunday, July 24, 2016

What is ECMAScript ? and the Relation Between ES and JavaScript


  • ECMAScript is scripting-language specification
  • JavaScript was originally created at Netscape, and they wanted to standardize the language. So, they submitted the language to the European Computer Manufacturer’s Association (ECMA) for standardization. 
  • JavaScript = ECMAScript + DOM API

-        The ECMAScript (or ES) is  scripting-language specification standardized by Ecma International developed by Brendan Eich of Netscape; initially it was named Mocha, later LiveScript, and finally JavaScript.
-        In December 1995, Sun Microsystems and Netscape announced JavaScript in a press release.
-        In March 1996, Netscape Navigator 2.0 was released, featuring support for JavaScript.
-        Netscape delivered JavaScript to Ecma International for standardization and the work on the specification, ECMA-262, began in November 1996.The first edition of ECMA-262 was adopted by the Ecma General Assembly of June 1997.

-      Languages such as ActionScript, JavaScript, JScript all use ECMAScript as its core standard.

-        Is JavaScript exactly the same as ECMAScript?
o   No, The core features of Javascript are based on the ECMAScript standard, but JavaScript also has other additional features that are not in the ECMA specifications/standard.

-        JavaScript = ECMAScript + DOM API:
o   ECMAScript ® Language Specification:  defines all logic for creating and editing objects, arrays, numbers, etc...
o   DOM API: makes it possible to communicate with HTML documents e.g. document.getElementById('myid') .


Monday, July 11, 2016

JavaScript Module Pattern & Closures

If you want to write well-organized JavaScript code, Or want to understand the concept behind almost all famous client side frameworks like jQuery, Angular, etc. … 
So you should know the following basics:

First Back To basics to be sure we will understand.

Object Literal syntax:

        var myObj = {
            defaults: { name: 'nady', age: 33 },
            myMethod: function () {
                // Do something


Normal Function :
       function myClosureFunction() {


Anonymous function 
       var anon = function () {
            alert('anonymous Func');

Or Simply using Closure:
-          You can declare a function that call itself immediately (Self-Executing).

       (function () {

-          The last parentheses , for calling itself so we can pass parameter like :

(function (message) {

Module Concept:
Simply the Module encapsulate your code like a class in other programming languages .

Creating Namespace to access our anonymous function (Module)
Declaring module in global scope enable us to call it everywhere, also we can call it from other modules.
        var myModule = (function () {

Private Methods & Variables:
-          JavaScript variables can belong to the local or global scope.
-          Private variables can be achieved using closures.
-          Closure creates its own scope out of global scope.

       var myModule = (function () {
            var privateVar = 22;
            var privateMetod = function () {

Public & Return
 Returning an Object with a function as a property:
       var myModule = (function () {

            return {
                publicMethod: function () {



Define all our “private” stuff locally and only return, “the public objects”.

var myModule = (function () {

            var privateMethod = function () {
                alert('privateMethod Called');

            return {
                publicMethodOne: function () {
                    alert('publicMethodOne Called');
                publicMethodTwo: function () {

                publicMethodThree: function () {



       // myModule.privateMethod()  you can't call this

       var myModule = (function () {

            // locally scoped Object
            var myObject = {};

            var privateMethod = function () { };

            myObject.someMethod = function () {

            return myObject;



var myModule = (function () {

            var privateMethod = function () {
                // private

            var methodOne = function () {
                // public

            var methodTow = function () {
                // public

            return {
                methodOne: methodOne,
                methodTow: methodTow


Extend our Module

    var myOriginalModule = (function () {

            var privateMethod = function () {
               // Code


        var myExtendedModule = (function (myOriginalModule) {

            myOriginalModule.myNewMethod = function () {
                // another method!

            return myOriginalModule;

        })(myOriginalModule || {});

-> Notice (Module || {}) this is incase Module is undefined -it instantiate a new Object, and bind our extension method to it, and return it, to avoid errors.