Tutorial by Examples: al

Some devices connected through a serial port send data to your program at a constant rate (streaming data) or send data at unpredictable intervals. You can configure the serial port to execute a function automatically to handle data whenever it arrives. This is called the "callback function&quo...
Scala has a powerful type-inference mechanism built-in to the language. This mechanism is termed as 'Local Type Inference': val i = 1 + 2 // the type of i is Int val s = "I am a String" // the type of s is String def squared(x : Int) = x*x // the return type ...
To split strings, Guava introduces the Splitter class. Why not use Java's splitting capabilities? As a rule, Guava does not duplicate functionality that is readily available in Java. Why then do we need an additional Splitter class? Do the split methods in Java's String class not provide us with a...
#include <SPI.h> #define CSPIN 1 void setup() { pinMode(CSPIN, OUTPUT); // init chip select pin as an output digitalWrite(CSPIN, 1); // most slaves interpret a high level on CS as "deasserted" SPI.begin(); SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MO...
This is an example on how to call a web service from salesforce. The code below is calling a REST based service hosted on data.gov to find farmers markets close to the zipcode. Please remember in order to invoke a HTTP callout from your org, you need to tweak the remote settings for the org. strin...
Custom Setting Custom Setting Field Custom Setting Field Value When the field is checked the validation rule will be disabled, for the running user or in this example, their profile - The rule can also be disabled for a whole Salesforce org - Validation Rule AND( /* the below is the...
Visual Studio 2013 can be downloaded here The setup is pretty easy.Select features you need and select the disk to install VS13 on.Click install and wait for it to finish.
functions.php: function rm_init_js() { wp_enqueue_script( 'custom-ajax-script', get_template_directory_uri() . '/js/ajax.js', array( 'jquery', 'wp-util' ), '1.0', true ); // pass custom variables to JS wp_localize_script( 'custom-ajax-script', 'BEJS', array( 'action' => ...
The image contained in the ImageView may not fit the exact size given to the container. In that case, the framework allows you to resize the image in a number of ways. Center <ImageView android:layout_width="20dp" android:layout_height="20dp" andr...
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). Official Docs When the image matches the proportions of the container: When the image is...
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). Official Docs It will center the image and resize it to the smaller size, if both container s...
Scale the image using START. Scale the image using END. Official Docs FitStart This will fit to the smallest size of the container, and it will align it to the start. <ImageView android:layout_width="200dp" android:layout_height="200dp" android:src...
Scale the image using CENTER. Official Docs This expands the image to try to match the container and it will align it to the center, it will fit to the smaller size. Bigger height ( fit to width ) Same width and height.
Scale the image using FILL. Official Docs <ImageView android:layout_width="100dp" android:layout_height="200dp" android:src="@mipmap/ic_launcher" android:id="@+id/imageView" android:scaleType="fitXY&quo...
This is a client-server example. The process forks and runs client in the parent process and server in the child process: client connects to server and waits until server exits; server accepts connection from client, enables keepalive, and waits any signal. Keepalive is configured using the f...
Dependencies To install electron you must first install Node.js, which comes with npm. How to install it? Use npm: # Install the `electron` command globally in your $PATH npm install electron -g # OR # Install as a development dependency npm install electron --save-dev
FFmpeg can be installed on a mixture of Operating Systems, including Unix and OS X. Using a command line extension, this utility can also be installed on Windows using a dll. OS X To install this utility on OS X, just head over to ffmpeg.org, download the release relative to your Macs architec...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['battery_service']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Battery Service... return server.getPri...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['heart_rate']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Heart Rate Service... return server.getP...
APT and APT-GET Easiest and fastest way is with apt-get command. This command may be considered as lower-level and "back-end", and support other APT-based tools. There are no fancy loaders, only basic progress info. This is fastest way for installing apps. Usage: sudo apt-get install ...

Page 132 of 269