Tutorial by Examples: f

At it's most basic level, acceptance testing is essentially black-box testing, which is fundamentally concerned with testing inputs and outputs of a closed system. As such, there are three essential features to acceptance testing: locating a resource, reading data, and writing data. When it comes to...
To upload a file, you'll first need to create a /data directory, and add the file you'll want to upload. tests/nightwatch/data/IM-0001-1001.dcm Your form will need an input with type of file. (Some people don't like the styling options this input provides; and a common pattern is to make this in...
Cgo enables the creation of Go packages that call C code. To use cgo write normal Go code that imports a pseudo-package "C". The Go code can then refer to types such as C.int, or functions such as C.Add. The import of "C" is immediately preceded by a comment, that comment, call...
In [1]: import pandas as pd In [2]: df = pd.DataFrame(columns = ['A', 'B', 'C']) In [3]: df Out[3]: Empty DataFrame Columns: [A, B, C] Index: [] Appending a row by a single column value: In [4]: df.loc[0, 'A'] = 1 In [5]: df Out[5]: A B C 0 1 NaN NaN Appending a ...
Enable validation using annotations in app/config/config.yml file framework: validation: { enable_annotations: true } Create an Entity in AppBundle/Entity directory. The validations are made with @Assert annotations. <?php # AppBundle/Entity/Car.php namespace AppBundle\Ent...
Create an Entity in AppBundle/Entity directory. You can do this manually, or by using Symfony's command php bin/console doctrine:generate:entity and filling in the required information in each step. You must specify yml option at Configuration format (yml, xml, php or annotation) step. <?php...
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...
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 ...
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 { ...
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"; ...
#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
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)...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { // Can also use .get({id: 1}) return r.db("stackoverflow").table("examples").get(1).run(conn) }).then((result) => { console.log(result); })
The following code can be found in a demo here: https://ellie-app.com/mbFwJT9jD3/0 import Html exposing (..) import Json.Decode exposing (Decoder) payload = """ [{ "id": 0, "name": "Adam Carter", "work": "Uni...
First, import modules and set connection strings. If you need parameters, you can either put them directly in the URL string (an API in this case) or build them as a dict and pass them to the params argument. import requests import json params = {'id': 'blahblah', 'output': 'json'} # You could ...
The row heigths or column widths of multiple Grids can be synchronized by setting a common SharedSizeGroup on the rows or columns to synchronize. Then a parent control somewhere up in the tree above the Grids needs to have the attached property Grid.IsSharedSizeScope set to True. <StackPanel Gri...
A lot of emoji consist of more than one code point. 🇯🇵: A flag is defined as a pair of "regional symbol indicator letters" (🇯 + 🇵) 🙋🏿: Some emoji may be followed by a skin tone modifier: 🙋 + 🏿 😀︎ or 😀️: Windows 10 allows you to specify if an emoji is colored or black/white b...
Imagine the following XML: <root> <element foobar="hello_world" /> <element example="this is one!" /> </root> /root/element[@foobar] and will return the <element foobar="hello_world" /> element.

Page 299 of 457