Tutorial by Examples: f

The Abstract Factory Pattern is a creational design pattern that can be used to define specific instances or classes without having to specify the exact object that is being created. function Car() { this.name = "Car"; this.wheels = 4; } function Truck() { this.name = "Truck"; ...
template <class InputIterator, class UnaryPredicate> InputIterator find_if (InputIterator first, InputIterator last, UnaryPredicate pred); Effects Finds the first element in a range for which the predicate function pred returns true. Parameters first => iterator pointing to the begin...
/* PL/SQL is a core Oracle Database technology, allowing you to build clean, secure, optimized APIs to SQL and business logic. */ set serveroutput on BEGIN DBMS_OUTPUT.PUT_LINE ('Hello World!'); END;
The "host" can be either a host name or an IP address. Also, it can involve wild cards. GRANT SELECT ON db.* TO sam@'my.domain.com' IDENTIFIED BY 'foo'; Examples: Note: these usually need to be quoted localhost -- the same machine as mysqld 'my.domain.com' -- a specific domain; th...
// Usage: var arc={ cx:150, cy:150, innerRadius:75, outerRadius:100, startAngle:-Math.PI/4, endAngle:Math.PI } drawArc(arc,'skyblue','gray',4); function drawArc(a,fill,stroke,strokewidth){ ctx.beginPath(); ctx.arc(a.cx,a.cy,a.innerRadius,a.startAngle,a.endAngle); ...
Before you start the cherry-pick process, you can check if the commit you want to cherry-pick already exists in the target branch, in which case you don't have to do anything. git branch --contains <commit> lists local branches that contain the specified commit. git branch -r --contains <...
Create a Java class which extends org.apache.hadoop.hive.ql.exec.hive.UDAF Create an inner class which implements UDAFEvaluator Implement five methods init() – This method initializes the evaluator and resets its internal state. We are using new Column() in the code below to indicate th...
A regex pattern where a DOTALL modifier (in most regex flavors expressed with s) changes the behavior of . enabling it to match a newline (LF) symbol: /cat (.*?) dog/s This Perl-style regex will match a string like "cat fled from\na dog" capturing "fled from\na" into Group 1....
Another example is a MULTILINE modifier (usually expressed with m flag (not in Oniguruma (e.g. Ruby) that uses m to denote a DOTALL modifier)) that makes ^ and $ anchors match the start/end of a line, not the start/end of the whole string. /^My Line \d+$/gm will find all lines that start with My...
The common modifier to ignore case is i: /fog/i will match Fog, foG, etc. The inline version of the modifier looks like (?i). Notes: In Java, by default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching c...
The modifier that allows using whitespace inside some parts of the pattern to format it for better readability and to allow comments starting with #: /(?x)^ # start of string (?=\D*\d) # the string should contain at least 1 digit (?!\d+$) # the string cannot consist of digi...
This is a .NET regex specific modifier expressed with n. When used, unnamed groups (like (\d+)) are not captured. Only valid captures are explicitly named groups (e.g. (?<name> subexpression)). (?n)(\d+)-(\w+)-(?<id>\w+) will match the whole 123-1_abc-00098, but (\d+) and (\w+) won't...
The UNICODE modifier, usually expressed as u (PHP, Python) or U (Java), makes the regex engine treat the pattern and the input string as Unicode strings and patterns, make the pattern shorthand classes like \w, \d, \s, etc. Unicode-aware. /\A\p{L}+\z/u is a PHP regex to match strings that consis...
The PCRE-compliant PCRE_DOLLAR_ENDONLY modifier that makes the $ anchor match at the very end of the string (excluding the position before the final newline in the string). /^\d+$/D is equal to /^\d+\z/ and matches a whole string that consists of 1 or more digits and will not match "123...
Another PCRE-compliant modifier expressed with /A modifier. If this modifier is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the start of the string which is being searched (the "subject string"). This effect can also be achieved by ap...
The PCRE-compliant PCRE_UNGREEDY flag expressed with /U. It switches greediness inside a pattern: /a.*?b/U = /a.*b/ and vice versa.
One more PCRE modifier that allows the use of duplicate named groups. NOTE: only inline version is supported - (?J), and must be placed at the start of the pattern. If you use /(?J)\w+-(?:new-(?<val>\w+)|\d+-empty-(?<val>[^-]+)-collection)/ the "val" group values will be ...
A PCRE modifier that causes an error if any backslash in a pattern is followed by a letter that has no special meaning. By default, a backslash followed by a letter with no special meaning is treated as a literal. E.g. /big\y/ will match bigy, but /big\y/X will throw an exception. Inline v...
Dojo provides us various themes like tundra, claro etc. Load themes using link tag in your HTML page pointing to Google CDN.
numpy.dot can be used to multiply a list of vectors by a matrix but the orientation of the vectors must be vertical so that a list of eight two component vectors appears like two eight components vectors: >>> a array([[ 1., 2.], [ 3., 1.]]) >>> b array([[ 1., 2., ...

Page 236 of 457