Tutorial by Examples: er

The semantics for this are similar to that of default value substitution, but instead of substituting a default value, it errors out with the provided error message. The forms are ${VARNAME?ERRMSG} and ${VARNAME:?ERRMSG}. The form with : will error our if the variable is unset or empty, whereas the ...
1. URLByDeletingPathExtension: If the receiver represents the root path, this property contains a copy of the original URL. If the URL has multiple path extensions, only the last one is removed. 2. URLByAppendingPathExtension: Returns a new URL made by appending a path extension to the original U...
Shortest match: $ a='I am a string' $ echo "${a#*a}" m a string Longest match: $ echo "${a##*a}" string
Shortest match: $ a='I am a string' $ echo "${a%a*}" I am Longest match: $ echo "${a%%a*}" I
First match: $ a='I am a string' $ echo "${a/a/A}" I Am a string All matches: $ echo "${a//a/A}" I Am A string Match at the beginning: $ echo "${a/#I/y}" y am a string Match at the end: $ echo "${a/%g/N}" I am a strinN Replace a pattern wi...
Inheritance is the biggest asset of the POM, where the following can be managed from super POM to child POM. dependencies developers and contributors plugin lists (including reports) plugin executions with matching ids plugin configuration The following enables the inheritance <paren...
For checking whether some object is of a certain class, the (binary) instanceof operator can be used since PHP version 5. The first (left) parameter is the object to test. If this variable is not an object, instanceof always returns false. If a constant expression is used, an error is thrown. The ...
An operator can be used to manipulate the flow of objects from Observable to Subscriber. Observable<Integer> integerObservable = Observable.just(1, 2, 3); // creating a simple Integer observable Subscriber<String> mSubscriber = new Subscriber<String>() { @Override publi...
You can use buffers to work with multiple files. When you open a file using :e path/to/file it opens in a new buffer (the command means edit the file). New buffer that holds a temporary copy of the file. You can go to previous buffer with :bp[rev] and next buffer with :bn[ext]. You can go to a...
Commands have one input (STDIN) and two kinds of outputs, standard output (STDOUT) and standard error (STDERR). For example: STDIN root@server~# read Type some text here Standard input is used to provide input to a program. (Here we're using the read builtin to read a line from STDIN.) STDO...
The ternary operator can be thought of as an inline if statement. It consists of three parts. The operator, and two outcomes. The syntax is as follows: $value = <operator> ? <true value> : <false value> If the operator is evaluated as true, the value in the first block will be ...
The ember data models have a toJSON method that extracts the relevant data: console.log(model.toJSON()); This method uses the JSONSerializer to create the JSON representation. If you want to log the data in a more app-specific way, you can use serialize: model.serialize(); which uses the se...
Supported by IE11+ View Result Use these 3 lines to vertical align practically everything. Just make sure the div/image you apply the code to has a parent with a height. CSS div.vertical { position: relative; top: 50%; transform: translateY(-50%); } HTML <div class="vertica...
The cubic-bezier function is a transition timing function which is often used for custom and smooth transitions. transition-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1); The function takes four parameters: cubic-bezier(P1_x, P1_y, P2_x, P2_y) These parameters will be mapped to points whic...
The following method computes the sum of integers from 0 to N using recursion. public int sum(final int n) { if (n > 0) { return n + sum(n - 1); } else { return n; } } This method is O(N) and can be reduced to a simple loop using tail-call optimization. In f...
The following method computes the value of num raised to the power of exp using recursion: public long power(final int num, final int exp) { if (exp == 0) { return 1; } if (exp == 1) { return num; } return num * power(num, exp - 1); } This illustrates ...
Hibernate can use two types of fetch when you are mapping the relationship between two entities: EAGER and LAZY. In general, the EAGER fetch type is not a good idea, because it tells JPA to always fetch the data, even when this data is not necessary. Per example, if you have a Person entity and th...
While there are many parameters that can be changed and variations that can be added depending on the desired functionality, this example lays out the basic framework for launching PowerPoint. Note: This code requires that the PowerPoint reference has been added to the active VBA Project. See th...
Suppose we have an interface: interface IPerson { name: string; age: number; breath(): void; } And we want to create more specific interface that has the same properties of the person, we can do it using the extends keyword: interface IManager extends IPerson { managerId:...
Install jquery via npm : npm install jquery --save Install typings for the library: To add typings for a library, do the following: typings install jquery --global --save Add jquery to angular-cli-build.js file to vendorNpmFiles array: This is required so the build system...

Page 92 of 417