Tutorial by Examples: am

After starting a merge, you might want to stop the merge and return everything to its pre-merge state. Use --abort: git merge --abort
If your latest commit is not published yet (not pushed to an upstream repository) then you can amend your commit. git commit --amend This will put the currently staged changes onto the previous commit. Note: This can also be used to edit an incorrect commit message. It will bring up the default...
A function can optionally declare a set of parameters: func SayHelloToMe(firstName, lastName string, age int) { fmt.Printf("Hello, %s %s!\n", firstName, lastName) fmt.Printf("You are %d", age) } Notice that the type for firstName is omitted because it is identical ...
Return values can be assigned to a local variable. An empty return statement can then be used to return their current values. This is known as "naked" return. Naked return statements should be used only in short functions as they harm readability in longer functions: func Inverse(v float3...
There are several PHP functions that accept user-defined callback functions as a parameter, such as: call_user_func(), usort() and array_map(). Depending on where the user-defined callback function was defined there are different ways to pass them: Procedural style: function square($number) { ...
// autoload.php spl_autoload_register(function ($class) { require_once "$class.php"; }); // Animal.php class Animal { public function eats($food) { echo "Yum, $food!"; } } // Ruminant.php class Ruminant extends Animal { public function eat...
Right after you install Git, the first thing you should do is set your username and email address. From a shell, type: git config --global user.name "Mr. Bean" git config --global user.email [email protected] git config is the command to get or set options --global means that the ...
Browse to File > New > Solution to bring you up the new project dialog Select Single View App and press Next Configure your app by setting your app name and organization ID, and press Next: Set your Project name and Solution name, or leave as the default name. Click Create to create...
curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Content-Type: application/json" \ --data "{\"shared_folder_id\": \"<SHARED_FOLDER_ID\",\"members...
let toInvite = [Sharing.AddMember(member: Sharing.MemberSelector.Email("<EMAIL_ADDRESS_TO_INVITE>"))] Dropbox.authorizedClient!.sharing.addFolderMember(sharedFolderId: "<SHARED_FOLDER_ID>", members: toInvite).response { response, error in if (response != nil...
// List folder Dropbox.authorizedClient!.files.listFolder(path: "/nonexistantpath").response { response, error in print("*** List folder ***") if let result = response { print("Folder contents:") for entry in result.entries { pr...
A module map can simply import mymodule by configuring it to read C header files and make them appear as Swift functions. Place a file named module.modulemap inside a directory named mymodule: Inside the module map file: // mymodule/module.modulemap module mymodule { header "defs.h&q...
public class TrustLoader { public static void main(String args[]) { try { //Gets the inputstream of a a trust store file under ssl/rpgrenadesClient.jks //This path refers to the ssl folder in the jar file, in a jar file in the same directory ...
Check whether a string is empty: if str.isEmpty { // do something if the string is empty } // If the string is empty, replace it with a fallback: let result = str.isEmpty ? "fallback string" : str Check whether two strings are equal (in the sense of Unicode canonical equivale...
import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; public class FrameCreator { public static void main(String args[]) { //All Swing actions should be run on the Event Dispatch Thread (EDT) //Calling SwingUtilities.invokeLater ma...
import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; public class CustomFrame extends JFrame { private static CustomFrame statFrame; public CustomFrame(String labelText) { setSize(500, 500); ...
Functions can take parameters so that their functionality can be modified. Parameters are given as a comma separated list with their types and names defined. func magicNumber(number1: Int) { print("\(number1) Is the magic number") } Note: The \(number1) syntax is basic String I...
A data.frame is a special kind of list: it is rectangular. Each element (column) of the list has same length, and where each row has a "row name". Each column has its own class, but the class of one column can be different from the class of another column (unlike a matrix, where all elemen...
Start by installing the PayPal Node module from NPM npm install paypal-rest-sdk In your application file, add in the configuration information for the SDK var paypal = require('paypal-rest-sdk'); var client_id = 'YOUR CLIENT ID'; var secret = 'YOUR SECRET'; paypal.configure({ 'mode'...
In this example, we're going to set up an Express server integration to display how to process a payment with PayPal, using the PayPal Node SDK. We will use a static JSON structure for the payment details for the sake of brevity. There are three general steps that we will follow when building out t...

Page 4 of 129