You can wrap values into actions and pipe the result of one computation into another:
return :: Monad m => a -> m a
(>>=) :: Monad m => m a -> (a -> m b) -> m b
However, the definition of a Monad doesn’t guarantee the existence of a function of type Monad m => m a -&...
do-notation is syntactic sugar for monads. Here are the rules:
do x <- mx do x <- mx
y <- my is equivalent to do y <- my
... ...
do let a = b let a = b in
...
CoffeeScript allows to deconstruct objects and arrays when they are fed to functions as arguments.
A function that leverages deconstruction will specify in its signature all the fields that are expected within its body. When invoking such function, an object or array containing all the expected fie...
The unset command is used to remove one or more variables.
unset ?-nocomplain? ?--? ?name name name name?
Each name is a variable name specified in any of the ways acceptable to the set command.
If a name refers to an element of an array then that element is removed without affecting the rema...
Enums are defined by the following the syntax above.
typedef NS_ENUM(NSUInteger, MyEnum) {
MyEnumValueA,
MyEnumValueB,
MyEnumValueC,
};
You also can set your own raw-values to the enumeration types.
typedef NS_ENUM(NSUInteger, MyEnum) {
MyEnumValueA = 0,
MyEnumValueB =...
The example below will collect the Device's OS version number and the the version of the application (which is defined in each projects' properties) that is entered into Version name on Android and Version on iOS.
First make an interface in your PCL project:
public interface INativeHelper {
/...
When object's are linked by a lookup or master-detail relationship, the parent records field's can be referenced from the child record or 'base object' in a query. This is also known as upwards traversal.
SELECT FirstName, Account.Name, Account.Category__c FROM Contact
It's possible to traverse ...
A Property procedure is a series of statement that retrieves or modifies a custom property on a module.
There are three types of property accessors:
A Get procedure that returns the value of a property.
A Let procedure that assigns a (non-Object) value to an object.
A Set procedure that assign...
Any public Sub, Function, or Property inside a class module can be called by preceding the call with an object reference:
Object.Procedure
In a DateRange class, a Sub could be used to add a number of days to the end date:
Public Sub AddDays(ByVal NoDays As Integer)
mEndDate = mEndDate + No...
Another useful feature is accessing your custom object collections as arrays in PHP. There are two interfaces available in PHP (>=5.0.0) core to support this: ArrayAccess and Iterator. The former allows you to access your custom objects as array.
ArrayAccess
Assume we have a user class and a da...
Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects.
Use .container class for a responsive fixed width container.
<div class="container">
...
</div>
Use .container-fluid c...
Swift
UIApplication.sharedApplication().preferredContentSizeCategory
Objective-C
[UIApplication sharedApplication].preferredContentSizeCategory;
This returns a content size category constant, or an accessibility content size category constant.
You can register for notifications of when the device text size is changed.
Swift
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(updateFont), name: name:UIContentSizeCategoryDidChangeNotification, object: nil)
Objective-C
[[NSNotificationCenter defaultCenter] addObs...
$dbServer = "localhost,1234"; //Name of the server/instance, including optional port number (default is 1433)
$dbName = "db001"; //Name of the database
$dbUser = "user"; //Name of the user
$dbPassword = "password"; //DB Password of that user
$connectionI...