Tutorial by Examples: o

To turn a Javascript Date object into a moment (moment object) just call moment and pass the Date as a argument moment(new Date()); // Moment {_isAMomentObject: true, _i: Sun Jul 31 2016 11:08:02 GMT+0300 (Jerusalem Daylight Time), _isUTC: false, _pf: Object, _locale: Locale…} To turn the momen...
For the purpose of sending push notifications to cordova apps. The first step is to obtain a device token. A "device token" is specific to each device and each project. Pre-requisite: Google Cloud Messaging Project Number For this go to Google Developer Console and create a new ...
Xamarin sturio opens Xib file and Storyboards by default in the Xamarin Designer. User can right click on the file and Open With -> `Xcode Interface Builder'
The Service Locator design pattern is very nearly dependency injection. Like the Bridge Pattern, this pattern can be used to reference platform-dependent code from a platform-independent context. Most interestingly, this pattern relies on the singleton pattern -- everything you put into the service ...
PSR-5 proposes a form of Generics-style notation for collections. Generics Syntax Type[] Type<Type> Type<Type[, Type]...> Type<Type[|Type]...> Values in a Collection MAY even be another array and even another Collection. Type<Type<Type>> Type<Type<Type[,...
Mediator pattern defines an object (Mediator) that encapsulates how a set of objects interact. It enables many-to-many communication. UML diagram: Key components: Mediator: Defines an interface for communication between Colleagues. Colleague: Is an abstract class, which defines the events to b...
The Monostate pattern is usually referred to as syntactic sugar over the Singleton pattern or as a conceptual Singleton. It avoids all the complications of having a single instance of a class, but all the instances use the same data. This is accomplished mostly by using static data members. One o...
In contrasto to the Singleton, the Monostate is suitable to be inherited to extend its functionalities, as long as member methods are not static. It follows a minimal example in C++: struct Settings { virtual std::size_t width() const noexcept { return width_; } virtual std::size_t heigh...
When only a single argument is supplied to numpy's where function it returns the indices of the input array (the condition) that evaluate as true (same behaviour as numpy.nonzero). This can be used to extract the indices of an array that satisfy a given condition. import numpy as np a = np.arang...
import unittest def addition(*args): """ add two or more summands and return the sum """ if len(args) < 2: raise ValueError, 'at least two summands are needed' for ii in args: if not isinstance(ii, (int, long, float, compl...
Installation npm install forever -g cd /node/project/directory Usages forever start app.js
SOAP is an acronym for Simple Object Access Protocol which defines a protocol that is used to exchange data via a Remote Procedure Call (RPC) with other SOAP services or clients. It is available in two version: SOAP 1.1 [IETF] SOAP 1.2 [IETF] SOAP 1.2 obsoletes SOAP 1.1 it is therefore recomm...
1. Logs: By default, Heroku allows only 1500 lines of consolidated logs. When more than 1500 lines of logs are required, one has to use addons provided Heroku. 2. Router: HTTP request have 30s timeout for initial response and 55s timeout thereafter. Maximum of 1MB buffer allowed for response. 3....
Within the context of an individual rule, Make automatically defines a number of special variables. These variables can have a different value for each rule in a makefile and are designed to make writing rules simpler. These variables can only be used in the recipe portion of a rule. VariableDesc...
The ?= operator is an extension that behaves like =, except that the assignment only occurs if the variable is not already set. x = hello x ?= world # $(x) will yield "hello"
The += operator is a common extension that adds the specified content to the end of the variable, separated by a space. x = hello x += world Variable references in the right-hand side will be expanded if and only if the original variable was defined as a simply-expanded variable.
This is such a common requirement in iOS development, and it was always something that had to be done purely in code (or using images - yuck!). Now it's incredibly easy to preview his kind of thing in Interface Builder, there's absolutely no excuse for not using it. Here's the code:- import UIKit ...
This tutorial assumes you already have a working OpenGL environment with all necessary libraries and headers available. #include <GL\glew.h> //Include GLEW for function-pointers etc. #include <GLFW\GLFW3.h> //Include GLFW for windows, context etc. //Impor...
glfwDefaultWindowHints(); glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); glfwWindowHint(GLFW_SAMPLES, 4); glfwWindowHint(GLFW_VISIBLE, GL_FALSE); //Window hints are used to manipulate the behavior of later created windows //As the name suggests, they are only hints, not hard constraints, which mea...
File Structure: pom.xml src/test/java/PlayStoreAutomation.java Launch command: mvn test -Dtest=PlayStoreAutomation PlayStoreAutomation.java import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import io.appium.java_client.android.AndroidDriver; import i...

Page 653 of 1038