Tutorial by Examples: n

As per Wiki : In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is required to create exactly one object to coordinate actions across the system. class Singleton { // Private constructor so it can not be arbitra...
Express passes a next callback to every route handler and middleware function that can be used to break logic for single routes across multiple handlers. Calling next() with no arguments tells express to continue to the next matching middleware or route handler. Calling next(err) with an error will ...
These classes increase the left margin of a column by * columns. For example, .col-md-offset-4 moves .col-md-4 over four columns. <div class="row"> <div class="col-lg-4"></div> <div class="col-lg-4 col-lg-offset-4"></div> </div&g...
Sending email is pretty simple in Go. It helps to understand the RFC 822, which specifies the style an email need to be in, the code below sends a RFC 822 compliant email. package main import ( "fmt" "net/smtp" ) func main() { // user we are authorizing as ...
func bufferedUnbufferedExample(buffered bool) { // We'll declare the channel, and we'll make it buffered or // unbuffered depending on the parameter `buffered` passed // to this function. var ch chan int if buffered { ch = make(chan int, 3) } else { ch...
If you want to detect when your user enters a specific location, you can create a fence for the specific location with a radius you want and be notified when your user enters or leaves the location. // Your own action filter, like the ones used in the Manifest private static final String FENCE_REC...
What is Bootstrap Grid System Bootstrap grid system provides the quick and easy way to create responsive website layouts. Bootstrap 3 includes predefined grid classes for quickly making grid layouts for different types of devices like cell phones, tablets, laptops and desktops, etc. For example, ...
Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any .row. <div class="row"> ...
Turn any fixed-width grid layout into a full-width layout by changing your outermost .container to .container-fluid. <div class="container-fluid"> <div class="row"> ... </div> </div>
Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding .col-xs-* .col-md-* to your columns. See the example below for a better idea of how it all works. <!-- Stack the columns on mobile by making one full-width and the other half-...
If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line. <div class="row"> <div class="col-xs-9">.col-xs-9</div> <div class="col-xs-4">.col-xs-4<br>Since 9 + 4 = 13 ...
With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a .clearfix and our responsive utility classes. <div class="row"> <div ...
Move columns to the right using .col-md-offset-* classes. These classes increase the left margin of a column by * columns. For example, .col-md-offset-4 moves .col-md-4 over four columns. <div class="row"> <div class="col-md-4">.col-md-4</div> <div cla...
To nest your content with the default grid, add a new .row and set of .col-sm-* columns within an existing .col-sm-* column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns). <div class="row"> <di...
Easily change the order of our built-in grid columns with .col-md-push-* and .col-md-pull-* modifier classes. <div class="row"> <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div> <div class="col-md-3 col-md-pull-9">.col-md-...
In addition to prebuilt grid classes for fast layouts, Bootstrap includes Less variables and mixins for quickly generating your own simple, semantic layouts. Variables Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use ...
For libraries that specify autoload information, Composer generates a vendor/autoload.php file. You can simply include this file and you will get autoloading for free. require __DIR__ . '/vendor/autoload.php'; This makes it really easy to use third party code. For example: If your project depend...
In the body of a function nargin and nargout indicate respectively the actual number of input and output supplied in the call. We can for example control the execution of a function based on the number of provided input. myVector.m: function [res] = myVector(a, b, c) % Roughly emulates the c...
Possessive quantifiers are another class of quantifiers in many regex flavours that allow backtracking to, effectively, be disabled for a given token. This can help improve performance, as well as preventing matches in certain cases. The class of possessive quantifiers can be distinguished from laz...
The following is a simple example Perl test script, that gives some structure to allow for testing of other methods in the class/package under test. The script produces standard output with simple "ok" / "not ok" text, which is called TAP (Test Anything Protocol). Typically the...

Page 669 of 1088