Tutorial by Examples: o

Types used in Sets and Dictionaries(key) must conform to Hashable protocol which inherits from Equatable protocol. Custom type conforming to Hashable protocol must implement A calculated property hashValue Define one of the equality operators i.e. == or !=. Following example implements Hasha...
Create a basic application with single view application template with swift as language Add SWRevealViewController.h and SWRevealViewController.m then click on Create Bridging Header button and add #import "SWRevealViewController.h" on the Bridging header Then select viewControll...
LINQ provides a method that makes it easy to create a collection filled with sequential numbers. For example, you can declare an array which contains the integers between 1 and 100. The Enumerable.Range method allows us to create sequence of integer numbers from a specified start position and a num...
When we want to change root password in windows, We need to follow following steps : Step 1 : Start your Command Prompt by using any of below method : Perss Crtl+R or Goto Start Menu > Run and then type cmd and hit enter Step 2 : Change your directory to where MYSQL is installed, In my case i...
In your command line, get in the directory you want to create the project in, then type: composer create-project zendframework/skeleton-application helloWorldTest. During installation, you will be asked if you want a minimal install: Let's say yes for the moment, we are just testing. For simplicity...
It's a good practice to cache loaded result to avoid multiple loading of same data. To invalidate cache onContentChanged() should be called. If loader has been already started, forceLoad() will be called, otherwise (if loader in stopped state) loader will be able to understand content change with ta...
Let's see MVP in action using a simple Login Screen. There are two Buttons—one for login action and another for a registration screen; two EditTexts—one for the email and the other for the password. LoginFragment (The View) public class LoginFragment extends Fragment implements LoginContract.Prese...
The JAXB Reference Implementation (JAXB-RI) has been included with the Java Development Kit since JDK 6 update 3. Refer to the Unofficial JAXB Guide for additional details on which JAXB-RI version is included with specific versions of the JDK.
// First load a product object $product->getSku(); $product->getName(); // Alternative method $product->getData('sku'); $product->getData('name');
// First load a collection object foreach($collection as $product) { $product->getSku(); $product->getName(); // Alternative method $product->getData('sku'); $product->getData('name'); }
Given below is a simple example to train a Caffe model on the Iris data set in Python, using PyCaffe. It also gives the predicted outputs given some user-defined inputs. iris_tuto.py import subprocess import platform import copy from sklearn.datasets import load_iris import sklearn.metrics ...
You should order your imports and declarations like so: extern crate declarations use imports External imports from other crates should come first Re-exports (pub use)
As your activity begins to stop, the system calls onSaveInstanceState() so your activity can save state information with a collection of key-value pairs. The default implementation of this method automatically saves information about the state of the activity's view hierarchy, such as the text in an...
Fragments also have a onSaveInstanceState() method which is called when their state needs to be saved: public class MySimpleFragment extends Fragment { private int someStateValue; private final String SOME_VALUE_KEY = "someValueToSave"; // Fires when a configuration ch...
If you want to lock the screen orientation change of any screen (activity) of your android application you just need to set the android:screenOrientation property of an <activity> within the AndroidManifest.xml: <activity android:name="com.techblogon.screenorientationexample.Main...
If your application doesn't need to update resources during a specific configuration change and you have a performance limitation that requires you to avoid the activity restart, then you can declare that your activity handles the configuration change itself, which prevents the system from restartin...
- (UIImage *)getSnapshot { UIScreen *screen = [UIScreen mainScreen]; CGRect bounds = [self.view bounds]; UIGraphicsBeginImageContextWithOptions(bounds.size, false, screen.scale); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetInterpolationQuality(context, kCGInterpola...
For example we will create view that contains emitter layer and animates particles. import QuartzCore class ConfettiView: UIView { // main emitter layer var emitter: CAEmitterLayer! // array of color to emit var colors: [UIColor]! // intensity of appearance var ...
Demonstrate how to embed a lua interpreter in C code, expose a C-defined function to Lua script, evaluate a Lua script, call a C-defined function from Lua, and call a Lua-defined function from C (the host). In this example, we want the mood to be set by a Lua script. Here is mood.lua: -- Get versi...
To setup a WebRTC-based communication system, you need three main components: A WebRTC signaling server To establish a WebRTC connections, peers need to contact a signaling server, which then provides the address information the peers require to set up a peer-to-peer connection. Signaling serv...

Page 478 of 1038