Tutorial by Examples: bi

Sometimes you may only need to simulate an event with two outcomes, maybe with different probabilities, but you may find yourself in a situation that calls for many possible outcomes with different probabilities. Let's imagine you want to simulate an event that has six equally probable outcomes. T...
One should have in mind that: Angular's data binding relies on JavaScript’s prototypal inheritance, thus it's subject to variable shadowing. A child scope normally prototypically inherits from its parent scope. One exception to this rule is a directive which has an isolated scope as it doesn't p...
cdecl is a Windows 32-bit function calling convention which is very similar to the calling convention used on many POSIX operating systems (documented in the i386 System V ABI). One of the differences is in returning small structs. Parameters Parameters are passed on the stack, with the first arg...
This is the default calling convention for 64-bit applications on many POSIX operating systems. Parameters The first eight scalar parameters are passed in (in order) RDI, RSI, RDX, RCX, R8, R9, R10, R11. Parameters past the first eight are placed on the stack, with earlier parameters closer to th...
stdcall is used for 32-bit Windows API calls. Parameters Parameters are passed on the stack, with the first parameter closest to the top of the stack. The callee will pop these values off of the stack before returning. Return Value Scalar return values are placed in EAX. Saved and Clobbered Re...
Vim's standard search commands are / for forward search and ? for backward search. To start a search from normal mode: press /, type your pattern, press <CR> to perform the search. Examples: /foobar<CR> search forward for foobar ?foo\/bar<CR> search backward for ...
You can have a dependency with a single jar or multiple jar files. With a single jar file you can add: dependencies { compile files('libs/local_dependency.jar') } It's possible to add a directory of jars to compile. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']...
You can add remote dependencies in Gradle usign this structure: compile 'group:name:version' or this alternative syntax: compile group: 'xxx', name: 'xxxxx', version: 'xxxx' For example: compile 'com.android.support:appcompat-v7:24.1.0' The compile 'com.android.support:appcompat-v7:24.1....
As parameters (8, 16, 32 bits) 8, 16, 32 bits integers are always passed, on the stack, as full width 32 bits values1. No extension, signed or zeroed, is needed. The callee will just use the lower part of the full width values. //C prototype of the callee void __attribute__((cdecl)) foo(char ...
As parameters (float, double) Floats are 32 bits in size, they are passed naturally on the stack. Doubles are 64 bits in size, they are passed, on the stack, respecting the Little Endian convention1, pushing first the upper 32 bits and than the lower ones. //C prototype of callee double foo(dou...
It's also possible to use data binding within your RecyclerView Adapter. Data model public class Item { private String name; public String getName() { return name; } } XML Layout <TextView android:layout_width="wrap_content" android:layou...
With the ~ selector, you can easily implement a global accessible boolean without using JavaScript. Add boolean as a checkbox To the very beginning of your document, add as much booleans as you want with a unique id and the hidden attribute set: <input type="checkbox" id="sideba...
The backface-visibility property relates to 3D transforms. With 3D transforms and the backface-visibility property, you're able to rotate an element such that the original front of an element no longer faces the screen. For example, this would flip an element away from the screen: JSFIDDLE <d...
To change UI content in runtime, you can use Binding. When binded property is changed from the code, it will be displayed to the UI. <TextBlock Text="{Binding Title}"/> To notify UI about changes, property must raise PropertyChanged event from INotifyPropertyChanged interface or ...
Unlike Java, Dart doesn’t have the keywords public, protected, and private. If an identifier starts with an underscore _, it’s private to its library. If you for example have class A in a separate library file (eg, other.dart), such as: library other; class A { int _private = 0; testA()...
Parameters The first 4 parameters are passed in (in order) RCX, RDX, R8 and R9. XMM0 to XMM3 are used to pass floating point parameters. Any further parameters are passed on the stack. Parameters larger than 64bit are passed by address. Spill Space Even if the function uses less than 4 paramet...
#include <stdio.h> int main(void) { /* define a small bit-field that can hold values from 0 .. 7 */ struct { unsigned int uint3: 3; } small; /* extract the right 3 bits from a value */ unsigned int value = 255 - 2; /* Binary 11111101 */ small.u...
Start with importing the library. from amqpstorm import Connection When consuming messages, we first need to define a function to handle the incoming messages. This can be any callable function, and has to take a message object, or a message tuple (depending on the to_tuple parameter defined in ...
Start with importing the library. from amqpstorm import Connection from amqpstorm import Message Next we need to open a connection to the RabbitMQ server. connection = Connection('127.0.0.1', 'guest', 'guest') After that we need to set up a channel. Each connection can have multiple channel...
First we need to set up two basic channels, one for the main queue, and one for the delay queue. In my example at the end, I include a couple of additional flags that are not required, but makes the code more reliable; such as confirm delivery, delivery_mode and durable. You can find more informatio...

Page 10 of 29