In order to enable writing more complex UI tests the UIAutomatorViewer is needed. The tool located at /tools/ makes a fullscreen screenshot including the layouts of the currently displayed views. See the subsequent picture to get an idea of what is shown:
For the UI tests we are looking for resou...
Trigger speech to text translation
private void startListening() {
//Intent to listen to user vocal input and return result in same activity
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
//Use a language model based on free-form speech recognition.
...
The following code can be used to trigger speech-to-text translation without showing a dialog:
public void startListeningWithoutDialog() {
// Intent to listen to user vocal input and return the result to the same activity.
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEEC...
First create a BroadcastReceiver class to handle the incoming Location updates:
public class LocationReceiver extends BroadcastReceiver implements Constants {
@Override
public void onReceive(Context context, Intent intent) {
if (LocationResult.hasResult(intent)) {
...
A repository pattern can be used to encapsulate data storage specific code in designated components. The part of your application, that needs the data will only work with the repositories. You will want to create a repository for each combination of item you store and your database technology.
Read...
We will take vehicle hierarchy example as depicted below.
Vehicle.java
package com.thejavageek.jpa.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance...
angular.component("SampleComponent", {
bindings: {
title: '@',
movies: '<',
reservation: "=",
processReservation: "&"
}
});
Here we have all binding elements.
@ indicates that we need a very basic binding, from the parent scope ...
The next example can be used to determine whether a enumeration has the FlagsAttribute specified. The methodology used is based on Reflection.
This example will give a True result:
Dim enu As [Enum] = New FileAttributes()
Dim hasFlags As Boolean = enu.GetType().GetCustomAttributes(GetType(FlagsAt...
If a particular header file is included more than once in a translation unit (TU),
there should not be any compilation problems.
This is termed 'idempotence'; your headers should be idempotent.
Think how difficult life would be if you had to ensure that #include <stdio.h> was only included ...
Gmail Example
MAIL_URL=smtp://username%40gmail.com:[email protected]:465/
Note: This setup only allows 2000 emails to be sent per day. Please see https://support.google.com/a/answer/176600?hl=en for alternative configurations.
Org provides a full markup language which helps structuring the document, and is reflected as accurately as possible when exporting to other formats (like HTML or LaTeX).
Structure
Document title
#+TITLE: This is the title of the document
Sectioning
* First level
** Second level
Lists
Or...
Setup
First, install the necessary packages with:
npm install express cors mongoose
Code
Then, add dependencies to server.js, create the database schema and the name of the collection, create an Express.js server, and connect to MongoDB:
var express = require('express');
var cors = require('...