Tutorial by Examples

The regular composition works for unary functions. In the case of binary, we can define (f .: g) x y = f (g x y) -- which is also = f ((g x) y) = (f . g x) y -- by definition of (.) = (f .) (g x) y = ((f .) . g) x y Thus,...
Extensions add new functionality to an existing class, structure, enumeration, or protocol type. This includes the ability to extend types for which you do not have access to the original source code. Extensions in Swift can: Add computed properties and computed type properties Define instance ...
Extensions can add new subscripts to an existing type. This example gets the character inside a String using the given index: 2.2 extension String { subscript(index: Int) -> Character { let newIndex = startIndex.advancedBy(index) return self[newIndex] } } var my...
In the Xcode, you have three separate areas of working - Navigators (in red), Debug area(in green) and Utilities(in blue). The workspace window always includes the editor area. When you select a file in your project, its contents appear in the editor area, where Xcode opens the file in an appropri...
Install webpack-dev-middleware via npm npm i -D webpack-dev-middleware webpack-hot-middleware Modify webpack.config.js Add webpack-hot-middleware/client to each items defined in "entry" Add new webpack.HotModuleReplacementPlugin() to "plugins" module.export...
PhpStorm can be very slow in large files as its performing so many inspections. One quick and easy way to speed up PhpStorm is to render using OpenGL. Previously in a 5000 line file it would give the 'eye' symbol in the top right for a long time before changing to a tick (or red/yellow box). After O...
Constructors are special methods named after the class and without a return type, and are used to construct objects. Constructors, like methods, can take input parameters. Constructors are used to initialize objects. Abstract classes can have constructors also. public class Hello{ // construct...
You can configure lint by adding a lintOptions section in the build.gradle file: android { //..... lintOptions { // turn off checking the given issue id's disable 'TypographyFractions','TypographyQuotes' // turn on the given issue id's enable 'Rtl...
You can specify your Lint checking preferences in the lint.xml file. If you are creating this file manually, place it in the root directory of your Android project. If you are configuring Lint preferences in Android Studio, the lint.xml file is automatically created and added to your Android project...
You can disable Lint checking from your Java and XML source files. Configuring lint checking in Java To disable Lint checking specifically for a Java class or method in your Android project, add the @SuppressLint annotation to that Java code. Example: @SuppressLint("NewApi") @Override...
Detailed instructions on getting reflection set up or installed.
Now that you have an object, it might be good to figure out what it is. You can use the Get-Member cmdlet to see what an object is and what it contains: Get-Item c:\windows | Get-Member This yields: TypeName: System.IO.DirectoryInfo Followed by a list of properties and methods the object ha...
The Leaflet package is designed to integerate with Shiny In the ui you call leafletOutput() and in the server you call renderLeaflet() library(shiny) library(leaflet) ui <- fluidPage( leafletOutput("my_leaf") ) server <- function(input, output, session){ out...
Data saved to TempData is stored in the session and will be automatically removed at the end of the first request where the data is accessed. If never read, it will be kept until finally read or the session times out. The typicaly usage looks like the following sequence (where each line is invoked ...
This converter will chain multiple converters together. public class ValueConverterGroup : List<IValueConverter>, IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return this.Aggregate(value, (current, converte...
In the root of your project, make sure Bower is installed (npm install -g bower) and run bower init. This will create a bower.json file in your project's directory. Create a new file called .bowerrc to your root directory. It should contain the following: { "directory": "public/b...
To determine the latest tested/supported version of Node that can be used with your installed version of Meteor, dump the node version directly from the build tool's bundled node instance. meteor node -v
The Range attribute can decorate any properties or public fields and specifies a range that a numerical field must fall between to be considered valid. [Range(minimumValue, maximumValue)] public int Property { get; set; } Additionally, it accepts an optional ErrorMessage property that can be us...
The [RegularExpression] attribute can decorate any properties or public fields and specifies a regular expression that must be matched for the property be considered valid. [RegularExpression(validationExpression)] public string Property { get; set; } Additionally, it accepts an optional ErrorM...
Meteor reads a mobile-config.js file in the root of your app directory during build, and uses the settings specified there to generate Cordova’s config.xml. Project_folder ├── /.meteor └── mobile-config.js Most configurations can be achieved with mobile-config.js (app metadata, preferences, ...

Page 624 of 1336