Tutorial by Examples: f

Android ButterKnife Zelezny Plugin for generating ButterKnife injections from selected layout XMLs in activities/fragments/adapters. Note : Make sure that you make the right click for your_xml_layou(R.layout.your_xml_layou) else the Generate menu will not contain Butterknife injector option. ...
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...
public class ReplaceFont { public static void changeDefaultFont(Context context, String oldFont, String assetsFont) { Typeface typeface = Typeface.createFromAsset(context.getAssets(), assetsFont); replaceFont(oldFont, typeface); } private static void replaceFont(String oldFont, Type...
Add the required libraries into the dependencies section of your Android module's build.gradle: android { ... defaultConfig { ... testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } dependencies { ... androidTestCompile 'com.android.su...
Putting UIAutomator tests together to a test suite is a quick thing: package de.androidtest.myapplication; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({InterAppTest1.class, InterAppTest2.class}) public class AppTestSuite {} ...
Form controls have some default styling without using any special classes. However labels and controls can be wrapped in .form-group tags for optimum spacing. <form> <div class="form-group"> <label for="input-email">Email address</label> &lt...
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. ...
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...
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...
In some very specific scenarios we would feel the need to perform a specific action for each flag of the source enumeration. We can write a simple Generic extension method to realize this task. <DebuggerStepThrough> <Extension> <EditorBrowsable(EditorBrowsableState.Always)> Pu...
The next example is intended to count the amount of flags in the specified flag combination. The example is provided as a extension method: <DebuggerStepThrough> <Extension> <EditorBrowsable(EditorBrowsableState.Always)> Public Function CountFlags(ByVal sender As [Enum]) As In...
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...
Modern headers should be self-contained, which means that a program that needs to use the facilities defined by header.h can include that header (#include "header.h") and not worry about whether other headers need to be included first. Recommendation: Header files should be self-contained...
If a singleshot timer is required, it is quiet handy to have the slot as lambda function right in the place where the timer is declared: QTimer::singleShot(1000, []() { /*Code here*/ } ); Due to this Bug (QTBUG-26406), this is way is only possible since Qt5.4. In earlier Qt5 versions it has to ...
The config location for your runner is: Debian/Ubuntu/CentOS /etc/gitlab-runner/config.toml if run as root ~/.gitlab-runner/config.toml if run as non-root Windows config.toml where your binary is located A minimal config.toml can look like this: concurrent = 1 [[runners]] name = "E...
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('...
Run the following as root: userdel -r username
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...
=SUMPRODUCT((A1:A100<>"")/COUNTIF(A1:A100,A1:A100&"")) counts unique cell values within A1:A100, excluding blank cells and ones with an empty string (""). How does it do that? Example: A1:A100 = [1, 1, 2, "apple", "peach", &qu...
=SUMPRODUCT(IF(FREQUENCY(MATCH(A1:A100,A1:A100,0),MATCH(A1:A100,A1:A100,0))>0,1))

Page 290 of 457