Tutorial by Examples: ect

{ "name": "my-project", "version": "0.0.1", "description": "This is a project.", "author": "Someone <[email protected]>", "contributors": [{ "name": "Som...
Look at the contents of /etc/redhat-release cat /etc/redhat-release Here is the output from a Fedora 24 machine: Fedora release 24 (Twenty Four) As mentioned in the debian-based response, you can also use the lsb_release -a command, which outputs this from a Fedora 24 machine: LSB Version: ...
Prerequisites iOS 7 or later, macOS 10.9 or later, all versions of tvOS and watchOS. Xcode 7.3 or later required. Installation Download the latest release of Realm files from here or from Github link and extract the zip. Navigate to ios/static/ directory Drag Realm.framework to t...
The Protractor API allows CSS element locators to use the jQuery-like shortcut notation $(). Normal CSS Element Locator: element(by.css('h1.documentation-text[ng-bind="title"]')); element(by.css('[ng-click="submit"])); Shortcut $() CSS Element Locator: $('h1.documentatio...
Destructuring is a convenient way to extract properties from objects into variables. Basic syntax: let person = { name: 'Bob', age: 25 }; let { name, age } = person; // Is equivalent to let name = person.name; // 'Bob' let age = person.age; // 25 Destructuring and renaming: le...
Swift import SystemConfiguration /// Class helps to code reuse in handling internet network connections. class NetworkHelper { /** Verify if the device is connected to internet network. - returns: true if is connected to any internet network, false if is not co...
Define a new type Person using namedtuple like this: Person = namedtuple('Person', ['age', 'height', 'name']) The second argument is the list of attributes that the tuple will have. You can list these attributes also as either space or comma separated string: Person = namedtuple('Person', 'age,...
Filter an enumeration by using a conditional expression Synonyms: Where-Object where ? Example: $names = @( "Aaron", "Albert", "Alphonse","Bernie", "Charlie", "Danny", "Ernie", "Frank") $names | Where-Object {...
Sort an enumeration in either ascending or descending order Synonyms: Sort-Object sort Assuming: $names = @( "Aaron", "Aaron", "Bernie", "Charlie", "Danny" ) Ascending sort is the default: $names | Sort-Object $names | sort Aaron Aa...
You can group an enumeration based on an expression. Synonyms: Group-Object group Examples: $names = @( "Aaron", "Albert", "Alphonse","Bernie", "Charlie", "Danny", "Ernie", "Frank") $names | Group-Object -Prope...
Projecting an enumeration allows you to extract specific members of each object, to extract all the details, or to compute values for each object Synonyms: Select-Object select Selecting a subset of the properties: $dir = dir "C:\MyFolder" $dir | Select-Object Name, FullName, Att...
To increment date objects in Javascript, we can usually do this: var checkoutDate = new Date(); // Thu Jul 21 2016 10:05:13 GMT-0400 (EDT) checkoutDate.setDate( checkoutDate.getDate() + 1 ); console.log(checkoutDate); // Fri Jul 22 2016 10:05:13 GMT-0400 (EDT) It is possible to use setD...
Start with an iterable which needs to be grouped lst = [("a", 5, 6), ("b", 2, 4), ("a", 2, 5), ("c", 2, 6)] Generate the grouped generator, grouping by the second element in each tuple: def testGroupBy(lst): groups = itertools.groupby(lst, key=lambda...
Enter these commands in Android device Terminal su setprop service.adb.tcp.port 5555 stop adbd start adbd After this, you can use CMD and ADB to connect using the following command adb connect 192.168.0.101.5555 And you can disable it and return ADB to listening on USB with setprop servi...
Arrays You can iterate over nested arrays: [[1, 2], [3, 4]].each { |(a, b)| p "a: #{ a }", "b: #{ b }" } The following syntax is allowed too: [[1, 2], [3, 4]].each { |a, b| "a: #{ a }", "b: #{ b }" } Will produce: "a: 1" "b: 2" ...
The simplest example of an injection in an Angular app - injecting $scope to an Angular Controller: angular.module('myModule', []) .controller('myController', ['$scope', function($scope) { $scope.members = ['Alice', 'Bob']; ... }]) The above illustrates an injection of a $scope into ...
There is also an option to dynamically request components. You can do it using the $injector service: myModule.controller('myController', ['$injector', function($injector) { var myService = $injector.get('myService'); }]); Note: while this method could be used to prevent the circular depen...
Equivalently, we can use the $inject property annotation to achieve the same as above: var MyController = function($scope) { // ... } MyController.$inject = ['$scope']; myModule.controller('MyController', MyController);
Subqueries can also be used in the SELECT part of the outer query. The following query shows all weather table columns with the corresponding states from the cities table. SELECT w.*, (SELECT c.state FROM cities AS c WHERE c.name = w.city ) AS state FROM weather AS w;
One (or two) of the coolest new features in recent Xcode releases are the IBInspectable properties and IBDesignable UIViews. These have nothing to do with the functionality of your application but instead impact the developer experience in Xcode. The goal is to be able to visually inspect custom v...

Page 14 of 99