Tutorial by Examples

In a non-strict-mode scope, when a variable is assigned without being initialized with the var, const or the let keyword, it is automatically declared in the global scope: a = 12; console.log(a); // 12 In strict mode however, any access to an undeclared variable will throw a reference error: &...
Differences in subsetting syntax A data.table is one of several two-dimensional data structures available in R, besides data.frame, matrix and (2D) array. All of these classes use a very similar but not identical syntax for subsetting, the A[rows, cols] schema. Consider the following data stored i...
Delegates may have variant type parameters. delegate void Action<in T>(T t); // T is an input delegate T Func<out T>(); // T is an output delegate T2 Func<in T1, out T2>(); // T1 is an input, T2 is an output This follows from the Liskov Substitution Principle, w...
Category theory is a modern mathematical theory and a branch of abstract algebra focused on the nature of connectedness and relation. It is useful for giving solid foundations and common language to many highly reusable programming abstractions. Haskell uses Category theory as inspiration for some o...
A category C consists of: A collection of objects called Obj(C) ; A collection (called Hom(C)) of morphisms between those objects. If a and b are in Obj(C), then a morphism f in Hom(C) is typically denoted f : a -> b, and the collection of all morphism between a and b is denoted hom(a,b) ; A...
Using Kestrel you can specify port using next approaches: Defining ASPNETCORE_URLS environment variable. Windows SET ASPNETCORE_URLS=https://0.0.0.0:5001 OS X export ASPNETCORE_URLS=https://0.0.0.0:5001 Via command line passing --server.urls parameter dotnet run --server.urls=http...
When configuring the built-in logging functionality, a common pattern is to create a logger with the __name__ of the current module: logger = logging.getLogger(__name__) This means that the fully-qualified name of the module will appear in the logs, making it easier to see where messages have co...
If you have a string that contains Python literals, such as strings, floats etc, you can use ast.literal_eval to evaluate its value instead of eval. This has the added feature of allowing only certain syntax. >>> import ast >>> code = """(1, 2, {'foo': 'bar'})&quot...
It is not possible to use eval or exec to execute code from untrusted user securely. Even ast.literal_eval is prone to crashes in the parser. It is sometimes possible to guard against malicious code execution, but it doesn't exclude the possibility of outright crashes in the parser or the tokenizer....
Detailed instructions on getting forms set up or installed.

Eq

All basic datatypes (like Int, String, Eq a => [a]) from Prelude except for functions and IO have instances of Eq. If a type instantiates Eq it means that we know how to compare two values for value or structural equality. > 3 == 2 False > 3 == 3 True Required methods (==) :: Eq ...

Ord

Types instantiating Ord include, e.g., Int, String, and [a] (for types a where there's an Ord a instance). If a type instantiates Ord it means that we know a “natural” ordering of values of that type. Note, there are often many possible choices of the “natural” ordering of a type and Ord forces us t...
First of all, you cannot "install" Java EE. Java EE consists of a number of specifications. You can install implementations of those specifications however. Depending on your needs, there are lots of possibilities. To install most (or all) of the specifications, you can choose a Java EE...
You can select elements with different selectors : by tag : "div" by class : ".class" by id : "#id" by attribute : "[color=blue]" multiple selectors (OR): "div1, div2, class1" multiple selectors (AND): "div1 div2 class1"
This will give current system version. Objective-C NSString *version = [[UIDevice currentDevice] systemVersion] Swift let version = UIDevice.currentDevice().systemVersion Swift 3 let version = UIDevice.current.systemVersion
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <!--- vvv Hamburger icon that gets shown when window reaches a certain scale vvv ---> <button type...
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".n...
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".n...
/* finds the next instance of needle in haystack zbpos: the zero-based position to begin searching from haystack: the string to search in needle: the string that must be found returns the next match of `needle` in `haystack`, or -1 if not found */ int findnext(int zbpos, const cha...
using System; using System.Web; using System.Web.Mvc; namespace Example.SDK.Filters { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] public sealed class CustomErrorHandlerFilter : HandleErrorAttribute { public override void OnExceptio...

Page 280 of 1336