Tutorial by Examples: c

[root@localhost ~]# docker run -it -v /etc:/etc1 8251da35e7a7 /bin/bash Here: /etc is host machine directory and /etc1 is the target inside container
//create a component that will be injected trait TimeUtil { lazy val timeUtil = new TimeUtilImpl() class TimeUtilImpl{ def now() = new DateTime() } } //main controller is depended on time util trait MainController { _ : TimeUtil => //inject time util into main...
// Website you wish to allow to connect to response.setHeader('Access-Control-Allow-Origin', '*'); // Request methods you wish to allow response.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); // Request headers you wish to allow response.setHeader('Acce...
While each mobile platforms do offer their own settings management api, there are no built in ways to read settings from a good old .net style app.config xml file; This is due to a bunch of good reasons, notably the .net framework configuration management api being on the heavyweight side, and each...
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...
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...
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>
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-...
Regex to match postcodes in UK The format is as follows, where A signifies a letter and 9 a digit: FormatCoverageExampleCellCellAA9A 9AAWC postcode area; EC1–EC4, NW1W, SE1P, SW1EC1A 1BBA9A 9AAE1W, N1C, N1PW1A 0AXA9 9AA, A99 9AAB, E, G, L, M, N, S, WM1 1AE, B33 8THAA9 9AA, AA99 9AAAll other postco...
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...
If you'd like to start implementing best practices, for yourself or your team, then Perl::Critic is the best place to start. The module is based on the Perl Best Practices book by Damien Conway and does a fairly good job implementing the suggestions made therein. Note: I should mention (and Conwa...
Install DateTime on your PC and then use it in perl script: use DateTime; Create new current datetime $dt = DateTime->now( time_zone => 'Asia/Ho_Chi_Minh'); Then you can access elements's values of date and time: $year = $dt->year; $month = $dt->month; $day = $dt->day; $...
#!/usr/bin/perl use Term::ANSIColor; print color("cyan"), "Hello", color("red"), "\tWorld", color("green"), "\tIt's Me!\n", color("reset");

Page 507 of 826