Tutorial by Examples: ect

This method will work on modern versions of Arch, CentOS, CoreOS, Debian, Fedora, Mageia, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Ubuntu, and others. This wide applicability makes it an ideal as a first approach, with fallback to other methods if you need to also identify o...
A bi-directional value converter utilizes two methods in your Value Converter class: toView and fromView these methods are aptly named to signify which direction the data is flowing. In our example we will be creating a prepend Value Converter which will make sure that an amount entered in our app ...
use lib 'includes'; use MySuperCoolModule; use lib 'includes'; adds the relative directory includes/ as another module search path in @INC. So assume that you have a module file MySyperCoolModule.pm inside includes/, which contains: package MySuperCoolModule; If you want, you can group as ma...
The right-hand side of the assignment in a for loop can be any row vector. The left-hand side of the assignment can be any valid variable name. The for loop assigns a different element of this vector to the variable each run. other_row_vector = [4, 3, 5, 1, 2]; for any_name = other_row_vector ...
SELECT * FROM table1, table2 SELECT table1.column1, table1.column2, table2.column1 FROM table1, table2 This is called cross product in SQL it is same as cross product in sets These statements return the selected columns from multiple tables in one query....
A std::vector can be useful for returning a dynamic number of variables of the same type. The following example uses int as data type, but a std::vector can hold any type that is trivially copyable: #include <vector> #include <iostream> // the following function returns all integers...
BeautifulSoup has a limited support for CSS selectors, but covers most commonly used ones. Use select() method to find multiple elements and select_one() to find a single element. Basic example: from bs4 import BeautifulSoup data = """ <ul> <li class="item&quo...
demoApp.directive('demoDirective', function () { var directiveDefinitionObject = { multiElement: priority: terminal: scope: {}, bindToController: {}, controller: controllerAs: require: restrict: templateNamespace: template: templateU...
Sometimes it is appropriate to use an immutable empty collection. The Collections class provides methods to get such collections in an efficient way: List<String> anEmptyList = Collections.emptyList(); Map<Integer, Date> anEmptyMap = Collections.emptyMap(); Set<Number> anEmptySe...
It's possible to create a new ASP.NET Core project entirely from the command line using the dotnet command. dotnet new web dotnet restore dotnet run dotnet new web scaffolds a new "empty" web project. The web parameter tells the dotnet tool to use the ASP.NET Core Empty template. Use...
In case your project needs to be based on a specific Symfony version, use the optional second argument of the new command: # use the most recent version in any Symfony branch $ symfony new my_project_name 2.8 $ symfony new my_project_name 3.1 # use a specific Symfony version $ symfony new my_...
If you want to extend a class as-if you are a static function, for example for class Something add static looking function fromString, this can only work if the class has a companion object and that the extension function has been declared upon the companion object: class Something { compani...
Common table expressions support extracting portions of larger queries. For example: WITH sales AS ( SELECT orders.ordered_at, orders.user_id, SUM(orders.amount) AS total FROM orders GROUP BY orders.ordered_at, orders.user_id ) SELECT sales.ordered_at, sales.total,...
Average The AVG() aggregate function will return the average of values selected. SELECT AVG(Salary) FROM Employees Aggregate functions can also be combined with the where clause. SELECT AVG(Salary) FROM Employees where DepartmentId = 1 Aggregate functions can also be combined with group by ...
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...
Analog to get a collection for a Stream by collect() an array can be obtained by the Stream.toArray() method: List<String> fruits = Arrays.asList("apple", "banana", "pear", "kiwi", "orange"); String[] filteredFruits = fruits.stream() ....
Using the default constructor T variable = Activator.CreateInstance(typeof(T)); Using parameterized constructor T variable = Activator.CreateInstance(typeof(T), arg1, arg2);
First, import the libraries that work with files: from os import listdir from os.path import isfile, join, exists A helper function to read only files from a directory: def get_files(path): for file in listdir(path): full_path = join(path, file) if isfile(full_path): ...
If you need to call an Objective-C method from C code, you have two ways: using objc_msgSend, or obtaining the IMP (method implementation function pointer) and calling that. #import <objc/objc.h> @implementation Example - (double)negate:(double)value { return -value; } - (doubl...
// *** Find all the objects which is of type movie, Both the syntax are valid *** NSPredicate *filterByMovieType = [NSPredicate predicateWithFormat:@"self.isMovie = %@",@1]; // OR //NSPredicate *filterByMovieType = [NSPredicate predicateWithFormat:@"self.isMovie = %@",[NSNumbe...

Page 18 of 99