Tutorial by Examples: e

Example below shows how to create a BroadcastReceiver which is able to receive BOOT_COMPLETED events. This way, you are able to start a Service or start an Activity as soon device was powered up. Also, you can use BOOT_COMPLETED events to restore your alarms since they are destroyed when device is ...
For the sake of this example, let us assume that we have a server for handling the POST requests that we will be making from our Android app: // User input data. String email = "[email protected]"; String password = "123"; // Our server URL for handling POST requests. String UR...
For a Django project with requirements and deployment tools under source control. This example builds upon concepts from the Two Scoops of Django. They have published a template: repository/ docs/ .gitignore project/ apps/ blog/ migrations/ ...
Casting: The Basics Casting is used to transform data from long to wide format. Starting with a long data set: DT = data.table(ID = rep(letters[1:3],3), Age = rep(20:22,3), Test = rep(c("OB_A","OB_B","OB_C"), each = 3), Result = 1:9) We can cast our data using the...
The FETCH clause was introduced in Oracle 12c R1: SELECT val FROM mytable ORDER BY val DESC FETCH FIRST 5 ROWS ONLY; An example without FETCH that works also in earlier versions: SELECT * FROM ( SELECT val FROM mytable ORDER BY val DESC ) WHERE ROWNUM <= 5;
Defined in header <numeric> template<class InputIterator, class T> T accumulate(InputIterator first, InputIterator last, T init); // (1) template<class InputIterator, class T, class BinaryOperation> T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation...
One of the nicest features of flexbox is to allow optimally fitting containers to their parent element. Live demo. HTML: <div class="flex-container"> <div class="flex-item">1</div> <div class="flex-item">2</div> <div class=&q...
The pointer-events property allows for control over how HTML elements respond to mouse/touch events. .disabled { pointer-events: none; } In this example, 'none' prevents all click, state and cursor options on the specified HTML element [[1]] Other valid values for HTMl elements are: ...
Using outline: .div1{ border: 3px solid black; outline: 6px solid blue; width: 100px; height: 100px; margin: 20px; } Using box-shadow: .div2{ border: 5px solid green; box-shadow: 0px 0px 0px 4px #000; width: 100px; height: 100px; margin: 20px; } Using a ps...
Having a global allows for better DRYness, you need only put values that are different into AssemblyInfo.cs for projects that have variance. This use assumes your product has more than one visual studio project. GlobalAssemblyInfo.cs using System.Reflection; using System.Runtime.InteropServices...
2.12.2 You can use the minElement() and maxElement() methods to find the minimum or maximum element in a given sequence. For example, with an array of numbers: let numbers = [2, 6, 1, 25, 13, 7, 9] let minimumNumber = numbers.minElement() // Optional(1) let maximumNumber = numbers.maxElement()...
Often beginning MATLAB developers will use MATLAB's editor to write and edit code, in particular custom functions with inputs and outputs. There is a Run button at the top that is available in recent versions of MATLAB: Once the developer finishes with the code, they are often tempted to push th...
Explicite selection A plotting style is usually selected using the with keyword, like plot x with points This allows to use different plotting styles for every plot: plot x with points, 2*x with lines Typing help with in the gnuplot command window gives a list of all available plotting styl...
ActiveRecord with includes ensures that all of the specified associations are loaded using the minimum possible number of queries. So when querying a table for data with an associated table, both tables are loaded into memory. @authors = Author.includes(:books).where(books: { bestseller: true } ) ...
Here is typical error handler for a subform as a table: Public Const cErrCodeValueRequierd = 3162 Public Const cErrCodeDuplicateKey = 3022 Private Sub Form_Error(DataErr As Integer, Response As Integer) Select Case DataErr Case cErrCodeDuplicateKey MsgBox "Duplic...
Given a class as follows: class Cube attr_reader :height, :width, :depth def initialize(args) @height = args[:height] || args[:y] || 1 @width = args[:width] || args[:x] || 1 @depth = args[:depth] || args[:z] || 1 end def volume height * width * depth end ...
To create a most basic test with Jasmine go to your spec (tests) folder and add file named testSpec.js. In that file add following: var request = require("request"); describe("Hello World Test", function() { // This is your test bundle describe("GET SO", fu...
To build a Rails application that will be an API server, you can start with a more limited subset of Rails in Rails 5. To generate a new Rails API app: rails new my_api --api What --api does is to remove functionality that is not needed when building an API. This includes sessions, cookies, ass...
In PHP, there are two versions of logical AND and OR operators. OperatorTrue if$a and $bBoth $a and $b are true$a && $bBoth $a and $b are true$a or $bEither $a or $b is true$a || $bEither $a or $b is true Note that the && and || opererators have higher precedence than and and or. S...
In cryptography, encryption is the process of encoding messages or information in such a way that only authorized parties can access it. Source: Encryption - Wikipedia

Page 514 of 1191