Tutorial by Examples: is

Directory structure: yourproject/ Cargo.lock Cargo.toml src/ main.rs writer.rs main.rs // This is import from writer.rs mod writer; fn main() { // Call of imported write() function. writer::write() // BAD writer::open_file() } w...
Here is a very simple example of a function that "promises to proceed when a given time elapses". It does that by creating a new Deferred object, that is resolved later and returning the Deferred's promise: function waitPromise(milliseconds){ // Create a new Deferred object using th...
We can have three cases to analyze an algorithm: Worst Case Average Case Best Case #include <stdio.h> // Linearly search x in arr[]. If x is present then return the index, // otherwise return -1 int search(int arr[], int n, int x) { int i; for (i=0; i<n; i...
std::integer_sequence itself is about holding a sequence of integers which can be turned into a parameter pack. Its primary value is the possibility to create "factory" class templates creating these sequences: #include <iostream> #include <initializer_list> #include <uti...
Below example shows how to change the hyperlink for "ID" and "Title(LinkTitle)" field inside the list view using CSR. Step1 : Create a JS file and paste below code (function () { function registerRenderer() { var ctxForm = {}; ctxForm.Templates = {}...
This example shows how to hide a "Date" field from the SharePoint list view using CSR. (function () { function RemoveFields(ctx) { var fieldName = "Date"; // here Date is field or column name to be hide var header = document.querySelectorAll("[d...
The QList class is a template class that provides lists. It stores items in a list that provides fast index-based access and index-based insertions and removals. To insert items into the list, you can use operator<<(), insert(), append() or prepend(). For example: operator<<() QList&l...
Lets have a look at the native app lifecycle methods for different platforms. Android. //Xamarin.Forms.Platform.Android.FormsApplicationActivity lifecycle methods: protected override void OnCreate(Bundle savedInstanceState); protected override void OnDestroy(); protected override void OnPause()...
If the engine is able to correctly predict you're using a specific small type for your values, it will be able to optimize the executed code. In this example, we'll use this trivial function summing the elements of an array and outputting the time it took: // summing properties var sum = (functio...
It parses the data from the %%GLOBAL_ConversionCode%% template variable, and as such this script should be inserted in order.html immediately after the %%GLOBAL_ConversionCode%% variable. This was originally intended for the Blueprint theme framework and, as such, may not work on Stencil. <scrip...
In Coq, destruct more or less corresponds to a case analysis. It is similar to induction except that there's no induction hypothesis. Here is a (admittedly rather trivial) example of this tactic: Require Import Coq.Arith.Lt. Theorem atLeastZero : forall a, 0 <= a. Proof. intros. destr...
Resource Acquisition Is Initialization (RAII) is a common idiom in resource management. In the case of dynamic memory, it uses smart pointers to accomplish resource management. When using RAII, an acquired resource is immediately given ownership to a smart pointer or equivalent resource manager. The...
If our component is not ready and waiting for data from server, then we can add loader using *ngIf. Steps: First declare a boolean: loading: boolean = false; Next, in your component add a lifecycle hook called ngOnInit ngOnInit() { this.loading = true; } and after you get complete dat...
At the end of the document add the following: \bibliographystyle{style} \bibliography{file location} Create a file with extension .bib and save the citation as follows: @inproceedings{citation_name, title={Paper Title}, author={List Authors}, pages={45--48}, year={2013}, organizat...
using System; using System.Speech.Synthesis; using System.Windows; namespace Stackoverflow.SpeechSynthesisExample { public partial class SpeechSynthesisSample : Window { public SpeechSynthesisSample() { InitializeComp...
Previously, datatables were initialized as follows: var oTable = $("#selector").dataTable(); This used to return a jQuery object which would stored in the variable oTable. And then to access the api to modify table properties, we had to initialize the api differently, as shown below: ...
We assume a fully working UIScrollview named _scrollView; Note that UITableView, UICollectionView are also scrollviews, hence the following examples would work on those UI elements. First, creation & allocation UIRefreshControl refreshControl = new UIRefreshControl(); Second, connecting th...
This example will register an vuex module dynamically for storing custom notifications that can automatically dismissed notifications.js resolve vuex store and define some constants //Vuex store previously configured on other side import _store from 'path/to/store'; //Notification default dur...
probably the most common misconception about asnycio is that it lets you run any task in parallel - sidestepping the GIL (global interpreter lock) and therefore execute blocking jobs in parallel (on separate threads). it does not! asyncio (and libraries that are built to collaborate with asyncio) b...
Prerequiste steps: Get dotnet core for your platform: Dotnet Core Follow instructions and make sure dotnet core is working Get Visual Studio Code for your platform: VS Code Launch Visual Studio Code (VS code) and install the C# extension then reload Create self hosted NancyFx project: ...

Page 86 of 109