Tutorial by Examples: al

Note: Let's setup some anonymous authentication for the example { "rules": { ".read": "auth != null", ".write": "auth != null" } } Once it is done, create a child by editing your database address. For example: https://your-proje...
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...
This example assumes that you have already set up a Firebase Realtime Database. If you are a starter, then please inform yourself here on how to add Firebase to your Android project. First, add the dependency of the Firebase Database to the app level build.gradle file: compile 'com.google.firebase...
CREATE TABLE [dbo].[ProcessLog]( [LogId] [int] IDENTITY(1,1) NOT NULL, [LogType] [varchar](20) NULL, [StartTime] [datetime] NULL, [EndTime] [datetime] NULL, [RunMinutes] AS (datediff(minute,coalesce([StartTime],getdate()),coalesce([EndTime],getdate()))) This gives run difference in minutes ...
The next code illustrates how to find the nearest value of a Enum. First we define this Enum that will serve to specify search criteria (search direction) Public Enum EnumFindDirection As Integer Nearest = 0 Less = 1 LessOrEqual = 2 Greater = 3 GreaterOrEqual = 4 End Enum...
Headers are a crucial consistency checking mechanism, but they should be as small as possible. In particular, that means that a header should not include other headers just because the implementation file will need the other headers. A header should contain only those headers necessary for a con...
Debian, Ubuntu and CentOS Add the official repository Debian/Ubuntu curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash CentOS curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh ...
MSBuild evaluates PropertyGroup, Choose and ItemGroup elements that are directly under the Project element before those that are in Target elements. Directly under the Project element, PropertyGroup and Choose elements are evaluated in the order in which they appear, and then ItemGroup elements a...
add_action( 'init', function() { // do something here } ); Using a function block to hook a set of instructions. With the init hook, the set of instructions will be executed right after wordpress has finished loading the necessary components.
function my_init_function() { // do something here } add_action( 'init', 'my_init_function' ); Using the name of the function to hook a set of instructions. With the init hook, the set of instructions will be executed right after wordpress has finished loading the necessary components. ...
class MyClass { static function my_init_method() { // do something here } } add_action( 'init', array( 'MyClass', 'my_init_method' ) ); Using a static method of a class to hook a set of instructions. With the init hook, the set of instructions will be executed right after w...
class MyClass { function my_init_method() { // do something here } } $obj = new MyClass(); add_action( 'init', array( $obj, 'my_init_method' ) ); Using a method of an object to hook a set of instructions. With the init hook, the set of instructions will be executed right...
If different users need different datetime format then you may need to parse your incoming date string to actual date according to the format. In this case this snippet may help you. public class DateTimeBinder : DefaultModelBinder { public override object BindModel(ControllerContext control...
public void doSomething() { DialogTestBinding binding = DataBindingUtil .inflate(LayoutInflater.from(context), R.layout.dialog_test, null, false); Dialog dialog = new Dialog(context); dialog.setContentView(binding.getRoot()); dialog.show(); }
int[string] aa0 = ["x": 5, "y": 6]; //int values, string keys auto aa1 = ["x": 5.0, "y": 6.0]; // double values, string keys string[int] aa2 = [10: "A", 11: "B"]; //string values, int keys
int[string] aa = ["x": 5, "y": 6]; // The value can be set by its key: aa["x"] = 7; assert(aa["x"] == 7); // if the key does not exist will be added aa["z"] = 8; assert(aa["z"] == 8);
Let's assume an associative array aa: int[string] aa = ["x": 5, "y": 6]; Items can be removed by using .remove(), if key exits will be removed and remove returns true: assert(aa.remove("x")); if the given key does not exist remove does nothing and returns false:...
Authentication in Django REST Framework can be configured globally as a subkey of the REST_FRAMEWORK variable in settings.py, just like the rest of the default framework configurations. REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.BasicAuthen...
The most interesting package for managing real tokens is django-rest-knox which supports multiple tokens per user (and cancelling each token independently), as well as having support for token expiration and several other security mechanisms. django-rest-knox depends on cryptography. You can find m...

Page 169 of 269