Tutorial by Examples: du

Dropbox.authorizedClient!.files.download(path: path, destination: destination).response { response, error in if let (metadata, url) = response { print("*** Download file ***") print("Downloaded file name: \(metadata.name)") print("Downloaded f...
This uses the SwiftyDropbox library to upload a file from a NSData to the Dropbox account, using upload sessions for larger files, handling every error case: import UIKit import SwiftyDropbox class ViewController: UIViewController { // replace this made up data with the real data le...
curl -X POST https://api.dropboxapi.com/2/users/get_current_account \ --header "Authorization: Bearer <ACCESS_TOKEN>" <ACCESS_TOKEN> should be replaced with your access token.
#include <stdio.h> #include <curl/curl.h> int main (int argc, char *argv[]) { CURL *curl; CURLcode res; /* In windows, this will init the winsock stuff */ curl_global_init(CURL_GLOBAL_ALL); /* get a curl handle */ curl = curl_ea...
<?php $headers = array("Authorization: Bearer <ACCESS_TOKEN>", "Content-Type: application/json"); $ch = curl_init('https://api.dropboxapi.com/2/users/get_space_usage'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POS...
This uses the SwiftyDropbox library to share a folder, handling every error case: Dropbox.authorizedClient!.sharing.shareFolder(path: "/folder_path").response { response, error in if let result = response { print("response: \(result)") } else if let callError ...
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...
Supplying pow() with 3 arguments pow(a, b, c) evaluates the modular exponentiation ab mod c: pow(3, 4, 17) # 13 # equivalent unoptimized expression: 3 ** 4 % 17 # 13 # steps: 3 ** 4 # 81 81 % 17 # 13 For built-in types using modular exponentiation is only possible...
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...
$url = "https://api.dropboxapi.com/2/users/get_current_account" $req = [System.Net.HttpWebRequest]::Create($url) $req.headers["Authorization"] = "Bearer <ACCESS_TOKEN>" $req.Method = "POST" $res = $req.GetResponse() Write-Host "Response Sta...
require Exporter; This will ensure that the Exporter module is loaded at runtime if it hasn't already been imported. (See also: perldoc -f require.) N.B.: Most users should use modules rather than require them. Unlike use, require does not call the module's import method and is executed at runti...
use Cwd; This will import the Cwd module at compile time and import its default symbols, i.e. make some of the module's variables and functions available to the code using it. (See also: perldoc -f use.) Generally this is will do the right thing. Sometimes, however, you will want to control whic...
A dictionary is an example of a key value store also known as Mapping in Python. It allows you to store and retrieve elements by referencing a key. As dictionaries are referenced by key, they have very fast lookups. As they are primarily used for referencing items by key, they are not sorted. crea...
In ECMAScript 6, when using the module syntax (import/export), each file becomes its own module with a private namespace. Top-level functions and variables do not pollute the global namespace. To expose functions, classes, and variables for other modules to import, you can use the export keyword. /...
Given that the module from the Defining a Module section exists in the file test.js, you can import from that module and use its exported members: import {doSomething, MyClass, PI} from './test' doSomething() const mine = new MyClass() mine.test() console.log(PI) The somethingPrivate()...
In addition to importing named members from a module or a module's default export, you can also import all members into a namespace binding. import * as test from './test' test.doSomething() All exported members are now available on the test variable. Non-exported members are not available, j...
Bold Text To bold text, use the <strong> or <b> tags: <strong>Bold Text Here</strong> or <b>Bold Text Here</b> What’s the difference? Semantics. <strong> is used to indicate that the text is fundamentally or semantically important to the surrounding...
import multiprocessing def fib(n): """computing the Fibonacci in an inefficient way was chosen to slow down the CPU.""" if n <= 2: return 1 else: return fib(n-1)+fib(n-2) p = multiprocessing.Pool() print(p.map(fib,[38,37,3...
WordPress [WP] is an open source Content Management System for building apps, websites, and blogs. WP is written in PHP and uses MySQL as the data store for the user content and configuration. It has a rich ecosystem of plugins and themes and enjoys a vibrant open source community, good documentatio...
A module can be "imported", or otherwise "required" by the require() function. For example, to load the http module that ships with Node.js, the following can be used: const http = require('http'); Aside from modules that are shipped with the runtime, you can also require mod...

Page 3 of 47