Tutorial by Examples: c

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; ...
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 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...
#include <gtk/gtk.h> // callback function which is called when button is clicked static void on_button_clicked(GtkButton *btn, gpointer data) { // change button label when it's clicked gtk_button_set_label(btn, "Hello World"); } // callback function which is called ...
Interpolation means that Perl interpreter will substitute the values of variables for their name and some symbols (which are impossible or difficult to type in directly) for special sequences of characters (it is also known as escaping). The most important distinction is between single and double qu...
Modules are defined in a file named module-info.java, named a module descriptor. It should be placed in the source-code root: |-- module-info.java |-- com |-- example |-- foo |-- Foo.java |-- bar |-- Bar.java Here is a simple module descri...
Assume you have a custom file you want to create an importer for. It could be an .xls file or whatever. In this case we're going to use a JSON file because it's easy but we're going to pick a custom extension to make it easy to tell which files are ours? Let's assume the format of the JSON file is ...
The "right-left" rule is a completely regular rule for deciphering C declarations. It can also be useful in creating them. Read the symbols as you encounter them in the declaration... * as "pointer to" - always on the left side [] as "array of" ...
WeakMap object allows you to store key/value pairs. The difference from Map is that keys must be objects and are weakly referenced. This means that if there aren't any other strong references to the key, the element in WeakMap can be removed by garbage collector. WeakMap constructor has an optional...

Page 454 of 826