Tutorial by Examples

There are three visibility types that you can apply to methods (class/object functions) and properties (class/object variables) within a class, which provide access control for the method or property to which they are applied. You can read extensively about these in the PHP Documentation for OOP Vi...
Include a row number according to the order specified. SELECT ROW_NUMBER() OVER(ORDER BY Fname ASC) AS RowNumber, Fname, LName FROM Employees
Uses a partition criteria to group the row numbering according to it. SELECT ROW_NUMBER() OVER(PARTITION BY DepartmentId ORDER BY DepartmentId ASC) AS RowNumber, DepartmentId, Fname, LName FROM Employees
This query selects all employees not on the Supervisors table. SELECT * FROM Employees WHERE EmployeeID not in (SELECT EmployeeID FROM Supervisors) The same results can be achieved using a LEFT JOIN. SELECT * FROM Employees AS e LEFT JOIN Supervisors AS s ON s.E...
Definition : When multiple methods with the same name are declared with different parameters, it is referred to as method overloading. Method overloading typically represents functions that are identical in their purpose but are written to accept different data types as their parameters. Factors af...
Jasmine can spy on an existing function using the spyOn function. let calculator = { multiply: function(a, b) { return a * b; }, square: function(a) { return this.multiply(a, a); } } describe('calculator', function() { it('squares numbers by multiplying them by the...
We can use jasmine.createSpy() to create a standalone spy. This is often useful if we need to pass a function as a callback to another function and want to test how it is used. // source code function each(arr, fn) { arr.forEach(fn); } // test code describe('each', function() { let m...
The NSDate class provides methods for creating NSDate objects corresponding to a given date and time. An NSDate can be initialized using the designated initializer, which: Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds. NSDate *date...
We can match on lists like any other data type, though they are somewhat unique, in that the constructor for building up lists is the infix function ::. (See the example Creating a list for more on how that works.) matchMyList : List SomeType -> SomeOtherType matchMyList myList = case myL...
Moment is a javascript library that was designed to make working with dates and times less time-consuming and more intuitive. You can easily start using this library by installing it in you web-app by using one of the following guides. Browser You can either download the JS file from the official...
If you're ever dealing with C Binary API's from Perl Code, via the syscall, ioctl, or fcntl functions, you need to know how to construct memory in a C Compatible way. For instance, if you were ever dealing with some function that expected a timespec, you'd look into /usr/include/time.h and find: s...
The procedure describes how to add an Object library reference, and afterwards how to declare new variables with reference to the new library class objects. The example below shows how to add the PowerPoint library to the existing VB Project. As can be seen, currently the PowerPoint Object library...
In addition to the standard makeLenses function for generating Lenses, Control.Lens.TH also offers the makeClassy function. makeClassy has the same type and works in essentially the same way as makeLenses, with one key difference. In addition to generating the standard lenses and traversals, if the ...
String literals imply no escaping or interpolation ( with the exception of quoting string terminators ) print 'This is a string literal\n'; # emits a literal \ and n to terminal print 'This literal contains a \'postraphe '; # emits the ' but not its preceding \ You can use alternative quoting...
Double-quoted strings use interpolation and escaping – unlike single-quoted strings. To double-quote a string, use either double quotes " or the qq operator. my $greeting = "Hello!\n"; print $greeting; # => Hello! (followed by a linefeed) my $bush = "They misunderestimat...
Large Multi-Line strings are burdensome to write. my $variable = <<'EOF'; this block of text is interpreted literally, no \'quotes matter, they're just text only the trailing left-aligned EOF matters. EOF NB: Make sure you ignore stack-overflows syntax highlighter: It is very wrong. A...
In Haskell, data types can have arguments just like functions. Take the Maybe type for example. Maybe is a very useful type which allows us to represent the idea of failure, or the possiblity thereof. In other words, if there is a possibility that a computation will fail, we use the Maybe type ther...
We have a sample Spring boot application which stores user data in MongoDB and we are using Rest services to retrieve data First there is a domain class i.e. POJO @Document public class User{ @Id private String id; private String name; } A corresponding repository based on ...
Oracle supports DATE (includes time to the nearest second) and TIMESTAMP (includes time to fractions of a second) datatypes, which allow arithmetic (addition and subtraction) natively. For example: To get the next day: select to_char(sysdate + 1, 'YYYY-MM-DD') as tomorrow from dual; To get the ...
The publisher-subscriber is a familiar concept given the rise of YouTube, Facebook and other social media services. The basic concept is that there is a Publisher who generates content and a Subscriber who consumes content. Whenever the Publisher generates content, each Subscriber is notified. Subsc...

Page 244 of 1336