Tutorial by Examples

Suppose we have a component which will hide at a certain window width. import { Component } from '@angular/core'; @Component({ ... template: ` <div> <p [hidden]="!visible" (window:resize)="onResize($event)" >Now you see me...</p> &lt...
Starting with Java 8, you can use lambda expressions & predicates. Example: Use a lambda expressions & a predicate to get a certain value from a list. In this example every person will be printed out with the fact if they are 18 and older or not. Person Class: public class Person { p...
An anonymous inner class is a form of inner class that is declared and instantiated with a single statement. As a consequence, there is no name for the class that can be used elsewhere in the program; i.e. it is anonymous. Anonymous classes are typically used in situations where you need to be abl...
A class written within a method called method local inner class. In that case the scope of the inner class is restricted within the method. A method-local inner class can be instantiated only within the method where the inner class is defined. The example of using method local inner class: public...
A DataFrame can be created from a list of dictionaries. Keys are used as column names. import pandas as pd L = [{'Name': 'John', 'Last Name': 'Smith'}, {'Name': 'Mary', 'Last Name': 'Wood'}] pd.DataFrame(L) # Output: Last Name Name # 0 Smith John # 1 Wood Mary Missin...
Step 1: Create events.xml file according to your requirement in frontend, Backend, or both YKM/Banner/etc/frontend/events.xml <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=&q...
Shall the property value's assignment be executed before or after the class' constructor? public class TestClass { public int TestProperty { get; set; } = 2; public TestClass() { if (TestProperty == 1) { Console.WriteLine("Shall this be e...
What are events? VBA is event-driven: VBA code runs in response to events raised by the host application or the host document - understanding events is fundamental to understanding VBA. APIs often expose objects that raise a number of events in response to various states. For example an Excel.Appl...
Using parameters passed by reference An event may define a ByRef parameter meant to be returned to the caller: Public Event BeforeSomething(ByRef cancel As Boolean) Public Event AfterSomething() Public Sub DoSomething() Dim cancel As Boolean RaiseEvent BeforeSomething(cancel) If...
Create TexturePostProcessor.cs file anywhere in Assets folder: using UnityEngine; using UnityEditor; public class TexturePostProcessor : AssetPostprocessor { void OnPostprocessTexture(Texture2D texture) { TextureImporter importer = assetImporter as TextureImporter; ...
You can use the filter operator to filter out items from the values stream based on a result of a predicate method. In other words, the items passing from the Observer to the Subscriber will be discarded based on the Function you pass filter, if the function returns false for a certain value, that ...
You can use the map operator to map the values of a stream to different values based on the outcome for each value from the function passed to map. The outcome stream is a new copy and will not modify the provided stream of values, the result stream will have the same length of the input stream but ...
CREATE TYPE MyComplexType as TABLE ( Id int, Name varchar(10) )
CREATE TYPE MyUniqueNamesType as TABLE ( FirstName varchar(10), LastName varchar(10), UNIQUE (FirstName,LastName) ) Note: constraints in user defined table types can not be named.
CREATE TYPE MyUniqueNamesType as TABLE ( FirstName varchar(10), LastName varchar(10), CreateDate datetime default GETDATE() PRIMARY KEY (FirstName,LastName) )
This example finds an array of approximately evenly spaced points along a cubic Bezier curve. It decomposes Path segments created with context.bezierCurveTo into points along that curve. // Return: an array of approximately evenly spaced points along a cubic Bezier curve // // Attribution: Stack...
This example finds an array of approximately evenly spaced points along a quadratic curve. It decomposes Path segments created with context.quadraticCurveTo into points along that curve. // Return: an array of approximately evenly spaced points along a Quadratic curve // // Attribution: Stackove...
This example finds an array of approximately evenly spaced points along a line. It decomposes Path segments created with context.lineTo into points along that line. // Return: an array of approximately evenly spaced points along a line // // pxTolerance: approximate spacing allowed between point...
This example finds an array of approximately evenly spaced points along an entire Path. It decomposes all Path segments created with context.lineTo, context.quadraticCurveTo and/or context.bezierCurveTo into points along that Path. Usage // Path related variables var A={x:50,y:100}; var B={x:12...

Page 734 of 1336