1) Services
A service is a constructor function that is invoked once at runtime with new, just like what we would do with plain javascript with only
difference that AngularJs is calling the new behind the scenes.
There is one thumb rule to remember in case of services
Services are constructors...
Eclipse debugging starts with what is referred to as Agents.
The JVM, which runs the complied .class sources has a feature that allows externally libraries (written in either Java or C++) to be injected into the JVM, just about runtime. These external libraries are referred to as Agents and they ha...
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.
...
Via jCenter
including the following in your project's build.gradle file:
compile 'com.google.android.exoplayer:exoplayer:rX.X.X'
where rX.X.X is the your preferred version. For the latest version, see the project's Releases. For more details, see the project on Bintray.
Instantiate your ExoPlayer:
exoPlayer = ExoPlayer.Factory.newInstance(RENDERER_COUNT, minBufferMs, minRebufferMs);
To play audio only you can use these values:
RENDERER_COUNT = 1 //since you want to render simple audio
minBufferMs = 1000
minRebufferMs = 5000
Both buffer values can be twea...
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...
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...
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...
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)) {
...
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...
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...
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...
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.