Tutorial by Examples: all

Users of SdkMan can install Gradle by running: sdk install gradle Install specific version sdk list gradle sdk install gradle 2.14 Switch versions sdk use gradle 2.12
Sometimes, you need to work with an array while ensuring you don't modify the original. Instead of a clone method, arrays have a slice method that lets you perform a shallow copy of any part of an array. Keep in mind that this only clones the first level. This works well with primitive types, like n...
1. Install Node.js and NPM: Gulp requires Node.js and NPM, Node's package manager. Most installers include NPM with Node.js. Refer to the installation documentation or confirm it is already installed by running the following command in your terminal, npm -v // will return NPM version or error say...
public async Task<Product> GetProductAsync(string productId) { using (_db) { return await _db.QueryFirstOrDefaultAsync<Product>("usp_GetProduct", new { id = productId }, commandType: CommandType.StoredProcedure); } }
Assumptions: An Oracle JDK has been installed. The JDK was installed to the default directory. Setup steps Open Windows Explorer. In the navigation pane on the left right click on This PC (or Computer for older Windows versions). There is a shorter way without using the explorer in...
Head over to CMake download page and get a binary for your operating system, e.g. Windows, Linux, or Mac OS X. On Windows double click the binary to install. On Linux run the binary from a terminal. On Linux, you can also install the packages from the distribution's package manager. On Ubuntu 16.0...
LibGDX has a fairly simple setup, with the help of a simple Java program. You can find the download here. When you startup the application, it will look something like this: Note: This screenshot have been taken on Linux and shows path that differs from a Windows installation. However, the form is...
Imports System.IO Dim filename As String = "c:\path\to\file.txt" File.WriteAllText(filename, "Text to write" & vbCrLf)
using System.IO; using System.Text; string filename = "c:\path\to\file.txt"; File.writeAllText(filename, "Text to write\n");
Swift 3 let stackView = UIStackView() stackView.axis = .horizontal stackView.alignment = .fill // .leading .firstBaseline .center .trailing .lastBaseline stackView.distribution = .fill // .fillEqually .fillProportionally .equalSpacing .equalCentering let label = UILabel() label.text = "...
Swift let stackView = UIStackView() stackView.axis = .Vertical stackView.alignment = .Fill // .Leading .FirstBaseline .Center .Trailing .LastBaseline stackView.distribution = .Fill // .FillEqually .FillProportionally .EqualSpacing .EqualCentering let label = UILabel(frame: CGRectZero) label....
The simplest use case is using the subprocess.call function. It accepts a list as the first argument. The first item in the list should be the external application you want to call. The other items in the list are arguments that will be passed to that application. subprocess.call([r'C:\path\to\a...
For cases when we don't want to write special classes to handle some resource, we may write a generic class: template<typename Function> class Finally final { public: explicit Finally(Function f) : f(std::move(f)) {} ~Finally() { f(); } // (1) See below Finally(const Final...
Cloning a huge repository (like a project with multiple years of history) might take a long time, or fail because of the amount of data to be transferred. In cases where you don't need to have the full history available, you can do a shallow clone: git clone [repo_url] --depth 1 The above comman...
__call() and __callStatic() are called when somebody is calling nonexistent object method in object or static context. class Foo { /** * This method will be called when somebody will try to invoke a method in object * context, which does not exist, like: * * $foo->...
Just add the using at the beginning and the [WebMethod] decorator to the static method to be called in the aspx page: using System.Web.Services; public partial class MyPage : System.Web.UI.Page { [WebMethod] public static int GetRandomNumberLessThan(int limit) { var r = ...
__CLASS__ magic constant returns the same result as get_class() function called without parameters and they both return the name of the class where it was defined (i.e. where you wrote the function call/constant name ). In contrast, get_class($this) and get_called_class() functions call, will both ...
Support for type hinting array parameters (and return values after PHP 7.1) was added in PHP 5.1 with the keyword array. Any arrays of any dimensions and types, as well as empty arrays, are valid values. Support for type hinting callables was added in PHP 5.4. Any value that is_callable() is valid ...
Detailed instructions on getting spring-security set up or installed.
Note: GRAILS requires a Java JDK installed (a runtime environment JRE is not sufficient) on your system, before setting up Grails. Please refer to, how to install JDK. As of this writing, it is recommended to install the latest JDK. For Mac OSX, Linux, Cygwin, Solaris and FreeBSD: The simplest w...

Page 14 of 113