Tutorial by Examples: al

If someone else wrote the code you are committing, you can give them credit with the --author option: git commit -m "msg" --author "John Smith <[email protected]>" You can also provide a pattern, which Git will use to search for previous authors: git commit -m &quo...
Python makes it very simple to check whether an item is in a list. Simply use the in operator. lst = ['test', 'twest', 'tweast', 'treast'] 'test' in lst # Out: True 'toast' in lst # Out: False Note: the in operator on sets is asymptotically faster than on lists. If you need to use it ...
Standard installation All Node.js binaries, installers, and source files can be downloaded here. You can download just the node.exe runtime or use the Windows installer (.msi), which will also install npm, the recommended package manager for Node.js, and configure paths. Installation by package m...
Users of homebrew can install gradle by running brew install gradle
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...
The most common and easiest type of centering is that of lines of text in an element. CSS has the rule text-align: center for this purpose: HTML <p>Lorem ipsum</p> CSS p { text-align: center; } This does not work for centering entire block elements. text-align controls onl...
Date and LocalDate objects cannot be exactly converted between each other since a Date object represents both a specific day and time, while a LocalDate object does not contain time or timezone information. However, it can be useful to convert between the two if you only care about the actual date i...
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...
Switch statement make use of partial matching. let coordinates: (x: Int, y: Int, z: Int) = (3, 2, 5) switch (coordinates) { case (0, 0, 0): // 1 print("Origin") case (_, 0, 0): // 2 print("On the x-axis.") case (0, _, 0): // 3 print("On the y-axis.") ca...
iex(1)> a = 10 10 iex(2)> b = 20 20 iex(3)> a + b 30 You can get a specific row passing the index of the row: iex(4)> v(3) 30 You can also specify an index relative to the current row: iex(5)> v(-1) # Retrieves value of row (5-1) -> 4 30 iex(6)> v(-5) # Retrieves...
You can set the opacity to a certain UIColor without creating a new one using the init(red:_,green:_,blue:_,alpha:_) initializer. Swift let colorWithAlpha = UIColor.redColor().colorWithAlphaComponent(0.1) Swift 3 //In Swift Latest Version _ colorWithAlpha = UIColor.red.withAlphaComponent(0.1)...
public async Task<Product> GetProductAsync(string productId) { using (_db) { return await _db.QueryFirstOrDefaultAsync<Product>("usp_GetProduct", new { id = productId }, commandType: CommandType.StoredProcedure); } }
One can iterate over a list using ~{ and ~} directives. CL-USER> (format t "~{~a, ~}~%" '(1 2 3 4 5)) 1, 2, 3, 4, 5, ~^ can be used to escape if there are no more elements left. CL-USER> (format t "~{~a~^, ~}~%" '(1 2 3 4 5)) 1, 2, 3, 4, 5 A numeric argument can ...
Google maintains documentation on getting started here: https://cloud.google.com/storage/docs/quickstart-console Getting ready to use GCS: Create a Google Cloud project, if you don't have one already. Enable billing for your project to allow buckets to be created. (Optional) Install the Google...
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...
Syntax {condition-to-evaluate} ? {statement-executed-on-true} : {statement-executed-on-false} As shown in the syntax, the Conditional Operator (also known as the Ternary Operator1) uses the ? (question mark) and : (colon) characters to enable a conditional expression of two possible outcomes. It c...
Create a receiver. This class will receive the intent and handle it how you wish. public class AlarmReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // Handle intent int reqCode = intent.getExtras().getInt(&...
The following types are defined as integral types: char Signed integer types Unsigned integer types char16_t and char32_t bool wchar_t With the exception of sizeof(char) / sizeof(signed char) / sizeof(unsigned char), which is split between § 3.9.1.1 [basic.fundamental/1] and § 5.3.3.1 [ex...
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...

Page 35 of 269