Tutorial by Examples: v

Swift let mapView = MKMapView(frame: CGRect(x: 0, y: 0, width: 320, height: 500)) It's recommended to store the mapView as a property of the containing ViewController since you might want to access it in more complex implementations. Objective C self.map = [[MKMapView alloc]initWithFrame:CGRec...
To make a rounded UIView, specify a cornerRadius for the view's layer. This also applies any class which inherits from UIView, such as UIImageView. Programmatically Swift Code someImageView.layoutIfNeeded() someImageView.clipsToBounds = true someImageView.layer.cornerRadius = 10 Objective-C...
All Java exceptions are instances of classes in the Exception class hierarchy. This can be represented as follows: java.lang.Throwable - This is the base class for all exception classes. Its methods and constructors implement a range of functionality common to all exceptions. java.lang.Excep...
If a name is bound inside a function, it is by default accessible only within the function: def foo(): a = 5 print(a) # ok print(a) # NameError: name 'a' is not defined Control flow constructs have no impact on the scope (with the exception of except), but accessing variable that w...
enum MyEnum { One, Two, Three } foreach(MyEnum e in Enum.GetValues(typeof(MyEnum))) Console.WriteLine(e); This will print: One Two Three
Running the latest Liferay CE is straightforward: Go to https://www.liferay.com/downloads. Choose a bundle among the ones listed. For beginners, the Tomcat bundle is a good choice. Click in "Download." Unzip the download package whenever you find fit. The unzipped directory will...
Define a new type, mytype: type :: mytype integer :: int real :: float end type mytype Declare a variable of type mytype: type(mytype) :: foo The components of a derived type can be accessed with the % operator1: foo%int = 4 foo%float = 3.142 A Fortran 2003 feature (not yet ...
In order to exit Vim, first make sure you are in Normal mode by pressing Esc. :q Enter (will prevent you from exiting if you have unsaved changes - short for :quit) To discard changes and exit Vim: :q! Enter to force exit and discard changes (short for :quit!, not to be confused with :!q), ...
Substitutability is a principle in object-oriented programming introduced by Barbara Liskov in a 1987 conference keynote stating that, if class B is a subclass of class A, then wherever A is expected, B can be used instead: class A {...} class B extends A {...} public void method(A obj) {...} ...
Deploying an advanced project template to shared hosting is a bit trickier than a basic one because it has two webroots, which shared hosting webservers don't support. We will need to adjust the directory structure so frontend URL will be http://site.local and backend URL will be http://site.local/a...
Introduction SharePoint 2016 is the version 16 release of the SharePoint product family. It was released on May 4, 2016. This example covers the installation of SharePoint 2016 using the Single Server Farm configuration. This configuration covers the basics of setting up a SharePoint farm without t...
CommandDescription<Esc>Leaves insert mode, triggers autocommands and abbreviations<C-[>Exact synonymous of <Esc><C-c>Leaves insert mode, doesn't trigger autocommands Some people like to use a relatively uncommon pair of characters like jk as shortcut for <Esc> or <C...
The private keyword marks properties, methods, fields and nested classes for use inside the class only: public class Foo() { private string someProperty { get; set; } private class Baz { public string Value { get; set; } } public void Do() { var ...
Active patterns are a special type of pattern matching where you can specify named categories that your data may fall into, and then use those categories in match statements. To define an active pattern that classifies numbers as positive, negative or zero: let (|Positive|Negative|Zero|) num = ...
Inline SVG allows SVG markup, written within HTML, to generate graphics in the browser. When using SVG inline, a DOCTYPE is not strictly required. Instead just the <svg> opening and closing tags together with either a viewBox or width and height attributes will suffice: <svg width="1...
Directives are one of the most powerful features of angularjs. Custom angularjs directives are used to extend functionality of html by creating new html elements or custom attributes to provide certain behavior to an html tag. directive.js // Create the App module if you haven't created it yet va...
This progam uses VCL, the default UI components library of Delphi, to print "Hello World" into a message box. The VCL wrapps most of the commonly used WinAPI components. This way, they can be used much easier, e.g. without the need to work with Window Handles. To include a dependency (lik...
There is already a function sum(). As a result, if we name a variable with the same name sum = 1+3; and if we try to use the function while the variable still exists in the workspace A = rand(2); sum(A,1) we will get the cryptic error: Subscript indices must either be real positive integer...
Download and install Visual Studio. Visual Studio can be downloaded from VisualStudio.com. The Community edition is suggested, first because it is free, and second because it involves all the general features and can be extended further. Open Visual Studio. Welcome. Go to File → New ...
The function in_array() returns true if an item exists in an array. $fruits = ['banana', 'apple']; $foo = in_array('banana', $fruits); // $foo value is true $bar = in_array('orange', $fruits); // $bar value is false You can also use the function array_search() to get the key of a specifi...

Page 25 of 296