Tutorial by Examples: ce

Select your button (or whatever view you want to center) on the storyboard. Then click the align button on the bottom right. Select Horizontally in Container and Vertically in Container. Click "Add 2 Constraints". If it wasn't perfectly centered already, you may need to do one more thin...
First we need to install composer. Steps to install composer Install Composer. curl -sS https://getcomposer.org/installer | php Now change directory: sudo mv composer.phar /usr/local/bin/composer Check composer working composer Now Composer installed. There two ways to install Yii2 adv...
Introduction Interfaces are definitions of the public APIs classes must implement to satisfy the interface. They work as "contracts", specifying what a set of subclasses does, but not how they do it. Interface definition is much alike class definition, changing the keyword class to inter...
x = [5, 5, 1, 3] y = [5, 2, 4, 3] Union (|) contains elements from both arrays, with duplicates removed: x | y => [5, 1, 3, 2, 4] Intersection (&) contains elements which are present both in first and second array: x & y => [5, 3] Difference (-) contains elements which ar...
Step 1: Open a Workbook Step 2 Option A: Press Alt + F11 This is the standard shortcut to open the VBE. Step 2 Option B: Developer Tab --> View Code First, the Developer Tab must be added to the ribbon. Go to File -> Options -> Customize Ribbon, then check the box for developer. ...
In Python 2, reduce is available either as a built-in function or from the functools package (version 2.6 onwards), whereas in Python 3 reduce is available only from functools. However the syntax for reduce in both Python2 and Python3 is the same and is reduce(function_to_reduce, list_to_reduce). A...
The main difference is that double-quoted String literals support string interpolations and the full set of escape sequences. For instance, they can include arbitrary Ruby expressions via interpolation: # Single-quoted strings don't support interpolation puts 'Now is #{Time.now}' # Now is #{Time...
To access tuple elements use Item1-Item8 properties. Only the properties with index number less or equal to tuple size are going to be available (i.e. one cannot access Item3 property in Tuple<T1,T2>). var tuple = new Tuple<string, int, bool, MyClass>("foo", 123, true, new MyC...
In Python 2, range function returns a list while xrange creates a special xrange object, which is an immutable sequence, which unlike other built-in sequence types, doesn't support slicing and has neither index nor count methods: Python 2.x2.3 print(range(1, 10)) # Out: [1, 2, 3, 4, 5, 6, 7, 8, 9...
As long as the element is a block, and it has an explicitly set width value, margins can be used to center block elements on a page horizontally. We add a width value that is lower than the width of the window and the auto property of margin then distributes the remaining space to the left and the ...
This is the Python 2 syntax, note the commas , on the raise and except lines: Python 2.x2.3 try: raise IOError, "input/output error" except IOError, exc: print exc In Python 3, the , syntax is dropped and replaced by parenthesis and the as keyword: try: raise IOErro...
Rails uses sqlite3 as the default database, but you can generate a new rails application with a database of your choice. Just add the -d option followed by the name of the database. $ rails new MyApp -T -d postgresql This is a (non-exhaustive) list of available database options: mysql oracle...
When working with multi-module projects, it is helpful to centralize dependencies in a single location rather than having them spread across many build files, especially for common libraries such as the Android support libraries and the Firebase libraries. One recommended way is to separate the Gra...
The Dim statement should be reserved for local variables. At module-level, prefer explicit access modifiers: Private for private fields, which can only be accessed within the module they're declared in. Public for public fields and global variables, which can be accessed by any calling code. Fr...
You can open the VB editor in any of the Microsoft Office applications by pressing Alt+F11 or going to the Developer tab and clicking on the "Visual Basic" button. If you don't see the Developer tab in the Ribbon, check if this is enabled. By default the Developer tab is disabled. To enab...
Consider we have a class Animal which has a child class Dog class Animal { public Animal() { Console.WriteLine("In Animal's constructor"); } } class Dog : Animal { public Dog() { Console.WriteLine("In Dog's constructor"); } ...
A Kotlin interface contains declarations of abstract methods, and default method implementations although they cannot store state. interface MyInterface { fun bar() } This interface can now be implemented by a class as follows: class Child : MyInterface { override fun bar() { ...
An interface in Kotlin can have default implementations for functions: interface MyInterface { fun withImplementation() { print("withImplementation() was called") } } Classes implementing such interfaces will be able to use those functions without reimplementing cl...
Different flavors of application builds can contain different resources. To create a flavor-specific resource make a directory with the lower-case name of your flavor in the src directory and add your resources in the same way you would normally. For example, if you had a flavour Development and w...
Elements of the same class can often be concatenated into arrays (with a few rare exceptions, e.g. function handles). Numeric scalars, by default of class double, can be stored in a matrix. >> A = [1, -2, 3.14, 4/5, 5^6; pi, inf, 7/0, nan, log(0)] A = 1.0e+04 * 0.0001 -0.0002 0...

Page 12 of 134