Tutorial by Examples: e

To begin using YouTube, just head over to youtube.com and use the search bar on the top of the page to find the required subject. Alternatively, you could just browse the home page. On this page, you can search the popular and trending videos, from Music, to gaming. If you wish to participate with c...
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...
To discover SQL Server's edition, product level and version number as well as the host machine name and the server type: SELECT SERVERPROPERTY('MachineName') AS Host, SERVERPROPERTY('InstanceName') AS Instance, DB_NAME() AS DatabaseContext, SERVERPROPERTY('Editio...
JSON Web Encryption (JWE) represents encrypted content using JavaScript Object Notation (JSON) based data structures. It defines a way to encrypt your claims data so that only intended receiver can read the information present in a token. In the JWE JSON Serialization, a JWE is represented as a JS...
From Section 9 of JSON Web Encryption specification (RFC 7516): The JOSE Header for a JWS can be distinguished from the JOSE Header for a JWE by examining the "alg" (algorithm) Header Parameter value. If the value represents a digital signature or MAC algorithm, or is the value "no...
Libpng was written as a companion to PNG specification as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. Libpng was designed to handle multiple sessions at one time, to be easily modifiable, to be portable to the vast majority of mac...
In fluent programming style you return this from fluent (setter) methods that would return nothing in non-fluent programming style. This allows you to chain the different method calls which makes your code shorter and easier to handle for the developers. Consider this non-fluent code: public clas...
The FileSystem API of Java 7 allows to read and add entries from or to a Zip file using the Java NIO file API in the same way as operating on any other filesystem. The FileSystem is a resource that should be properly closed after use, therefore the try-with-resources block should be used. Reading ...
The WeakSet object is used for storing weakly held objects in a collection. The difference from Set is that you can't store primitive values, like numbers or string. Also, references to the objects in the collection are held weakly, which means that if there is no other reference to an object stored...
To add a value to a WeakSet, use the .add() method. This method is chainable. const obj1 = {}, obj2 = {}; const weakset = new WeakSet(); weakset.add(obj1).add(obj2);
To check if a value exits in a WeakSet, use the .has() method. const obj1 = {}, obj2 = {}; const weakset = new WeakSet([obj1]); console.log(weakset.has(obj1)); // true console.log(weakset.has(obj2)); // false
To remove a value from a WeakSet, use the .delete() method. This method returns true if the value existed and has been removed, otherwise false. const obj1 = {}, obj2 = {}; const weakset = new WeakSet([obj1]); console.log(weakset.delete(obj1)); // true console.log(weakset.delete(obj2));...
import java.util.stream.IntStream; public class Concurrent { public static void printAndWait(String s) { System.out.println(s); try { Thread.sleep(1000); } catch (Exception e) {} } public static void main(String[] args) { Threa...
The loop macro has two forms: the "simple" form and the "extended" form. The extended form is covered in another documentation topic, but the simple loop is useful for very basic loop. The simple loop form takes a number of forms and repeats them until the loop is exited using ...
Our server object is given an 'application' parameter which can be any callable application object (see other examples). It writes first the headers, then the body of data returned by our application to the system standard output. import os, sys def run(application): environ['wsgi.inpu...
The name Smalltalk usually refers to ANSI Smalltalk or Smalltalk 80 (of which the first is based on). While most implementations are close to the standard, they vary in different aspects (usually referred to as dialects). Each implementation has it's own method of installation. Well known FOSS imp...
Care must be taken when initializing variables of type float to literal values or comparing them with literal values, because regular floating point literals like 0.1 are of type double. This may lead to surprises: #include <stdio.h> int main() { float n; n = 0.1; if (n > ...

Page 652 of 1191