Wednesday, 7 June 2017

English Pronunciation


  1. Vegetable => Veg-table
  2. Comfortable => Comf-table
  3. Almond => Aa-mond
  4. Salmon => Samon
  5. Half => Haf
  6. Would => woud
  7. Talk => Taak
  8. Walk => Waak
  9. Etc => et cetera
  10. Clothes => Clo-th-zz
  11. Jewellery => Jewell-ry
  12. Architecture => Ar-ki-tecture
  13. Stomach => Sta-mak
  14. Ache => Ae-k
  15. Enthusiastic => En-thuu-siastic
  16. Work => V-a-rk
  17. World => V-a-rld
  18. Word => V-a-rd
  19. Photograph => Pho-tograph
  20. Photography => Pho-tog-raphy
  21. Photographer => Pho-tog-rapher
  22. Photographic => Photo-graf-hic
  23. romantically => romantic-lly
  24. musically => music-lly
  25. logically => logic-lly
  26. b always silent when preceded by m
  27. climb => cl-ae-m
  28. crumb => crum
  29. lamb => la-am
  30. thumb => tha-mm
  31. dumb => da-mm
  32. plumber => plum-er
  33. b is often silent when its before t
  34. subtle => sa-tle
  35. debt => de-t
  36. doubt => da-u-t
  37. c if often silent after s
  38. muscle => mus-le
  39. scissors => si-ssors
  40. fascinate =>fae-si-nate
  41. scene => se-ne
  42. scenario => sa-nario
  43. Wednesday => Wh-ns-day
  44. Handsome => han-some
  45. sandwich => san-wich
  46. d can be very quite in front of g
  47. edge => e-hg-e
  48. knowledge => knowle-hg-e
  49. bridge => bri-hg-e
  50. hedge => he-hg-e
  51. e can be silent at end of word
  52. clue => clu
  53. bake => baek
  54. taste => tae-st
  55. wanted => want-ed
  56. looked => look-d
  57. asked => ask-d
  58. played => play-d
  59. baked => bak-d
  60. wrapped => wrapp-d
  61. sign => si-en
  62. champagne => champe-ne
  63. design => de-si-en
  64. foreign => for-e-n
  65. though => thou
  66. high => ha-i
  67. light => lae-et
  68. daughter => dau-ter
  69. bright => bri-et
  70. what => wh-at
  71. when => wh-en
  72. why => wh-y
  73. whistle => wh-istle
  74. honest => onest
  75. hour => an a-our
  76. choir => k-oir
  77. echo => ec-o
  78. ghost => go-st
  79. rhythm => ri-dm
  80. rhyme => r-yme
  81. business => biz-ness
  82. n is silent after m
  83. damn => dam
  84. autumn => autum
  85. hymn => himm
  86. column => colum
  87. receipt => recei-t
  88. psychology => sychology
  89. psycho => sycho
  90. paragraph => para-graf
  91. telephone => tele-fone
  92. butter => butte
  93. island => i-land
  94. debris => dib-ri
  95. isle => i-le
  96. listen => lis-en
  97. castle => cas-le
  98. ballet => bal-le
  99. soften => sof-en
  100. gourmet => gour-me
  101. asthma => as-hma
  102. Christmas => Chris-mas
  103. whistle => whi-s-le
  104. guitar => gi-taar
  105. guilty => gil-ty
  106. tongue => tong-e
  107. guard => gard
  108. colleague => col-le-ge
  109. guess => ge-s
  110. beautifully => beautif-lly
  111. wonderfully => wonderf-lly
  112. wrong => rong
  113. wrist => rist
  114. write => rite
  115. wrote => rote
  116. who => hu
  117. whoever => hu-ever
  118. whole => hole
  119. two => tu
  120. sword => sord
  121. answer => ans-er



Resources:
https://www.youtube.com/watch?v=nUccn2K0fjw

Tuesday, 28 March 2017

New post

1:  import { NgModule }   from '@angular/core';  
2:  import { BrowserModule } from '@angular/platform-browser';  
3:  import { AppComponent } from './app.component';  
4:  @NgModule({  
5:   imports:   [ BrowserModule ],  
6:   declarations: [ AppComponent ],  
7:   bootstrap:  [ AppComponent ]  
8:  })  
9:  export class AppModule { }  

Monday, 27 March 2017

Eager loading, Lazy loading and work through using DTOs

Eager Loading: use the Include method like
db.books.Include(b=>b.Related_entity);

Lazy Loading: EF automatically loads the related entity when navigation property is referenced. To enable lazy loading, make the navigation property virtual.
public virtual Author Author{get;set;}

Problem of Circular Reference during Serializing models.
When both entities have navigation property with each other, it created a problem when we serialize the models. It creates a circular object graph.

Solution:
We need to use DTO and load all data in them before returning it. 

Code first Data Migration EF

In Code First we write the code first (Models) and let migration tools create tables.

From Tools --> Library Package Manager --> Package Manager Console.
Enter command:  Enable-Migrations
This command adds a folder named Migrations and file Configuration.cs in the folder.
The file has Seed method to pre-load the tables with data.

Type command: Add-Migration Initial
update-database
The first command generates code that creates the database and second command executes that code.


Monday, 10 October 2016

Call Async Post Method


using (var client = new HttpClient())
{
 client.BaseAddress = new Uri("Your URL");
 client.DefaultRequestHeaders.Accept.Clear();
 client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var response = client.PostAsync("API method name", new StringContent(JsonConvert.SerializeObject( "Parameter to send").ToString(), Encoding.UTF8, "application/json")).Result.Content.ReadAsStringAsync().Result;
var resultList = JsonConvert.DeserializeObject<List<"Your DTO Type">>(response ).ToList();
}

Monday, 3 October 2016

Angular JS CRUD - DB

Service.js

/// <reference path="D:\Projects\testapi\testapi\Scripts/angular.min.js" />


app.service('personservice', function ($http, $location) {

    this.personlist = function () {
        return $http({
            method: "GET",
            url: "/api/people"

        }).then(function (result) {
            return result.data;
        });
    };

    this.addPerson = function (name, age) {

        return $http({
            method: "POST",
            url: "/api/People",
            data: { name: name, age: age }
        }).then(function (result) {
            return result.data;
        })
    };

    this.deletePerson = function (id) {
        return $http({
            method: "delete",
            url: "api/People/" + id,
        }).then(function (result) {
            return result.data;
        })
    };

});


Controller.js

/// <reference path="D:\Projects\testapi\testapi\Scripts/angular.min.js" />

app.controller('personcontroller', function ($scope, personservice, $location) {

    init();
    function init() {
        personservice.personlist()
        .then(function (result) {
            $scope.people = result;
        });
    }

    $scope.addPerson = function () {
        var name = $scope.newPerson.name;
        var age = $scope.newPerson.age;
        personservice.addPerson(name, age)
           .then(function (result) {
               $scope.addedPerson = result;
           });
    }

    $scope.deletePerson = function (id) {
        personservice.deletePerson(id)
            .then(function (result) {

                $scope.deletedPerson = result;
            });
    };

});



App.js
/// <reference path="" />
var app = angular.module('app', ['ngRoute']);

app.config(function ($routeProvider) {
    $routeProvider.when('/add',
        {
            controller: 'personcontroller',
            templateUrl: 'AngularCRUD/Person/views/add.html'
        })
    .when('/edit/:id', {
        controller: 'personcontroller',
        templateUrl: 'AngularCRUD/Person/views/edit.html'
    })
    .when('/list', {
             controller: 'personcontroller',
             templateUrl: 'AngularCRUD/Person/views/list.html'
         }).
    otherwise({ redirectTo: '/list' });

});


AngularJS - Temp CRUD

Service.js

app.service('personservice', function () {
    var people = [{ id: 1, name: 'rishi', age: 32 }, { id: 2, name: 'jaismee', age: 26 }, { id: 3, name: 'romita', age: 28 }];

    this.personlist = function () {
        return people;
    }

    this.addPerson = function (name, age) {
        var topId = people.length + 1;
        people.push({ id: topId, name: name, age: age });
    };

    this.deletePerson = function (id) {
        for (var i = people.length - 1; i >= 0; i++)
        {
            if (people[i].id === id)
            {
                people.splice(i, 1);
                break;
            }
        }
    }

    this.getDetail = function (id) {
        for (i = people.length - 1; i >= 0; i++)
        {
            if (people[i].id === id)
            {
                return people[i];
            }
        }
    }

});


Controller.js

app.controller('personcontroller', function ($scope, personservice, $location) {
    init();
    function init() {
        $scope.people = personservice.personlist();
    }

    $scope.addPerson = function () {
      var name =  $scope.newPerson.name;
      var age =  $scope.newPerson.age;
        personservice.addPerson(name, age);
     
        $scope.newPerson.name = '';
        $scope.newPerson.age = '';
        //$location.path('#/list');
    }

    $scope.deletePerson = function (id)
    {
        personservice.deletePerson(id);
    }

});

app.js
/// <reference path="" />
var app = angular.module('app', ['ngRoute']);

app.config(function ($routeProvider) {
    $routeProvider.when('/add',
        {
            controller: 'personcontroller',
            templateUrl: 'AngularCRUD/Person/views/add.html'
        })
    .when('/edit/:id', {
        controller: 'personcontroller',
        templateUrl: 'AngularCRUD/Person/views/edit.html'
    })
    .when('/list', {
             controller: 'personcontroller',
             templateUrl: 'AngularCRUD/Person/views/list.html'
         }).
    otherwise({ redirectTo: '/list' });

});

list.html
<h1>List</h1>
<ul ng-repeat="person in people">
    <li>{{person.name}}{{person.age}} </li><a ng-click="deletePerson(person.id)" href="#"> delete</a>
</ul>

Add.html
<h1>Add</h1>
<div>
    Name : <input type="text" ng-model="newPerson.name" />
</div>
<div>
    Age : <input type="text" ng-model="newPerson.age" />
</div>
<div>
    <a ng-click="addPerson()" href="#/add" >Add</a>
</div>

Bevereages

Types of Beverages Fermented - yeast reacts with sugar to convert into ethyl alcohol & CO2. 4-14% Wine (red, white & rose), Cider ...