Tutorial by Examples: ed

An ordered list can be created with the <ol> tag and each list item can be created with the <li> tag as in the example below: <ol> <li>Item</li> <li>Another Item</li> <li>Yet Another Item</li> </ol> This will produce a numbere...
Here's a standalone random number generator that doesn't rely on rand() or similar library functions. Why would you want such a thing? Maybe you don't trust your platform's builtin random number generator, or maybe you want a reproducible source of randomness independent of any particular library ...
> redirect the standard output (aka STDOUT) of the current command into a file or another descriptor. These examples write the output of the ls command into the file file.txt ls >file.txt > file.txt ls The target file is created if it doesn't exists, otherwise this file is truncated. ...
< reads from its right argument and writes to its left argument. To write a file into STDIN we should read /tmp/a_file and write into STDIN i.e 0</tmp/a_file Note: Internal file descriptor defaults to 0 (STDIN) for < $ echo "b" > /tmp/list.txt $ echo "a" >> ...
File descriptors like 0 and 1 are pointers. We change what file descriptors point to with redirection. >/dev/null means 1 points to /dev/null. First we point 1 (STDOUT) to /dev/null then point 2 (STDERR) to whatever 1 points to. # STDERR is redirect to STDOUT: redirected to /dev/null, # effect...
2 is STDERR. $ echo_to_stderr 2>/dev/null # echos nothing Definitions: echo_to_stderr is a command that writes "stderr" to STDERR echo_to_stderr () { echo stderr >&2 } $ echo_to_stderr stderr
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...
A simple two-column layout consists of two fixed-width, floated elements. Note that the sidebar and content area are not the same height in this example. This is one of the tricky parts with multi-column layouts using floats, and requires workarounds to make multiple columns appear to be the same he...
This uses the Dropbox Python SDK to download a file from the Dropbox API at the remote path /Homework/math/Prime_Numbers.txt to the local file Prime_Numbers.txt: import dropbox dbx = dropbox.Dropbox("<ACCESS_TOKEN>") with open("Prime_Numbers.txt", "wb") as f:...
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...
This example uses the Dropbox .NET library to upload a file to a Dropbox account, using upload sessions for larger files: private async Task Upload(string localPath, string remotePath) { const int ChunkSize = 4096 * 1024; using (var fileStream = File.Open(localPath, FileMode.Open)) ...
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...
This uses the Dropbox Python SDK to get the user's account information from the Dropbox API. import dropbox dbx = dropbox.Dropbox("<ACCESS_TOKEN>") dbx.users_get_current_account() <ACCESS_TOKEN> should be replaced with the access token.
<?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 ...
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...
Dropbox.authorizedClient!.files.getMetadata(path: "/test.jpg", includeMediaInfo: true).response { response, error in if let result = response as? Files.FileMetadata { print(result.name) if result.mediaInfo != nil { switch result.mediaInfo! as Files.Med...

Page 5 of 145