Using width or height tags to resize images in your markup can create a problem in Internet Explorer browsers. If your reader is viewing an email in-browser, and that email happens to have fluid images in it, they’ll look pretty ugly as they resize. Using -ms-interpolation-mode:bicubic; ensures that...
Create new patches with hg qnew patch-name and then update them with new changes with hg qrefresh:
hg qnew myFirstPatch // Creates a new patch called "myFirstPatch"
... // Edit some files
hg qrefresh // Updates "myFirstPatch" with changes
hg qnew ...
Pushing a patch applies the patch to the repository while poping a patch unapplies the patch from the repository.
Pop the current patch off the queue with hg qpop and push it back onto the queue with hg qpush:
hg qpop
hg qpush
Pop all patches:
hg qpop -a
PUsh all patches:
hg qpush -a
...
Finishing patches makes them permanent changesets.
Finish first applied patch in the queue:
hg qfinish
Finish all applied patches in the queue:
hg qfinish -a
qnew: create a new patch
qpop: pop the current patch off the stack
qpush: push the next patch onto the stack
qrefresh: update the current patch
qapplied: print the patches already applied
qseries: print the entire series file
qfinish: move applied patches into repository history
qdelete: re...
Functional tests are best described as tests for your user stories. If you've dealt with user stories before they normally follow the following pattern:
As a [role], I want to [desire], so that [benefit/desired outcome]
For the following examples we'll use this user story as an example:
As a Du...
Behat provides Gherkin Syntax which is a human-readable format. It allows you to easily describe your user stories.
To start with Behat you should install it with Composer and then initialize your test files:
$ composer require --dev behat/behat="^3.0.5"
$ ./vendor/bin/behat --init
...
Mink provides an interface for web drivers (like Goutte and Selenium) as well as a MinkContext which, when extended, provides additional web language for our steps.
To install Mink (and the default Goutte driver):
$ composer require --dev behat/mink-extension="^2.0"
$ composer require -...
If we want to test JavaScript on a website, we'll need to use something a bit more powerful than Goutte (which is just cURL via Guzzle). There are a couple of options such as ZombieJS, Selenium and Sahi. For this example I'll use Selenium.
First you'll need to install the drivers for Mink:
$ compo...
From documentation:
The HttpContext.Items collection is the best location to store data that is only needed while processing a given request. Its contents are discarded after each request. It is best used as a means of communicating between components or middleware that operate at different poi...
Django 1.10 introduced a new middleware style where process_request and process_response are merged together.
In this new style, a middleware is a callable that returns another callable. Well, actually the former is a middleware factory and the latter is the actual middleware.
The middleware facto...
The predicate function matches can be used to evaluate strings on the fly without use of any object declarations.
IF matches( val = 'Not a hex string'
regex = '[0-9a-f]*' ).
cl_demo_output=>display( 'This will not display' ).
ELSEIF matches( val = '6c6f7665'
reg...
As already pointed out in other pitfalls, catching all exceptions by using
try {
// Some code
} catch (Exception) {
// Some error handling
}
Comes with a lot of different problems. But one perticular problem is that it can lead to deadlocks as it breaks the interrupt system when writ...
The latest version of the Oracle Java style guide mandates that the "then" and "else" statements in an if statement should always be enclosed in "braces" or "curly brackets". Similar rules apply to the bodies of various loop statements.
if (a) { //...
Solr is a standalone enterprise search server with a REST-like API. You put documents in it (called "indexing") via JSON, XML, CSV or binary over HTTP. You query it via HTTP GET and receive JSON, XML, CSV or binary results.
Solr uses the Lucene search library and extends it.
Here are som...
Create blank Multi-Device (Firemonkey) application.
Drop Rectangle on Form.
In Object inspector window (F11) find RotationAngle click on drop
down button, and select "Create New TFloatAnimation".
Object inspector window is automatically switched to a newly added
TFloatAnimation, you...