Tutorial by Examples: and

<?php $parameters = array('path' => '','include_deleted' => true,'recursive' => true); $headers = array('Authorization: Bearer <ACCESS_TOKEN>', 'Content-Type: application/json'); $curlOptions = array( CURLOPT_HTTPHEADER => $headers, C...
Dropbox.authorizedClient!.files.listFolder(path: "").response { response, error in print("*** List folder ***") if let result = response { print("Folder contents:") for entry in result.entries { print(entry.name) if ...
// 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...
You can use a custom toJSON method and reviver function to transmit instances of your own class in JSON. If an object has a toJSON method, its result will be serialized instead of the object itself. 6 function Car(color, speed) { this.color = color; this.speed = speed; } Car.prototype.to...
JavaScript has two primary ways to represent binary data in the browser. ArrayBuffers/TypedArrays contain mutable (though still fixed-length) binary data which you can directly manipulate. Blobs contain immutable binary data which can only be accessed through the asynchronous File interface. Conver...
5.1 When you take a reference to a method (a property which is a function) in JavaScript, it usually doesn't remember the object it was originally attached to. If the method needs to refer to that object as this it won't be able to, and calling it will probably cause a crash. You can use the .bind...
Template literals are a special type of string literal that can be used instead of the standard '...' or "...". They are declared by quoting the string with backticks instead of the standard single or double quotes: `...`. Template literals can contain line breaks and arbitrary expression...
Instance variables are unique for each instance, while class variables are shared by all instances. class C: x = 2 # class variable def __init__(self, y): self.y = y # instance variable C.x # 2 C.y # AttributeError: type object 'C' has no attribute 'y' c1 = C(3) c1....
The idea of bound and unbound methods was removed in Python 3. In Python 3 when you declare a method within a class, you are using a def keyword, thus creating a function object. This is a regular function, and the surrounding class works as its namespace. In the following example we declare method ...
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 ...
A rebase switches the meaning of "ours" and "theirs": git checkout topic git rebase master # rebase topic branch on top of master branch Whatever HEAD's pointing to is "ours" The first thing a rebase does is resetting the HEAD to master; before cherry-picking...
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...
A Swift String is made of Unicode code points. It can be decomposed and encoded in several different ways. let str = "ที่👌①!" Decomposing Strings A string's characters are Unicode extended grapheme clusters: Array(str.characters) // ["ที่", "👌", "①", ...
The following is an example that displays 5 one-dimensional random walks of 200 steps: y = cumsum(rand(200,5) - 0.5); plot(y) legend('1', '2', '3', '4', '5') title('random walks') In the above code, y is a matrix of 5 columns, each of length 200. Since x is omitted, it defaults to the row n...
Node.js can also be used to create command line utilities. The example below reads the first argument from the command line and prints a Hello message. To run this code on an Unix System: Create a new file and paste the code below. The filename is irrelevant. Make this file executable with chmo...
In order to begin building with PayPal APIs, you have to create an application to obtain a client ID and secret. Go to https://developer.paypal.com/developer/applications/, sign in, and click on "Create App", as shown below: Next, enter an application name, select the sandbox testing a...
When testing you PayPal integration on sandbox, you'll need to have sandbox user accounts set up to use to go through the payment flow. Go to https://developer.paypal.com/developer/accounts/, log in using your PayPal account, and click on "Create Account", as below: Enter in the accoun...
man <command> This will show the manual page for the specified command. For example, man ping will show: PING(8) BSD System Manager's Manual PING(8) NAME ping -- send ICMP ECHO_REQUEST packets to network hosts SYNOPSIS ping [-AaCDdfno...
Consider the below list comprehension: >>> def f(x): ... import time ... time.sleep(.1) # Simulate expensive function ... return x**2 >>> [f(x) for x in range(1000) if f(x) > 10] [16, 25, 36, ...] This results in two calls to f(x) for 1,000 values of...
Signal numbers can be synchronous (like SIGSEGV – segmentation fault) when they are triggered by a malfunctioning of the program itself or asynchronous (like SIGINT - interactive attention) when they are initiated from outside the program, e.g by a keypress as Cntrl-C. The signal() function is part...

Page 7 of 153