Tutorial by Examples: dc

Break and continue statements can be followed by an optional label which works like some kind of a goto statement, resumes execution from the label referenced position for(var i = 0; i < 5; i++){ nextLoop2Iteration: for(var j = 0; j < 5; j++){ if(i == j) break nextLoop2Iteration; ...
Information The ABSTRACT and FINAL additions to the METHODS and CLASS statements allow you to define abstract and final methods or classes. An abstract method is defined in an abstract class and cannot be implemented in that class. Instead, it is implemented in a subclass of the class. Abstra...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="M 10,10 l 90,90 M 100,10 l -90,90" stroke="red" stroke-width="10" /> </svg> Result:
Loop control statements are used to change the flow of execution from its normal sequence. When execution leaves a scope, all automatic objects that were created in that scope are destroyed. The break and continue are loop control statements. The break statement terminates a loop without any furthe...
The following example adds a column admin to the users table, and gives that column the default value false. class AddDetailsToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :admin, :boolean, default: false end end Migrations with defaults might take a long tim...
DCGs can be used for parsing. Best of all, the same DCG can often be used to both parse and generate lists that are being described. For example: sentence --> article, subject, verb, object. article --> [the]. subject --> [woman] | [man]. verb --> [likes] | [enjoys]. object ...
<template name="myTemplate"> {{#each results}} <div><span>{{name}}</span><span>{{age}}</span></div> {{/each}} </template> Template.myTemplate.onCreated(function() { this.results = new ReactiveVar(); Meteor.call('myMethod'...
To create a background session // Swift: let mySessionID = "com.example.bgSession" let bgSessionConfig = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(mySessionID) let session = NSURLSession(configuration: bgSessionConfig) // add tasks here //...
3D transforms can be use to create many 3D shapes. Here is a simple 3D CSS cube example: HTML: <div class="cube"> <div class="cubeFace"></div> <div class="cubeFace face2"></div> </div> CSS: body { perspective-origin: 5...
[^0-9a-zA-Z] This will match all characters that are neither numbers nor letters (alphanumerical characters). If the underscore character _ is also to be negated, the expression can be shortened to: [^\w] Or: \W In the following sentences: Hi, what's up? I can't wait for 2017!...
[^0-9] This will match all characters that are not ASCII digits. If Unicode digits are also to be negated, the following expression can be used, depending on your flavor/language settings: [^\d] This can be shortened to: \D You may need to enable Unicode character properties support expl...
A list of recognised color keyword names can be found in the W3C Recommendation for SVG. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle r="30" cx="100" cy="100" fill="red" stroke=&qu...
C++17 Normally, elision is an optimization. While virtually every compiler support copy elision in the simplest of cases, having elision still places a particular burden on users. Namely, the type who's copy/move is being elided must still have the copy/move operation that was elided. For example:...
After you've created and registered your platform-specific classes you can start hooking them up to your shared code. The following page contains a button that triggers the text-to-speech functionality using a pre-defined sentence. It uses DependencyService to retrieve a platform-specific implementa...
It's fairly common that you may create a class that implements IDisposable, and then derive classes that also contain managed resources. It is recommendeded to mark the Dispose method with the virtual keyword so that clients have the ability to cleanup any resources they may own. public class Paren...
The policy builder allows you to build sophisticated policies. app.UseCors(builder => { builder.WithOrigins("http://localhost:5000", "http://myproductionapp.com") .WithMethods("GET", "POST", "HEAD") .WithHeaders(&quo...
HTML also provides the tables with the <thead>, <tbody>, <tfoot>, and <caption> elements. These additional elements are useful for adding semantic value to your tables and for providing a place for separate CSS styling. When printing out a table that doesn't fit onto one (pa...
The following code broadcasts the contents in buffer among all the processes belonging to the MPI_COMM_WORLD communicator (i.e. all the processes running in parallel) using the MPI_Bcast operation. int rank; int res; res = MPI_Comm_rank (MPI_COMM_WORLD, &rank); if (res != MPI_SUCCESS) { ...
Stanford CoreNLP is a popular Natural Language Processing toolkit supporting many core NLP tasks. To download and install the program, either download a release package and include the necessary *.jar files in your classpath, or add the dependency off of Maven central. See the download page for mor...
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("MyList"); int itemId = 2; ListItem oListItem = oList.Items.GetById(itemId); oListItem.BreakRoleInheritance(true); User oUser = clientContext.Web.SiteUsers.GetByLoginName...

Page 7 of 28