Tutorial by Examples

While running any web application it’s necessary to take loading time into consideration. If your code tries to access any element that is not yet loaded, WebDriver will throw an exception and your script will stop. There are three types of Waits - Implicit Waits Explicit Waits Fluent Waits ...
In explicit wait, you expect for a condition to happen. For example you want to wait until an element is clickable. Here is a demonstration of a few common problems. Please note: In all of these examples you can use any By as a locator, such as classname, xpath, link text, tag name or cssSelector ...
In Racket, we use recursion very frequently. Here is an example of a function that sums all of the numbers from zero to the parameter, n. (define (sum n) (if (zero? n) 0 (+ n (sum (sub1 n))))) Note that there are many helpful convenience based functions used here, such as ...
Standard properties Depending on the type of the property, there are up to 3 methods for a single property. Let <property> denote the name of a property and <Property> the name of the property with an uppercase first letter. And let T be the type of the property; for primitive wrappers ...
The following example shows the declaration of a property (StringProperty in this case) and demonstrates how to add a ChangeListener to it. import java.text.MessageFormat; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.beans.value.Ch...
This example shows how to use a readonly wrapper property to create a property that cannot be written to. In this case cost and price can be modified, but profit will always be price - cost. import java.text.MessageFormat; import javafx.beans.property.IntegerProperty; import javafx.beans.property...
The following example remaps the key Z to Y and vice versa, e.g. if you want to work with the QWERTY layout on a QWERTZ keyboard. z::y y::z
# list gem sources: gem sources -l # remove default gem source: gem sources -r https://rubygems.org/ # add other gem sources: gem sources -a https://ruby.taobao.org/
Mostly used under ng-repeat ngValue is useful when dynamically generating lists of radio buttons using ngRepeat <script> angular.module('valueExample', []) .controller('ExampleController', ['$scope', function($scope) { $scope.names = ['pizza', 'unicorns', 'robots']; ...
Overall the easiest way to work with JSON is to have a case class mapping directly to the JSON (same fields name, equivalent types, etc.). case class Person( name: String, age: Int, hobbies: Seq[String], pet: Pet ) case class Pet( name: String, `type`: String ) // these...
Prerequisites Intellij IDEA installed (Community or Ultimate edition) Scala Plugin installed in IntelliJ A standard Play project, created for instance with Activator (activator new [nameoftheproject] play-scala). Opening the project Open IntelliJ IDEA Go to menu File > Open ... > c...
It is very easy to pass information between threads using the MVar a type and its accompanying functions in Control.Concurrent: newEmptyMVar :: IO (MVar a) -- creates a new MVar a newMVar :: a -> IO (MVar a) -- creates a new MVar with the given value takeMVar :: MVar a -> IO a -- retrieve...
Summary: MVVM is an architectural pattern that is represented by three distinct components, the Model, View and ViewModel. In order to understand these three layers, it is necessary to briefly define each, followed by an explanation of how they work together. Model is the layer that drives the bus...
The BubbleSort compares each successive pair of elements in an unordered list and inverts the elements if they are not in order. The following example illustrates the bubble sort on the list {6,5,3,1,8,7,2,4} (pairs that were compared in each step are encapsulated in '**'): {6,5,3,1,8,7,2,4} {**5...
qmake is a build automation tool, which is shipped with Qt framework. It does similar job to tools such as CMake or GNU Autotools, but it is designed to be used specifically with Qt. As such it is well integrated with Qt ecosystem, notably Qt Creator IDE. If you start Qt Creator and select File -&g...
Debugging is a very powerful way to have a closer look and fix incorrectly working (or non working) code. Run code step by step First thing you need to do during debugging is to stop the code at specific locations and then run it line by line to see whether that happens what's expected. Breakp...
In VBA, Strings can be declared with a specific length; they are automatically padded or truncated to maintain that length as declared. Public Sub TwoTypesOfStrings() Dim FixedLengthString As String * 5 ' declares a string of 5 characters Dim NormalString As String Debug.Print Fi...
The JavaScript coding convention is to place the starting bracket of blocks on the same line of their declaration: if (...) { } function (a, b, ...) { } Instead of in the next line: if (...) { } function (a, b, ...) { } This has been adopted to avoid semicolon insertion ...
The practice of replacing an object with a test double that verifies expectations, for instance asserting that a method has been called, is referred to as mocking. Lets assume we have SomeService to test. class SomeService { private $repository; public function __construct(Repository $r...
Since arrays are reference types, an array variable can be null. To declare a null array variable, you must declare it without a size: Dim array() As Integer Or Dim array As Integer() To check if an array is null, test to see if it Is Nothing: Dim array() As Integer If array Is Nothing Th...

Page 598 of 1336