Tutorial by Examples: e

This example illustrates how the default key is chosen if we do not specify any c = groupby(['goat', 'dog', 'cow', 1, 1, 2, 3, 11, 10, ('persons', 'man', 'woman')]) dic = {} for k, v in c: dic[k] = list(v) dic Results in {1: [1, 1], 2: [2], 3: [3], ('persons', 'man', 'woman'): [('...
Notice in this example that mulato and camel don't show up in our result. Only the last element with the specified key shows up. The last result for c actually wipes out two previous results. But watch the new version where I have the data sorted first on same key. list_things = ['goat', 'dog', 'do...
In this example we see what happens when we use different types of iterable. things = [("animal", "bear"), ("animal", "duck"), ("plant", "cactus"), ("vehicle", "harley"), \ ("vehicle", "speed b...
package MyHiveUDFs; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.hive.ql.exec.UDF; import org.apache.hadoop.io.Text; public class Strip extends UDF { private Text result = new Text(); public Text evaluate(Text str) { if(str == null) { return null; } resul...
class ParentClass { [string] $Message = "Its under the Parent Class" [string] GetMessage() { return ("Message: {0}" -f $this.Message) } } # Bar extends Foo and inherits its members class ChildClass : ParentClass { } $Inherit = [ChildClass...
Algorithm BFS(G) Input graph G Output labeling of the edges and partition of the vertices of G for all u ∈ G.vertices() setLabel(u, UNEXPLORED) for all e ∈ G.edges() setLabel (e, UNEXPLORED) for all v ∈ G.vertices() if getLabel(v) = UNEXPLORED ...
From Java 8 onwards, the Lambda operator ( -> ) is the operator used to introduce a Lambda Expression. There are two common syntaxes, as illustrated by these examples: Java SE 8 a -> a + 1 // a lambda that adds one to its argument a -> { return a + 1; } // an equivalen...
Naturally, being able to install hard drive cloning utilities can be an important aspect of installing and maintaining your operating system. Getting set up with Clonezilla is surprisingly less straightforward than I'd have expected. The wealth of options, while valuable, also makes each part of id...
index.html: <html ng-app="masterAngularMaterial"> <head> <!-- This is important (meta) --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Angular and other dependencies --> ...
Make sure you link the Angular and Angular Material libraries! index.html: <html ng-app="mdButtonApp"> <head> <!-- Import Angular --> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script&gt...
This example will be using the class md-icon-button, which must be applied to <md-button> in order to get an icon button. It is also recommended to add an aria-label attribute to <md-button> for accessibility purpose or the ARIA provider will throw a warning that there is no aria-labe...
Starting with version 3.2 of the ArcGIS API for JavaScript, developers must include an additional Cascading Style Sheet (CSS) file: esri.css. The URL for this file is: // versions 3.11 and forward <link rel="stylesheet" href="https://js.arcgis.com/API-VERSION/esri/css/esri.css&...
The esri.css file does not include the CSS for various Dojo widgets or themes like tundra or claro; those files must be included separately. Exceptions are the Grid and RangeSlider, which are used by widgets in the API. Grid styles must be explicitly included. For instance, this CSS file would be i...
Let's take this example without using generics protocol JSONDecodable { static func from(_ json: [String: Any]) -> Any? } The protocol declaration seems fine unless you actually use it. let myTestObject = TestObject.from(myJson) as? TestObject Why do you have to cast the result to T...
import { BrowserModule } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { Component, DebugElement } from '@angular/core'; import { dispatchEvent } from "@an...
Introduction When working with various libraries and their associated requirements, it is often necessary to know the version of current PHP parser or one of it's packages. This function accepts a single optional parameter in the form of extension name: phpversion('extension'). If the extension in...
/* Define a query named q1 for the Customer table */ DEFINE QUERY q1 FOR Customer. /* Open the query for all Customer records where the state is "tx" */ OPEN QUERY q1 FOR EACH Customer WHERE Customer.state ='TX'. ...
This query will join three tables: Customer, Order and Orderline. The use of the OF statement as in childtable OF parenttable assumes that indexes are constructed in a specific way. That is the case in the sports2000-database. DEFINE QUERY q1 FOR Customer, Order, Orderline. OPEN QUERY q1 FOR EA...
Informats are used to tell SAS how to read in the data and are identified with an informat statement. data test; infile test.csv; informat id $6. date mmddyy10. cost comma10.2 ; input @1 id @7 date @20 cost ; run; Informats and Format...
Keras is a high-level neural networks library, written in Python and capable of running on top of either TensorFlow or Theano. It was developed with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research. Use Keras ...

Page 971 of 1191