Tutorial by Examples: er

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...
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...
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...
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...
For immutable elements (e.g. None, string literals etc.): my_list = [None] * 10 my_list = ['test'] * 10 For mutable elements, the same construct will result in all elements of the list referring to the same object, for example, for a set: >>> my_list=[{1}] * 10 >>> print(my_...
General syntax: DATEADD (datepart , number , datetime_expr) To add a time measure, the number must be positive. To subtract a time measure, the number must be negative. Examples DECLARE @now DATETIME2 = GETDATE(); SELECT @now; --2016-07-21 14:39:46.4170000 SELECT DAT...
These are the datepart values available to date & time functions: datepartAbbreviationsyearyy, yyyyquarterqq, qmonthmm, mdayofyeardy, ydaydd, dweekwk, wwweekdaydw, whourhhminutemi, nsecondss, smillisecondmsmicrosecondmcsnanosecondns NOTE: Use of abbreviations is generally discouraged as they c...
General syntax: DATEDIFF (datepart, datetime_expr1, datetime_expr2) It will return a positive number if datetime_expr is in the past relative to datetime_expr2, and a negative number otherwise. Examples DECLARE @now DATETIME2 = GETDATE(); DECLARE @oneYearAgo DATETIME2 = DATEADD(YEAR, -1, @now...
Some properties can take multiple values, collectively known as a property list. /* Two values in this property list */ span { text-shadow: yellow 0 0 3px, green 4px 4px 10px; } /* Alternate Formatting */ span { text-shadow: yellow 0 0 3px, green 4px 4px 10px; } ...
The most basic instance of an if construct evaluates a condition and executes some code according to the condition outcome. If the condition returns true, the code within the conditional is executed. counter = 10 if counter is 10 console.log 'This will be executed!' The if construct can be e...
Make sure your tomcat configurations file, server.xml has this line: <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" maxHttpHeaderSize="8192" SSLEnabled="true" maxThreads="150" minSpareThrea...
PHP 5.5 introduces Generators and the yield keyword, which allows us to write asynchronous code that looks more like synchronous code. The yield expression is responsible for giving control back to the calling code and providing a point of resumption at that place. One can send a value along the yi...
This attribute applies a version to the assembly. [assembly: AssemblyVersion("1.0.*")] The * character is used to auto-increment a portion of the version automatically every time you compile (often used for the "build" number)
Iterators produce enumerators. In C#, enumerators are produced by defining methods, properties or indexers that contain yield statements. Most methods will return control to their caller through normal return statements, which disposes all state local to that method. In contrast, methods that use y...
When defining themes, one usually uses the theme provided by the system, and then changes modifies the look to fit his own application. For example, this is how the Theme.AppCompat theme is inherited: <style name="AppTheme" parent="Theme.AppCompat"> <item name=&quo...
Vlookup finds some value in the leftmost column of a range and returns a value some number of columns to the right and in the same row. Let's say you want to find the surname of Employee ID 2 from this table: =VLOOKUP(2,$A$2:$C$4,3,0) The value you're retrieving data for is 2 The table you...
Your code in source control has version numbers either by default (SVN ids or Git SHA1 hashes) or explicitly (Git tags). Rather than manually updating versions in AssemblyInfo.cs you can use a build time process to write the version from your source control system into your AssemblyInfo.cs files and...

Page 185 of 417