Tutorial by Examples: bi

It is very convenient to use extension methods with interfaces as implementation can be stored outside of class and all it takes to add some functionality to class is to decorate class with interface. public interface IInterface { string Do() } public static class ExtensionMethods{ pu...
we can annotate fields with @BindView and a view ID for Butter Knife to find and automatically cast the corresponding view in our layout. Binding Views Binding Views in Activity class ExampleActivity extends Activity { @BindView(R.id.title) TextView title; @BindView(R.id.subtitle) TextView ...
The bitwise NOT (~) performs a NOT operation on each bit in a value. Syntax: ~expression Returns: a Number. Description The truth table for the NOT operation is: aNOT a01101337 (base 10) = 0000010100111001 (base 2) ~1337 (base 10) = 1111101011000110 (base 2) = -1338 (base 10) A bit...
It's often useful to combine multiple plot types in one graph (for example a Barplot next to a Scatterplot.) R makes this easy with the help of the functions par() and layout(). par() par uses the arguments mfrow or mfcol to create a matrix of nrows and ncols c(nrows, ncols) which will serve as a ...
Unlike Big-O notation, which represents only upper bound of the running time for some algorithm, Big-Theta is a tight bound; both upper and lower bound. Tight bound is more precise, but also more difficult to compute. The Big-Theta notation is symmetric: f(x) = Ө(g(x)) <=> g(x) = Ө(f(x)) An ...
OnClick Listener: @OnClick(R.id.login) public void login(View view) { // Additional logic } All arguments to the listener method are optional: @OnClick(R.id.login) public void login() { // Additional logic } Specific type will be automatically casted: @OnClick(R.id.submit) publi...
Fragments have a different view lifecycle than activities. When binding a fragment in onCreateView, set the views to null in onDestroyView. Butter Knife returns an Unbinder instance when you call bind to do this for you. Call its unbind method in the appropriate lifecycle callback. An example: pub...
When Intel defined the original 8086, it was a 16-bit processor with a 20-bit address bus (see below). They defined 8 general-purpose 16-bit registers - but gave them specific roles for certain instructions: AX The Accumulator register. Many opcodes either assumed this register, or were faster i...
When Intel produced the 80386, they upgraded from a 16-bit processor to a 32-bit one. 32-bit processing means two things: both the data being manipulated was 32-bit, and the memory addresses being accessed were 32-bit. To do this, but still remain compatible with their earlier processors, they intro...
The first four 16-bit registers could have their upper- and lower-half bytes accessed directly as their own registers: AH and AL are the High and Low halves of the AX register. BH and BL are the High and Low halves of the BX register. CH and CL are the High and Low halves of the CX register. D...
AMD is a processor manufacturer that had licensed the design of the 80386 from Intel to produce compatible - but competing - versions. They made internal changes to the design to improve throughput or other enhancements to the design, while still being able to execute the same programs. To one-up I...
/** * Parameters * * @param int $int * @param string $string * @param array $array * @param bool $bool */ function demo_param($int, $string, $array, $bool) { } /** * Parameters - Optional / Defaults * * @param int $int * @param string $string * @param ...
This example hides the red box (border) if the checkbox is not checked by making use of an IValueConverter. Note: The BooleanToVisibilityConverter used in the example below is a built-in value converter, located in the System.Windows.Controls namespace. XAML: <Window x:Class="StackOverflo...
You can bind to a property on a named element, but the named element must be in scope. <StackPanel> <CheckBox x:Name="MyCheckBox" IsChecked="True" /> <TextBlock Text="{Binding IsChecked, ElementName=MyCheckBox}" /> </StackPanel>
You can bind to a property of an ancestor in the visual tree by using a RelativeSource binding. The nearest control higher in the visual tree which has the same type or is derived from the type you specify will be used as the binding's source: <Grid Background="Blue"> <Grid ...
You can diff UTF-16 encoded files (localization strings file os iOS and macOS are examples) by specifying how git should diff these files. Add the following to your ~/.gitconfig file. [diff "utf16"] textconv = "iconv -f utf-16 -t utf-8" iconv is a program to convert differe...
type Person = { Age : int PassedDriversTest : bool } let someone = { Age = 19; PassedDriversTest = true } match someone.PassedDriversTest with | true when someone.Age >= 16 -> printfn "congrats" | true -> printfn "wait until you are 16" | false -> p...
Think about a situation where we need to callback a function with arguments. std::function used with std::bind gives a very powerful design construct as shown below. class A { public: std::function<void(int, const std::string&)> m_CbFunc = nullptr; void foo() { ...
The cubic-bezier function is a transition timing function which is often used for custom and smooth transitions. transition-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1); The function takes four parameters: cubic-bezier(P1_x, P1_y, P2_x, P2_y) These parameters will be mapped to points whic...
<p ng-bind="message"></p> This 'message' has to be attached to the current elements controller's scope. $scope.message = "Hello World"; At a later point of time , even if the message model is updated , that updated value is reflected in the HTML element. When ...

Page 6 of 29