Tutorial by Examples: c

describe('Suite Name', function() { describe('#method()', function() { it('should run without an error', function() { return doSomething().then(result => { expect(result).to.be.equal('hello world') }) }) }) })
Unlike var, const/let are bound to lexical scope rather than function scope. { var x = 1 // will escape the scope let y = 2 // bound to lexical scope const z = 3 // bound to lexical scope, constant } console.log(x) // 1 console.log(y) // ReferenceError: y is not defined console.log(z...
Arrow functions automatically bind to the 'this' lexical scope of the surrounding code. performSomething(result => { this.someVariable = result }) vs performSomething(function(result) { this.someVariable = result }.bind(this))
Before starting work with scrapy you have to start a project where you want to store your code. Enter the directory and run this code scrapy startproject helloProject The third part of this code is project name. This code will create a "helloProject" directory with the following conten...
You can qualify a whole folder folder for a specific device type, its files will override the ones outside it on that device: / DeviceFamily-Mobile PageOfEden.xaml MainPage.xaml MainPage.xaml MainPage.xaml.cs PageOfEden.xaml PageOfEden.xaml.cs Files inside the qualifying folder won...
If you browse your app's Assets folder you will notice that all resources are qualified by their scales (As you are required to put seperate files for each scaling in the package manifest). SplashScreen.scale-100.png SplashScreen.scale-125.png SplashScreen.scale-150.png SplashScreen.scale-200.pn...
Multidimensional arrays follow the same rules as single-dimensional arrays when passing them to a function. However the combination of decay-to-pointer, operator precedence, and the two different ways to declare a multidimensional array (array of arrays vs array of pointers) may make the declaratio...
This ability was added to the Bind markup extension after v1607 (Redstone 1). You can specify a function path, as well as arg paths and constant args. Let's assume we have a function defined in our backcode: public string Translate(string text, string from, string to) Now we can use bind to eva...
This guide assumes you have already installed react, redux, react-router and react-redux and have configured react, redux and react-router., If you haven't, Please do so. Note: While react-router in not a dependency of react-redux, It's very likely that we will using it in our react application for...
php bin/magento setup:upgrade => Setup Upgrade php bin/magento setup:di:compile => Setup: Compile php bin/magento indexer:reindex => Reindex php bin/magento cache:flush => Clear Cache php bin/magento deploy:mode:set...
QTimer add the functionality to have a specific function/slot called after a certain interval (repeatedly or just once). The QTimer thus allows a GUI application to "check" things regularly or handle timeouts without having to manually start an extra thread for this and be careful about r...
Decorator pattern adds behavior to objects without affecting other objects of the same class. The decorator pattern is a useful alternative to creating sub-classes. Create a module for each decorator. This approach is more flexible than inheritance because you can mix and match responsibilities in ...
Java Source Code import org.opencv.core.Core; import org.opencv.core.Core.MinMaxLocResult; import org.opencv.core.Mat; import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class TemplateMatching { ...
In Rust, there is no concept of "inheriting" the properties of a struct. Instead, when you are designing the relationship between objects do it in a way that one's functionality is defined by an interface (a trait in Rust). This promotes composition over inheritance, which is considered mo...
This UNION ALL combines data from multiple tables and serve as a table name alias to use for your queries: SELECT YEAR(date_time_column), MONTH(date_time_column), MIN(DATE(date_time_column)), MAX(DATE(date_time_column)), COUNT(DISTINCT (ip)), COUNT(ip), (COUNT(ip) / COUNT(DISTINCT (ip))) AS Ratio ...
Dockerization of ASP.NET Application requires a Dockerfile for configuration and running it as a docker container. FROM microsoft/dotnet:latest RUN apt-get update && apt-get install sqlite3 libsqlite3-dev COPY . /app WORKDIR /app RUN ["dotnet", "restore"] ...
It is nessecary to have .NET or a mono-aspnet package. It is important to understand the importance of dockerization. Install dotnet on ubuntu or the OS you are working on. Installing DOTNET $ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty m...
First of all, the problem of handling spaces in arguments is NOT actually a Java problem. Rather it is a problem that needs to be handled by the command shell that you are using when you run a Java program. As an example, let us suppose that we have the following simple program that prints the siz...
Go to Codeship.com and create an account (or login) Create a new project Import your project via Github or Bitbucket On the screen "Configure Your Tests" use these commands: Select "I want to create my own custom commands" from the "Select your technology to prepop...
Write some tests Install dispatch:mocha-phantomjs: meteor add dispatch:mocha-phantomjs Add a test-command to your package.json. { "name": "awesome meteor package", "scripts": { "test": "meteor test --driver-package dispatch:mocha-...

Page 570 of 826