Tutorial by Examples: st

/// <summary> /// Gets a BackgroundTask by its name /// </summary> /// <param name="taskName">Name of the task to find</param> /// <returns>The found Task or null if none found</returns> public BackgroundTaskRegistration TaskByName(string taskName) ...
private bool IsTaskRegistered(string taskName) => BackgroundTaskRegistration.AllTasks.Any(x => x.Value.Name.Equals(taskName));
/// <summary> /// Unregister a single background task with given name /// </summary> /// <param name="taskName">task name</param> /// <param name="cancelTask">true if task should be cancelled, false if allowed to finish</param> public void...
An instant is a specific moment in time. Any date-time object that refers to a moment of time is recognized as an instant. To test if an object is an instant, use is.instant. library(lubridate) today_start <- dmy_hms("22.07.2016 12:00:00", tz = "IST") # default tz="UT...
Using Homebrew Prerequisites: Make sure you're on OS X 10.9 (Mavericks) or above, and have Homebrew installed. Run the following in your terminal: brew update && brew install rethinkdb Compile from source Building RethinkDB from source requires OS X 10.9 (Mavericks) or greater. Xcode...
GROUP BY is used in combination with aggregation functions. Consider the following table: orderIduserIdstoreNameorderValueorderDate143Store A2520-03-2016257Store B5022-03-2016343Store A3025-03-2016482Store C1026-03-2016521Store A4529-03-2016 The query below uses GROUP BY to perform aggregated calc...
Protocol Oriented Programming is a useful tool in order to easily write better unit tests for our code. Let's say we want to test a UIViewController that relies on a ViewModel class. The needed steps on the production code are: Define a protocol that exposes the public interface of the class Vi...
Using a custom inspector allows you to change the way a script is drawn in the Inspector. Sometimes you want to add extra information in the inspector for your script that isn't possible to do with a custom property drawer. Below is a simple example of a custom object that with using a custom inspe...
Sometimes you have custom objects that contain data but do not derive from MonoBehaviour. Adding these objects as a field in a class that is MonoBehaviour will have no visual effect unless you write your own custom property drawer for the object's type. Below is a simple example of a custom object,...
Given this data User_IDCompletion_Date12016-07-2012016-07-2122016-07-2022016-07-2122016-07-22 ;with CTE as (SELECT *, ROW_NUMBER() OVER (PARTITION BY User_ID ORDER BY Completion_Date DESC) Row_Num FROM Data) SELECT * FORM CTE WHERE Row_Num <= n Us...
It is now a best-practice to use Vector instead of List because the implementations have better performance Performance characteristics can be found here. Vector can be used wherever List is used. List creation List[Int]() // Declares an empty list of type Int List.empty[Int] // U...
An Enum instance can be created by parsing a string representation of the Enum. Module Module1 Enum Size Small Medium Large End Enum Sub Main() Dim shirtSize As Size = DirectCast([Enum].Parse(GetType(Size), "Medium"), Size) ...
The Math.random() function should give random numbers that have a standard deviation approaching 0. When picking from a deck of card, or simulating a dice roll this is what we want. But in most situations this is unrealistic. In the real world the randomness tends to gather around an common normal...
Flash Player 10 introduced the Vector.<*> generic list type that was faster than the Array. However, this is not entirely true. Only the following Vector types are faster than the Array counterparts, due to the way they are implemented in Flash Player. Vector.<int> - Vector of 32-bit ...
It is possible to find the first element of a Stream that matches a condition. For this example, we will find the first Integer whose square is over 50000. IntStream.iterate(1, i -> i + 1) // Generate an infinite stream 1,2,3,4... .filter(i -> (i*i) > 50000) // Filter to find element...
Electron ports HTML web applications to native applications for a range of devices, including creating native desktop applications. It's also very easy to get started! To begin, we must have electron, nodejs, npm, git and meteor installed. Familiarity with these tools is vital for working with Mete...
Installing Angular Material npm npm install angular-material --save bower bower install angular-material --save jspm jspm install angular-material From Cloud cdnjs | jsdelivr | googlecdn Getting Started (blank shell) <html lang="en"> <head> <meta name...
Files: - example.rs (root of our modules tree, generally named lib.rs or main.rs when using Cargo) - first.rs - second/ - mod.rs - sub.rs Modules: - example -> example - first -> example::first - second -> example::second - sub -> exampl...
Streams of elements usually do not allow access to the index value of the current item. To iterate over an array or ArrayList while having access to indexes, use IntStream.range(start, endExclusive). String[] names = { "Jon", "Darin", "Bauke", "Hans", "M...
In a normal mathematical coordinate system, the point x=0, y=0 is at the lower left corner of the graph. But in the SVG coordinate system, this (0,0) point is at the top left corner of the ‘canvas’, it is sort of similar to CSS when you specify the position to absolute/fix and use top and left to co...

Page 86 of 369