Tutorial by Examples

Ideally, Prolog predicates can be used in all directions. For many pure predicates, this is also actually the case. However, some predicates only work in particular modes, which means instantiation patterns of their arguments. By convention, the most common argument order for such predicates is: ...
A function that is declared constexpr is implicitly inline and calls to such a function potentially yield constant expressions. For example, the following function, if called with constant expression arguments, yields a constant expression too: C++11 constexpr int Sum(int a, int b) { return ...
.git/hooks/pre-commit #!/bin/sh if [ -s pom.xml ]; then echo "Running mvn verify" mvn clean verify if [ $? -ne 0 ]; then echo "Maven build failed" exit 1 fi fi
Prior to C++17, when writing a template non-type parameter, you had to specify its type first. So a common pattern became writing something like: template <class T, T N> struct integral_constant { using type = T; static constexpr T value = N; }; using five = integral_constant&l...
Prior to C++17, template deduction cannot deduce the class type for you in a constructor. It must be explicitly specified. Sometimes, however, these types can be very cumbersome or (in the case of lambdas) impossible to name, so we got a proliferation of type factories (like make_pair(), make_tuple(...
To add a remote, use git remote add in the root of your local repository. For adding a remote Git repository <url> as an easy short name <name> use git remote add <name> <url> The command git fetch <name> can then be used to create and update remote-tracking branch...
Rename the remote named <old> to <new>. All remote-tracking branches and configuration settings for the remote are updated. To rename a remote branch name dev to dev1 : git remote rename dev dev1
Remove the remote named <name>. All remote-tracking branches and configuration settings for the remote are removed. To remove a remote repository dev: git remote rm dev
To list all configured remote repositories, use git remote. It shows the short name (aliases) of each remote handle that you have configured. $ git remote premium premiumPro origin To show more detailed information, the --verbose or -v flag can be used. The output will include the URL and th...
Types used in Sets and Dictionaries(key) must conform to Hashable protocol which inherits from Equatable protocol. Custom type conforming to Hashable protocol must implement A calculated property hashValue Define one of the equality operators i.e. == or !=. Following example implements Hasha...
Create a basic application with single view application template with swift as language Add SWRevealViewController.h and SWRevealViewController.m then click on Create Bridging Header button and add #import "SWRevealViewController.h" on the Bridging header Then select viewControll...
LINQ provides a method that makes it easy to create a collection filled with sequential numbers. For example, you can declare an array which contains the integers between 1 and 100. The Enumerable.Range method allows us to create sequence of integer numbers from a specified start position and a num...
When we want to change root password in windows, We need to follow following steps : Step 1 : Start your Command Prompt by using any of below method : Perss Crtl+R or Goto Start Menu > Run and then type cmd and hit enter Step 2 : Change your directory to where MYSQL is installed, In my case i...
In your command line, get in the directory you want to create the project in, then type: composer create-project zendframework/skeleton-application helloWorldTest. During installation, you will be asked if you want a minimal install: Let's say yes for the moment, we are just testing. For simplicity...
It's a good practice to cache loaded result to avoid multiple loading of same data. To invalidate cache onContentChanged() should be called. If loader has been already started, forceLoad() will be called, otherwise (if loader in stopped state) loader will be able to understand content change with ta...
Suppose you have a collection elements, and you want to create another collection containing the same elements but with all duplicates eliminated: Collection<Type> noDuplicates = new HashSet<Type>(elements); Example: List<String> names = new ArrayList<>( Arrays....
Let's see MVP in action using a simple Login Screen. There are two Buttons—one for login action and another for a registration screen; two EditTexts—one for the email and the other for the password. LoginFragment (The View) public class LoginFragment extends Fragment implements LoginContract.Prese...
The JAXB Reference Implementation (JAXB-RI) has been included with the Java Development Kit since JDK 6 update 3. Refer to the Unofficial JAXB Guide for additional details on which JAXB-RI version is included with specific versions of the JDK.
// First load a product object $product->getSku(); $product->getName(); // Alternative method $product->getData('sku'); $product->getData('name');
// First load a collection object foreach($collection as $product) { $product->getSku(); $product->getName(); // Alternative method $product->getData('sku'); $product->getData('name'); }

Page 627 of 1336