Tutorial by Examples

1 cd my/project/dir 2 git clone git://github.com/zendframework/ZendSkeletonApplication.git 3 cd ZendSkeletonApplication 4 php composer.phar self-update 5 php composer.phar install
We install OpenCV 3.1.0 on Windows and get started. There are two ways to install OpenCV on windows. One is to download the installer and run it. Other is to build from source. This is the easiest way to install OpenCV and get started. OpenCV gives pre-build binaries to install on Windows here. Aft...
To get products from the database, you need to use Magento 2's repository design pattern. Each module can be bundled with it's own repositories, and the Product Catalog module is not any different. You can use dependency injection in your class to access the repository. A working example would look...
Like classes, interfaces can receive polymorphic parameters (aka Generics) too. Declaring Generic Parameters on Interfaces interface IStatus<U> { code: U; } interface IEvents<T> { list: T[]; emit(event: T): void; getAll(): T[]; } Here, you can see that our t...
<?php wp_enqueue_style('theme-five', get_template_directory_uri() . '/path/to/additional/css'); wp_style_add_data('theme-five', 'alt', true); wp_style_add_data('theme-five', 'title', __('theme-five.css', 'your-theme-name')); ?> wp_style_add_data
In this example we use a parameter in the route to specify the page number. We set a default of 1 in the function parameter page=1. We have a User object in the database and we query it, ordering in descending order, showing latest users first. We then use the paginate method of the query object in ...
Here we use the object that we passed to render_template to display the pages, the current active page, and also a previous and next buttons if you can go to the previous/next page. <!-- previous page --> {% if users_list.has_prev %} <li> <a href="{{ url_for('users', page...
// An alert dialog $scope.showAlert = function() { var alertPopup = $ionicPopup.alert({ title: 'Don\'t eat that!', template: 'It might taste good' }); alertPopup.then(function(res) { console.log('Hello your first example.'); }); }; });
This example shows how to retrieve an ID of a newly created item using SharePoint REST API. Note : listName - This variable contains name of you list. newItemBody - This will be your request body for adding new item in list. e.g. var newItemBody = { __metadata: { 'type': 'SP.Data.MyListNameIte...
First, we need a custom endpoint builder. public class WSConfigurator extends ServerEndpointConfig.Configurator { @Inject private static Injector injector; @Override public <T> T getEndpointInstance(Class<T> endpointClass) throws InstantiationException { ...
String jsonStr = "{\"name\" : \"Abcd\", \"greeting\": \"Hello\", }"; //Sample Json String Gson gson = new Gson(); // Creates new instance of Gson JsonElement element = gson.fromJson (jsonStr, JsonElement.class); //Converts the json string to Json...
Component import {Component, OnInit} from '@angular/core'; import { FormGroup, FormControl, FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES, Validators, FormBuilder, FormArray } from "@angular/forms"; import {Control} from "@angular/common"; ...
This example applies to maven projects. Add the jetty-maven-plugin to build element as below. <build> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version&g...
#lang racket (define (sum-of-list l) (if (null? l) 0 (+ (car l) (sum-of-list (cdr l))))) (sum-of-list '(1 2 3 4 5)) ;; => 15
#lang racket (letrec ([sum-of-list (λ (l) (if (null? l) 0 (+ (car l) (sum-of-list (cdr l)))))]) (sum-of-list '(1 2 3 4 5))) ;; => 15 It is possible to write mutually recursive functions with letrec: #lang ...
A normal let form binds each value to its corresponding identifier, before executing the body. With a "named let", the body can then recursively be re-executed, passing a new value for each identifier. #lang racket (let sum-of-list ([l '(1 2 3)]) (if (null? l) 0 (+ (car ...
#lang racket (require mzlib/etc) ((rec sum-of-list (λ (l) (if (null? l) 0 (+ (car l) (sum-of-list (cdr l)))))) '(1 2 3 4 5)) ;; => 15 ;; Outside of the rec form, sum-of-list gives an error: ;; sum-of-list: undefined; ;; cannot reference an identifier befor...
It is common practice to use higher order functions instead of recursion, if there is a higher order function which expresses the right recursion pattern. In our case, sum-of-numbers can be defined using foldl: #lang racket (define (sum-of-numbers l) (foldl + 0 l)) (sum-of-numbers '(1 2 3 4 5)...
Masonry is a library for objective-c but xamarin have created a binding for it and created it as a nuget package https://www.nuget.org/packages/Masonry/. Nuget install Install-Package Masonry This centers a button 100 points below the centre point of the containing view and sets a width between...
webpack 2 introduces tree shaking which can remove unused code when ES2015 modules are used to import and export code. Install npm install babel-preset-es2015-webpack --save-dev Usage in .babelrc: { "presets": [ "es2015-webpack" ] }

Page 886 of 1336