Tutorial by Examples: au

One way to mock a function is to use the create_autospec function, which will mock out an object according to its specs. With functions, we can use this to ensure that they are called appropriately. With a function multiply in custom_math.py: def multiply(a, b): return a * b And a function...
To play audio using the Web Audio API, we need to get an ArrayBuffer of audio data and pass it to a BufferSource for playback. To get an audio buffer of the sound to play, you need to use the AudioContext.decodeAudioData method like so: const audioCtx = new (window.AudioContext || window.webkitAud...
This example shows how to use two audio sources, and alter one of them based on the other. In this case we create an audio Ducker, that will lower the volume of the primary track if the secondary track produces sound. The ScriptProcessorNode will send regular events to its audioprocess handler. In ...
The @Header and @Body annotations can be placed into the method signatures and Retrofit will automatically create them based on your models. public interface MyService { @POST("authentication/user") Call<AuthenticationResponse> authenticateUser(@Body AuthenticationReques...
Import in your gradle root file classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' Import in your gradle app file apt 'com.google.auto.value:auto-value:1.2' apt 'com.ryanharter.auto.value:auto-value-gson:0.3.1' provided 'com.jakewharton.auto.value:auto-value-annotations:1.2-update...
docker-compose.yml version: '2' services: php: image: phpmyadmin/phpmyadmin links: - mysql:db depends_on: - mysql mysql: image: k0st/alpine-mariadb volumes: - ./data/mysql:/var/lib/mysql environment: - MYSQL_DATABASE=mydb ...
An Akka MessageDispatcher is what makes Akka Actors "tick", it is the engine of the machine so to speak. All MessageDispatcher implementations are also an ExecutionContext, which means that they can be used to execute arbitrary code, for instance Futures. Every ActorSystem will have a def...
LOOP has its own IF statement that can control how the clauses are executed: (loop repeat 1000 for x = (random 100) if (evenp x) collect x into evens else collect x into odds finally (return (values evens odds))) Combining multiple clauses in an IF ...
To read default configuration properties: package com.example; public class ExampleApplication { private Properties getDefaults() throws IOException { Properties defaults = new Properties(); try (InputStream defaultsStream = ExampleApplication.class.getResou...
Cask is a project management tool which can be also used to easily manage your local emacs configuration. Installing cask is easy. You can either run the following command on the command-line: curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python Or if you are on a mac, you...
<svg width="900px" height="400px" viewBox="0 0 900 400"> <defs> <filter id="basicGaussian"> <feGaussianBlur stdDeviation="5"/> </filter> </defs> <image xlink:href=&q...
<svg width="900px" height="400px" viewBox="0 0 900 400"> <defs> <filter id="xAxisGaussian"> <feGaussianBlur stdDeviation="5 0"/> </filter> </defs> <image xlink:href=...
HTTP Basic Authentication provides a straightforward mechanism for authentication. Credentials are sent in plain text, and so is insecure by default. Successful authentication proceeds as follows. The client requests a page for which access is restricted: GET /secret The server responds with st...
Identifying your user is only part of security. Once you know who they are, you need a way to control their access to data in your database. Firebase Database Rules allow you to control access for each user. For example, here's a set of security rules that allows anyone to read the path /foo/, but n...
The default rules require Authentication. They allow full read and write access to authenticated users of your app. They are useful if you want data open to all users of your app but don't want it open to the world. // These rules require authentication { "rules": { ".read&...
Here's an example of a rule that gives each authenticated user a personal node at /users/$user_id where $user_id is the ID of the user obtained through Authentication. // These rules grant access to a node matching the authenticated // user's ID from the Firebase auth token { "rules"...
With Vault you can also encrypt non-structured data, such as private key files and still be able to decrypt them in your play with the lookup module. --- - name: Copy private key to destination copy: dest=/home/user/.ssh/id_rsa mode=0600 content=lookup('pipe', 'ANSIBLE_VAULT_PA...
You can run a play which relies on vault-encrypted templates by using the local_action module. --- - name: Decrypt template local_action: "shell {{ view_encrypted_file_cmd }} {{ role_path }}/templates/template.enc > {{ role_path }}/templates/template" changed_when: False - ...
Step 1 GET /authorize?response_type=code&client_id=[APP_KEY]&state=[RANDOM_STRING] &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb &scope=[OPTIONAL_SCOPES] HTTP/1.1 Host: server.example.com Step 2 POST /token HTTP/1.1 Host: server.example.com Content-Type: a...
For testing our application, I'm using advance rest client which is chrome extension: So, here is the snapshot for inserting the data:

Page 12 of 37