Tutorial by Examples: ect

This can be done in the following two ways - cts:search( fn:collection("first-collection"), cts:word-query("marklogic")) In this, the scope is changed from all the documents to documents in collection "first-collection" only. In the second approach, use ...
The :last-of-type selects the element that is the last child, of a particular type, of its parent. In the example below, the css selects the last paragraph and the last heading h1. p:last-of-type { background: #C5CAE9; } h1:last-of-type { background: #CDDC39; } <div class="c...
The methods object.wait(), object.notify() and object.notifyAll() are meant to be used in a very specific way. (see http://stackoverflow.com/documentation/java/5409/wait-notify#t=20160811161648303307 ) The "Lost Notification" problem One common beginner mistake is to unconditionally cal...
You can create extension methods to improve usability for nested collections like a Dictionary with a List<T> value. Consider the following extension methods: public static class DictListExtensions { public static void Add<TKey, TValue, TCollection>(this Dictionary<TKey, TColl...
Sometimes it's useful to test private & protected methods as well as public ones. class Car { /** * @param mixed $argument * * @return mixed */ protected function drive($argument) { return $argument; } /** * @return bool *...
Selection with increasing scope This comes handy when you want to select a block to extract a variable / method etc, no need to do a precise bracket matching, just put the caret somewhere in the statement and keep doing this Windows: Ctrl + W OS X / macOS: Cmd + W Selection with decreasing scope...
After launching Visual Studio 2015, go to File → New → Project. In the New Project dialog box, browse in the templates tree to Visual C# → Windows → Universal and select Blank App (Universal Windows). Next, we need to fill the form to describe the Application: Name: this is the name of the appli...
Similar to enabling all HTTP content, all configuration happens under the App Transport Security Settings. Add the Exception Domains dictionary (NSExceptionDomains) to the top level ATS settings. For every domain, add a dictionary item to the Exception Domains, where the key is the domain in questi...
If you have multiple libraries in the same solution, you can add local (project) references between them: { "dependencies": { "NETStandard.Library": "1.6.0", "MyOtherLibrary": { "target": "project" } }...
This is a basic project that uses FXML, created with NetBeans (New Project -> JavaFX -> JavaFX FXML Application). It contains just three files: Main Application class package org.stackoverflow; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Par...
This is a snippet of master report. Two parameters and the connection (for example, jdbc) are passing to the subreport. One value is returned from the subreport back to the master report, this value (variable) can be used in master report <subreport> <reportElement x="0" y=&...
This topic explains the concept of an object reference; it is targeted at people who are new to programming in Java. You should already be familiar with some terms and meanings: class definition, main method, object instance, and the calling of methods "on" an object, and passing parameter...
$ a='I am a string with spaces' $ [ $a = $a ] || echo "didn't match" bash: [: too many arguments didn't match [ $a = $a ] was interpreted as [ I am a string with spaces = I am a string with spaces ]. [ is the test command for which I am a string with spaces is not a single argument...
Classes have instance variable (dependencies), on which they call methods. Example taken from http://www.jamesshore.com/Blog/Dependency-Injection-Demystified.html for reference public class Example { private DatabaseThingie myDatabase; public Example() { myDatabase = new DatabaseTh...
A for loop iterates from the starting value down to the ending value inclusive, as a "count-down" example. program CountDown; {$APPTYPE CONSOLE} var i : Integer; begin for i := 10 downto 0 do WriteLn(i); end. Output: 10 9 8 7 6 5 4 3 2 1 0
/** * @var \Vendor\Module\Helper\Data */ protected $customHelper; /** * Constructor call * @param \Vendor\Module\Helper\Data $customHelper */ public function __construct( \Vendor\Module\Helper\Data $customHelper ) { $this->customHelper = $customHelper; parent::__co...
Let's say we have a table team_person as below: +======+===========+ | team | person | +======+===========+ | A | John | +------+-----------+ | B | Smith | +------+-----------+ | A | Walter | +------+-----------+ | A | Louis | +------+-----------+ | C | ...
R contains a Date class, which is created with as.Date(), which takes a string or vector of strings, and if the date is not in ISO 8601 date format YYYY-MM-DD, a formatting string of strptime-style tokens. as.Date('2016-08-01') # in ISO format, so does not require formatting string ## [1] &quot...
Create a testing class in the src/test/scala directory, in a file named HelloWorldSpec.scala. Put this inside the file: import org.scalatest.{FlatSpec, Matchers} class HelloWorldSpec extends FlatSpec with Matchers { "Hello World" should "not be an empty String" in { ...
This example has two parts - some boilerplate steps for adding Castle Windsor to your WCF service, and then a simple, concrete example to show how we configure and use Windsor's container. That makes the example a little bit long. If you already understand using a DI container then you likely only ...

Page 57 of 99