Tutorial by Examples

An SKView does not need to fill the whole screen and can share space with other UI controls. You can even have more than one SKView displayed at once if you wish. To create a smaller SKView amongst other controls with Interface Builder, first create a normal ViewController, then drag and drop a new...
When a function returns an object (as opposed to using one that's passed in by the caller), be careful an exception doesn't cause the object to leak. function MakeStrings: TStrings; begin // Create a new object before entering the try-block. Result := TStringList.Create; try // Execu...
A try-finally block may be nested inside a try-except block. try AcquireResources; try UseResource; finally ReleaseResource; end; except on E: EResourceUsageError do begin HandleResourceErrors; end; end; If an exception occurs inside UseResource, then execution...
A try-except block may be nested inside a try-finally block. AcquireResource; try UseResource1; try UseResource2; except on E: EResourceUsageError do begin HandleResourceErrors; end; end; UseResource3; finally ReleaseResource; end; If an EResourceUsageE...
In Tcl itself, a string consisting of a single word does not need to be quoted. In the language of expression strings that expr evaluates, all operands must have an identifiable type. Numeric operands are written without any decoration: expr {455682 / 1.96e4} So are boolean constants: expr {tr...
The angular.copy function takes an object, array or a value and creates a deep copy of it. angular.copy() Example: Objects: let obj = {name: "vespa", occupation: "princess"}; let cpy = angular.copy(obj); cpy.name = "yogurt" // obj = {name: "vespa", ...
Navigation controller can be embed in each tabs using storyboard it self. It can be like in the screenshot added. To add a Navigation Controller to a View Controller connecting from Tab Bar Controller, here are the flow Select the view controller for which we need to add navigation controller. H...
Consider following html code <ul> <li id=“one” class=“main”>Item 1</li> <li id=“two” class=“main”>Item 2</li> <li id=“three” class=“main”>Item 3</li> <li id=“four”>Item 4</li> </ul> Following dom tree will be constructed ba...
In order to print the value of a variable such as, set tempVar "This is a string." The argument in the puts statement is preceded by a $ sign, which tells Tcl to use the value of the variable. % set tempVar "This is a string." This is a string. % puts $tempVar This is a s...
The tr method returns a copy of a string where the characters of the first argument are replaced by the characters of the second argument. "string".tr('r', 'l') # => "stling" To replace only the first occurrence of a pattern with with another expression use the sub method ...
We can use org.apache.commons.lang3.RandomUtils to generate random numbers using a single line. int x = RandomUtils.nextInt(1, 1000); The method nextInt(int startInclusive, int endExclusive) takes a range. Apart from int, we can generate random long, double, float and bytes using this class. R...
What happens if I don't set base_url ? You will not get any Impotency error to set this and proceed. You can continue without setting, but you should know about HTTP header injection If I did't set it what will show up? You will get http://[::1]/ instead of your actual URL. What does this m...
Any project that targets netstandard1.X can be packed into a NuGet package by running: dotnet pack The resulting package can be uploaded to NuGet, MyGet, or hosted in a local package source.
This example describes how to create a SurfaceView with a dedicated drawing thread. This implementation also handles edge cases such as manufacture specific issues as well as starting/stopping the thread to save cpu time. import android.content.Context; import android.graphics.Canvas; import and...
One Button Swift class ViewController: UIViewController { @IBAction func showAlertButtonTapped(sender: UIButton) { // create the alert let alert = UIAlertController(title: "My Title", message: "This is my message.", preferredStyle: UIAlertCo...
If you want to write strings containing other languages (JSON, regexes), it's hard to keep up with escaping symbols, and it would be nice to get some code assist. Put your cursor inside an empty string ALT + ENTER Pick "Inect language or reference" Pick the desirable language (...
Front matter tells Jekyll to parse a file. You add predefined variables, which are YAML sets, to the front matter. Then, you can use Liquid tags in your files to access the front matter. Front matter is indicated with two triple-dashed lines. You must place the variables between the two triple-dash...
When using clustered index, the rows of the table are sorted by the column to which the clustered index is applied. Therefore, there can be only one clustered index on the table because you can't order the table by two different columns. Generally, it is best to use clustered index when performing ...
Nonclustered indexes are stored separately from the table. Each index in this structure contains a pointer to the row in the table which it represents. This pointers are called a row locators. The structure of the row locator depends on whether the data pages are stored in a heap or a clustered tab...
Below code showcases multiple Producer/Consumer program. Both Producer and Consumer threads share same global queue. import java.util.concurrent.*; import java.util.Random; public class ProducerConsumerWithES { public static void main(String args[]) { BlockingQueue<Integer> ...

Page 502 of 1336