Tutorial by Examples: e

You can enhance your own classes with generics just like NSArray or NSDictionary. @interface MyClass<__covariant T> @property (nonnull, nonatomic, strong, readonly) NSArray<T>* allObjects; - (void) addObject:(nonnull T)obj; @end
The format statement applies the given format to the specified variable for display purposes only, i.e. the underlying value does not change. data example1 ; Date = '02AUG2016'd ; /* stored as a SAS date, i.e. a number */ Date2 = '31AUG2016'd ; format Date monyy7. Date2 yymmddn8. ; run...
//Here self.webView is the view whose screenshot I need to take //The screenshot is saved in jpg format in the application directory to avoid any loss of quality in retina display devices i.e. all current devices running iOS 10 UIGraphicsBeginImageContextWithOptions(self.webView.bounds.size, N...
Idiom specific adjustments can be done from C# code, for example for changing the layout orientation whether the view is shown or a phone or a tablet. if (Device.Idiom == TargetIdiom.Phone) { this.panel.Orientation = StackOrientation.Vertical; } else { this.panel.Orientation = Stac...
Adjustments can be done for specific platforms from C# code, for example for changing padding for all the targeted platforms. if (Device.OS == TargetPlatform.iOS) { panel.Padding = new Thickness (10); } else { panel.Padding = new Thickness (20); } An helper method is also availab...
When working with XAML, using a centralized Style allows you to update a set of styled views from one place. All the idiom and platform adjustements can also be integrated to your styles. <Style TargetType="StackLayout"> <Setter Property="Padding"> <Setter...
You can create custom views that can be integrated to your page thanks to those adjustment tools. Select File > New > File... > Forms > Forms ContentView (Xaml) and create a view for each specific layout : TabletHome.xamland PhoneHome.xaml. Then select File > New > File... > F...
Creating variables in VBScript can be done by using the Dim, Public, or Private statement. It is best practice to put at the top of the script "Option Explicit" which forces you to explicitly define a variable. You can declare one variable like this: Option Explicit Dim firstName O...
Here are some ways to set variables: You can set a variable to a specific, string, number, date using SET EX: SET @var_string = 'my_var'; SET @var_num = '2' SET @var_date = '2015-07-20'; you can set a variable to be the result of a select statement using := EX: Select @var := '123'; (...
To mark some expression as an abbreviation, use <abbr> tag: <p>I like to write <abbr title="Hypertext Markup Language">HTML</abbr>!</p> If present, the title attribute is used to present the full description of such abbreviation.
To move to split on left, use <C-w><C-h> To move to split below, use <C-w><C-j> To move to split on right, use <C-w><C-k> To move to split above, use <C-w><C-l>
It's a better experience to open split below and on right set it using set splitbelow set splitright
Source table RowABCD1CodeProductColourPrice21penred50032penblue-5043penred054pencilblue1765pencilgreen-1.5 to select all: = QUERY(A1:D5, "select *") or = QUERY(A1:D5, "select A, B, C, D") or convert data range into array and use this formula: = QUERY({A1:D5}, "sel...
Assume you want to delegate to a class but you do not want to provide the delegated-to class in the constructor parameter. Instead, you want to construct it privately, making the constructor caller unaware of it. At first this might seem impossible because class delegation allows to delegate only to...
Gson does not support inheritance out of the box. Let's say we have the following class hierarchy: public class BaseClass { int a; public int getInt() { return a; } } public class DerivedClass1 extends BaseClass { int b; @Override public int getI...
Struct defines new classes with the specified attributes and accessor methods. Person = Struct.new :first_name, :last_name You can then instantiate objects and use them: person = Person.new 'John', 'Doe' # => #<struct Person first_name="John", last_name="Doe"> p...
Person = Struct.new :name do def greet(someone) "Hello #{someone}! I am #{name}!" end end Person.new('Alice').greet 'Bob' # => "Hello Bob! I am Alice!"
Attributes can be accessed strings and symbols as keys. Numerical indexes also work. Person = Struct.new :name alice = Person.new 'Alice' alice['name'] # => "Alice" alice[:name] # => "Alice" alice[0] # => "Alice"
The first thing to do is to add the service to AndroidManifest.xml, inside the <application> tag: <application ...> ... <service android:name=".RecordingService" <!--"enabled" tag specifies Whether or not the service can ...
filter returns a list of each item in the given list for which the given predicate returns a non-#f value. ;; Get only even numbers in a list > (filter even? '(1 2 3 4)) '(2 4) ;; Get all square numbers from 1 to 100 > (filter (lambda (n) (integer? (sqrt n))) (range 1 100)) '(1 4 9 16 ...

Page 607 of 1191