In ExtJS, you can override nearly any method of the framework and replace it with your own. This allows you to modify existing classes without directly modifying the ExtJS source code.
Sometimes, you may want to enhance an existing class or provide a sane default property on a class.
For example, ...
It is possible to create more complex loops with dictionaries.
From vars:
packages:
- present: tree
- present: nmap
- absent: apache2
then the loop:
- name: manage packages
package: name={{ item.value }} state={{ item.key }}
with_items: '{{ packages }}'
Or, if you don't like ...
FirebaseUI offers Android, iOS, and Web clients. You can get started with them like so:
Android:
// app/build.gradle
dependencies {
// Single target that includes all FirebaseUI libraries
compile 'com.firebaseui:firebase-ui:0.5.2'
// FirebaseUI Database only
compile 'com.f...
Sometimes you need to set the same data in many of your views.
Using View::share
// "View" is the View Facade
View::share('shareddata', $data);
After this, the contents of $data will be available in all views under the name $shareddata.
View::share is typically called in a service p...
We can add adaptivity to any subclass of UIView which we add on view controller in nib file.
Lets take an example of adding adaptivity using size classes to a view.
Add a view on view controller as:
Now we need to pin this view to it's superview for fixing it's size and position using con...
Before understand require to follow some setup for project integrate with firebase.
Create your project in Firebase Console and download google-service.json file from console and put it in app level module of your project,
Follow link for Create Project in console
After this we require to...
var result = switch([1, 6]) {
case [2, _]:
"0";
case [_, 6]:
"1";
case []:
"2";
case [_, _, _]:
"3";
case _:
"4";
}
References
"Array matching", Haxe manual
It is also possible to further restrict patterns with guards. These are defined by the case ... if(condition): syntax.
var myArray = [7, 6];
var s = switch(myArray) {
case [a, b] if (b > a):
b + ">" +a;
case [a, b]:
b + "<=" +a;
case _:...
This relies on the official consul docker image to run consul in clustered mode in a docker swarm with new swarm mode in Docker 1.12. This example is based on http://qnib.org/2016/08/11/consul-service/. Briefly the idea is to use two docker swarm services that talk to each other. This solves the pro...
This is example has extracted from this boilerplate.
Custom middleware:
export default function clientMiddleware() {
return ({dispatch, getState}) => {
return next => action => {
if (typeof action === 'function') {
return action(dispatch, getState);
}
...
The most basic case to lift a particular window above the others, just call the .lift() method on that window (either Toplevel or Tk)
import tkinter as tk #import Tkinter as tk #change to commented for python2
root = tk.Tk()
for i in range(4):
#make a window with a label
window = tk...
WordPress is applying pre_get_posts filter to literally any loop it generates. It means that all changes we are making in our callback function are applied to all exiting loops.
Obviously it is not what we want in most scenarios.
In most cases we would like to target only main loop, and only for n...
' Just setting up the example
Public Class A
Public Property ID as integer
Public Property Name as string
Public Property OtherValue as Object
End Class
Public Sub Example()
'Setup the list of items
Dim originalList As New List(Of A)
originalList.Add(New A() With {...
Variance measures how far a set numbers is spread out from it's mean. From practical perspective it is squared distance from its mean (center) - the bigger the number the farther the point is.
The following example would return variance of salary values
SELECT name, salary, VARIANCE(salary) "...
At it's most basic level, acceptance testing is essentially black-box testing, which is fundamentally concerned with testing inputs and outputs of a closed system. As such, there are three essential features to acceptance testing: locating a resource, reading data, and writing data. When it comes to...
We install OpenCV 3.1.0 on Windows and get started. There are two ways to install OpenCV on windows. One is to download the installer and run it. Other is to build from source.
This is the easiest way to install OpenCV and get started. OpenCV gives pre-build binaries to install on Windows here. Aft...
This example shows how to retrieve an ID of a newly created item using SharePoint REST API.
Note :
listName - This variable contains name of you list.
newItemBody - This will be your request body for adding new item in list.
e.g. var newItemBody =
{
__metadata: { 'type': 'SP.Data.MyListNameIte...