Tutorial by Examples: def

String hubUrl = "http://localhost:4444/wd/hub" DesiredCapabilities capability = DesiredCapabilities.firefox(); //or which browser you want RemoteWebDriver driver = new RemoteWebDriver(hubUrl, capability);
ElementAt will return the item at index n. If n is not within the range of the enumerable, throws an ArgumentOutOfRangeException. int[] numbers = { 1, 2, 3, 4, 5 }; numbers.ElementAt(2); // 3 numbers.ElementAt(10); // throws ArgumentOutOfRangeException ElementAtOrDefault will return the item...
Components in Vue are like widgets. They allow us to write reusable custom elements with desired behavior. They are nothing but objects which can contain any/all of the options that the root or any Vue instance can contain, including an HTML template to render. Components consist of: HTML marku...
Open the psql command line tool connected to the database where your table is. Then type the following command: \d tablename To get extended information type \d+ tablename If you have forgotten the name of the table, just type \d into psql to obtain a list of tables and views in the current ...
deftest is a macro for defining a unit test, similar to unit tests in other languages. You can create a test as follows: (deftest add-nums (is (= 2 (+ 1 1))) (is (= 3 (+ 1 2)))) Here we are defining a test called add-nums, which tests the + function. The test has two assertions. You can ...
Just like in case of the function arguments, template parameters can have their default values. All template parameters with a default value have to be declared at the end of the template parameter list. The basic idea is that the template parameters with default value can be omitted while template ...
<div tabindex="2">Second</div> <div tabindex="1">First</div> Positive values will insert the element at the tabbing order position of its respective value. Elements without preference (i.e. tabindex="0" or native elements such as button and a...
#include <stdio.h> #include <stdlib.h> int main (void) { int * pdata; size_t n; printf ("Enter the size of the array: "); fflush(stdout); /* Make sure the prompt gets printed to buffered stdout. */ if (1 != scanf("%zu", &n)) /* If zu is n...
5.1 JavaScript does not directly support enumerators but the functionality of an enum can be mimicked. // Prevent the enum from being changed const TestEnum = Object.freeze({ One:1, Two:2, Three:3 }); // Define a variable with a value from the enum var x = TestEnum.Two; // Prin...
Consider the following component with one input myInput and an internal value called someInternalValue. Both of them are used in a component's template. import {Component, Input} from '@angular/core'; @Component({ template:` <div> <p>{{myInput}}</p> <p>{...
You often find yourself in a situation where you need to find a variables corresponding value, and collections got you covered. In the example below we got three different locales in an array with a corresponding calling code assigned. We want to be able to provide a locale and in return get the as...
ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); Web oWebsite = clientContext.Web; BasePermissions permissions = new BasePermissions(); permissions.Set(PermissionKind.CreateAlerts); permissions.Set(PermissionKind.ManageAlerts); RoleDefi...
extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; #[derive(Deserialize, Debug)] struct Request { // Use the result of a function as the default if "resource" is // not included in the input. #[serde(default="default_resource&quot...
You can give alias names to a struct: typedef struct Person { char name[32]; int age; } Person; Person person; Compared to the traditional way of declaring structs, programmers wouldn't need to have struct every time they declare an instance of that struct. Note that the name Pers...
union U { int a; short b; float c; }; U u; u.a = 10; if (u.b == 10) { // this is undefined behavior since 'a' was the last member to be // written to. A lot of compilers will allow this and might issue a // warning, but the result will be "as expected"; thi...
Some of the additional attributes are parsed by the npm website like repository, bugs or homepage and shown in the infobox for this packages { "main": "server.js", "repository" : { "type": "git", "url": "git+https:/...
Most modern distributions will come with BASH (Bourne Again SHell) pre-installed and configured as a default shell. The command (actually an executable binary, an ELF) that is responsible for changing shells in Linux is chsh (change shell). We can first check which shells are already installed and...
A definition of a term or concept. <span role="term" aria-labelledby="def1">Love</span> <span id="def1" role="definition">an intense feeling of deep affection.</span>
defaultProps allows you to set default, or fallback, values for your component props. defaultProps are useful when you call components from different views with fixed props, but in some views you need to pass different value. Syntax ES5 var MyClass = React.createClass({ getDefaultProps: ...
Some basic types and classes in Java are fundamentally mutable. For example, all array types are mutable, and so are classes like java.util.Data. This can be awkward in situations where an immutable type is mandated. One way to deal with this is to create an immutable wrapper for the mutable type...

Page 8 of 27