Tutorial by Examples: api

imports: from subprocess import Popen, PIPE from lxml import etree from io import StringIO Downloading: user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36' url = 'http://stackoverflow.com' get = Popen(['curl...
The following server-side configuration allows CORS request to work along with Windows Authentication (no anonymous must be enabled in IIS). web.config - allow unauthenticated (anonymous) preflight requests (OPTIONS) <system.web> <authentication mode="Windows" /> &l...
The following example shows how to properly construct both GET and POST requests against Web API 2 (CORS must be configured server-side, if sent from another domain): <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.js"></script> CORS with Wi...
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script> CORS with Windows Authentication test (Angular) <script type="text/javascript"> var app = angular.module('myApp', []); app.c...
The Search API provides access to recent tweets*. This is as opposed to the Stream API, which provides search results in real-time. <example> *Note that "the Search API is focused on relevance and not completeness" - Twitter Search API
The Stream API provides access to tweets in real-time. Streams can be filtered based on keywords, language, location, and more. Here's a simple example to track mentions of the word "tweepy": #set up a new class using tweepy.StreamListener class SimpleListener(tweepy.StreamListener): ...
Probably the most common way to invoke a Lambda is to use API Gateway, which maps a REST call to the lambda code. You can add multiple triggers to your Lambda during at any time, including when creating a new lambda. If you are familiar with API Gateway, you can associate any method with a deployed...
import grails.rest.* @Resource(uri='/books') class Book { String title static constraints = { title blank:false } } Simply by adding the Resource transformation and specifying a URI, your domain class will automatically be available as a REST resource in either XM...
This example is the same as WordCount, but uses the Table API. See WordCount for details about execution and results. Maven To use the Table API, add flink-table as a maven dependency: <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table_2.11&...
This example is the same as WordCount, but uses the Table API. See WordCount for details about execution and results. Maven To use the Streaming API, add flink-streaming as a maven dependency: <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-str...
In Progress 4GL the normal way to write a special character is to preceed it with a tilde character (~). These are the default special characters SequenceInterpreted asComment~""Used to write " inside strings defined using "string".~''Used to write ' inside strings defined...
To add additional restriction to the poReceiptLinesSelection data view, you should invoke Select method on base view and inspect each item in returned PXResultSet independently to decide if it complies with additional restriction(s): public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEn...
from bs4 import BeautifulSoup import requests main_url = "https://fr.wikipedia.org/wiki/Hello_world" req = requests.get(main_url) soup = BeautifulSoup(req.text, "html.parser") # Finding the main title tag. title = soup.find("h1", class_ = "firstHeading&qu...
API: Application programming interface are the set of requirements which govern how one application can talk to another, API's are what makes the information exchange between programs possible. For Example System-level APIs makes it possible for applications like LibreOffice to run on top of an ...
navigator.mediaDevices is the common method adapted in Chrome and FF to getUserMedia as of now. A promised based call back which returns local stream on success navigator.mediaDevices.getUserMedia({ audio: true, video: true }) .then(stream => { // attach this stream to window obje...
Step 1: Create your GitHub account If you already have a GitHub account, please proceed to Step 2. Otherwise, please follow below: 1.a Go to Github page. 1.b Enter your desired username, your email address and then your desired password. Afterwards, click the Sign up for GitHub button. Step 2:...
Gin is a web framework written in Golang. It features a martini-like API with much better performance, up to 40 times faster. If you need performance and good productivity, you will love Gin. There will be 8 packages + main.go controllers core libs middlewares public routers services...
function exampleCloseIncident(id, status){ var parameters = {}; var incidentresolution = {}; incidentresolution["[email protected]"] = "/incidents(" + id + ")"; incidentresolution["@odata.type"] = "Microsoft.Dynamics.CRM.incidentre...
This example helper class interacts with the finger print manager and performs encryption and decryption of password. Please note that the method used for encryption in this example is AES. This is not the only way to encrypt and other examples exist. In this example the data is encrypted and decryp...
Since both R and regex share the escape character ,"\", building correct patterns for grep, sub, gsub or any other function that accepts a pattern argument will often need pairing of backslashes. If you build a three item character vector in which one items has a linefeed, another a tab ch...

Page 10 of 12