Tutorial by Examples: du

if you want to see component's individual coverage of tests follow these steps. npm install --save-dev karma-teamcity-reporter Add `require('karma-teamcity-reporter')` to list of plugins in karma.conf.js ng test --code-coverage --reporters=teamcity,coverage-istanbul note that l...
C99 While writing // delimited comments, it is possible to make a typographical error that affects their expected operation. If one types: int x = 20; // Why did I do this??/ The / at the end was a typo but now will get interpreted into \. This is because the ??/ forms a trigraph. The ??/ tri...
To get the list of Elixir modules just type h Elixir.[TAB] Pressing [TAB] autocompletes modules and functions names. In this case it lists all modules. To find all functions in a module e.g. List use h List.[TAB]
1. For Loop: CountriesName = ["India", "Canada", "America", "Iraq"] for country in CountriesName puts country end 2. Each Iterator: Same set of work can be done with each loop which we did with for loop. CountriesName = ["India", "C...
Here i will show you how to fetch All parent(configuarble products) A parent product and all of its children.
We will start by making a simple class that gets all our parent(Configurable products) <?php namespace Test\Test\Controller\Test; use Magento\Framework\App\Action\Context; class Products extends \Magento\Framework\App\Action\Action { public function __construct( \...
Here we first fetch our parent product and the we will get all children products that this parent have. <?php namespace Test\Test\Controller\Test; use Magento\Framework\App\Action\Context; class Products extends \Magento\Framework\App\Action\Action { public function __cons...
(let [xf (comp (map inc) (filter even?))] (transduce xf + [1 2 3 4 5 6 7 8 9 10])) ;; => 30 This example creates a transducer assigned to the local xf and uses transduce to apply it to some data. The transducer add's one to each of it's inputs and only returns the ...
(def xf (filter keyword?)) Apply to a collection, returning a sequence: (sequence xf [:a 1 2 :b :c]) ;; => (:a :b :c) Apply to a collection, reducing the resulting collection with another function: (transduce xf str [:a 1 2 :b :c]) ;; => ":a:b:c" Apply to a collection, and...
<?php //Creating Connection to MySQL database using MySQLi $mysqli = mysqli_connect("IP ADDRESS OR DOAMIN", "username", "password", "database_name"); //Executing Query in the Database using MySQLi $result = mysqli_query($mysqli, "SELECT * FROM T...
You can also easily wrap all angular modules, which you are going to use, into one module: import { NgModule } from '@angular/core'; import { MdButtonModule, MdSnackBarModule, MdSidenavModule } from '@angular/material'; @NgModule({ imports: [ BrowserAnimationsModule, MdB...
shared.service.ts: import { Injectable } from '@angular/core'; import { Headers, Http } from '@angular/http'; import 'rxjs/add/operator/toPromise'; import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Rx'; import {Subject} from 'rxjs/Subject'; @Injectable(...
A module is a class with the @NgModule decorator. To create a module we add @NgModule passing some parameters: bootstrap: The component that will be the root of your application. This configuration is only present on your root module declarations: Resources the module declares. When you add a ne...
Modules can be nested by using the imports parameter of @NgModule decorator. We can create a core.module in our application that will contain generic things, like a ReservePipe (a pipe that reverse a string) and bundle those in this module: import { CommonModule } from '@angular/common'; import {...
When offering IAP within an an app, you must first add an entry for each individual purchase within iTunes Connect. If you’ve ever listed an app for sale in the store, it’s a similar process and includes things like choosing a pricing tier for the purchase. When the user makes a purchase, the App ...
Pseudorandom Distribution Accorinding to this Stack Overflow answer, user CherryDT pointed out this code: set /a num=%random% %% 100 does not give a uniform distribution. The internal dynamic variable %random% does gives a uniform distribution, but the above code will not be a uniformed random...
So the most used functions on Clojure map and filter have been modified to return transducers (composable algorithmic transformations), if not called with a collection. That means: (map inc) returns a transducer and so does (filter odd?) The advantage: the functions can be composed into a single f...
Consider Kotlin's Null Type system and WeakReference<T>. So let's say we have to save some sort of reference and we wanted to avoid memory leaks, here is where WeakReference comes in. take for example this: class MyMemoryExpensiveClass { companion object { var reference: WeakR...
ng-repeat is the built-in directive provided by AngularJS, mostly used for listing the array elements on UI dynamically as per the changes in our model. Official "ng-repeat" docs can be found at : https://docs.angularjs.org/api/ng/directive/ngRepeat Also the most common error faced whil...
This post shows how to use most of the functions in the Regex class, work with null safely related to the Regex functions, and how raw strings makes it easier to write and read regex patterns. The RegEx class To work with regular expressions in Kotlin, you need to use the Regex(pattern: String) cl...

Page 46 of 47