Tutorial by Examples

You can also apply a mixin globally. Use caution! Once you apply a mixin globally, it will affect every Vue instance created afterwards. When used properly, this can be used to inject processing logic for custom options: // inject a handler for `myOption` custom option Vue.mixin({ created: func...
When custom options are merged, they use the default strategy, which simply overwrites the existing value. If you want a custom option to be merged using custom logic, you need to attach a function to Vue.config.optionMergeStrategies: Vue.config.optionMergeStrategies.myOption = function (toVal, fro...
Mixins are a flexible way to distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be “mixed” into the component’s own options. // define a mixin object var myMixin = { created: fun...
When a mixin and the component itself contain overlapping options, they will be “merged” using appropriate strategies. For example, hook functions with the same name are merged into an array so that all of them will be called. In addition, mixin hooks will be called before the component’s own hooks:...
Let's say you have a service the same as the one defined in the "First service and host" example. To create a client, define the client configuration section in the system.serviceModel section of your client configuration file. <system.serviceModel> <services> <cli...
RoboGuice is a framework that brings the simplicity and ease of Dependency Injection to Android, using Google's own Guice library. @ContentView(R.layout.main) class RoboWay extends RoboActivity { @InjectView(R.id.name) TextView name; @InjectView(R.id.thumbnail) Image...
Add the following pom to the dependencies section of your gradle build file : project.dependencies { compile 'org.roboguice:roboguice:3.+' provided 'org.roboguice:roboblender:3.+' }
The @ContentView annotation can be used to further alleviate development of activities and replace the setContentView statement : @ContentView(R.layout.myactivity_layout) public class MyActivity extends RoboActivity { @InjectView(R.id.text1) TextView textView; @Override protected ...
You can inject any type of resource, Strings, Animations, Drawables, etc. To inject your first resource into an activity, you'll need to: Inherit from RoboActivity Annotate your resources with @InjectResource Example @InjectResource(R.string.app_name) String name; @InjectResource(R.drawa...
You can inject any view using the @InjectView annotation: You'll need to: Inherit from RoboActivity Set your content view Annotate your views with @InjectView Example @InjectView(R.id.textView1) TextView textView1; @InjectView(R.id.textView2) TextView textView2; @InjectView(R.id.imag...
The UIAlertController available since iOS8 allows you to use the same alert object for either Action sheets or more classic alerts. The only difference is the UIAlertControllerStyle passed as a parameter when creating. This line changes from an AlertView to an ActionSheet, compared to some other ex...
It was common practice to use NSRunLoop to show modal UIAlertView to block code execution until user input is processed in iOS; until Apple released the iOS7, it broke few existing apps. Fortunately, there is a better way of implementing it with C#’s async/await. Here’s the new code taking advantag...
User input Imagine you want a user to enter a number via input. You want to ensure that the input is a number. You can use try/except for this: Python 3.x3.0 while True: try: nb = int(input('Enter a number: ')) break except ValueError: print('This is not a num...
To change the appearance of the keyboard, the following types can be set individually on every UITextFields property: keyboardType typedef NS_ENUM(NSInteger, UIKeyboardType) { UIKeyboardTypeDefault, // Default type for the current input method. UIKeyboardTypeASCIICapable, ...
Func provides a holder for parameterised anonymous functions. The leading types are the inputs and the last type is always the return value. // square a number. Func<double, double> square = (x) => { return x * x; }; // get the square root. // note how the signature matches the built ...
Functions have two built-in methods that allow the programmer to supply arguments and the this variable differently: call and apply. This is useful, because functions that operate on one object (the object that they are a property of) can be repurposed to operate on another, compatible object. Addi...
To create a variable: variableType variableName; For example: int a; To create a variable and initialize it: variableType variableName = initialValue; For example: int a = 2;
If you have a variable declared before, you can assign some value to it: For example: int a; // declared previously a = 2; Or change the value: int a = 3; // initalized previously a = 2;
char : signed 1-byte character value byte : unsigned 8-bit integer int : signed 16-bit (on ATMEGA based boards) or 32-bit (on Arduino Due) integer unsigned int : unsigned 16-bit (on ATMEGA based boards) or 32-bit (on Arduino Due) integer long : signed 32-bit integer unsigned long : unsigned 3...
DECLARE @Employees TABLE ( EmployeeID INT NOT NULL PRIMARY KEY, FirstName NVARCHAR(50) NOT NULL, LastName NVARCHAR(50) NOT NULL, ManagerID INT NULL ) When you create a normal table, you use CREATE TABLE Name (Columns) syntax. When creating a table variable, you use DECLARE @...

Page 320 of 1336