Tutorial by Examples

More than one queue may be created. Each queue can be thought of as a separate branch. hg qqueue --create foo // Create a new queue called "foo" hg qqueue --list // List all queues hg qqueue --active // Print name of active queue hg qqueue --rename bar // Rename active queue ...
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...
The wheel collider inside unity is built upon Nvidia's PhysX wheel collider, and therefore shares many similar properties. Technically unity is a "unitless" program, but to make everything make sense, some standard units are required. Basic Properties Mass - the weight of the wheel in ...
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...
DateTimeField is used to store date time values. class MyModel(models.Model): start_time = models.DateFimeField(null=True, blank=True) created_on = models.DateTimeField(auto_now_add=True) updated_on = models.DateTimeField(auto_now=True) A DateTimeField has two optional parameters:...
A global RegExp match can be performed using preg_match_all. preg_match_all returns all matching results in the subject string (in contrast to preg_match, which only returns the first one). The preg_match_all function returns the number of matches. Third parameter $matches will contain matches in f...
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...
Scaling to fit Means that the whole image will be visible but there may be some empty space on the sides or top and bottom if the image is not the same aspect as the canvas. The example shows the image scaled to fit. The blue on the sides is due to the fact that the image is not the same aspect as ...
Documenting your work Remember what you've done and retain long outputs which can't be kept in WinDbg's buffer. It's always good to have a log available for reproducing debugging steps, e.g. to ask questions on Stack Overflow. CommandPurpose.logopencreate a log file.logcloseclose the log file.dump...
Following are the Prerequisites for installing Cookiecutter: pip virtualenv PostgreSQL Create a virtualenv for your project and activate it: $ mkvirtualenv <virtualenv name> $ workon <virtualenv name> Now install Cookiecutter using: $ pip install cookiecutter Change dire...
This example finds a point on a bezier or cubic curve at position where position is he unit distance on the curve 0 <= position <= 1. The position is clamped to the range thus if values < 0 or > 1 are passed they will be set 0,1 respectively. Pass the function 6 coordinates for quadrati...

Page 750 of 1336