Tutorial by Examples: is

The last common use of HTTP APIs is to obtain a list of existing resources on the server. Lists like this should be obtained using GET requests, since they only retrieve data. The server should return 200 OK if it can supply the list, or an appropriate error code if not. Listing our employees, the...
Vuex is an official plugin for Vue.js which offers a centralised datastore for use within your application. It is heavily influenced by the Flux application architecture which features a unidirectional data flow leading to simpler application design and reasoning. Within a Vuex application the data...
Like any other java program, every swing program starts with a main method. The main method is initiated by the main thread. However, Swing components need to be created and updated on the event dispatch thread (or short: EDT). To illustrate the dynamic between the main thread and the EDT take a loo...
ActiveWorkbook and ThisWorkbook sometimes get used interchangeably by new users of VBA without fully understanding which each object relates to, this can cause undesired behaviour at run-time. Both of these objects belong to the Application Object The ActiveWorkbook object refers to the workbook ...
$user = User::find(1); $user->name = 'abc'; $user->save(); You can also update multiple attributes at once using update, which does not require using save afterwards: $user = User::find(1); $user->update(['name' => 'abc', 'location' => 'xyz']); You can also update a model(s)...
Assuming this HTML in the page: <body> <div id="myPage"> </div> </body> A view can be bound to it with: var MyPageView = Backbone.View.extend( { "el": "#myPage", "template": _.template( "<p>This is m...
We can easily separate distribution specific tasks and variables into different dedicated .yml files. Ansible helps us to automatically identify the target hosts distribution via {{ ansible_distribution }} and {{ ansible_distribution_version }}, so we just have to name the distribution dedicated .y...
We can provision remote systems with Ansible. You should have an SSH key-pair and you should take your SSH public key to the machine ~/.ssh/authorized_keys file. The porpuse is you can login without any authorization. Prerequisites: Ansible You need an Inventory file (for ex.: development.ini...
To register your device for push notifications, add the following code to your AppDelegate file in didFinishLaunchingWithOptions method: Swift func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for c...
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload HSTS is activated only after a successful HTTPS request to the server with a valid certificate. There is still a risk of a first-time user accessing the site, at which point a Man-in-the-Middle attack is possible. To make th...
Setup your view controller to manage editing of text for the text field. class MyViewController: UITextFieldDelegate { override viewDidLoad() { super.viewDidLoad() textField.delegate = self } } textFieldShouldReturn is called every time the return butto...
Premise The most confusing thing surrounding pointer syntax in C and C++ is that there are actually two different meanings that apply when the pointer symbol, the asterisk (*), is used with a variable. Example Firstly, you use * to declare a pointer variable. int i = 5; /* 'p' is a pointer to a...
Suppose you have two lists: A and B, and you need to find the elements that exist in both lists. You can do it by just invoking the method List.retainAll(). Example: public static void main(String[] args) { List<Integer> numbersA = new ArrayList<>(); List<Integer> numb...
C++14 In C++14, this is easily done by std::mismatch which returns the first mismatching pair from two ranges: std::string prefix = "foo"; std::string string = "foobar"; bool isPrefix = std::mismatch(prefix.begin(), prefix.end(), string.begin(), string.end()).first == ...
The code below implements a very simple complex number type for which the underlying field is automatically promoted, following the language's type promotion rules, under application of the four basic operators (+, -, *, and /) with a member of a different field (be it another complex<T> or so...
Consider the case of creating a nested list structure by multiplying: li = [[]] * 3 print(li) # Out: [[], [], []] At first glance we would think we have a list of containing 3 different nested lists. Let's try to append 1 to the first one: li[0].append(1) print(li) # Out: [[1], [1], [1]] ...
iex> [1, 2, 3] -- [1, 3] [2] -- removes the first occurrence of an item on the left list for each item on the right.
Use in operator to check if an element is a member of a list. iex> 2 in [1, 2, 3] true iex> "bob" in [1, 2, 3] false
Common use when: ansible_os_family == "CentOS" when: ansible_os_family == "Redhat" when: ansible_os_family == "Darwin" when: ansible_os_family == "Debian" when: ansible_os_family == "Windows" All Lists based on discuss here http://comments...
The angular.isObject return true if and only if the argument passed to it is an object, this function will also return true for an Array and will return false for null even though typeof null is object . angular.isObject(value) This function is useful for type checking when you need a defined ...

Page 38 of 109