Tutorial by Examples

You can display an SVG file within an HTML document, by specifying it as a background image in CSS. For example: .element { background-size: 100px 100px; background: url(my_svg_file.svg); height: 100px; width: 100px; } If the dimensions specified in your SVG file are larger ...
The Null-Coalescing operator ?? will return the left-hand side when not null. If it is null, it will return the right-hand side. object foo = null; object bar = new object(); var c = foo ?? bar; //c will be bar since foo was null The ?? operator can be chained which allows the removal of if...
Often times you will have reason to catch when your program is being told to stop by the OS and take some actions to preserve the state, or clean up your application. To accomplish this you can use the os/signal package from the standard library. Below is a simple example of assigning all signals fr...
Databings are essential for working with XAML. The XAML dialect for UWP apps provides a type of binding: the {x:Bind} markup extension. Working with {Binding XXX} and {x:Bind XXX} is mostly equivalent, with the difference that the x:Bind extension works at compile time, which enables better debuggi...
Most of the time you need to import namespaces in your XAML file. How this is done is different for the different XAML variants. For Windows Phone, Silverlight, WPF use the clr-namespace syntax: <Window ... xmlns:internal="clr-namespace:rootnamespace.namespace" xmlns:exte...
Multi Binding is a feature exclusive for WPF development. It allows a binding to multiple values at once (typically used with a MultiValueConverter). <TextBox> <TextBox.Text> <MultiBinding Converter="{StaticResource MyConverter}"> <Binding P...
By default, RethinkDB binds all services to 127.0.0.1. So this following example will persist data to the host_data_path on the container's host machine and available to 127.0.0.1 on the standard ports. ServiceFlagDefault PortDriver--driver-port28015Cluster--cluster-port29015HTTP WebUI--http-port80...
When deploying RethinkDB in production, you want to either turn off or lock down the WebUI. This will only respond to localhost to access the WebUI allowing you to SSH Tunnel to the host machine and access it for diagnostics and troubleshooting. docker run -d \ -v host_data_path:/data \ ret...
By default, Android will display Toast messages at the bottom of the screen even if the keyboard is showing. This will show a Toast message just above the keyboard. public void showMessage(final String message, final int length) { View root = findViewById(android.R.id.content); Toast toas...
ndk-build NDK_PROJECT_PATH=PROJECT_PATH APP_BUILD_SCRIPT=MyAndroid.mk
Currently it contains rules for following libraries:- ButterKnife RxJava Android Support Library Android Design Support Library Retrofit Gson and Jackson Otto Crashlitycs Picasso Volley OkHttp3 Parcelable #Butterknife -keep class butterknife.** { *; } -keepnames class * { @butterk...
For enabling ProGuard configurations for your application you need to enable it in your module level gradle file. you need to set the value of minifyEnabled true. You can also enable shrinkResources true which will remove resources that ProGuard flaggs as unused. buildTypes { release { ...
public class ShakeDetector implements SensorEventListener { private static final float SHAKE_THRESHOLD_GRAVITY = 2.7F; private static final int SHAKE_SLOP_TIME_MS = 500; private static final int SHAKE_COUNT_RESET_TIME_MS = 3000; private OnShakeListener mListener; pri...
First of all you need to setup your project adding Firebase to your Android project following the steps described in this topic. Set up Firebase and the FCM SDK Add the FCM dependency to your app-level build.gradle file dependencies { compile 'com.google.firebase:firebase-messaging:11.0.4' } ...
This annotation ensures that only the valid integer constants that you expect are used. The following example illustrates the steps to create an annotation: import android.support.annotation.IntDef; public abstract class Car { //Define the list of accepted constants @IntDef({MICROCA...
Open Android Monitor Tab Click on Screen Capture Button
Open Android Device Monitor ( ie C:<ANDROID_SDK_LOCATION>\tools\monitor.bat) Select your device Click on Screen Capture Button
Example below saves a screenshot on Devices's Internal Storage. adb shell screencap /sdcard/screen.png
If you use Linux (or Windows with Cygwin), you can run: adb shell screencap -p | sed 's/\r$//' > screenshot.png
A Gemfile is the standard way to organize dependencies in your application. A basic Gemfile will look like this: source 'https://rubygems.org' gem 'rack' gem 'sinatra' gem 'uglifier' You can specify the versions of the gem you want as follows: # Match except on point release. Use only 1.5....

Page 608 of 1336