Tutorial by Examples: bac

While using Image/Colour as an background in a CardView, You might end up with slight white paddings (If default Card colour is white) on the edges. This occurs due to the default rounded corners in the Card View. Here is how to avoid those margins in Pre-lollipop devices. We need to use an attribu...
To use standard location services while the application is in the background you need first turn on Background Modes in the Capabilities tab of the Target settings, and select Location updates. Or, add it directly to the Info.plist. <key>NSLocationAlwaysUsageDescription</key> <st...
Web deployment offers the option to automatically backup target Web site (not target Web application!) on deployment. This is recommended to allow web application rollback. In order to configure automatic backups, the following steps must be followed: 1) Enable backups Open %programfiles%\IIS\Mic...
PowerShell Workflows are inherently equipped with the ability to run as a background job. To call a workflow as a PowerShell background job, use the -AsJob parameter when invoking the workflow. workflow DoSomeWork { Get-Process -ComputerName server01 Get-Process -ComputerName server02 Get-...
Callback functions in JavaScript Callback functions are common in JavaScript. Callback functions are possible in JavaScript because functions are first-class citizens. Synchronous callbacks. Callback functions can be synchronous or asynchronous. Since Asynchronous callback functions may be more c...
Callback hell (also a pyramid of doom or boomerang effect) arises when you nest too many callback functions inside a callback function. Here is an example to read a file (in ES6). const fs = require('fs'); let filename = `${__dirname}/myfile.txt`; fs.exists(filename, exists => { if (exi...
The idea is to measure a layout before and after each change and if there is a significant change you can be somewhat certain that its the softkeyboard. // A variable to hold the last content layout hight private int mLastContentHeight = 0; private ViewTreeObserver.OnGlobalLayoutListener keyboa...
The following code will attempt to execute loadFromHttp() up to 5 times (maxAttempts), with each attempt delayed by as many seconds. If maxAttempts is surpassed, the Observable gives up. // assume loadFromHttp() returns a Promise, which might fail. Rx.Observable.from(loadFromHttp()) ....
There are a number of metrics describing the communication between Varnish and it's backends. The most important metrics here might be these: backend_busy - Number of http 5xx statuses recieved by a backend. With VCL you can configure Varnish to try another backend if this happens. backend_fail...
package main import ( //"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/restclient" "log" "os" // unver "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" client &...
Go to Xcode and open your project. In your app target, navigate to Capabilities tab. Turn on Background Modes.
Background fetch is a new mode that lets your app appear always up-to-date with the latest information while minimizing the impact on battery. You could download feeds within fixed time intervals with this capability. To get started: 1- Check Background Fetch in capabilities screen in Xcode. 2- I...
1- Run the app on a real device and attach it to Xcode debugger. 2- From Debug menu, select Simulate Background Fetch: 3- Now Xcode will pause the app with SIGSTOP signal. Just tap the continue button to let the app do the background fetch. Now you will see that data is fetched and ready for ...
By default, when you are streaming an audio, by exiting the app it will stop, but you can prevent this by turning on the first check box in Background capability page in Xcode. iOS will automatically handle this for you, and you don't need to write any code!
When using d3.request() or one of the convenience constructors (d3.json, d3.csv, d3.tsv, d3.html and d3.xml) there are many sources for error. There may be problems with the issued request or its response due to network errors, or the parsing might fail if the content is not well-formed. Within the...
Sometimes we'd like to pause code execution to inspect the state of the application (see Debugging). When running code through the MATLAB editor, this can be done using the "Pause" button in the UI or by pressing Ctrl+c (on Windows). However, when a computation was initiated from a GUI (vi...
Adding a video that will autoplay on a loop and has no controls or sound. Perfect for a video header or background. <video width="1280" height="720" autoplay muted loop poster="video.jpg" id="videobg"> <source src="video.mp4" type="...
As you may have noticed in the example above, we are rewriting the same step multiple times: Given the user is on the login page This can be exceptionally tedious, especially if we have more than one given step that is reused. Gherkin provides a solution for this by giving us another keyword to ...
Firebase handles notifications differently when the app is in background (killed process) and when in foreground (active). When your app is in the background, notification messages are displayed in the system tray, and onMessageReceived is not called. For notification messages with a data payload...
new Vue({ el:"#app", data:{ foo: "bar" }, methods:{ doSomethingAsynchronous(){ setTimeout(function(){ // This is wrong! Inside this function, // "this" refers to the window object. this.foo = "baz"; ...

Page 10 of 12