Tutorial by Examples: al

AlertDialog.Builder builder = new AlertDialog.Builder(context); //Set Title builder.setTitle("Reset...") //Set Message .setMessage("Are you sure?") //Set the icon of the dialog .setIcon(drawable) //Set...
When the destructor for std::thread is invoked, a call to either join() or detach() must have been made. If a thread has not been joined or detached, then by default std::terminate will be called. Using RAII, this is generally simple enough to accomplish: class thread_joiner { public: thre...
Download a distributed archive from Binaries section of JMeter from Download Apache JMeter page. Depending on the version you downloaded, check minimal Java version requirements and install Java if needed. Ensure the JAVA_HOME environment variable is set and points to a correct version. ...
Installing Wildfly is just a matter of unzipping the distribution into your local machine. Wildfly can be dowloaded from its official website. Once it is unzipped go in to bin directory of installation and run standalone.sh for Linux systems or standalone.bat for Windows systems to start your WildF...
.SD .SD refers to the subset of the data.table for each group, excluding all columns used in by. .SD along with lapply can be used to apply any function to multiple columns by group in a data.table We will continue using the same built-in dataset, mtcars: mtcars = data.table(mtcars) # Let's not ...
Validating array form input fields is very simple. Suppose you have to validate each name, email and father name in a given array. You could do the following: $validator = \Validator::make($request->all(), [ 'name.*' => 'required', 'email.*' => 'email|unique:users'...
When running from the CLI, PHP exhibits some different behaviours than when run from a web server. These differences should be kept in mind, especially in the case where the same script might be run from both environments. No directory change When running a script from a web server, the current w...
There are a number of different ways to install the AWS CLI on your machine, depending on what operating system and environment you are using: On Microsoft Windows – use the MSI installer. On Linux, OS X, or Unix – use pip (a package manager for Python software) or install manually with the bundle...
The preferred way of describing dependencies is by using constructor injection which follows Explicit Dependencies Principle: ITestService.cs public interface ITestService { int GenerateRandom(); } TestService.cs public class TestService : ITestService { public int GenerateRando...
With C++11 and higher calculations at compile time can be much easier. For example calculating the power of a given number at compile time will be following: template <typename T> constexpr T calculatePower(T value, unsigned power) { return power == 0 ? 1 : value * calculatePower(value,...
We can use partial application to "lock" the first argument. After applying one argument we are left with a function which expects one more argument before returning the result. (+) :: Int -> Int -> Int addOne :: Int -> Int addOne = (+) 1 We can then use addOne in order to...
Returning partially applied functions is one technique to write concise code. add :: Int -> Int -> Int add x = (+x) add 5 2 In this example (+x) is a partially applied function. Notice that the second parameter to the add function does not need to be specified in the function definitio...
To access pixel values in an OpenCV cv::Mat object, you first have to know the type of your matrix. The most common types are: CV_8UC1 for 8-bit 1-channel grayscale images; CV_32FC1 for 32-bit floating point 1-channel grayscale images; CV_8UC3 for 8-bit 3-channel color images; and CV_32FC3 ...
Swift class FooViewController: UIViewController { override func loadView() { view = FooView() } }
Model using System.ComponentModel.DataAnnotations; public class ViewModel { [Required(ErrorMessage="Name is required")] public string Name { get; set; } [StringLength(14, MinimumLength = 14, ErrorMessage = "Invalid Phone Number")] [Required(ErrorMessag...
Remote Validation used to check whether the content enter in the input control is valid or not by sending an ajax request to server side to check it. Working The RemoteAttribute works by making an AJAX call from the client to a controller action with the value of the field being validated. The con...
To install packages directly from GitHub use the devtools package: library(devtools) install_github("authorName/repositoryName") To install ggplot2 from github: devtools::install_github("tidyverse/ggplot2") The above command will install the version of ggplot2 that corre...
The installer requires PHP 5.4 or higher. If you still use the legacy PHP 5.3 version, you cannot use the Symfony Installer. Read the Creating Symfony Applications without the Installer section to learn how to proceed. - source: http://symfony.com/doc/current/book/installation.html
With this declaration: fun Temporal.toIsoString(): String = DateTimeFormatter.ISO_INSTANT.format(this) You can now simply: val dateAsString = someInstant.toIsoString()
NumPy is available in the default repositories of most popular Linux distributions and can be installed in the same way that packages in a Linux distribution are usually installed. Some Linux distributions have different NumPy packages for Python 2.x and Python 3.x. In Ubuntu and Debian, install nu...

Page 49 of 269