Tutorial by Examples: ti

First declare a property like this in the ViewController @property (nonatomic) UIRefreshControl *refreshControl; Later in the viewDidLoad() set up the refreshControl as given below: self.refreshControl = [[UIRefreshControl alloc]init]; [self.tableView addSubview:self.refreshControl]; [self.re...
What is Concurrency? Doing multiple things at the same time. Taking advantage of number of cores available in multicore CPUs. Running multiple programs in parallel. Objectives of Concurrency Running program in background without hogging CPU. Define Tasks, Define Rules and let...
Jest is a javascript testing framework widely used for testing react applications. Its supported by facebook Here's a test import 'react-native'; import React from 'react'; import Index from '../index.android.js'; import renderer from 'react-test-renderer'; it('renders correctly', () =>...
One common pitfall is to try and use this in a nested function or an object, where the context has been lost. document.getElementById('myAJAXButton').onclick = function(){ makeAJAXRequest(function(result){ if (result) { // success this.className = 'success'; } }) }...
5.1 Every function has a bind method, which will create a wrapped function that will call it with the correct context. See here for more information. var monitor = { threshold: 5, check: function(value) { if (value > this.threshold) { this.display("Value is too high!&quot...
When using a function as a constructor, it has a special this binding, which refers to the newly created object: function Cat(name) { this.name = name; this.sound = "Meow"; } var cat = new Cat("Tom"); // is a Cat object cat.sound; // Returns "Meow" var ca...
There are various ways to use colours in Processing since Processing is very flexible with colour formats. RGB and RGBA This is the standard RGB(A) notation and the default color mode. The first three colour values (red, green, blue) range from 0 to 255. For example, the below example is the colou...
The reference to the outer class uses the class name and this public class OuterClass { public class InnerClass { public void method() { System.out.println("I can access my enclosing class: " + OuterClass.this); } } } You can access fields and ...
Download Play! 1. Goto http://www.playframework.com/download and download latest Play! release (play-2.5.X.zip at the time of this writing). Unzip in a directory of your choice. We’ll refer to uncompressed folder directory as PLAY_HOME. Add PLAY_HOME folder to you PATH environment variable, so that...
You can make your plugin customizable by accepting options. $.fn.colourize = function(options) { // This is one method to support default options var style = $.extend({ color: "green", backgroundColor: "white" }, options); // Set the col...
func isValidEmail(email: String) -> Bool { let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}" let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) return emailTest.evaluate(with: email) } or you could use String extensio...
Let's say that you have the following class: public class PersonInfo { public int ID { get; set; } [Display(Name = "First Name")] [Required(ErrorMessage = "Please enter your first name!")] public string FirstName{ get; set; } [Display(Name = "L...
public String getCitiesByCountry(String countryName) throws MalformedURLException, IOException { //Code to make a webservice HTTP request String responseString = ""; String outputString = ""; String wsURL = "http://www.webservicex.com/globalweather.asm...
Go to https://www.mozilla.org/firefox/new/. 1.Click on Download button. 2.An executable file will be downloaded. 3.Double click on the .exe file and click run. 4.Finish the setup. 5.Select the option of "Maintain shortcut on the desktop".
Slightly counterintuitively (but also the only sane way to make it work), this: val dyn: Dynamic = ??? dyn.x(y) = z is equivalent to: dyn.selectDynamic("x").update(y, z) while dyn.x(y) is still dyn.applyDynamic("x")(y) It is important to be aware of this, or else...
Result<T, E> is an enum type which has two variants: Ok(T) indicating successful execution with meaningful result of type T, and Err(E) indicating occurrence of an unexpected error during execution, described by a value of type E. enum DateError { InvalidDay, InvalidMonth, } str...
Using a CASE statement, conditionally display an expression in the column based on values found in another column, a.k.a. “my kingdom for an OR”. In the example, the result is obtained when the status of the transaction is Pending Fulfillment or Partially Fulfilled: CASE DECODE( {status}, 'Pending ...
The example builds a string from the name of the parent record, the name of this record, and the memo of this record. {createdfrom} || ' ' || {name} || ' ' || {memo}
'<div style="font-size:11pt">' || expression || '</div>'
In a string formula field, consider that some values might contain substrings which look to the browser like HTML. Unless this is intentional, it is important to protect the values from corruption. This is useful to avoid injection attacks: it prevents someone from entering HTML into a comment field...

Page 401 of 505