Tutorial by Examples: f

The effective type of a data object is the last type information that was associated with it, if any. // a normal variable, effective type uint32_t, and this type never changes uint32_t a = 0.0; // effective type of *pa is uint32_t, too, simply // because *pa is the object a uint32_t* pa = &a...
SELECT OBJECT_ID('MemOptTable1') AS MemOptTable1_ObjectID, OBJECT_ID('MemOptTable2') AS MemOptTable2_ObjectID GO SELECT name,description FROM sys.dm_os_loaded_modules WHERE name LIKE '%XTP%' GO Show all Memory Optimized Tables: SELECT name,type_desc,durability_desc,...
Recommendation Because the symbols i and j can represent significantly different things in MATLAB, their use as loop indices has split the MATLAB user community since ages. While some historic performance reasons could help the balance lean to one side, this is no longer the case and now the choice...
Returns a table with a rows containing the values that were actual (current) at the specified point in time in the past. SELECT * FROM Employee FOR SYSTEM_TIME AS OF '2016-08-06 08:32:37.91'
Required compiler features can be specified on a target using the command target_compile_features: add_library(foo foo.cpp ) target_compile_features(foo PRIVATE # scope of the feature cxx_constexpr # list of features ) The features must be part of CMAKE_C_COMPILE_FE...
function getSheetData() { var sheet = SpreadsheetApp.getActiveSheet(); var startRow = 2; // First row of data to process var numRows = 100; // Number of rows to process var startCol = 1; //First column of data to process var numCols = 15; // Number of columns to process ...
A simple PL/pgSQL function: CREATE FUNCTION active_subscribers() RETURNS bigint AS $$ DECLARE -- variable for the following BEGIN ... END block subscribers integer; BEGIN -- SELECT must always be used with INTO SELECT COUNT(user_id) INTO subscribers FROM users WHERE subscribed...
DECLARE CURSOR c_emp_to_be_raised(p_sal emp.sal%TYPE) IS SELECT * FROM emp WHERE sal < p_sal; BEGIN FOR cRowEmp IN c_emp_to_be_raised(1000) LOOP dbms_Output.Put_Line(cRowEmp .eName ||' ' ||cRowEmp.sal||'... should be raised ;)'); END LOOP; END; /
BEGIN FOR x IN (SELECT * FROM emp WHERE sal < 100) LOOP dbms_Output.Put_Line(x.eName ||' '||x.sal||'... should REALLY be raised :D'); END LOOP; END; / First advantage is there is no tedious declaration to do (think of this horrible "CURSOR" thing you had in previous ve...
SYS_REFCURSOR can be used as a return type when you need to easily handle a list returned not from a table, but more specifically from a function: function returning a cursor CREATE OR REPLACE FUNCTION list_of (required_type_in IN VARCHAR2) RETURN SYS_REFCURSOR IS v_ SYS_REFCURSOR; BEGIN...
This is a minimal possible XSLT transformation. It produces the string value of the source XML document. The output format is text. Source XML document: <t>Hello, World!</t> XSLT transformation: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/T...
This example shows the base of almost any XSLT transformation and the most fundamental XSLT design pattern. Producing as output an XML document that is identical to the source XML document. Source XML document: <t>Hello, World!</t> XSLT transformation: <xsl:stylesheet version=&q...
A downcast can be used to make use of a subclass's code and data inside of a function taking a parameter of its superclass. class Rat { var color = "white" } class PetRat: Rat { var name = "Spot" } func nameOfRat(🐭: Rat) -> String { guard let petRat = ...
If we have two pointer arguments of the same type, the compiler can't make any assumption and will always have to assume that the change to *e may change *f: void fun(float* e, float* f) { float a = *f *e = 22; float b = *f; print("is %g equal to %g?\n", a, b); } f...
Copy byte-per-byte of a file The following function copies a file into another by performing an exact byte-per-byte copy, ignoring the kind of content (which can be either lines of characters in some encoding or binary data): (defun byte-copy (infile outfile) (with-open-file (instream infile :d...
A common use of macros is to create templates for data structures which obey common rules but may contain different fields. By writing a macro, you can allow the detailed configuration of the data structure to be specified without needing to repeat boilerplate code, nor to use a less efficient struc...
null returns True if there are no elements a in a foldable structure t a, and False if there is one or more. Structures for which null is True have a length of 0. ghci> null [] True ghci> null [14, 29] False ghci> null Nothing True ghci> null (Right 'a') False ghci> null ('x'...
Converts the specified string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly. Convert a specific format string to equivalent DateTime Le...
The loop macro supports iteration over the keys, the values, or the keys and values of a hash table. The following examples show possibilities, but the full loop syntax allows more combinations and variants. Over keys and values (let ((ht (make-hash-table))) (setf (gethash 'a ht) 1 (g...
The keys and values of a hash table can be iterated over using the macro with-hash-table-iterator. This may be a bit more complex than maphash or loop, but it could be used to implement the iteration constructs used in those methods. with-hash-table-iterator takes a name and a hash table and binds...

Page 246 of 457