Tutorial by Examples: and

Once user clicks on a push notification, the following callback function will be called. You can parse the JSON to get any specific info sent from backend that will helps you in deep linking: Swift func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : ...
Displaying all the logs from the default buffer on the Command Line can be accomplished by: adb logcat This command will show you all the logs from the device's main buffer. Notice that if you use it for the first time, you'll get a lot of information, an enormous stream of data. So you may want...
This example is written with F# in mind but the ideas are applicable in all environments The first rule when optimizing for performance is to not to rely assumption; always Measure and Verify your assumptions. As we are not writing machine code directly it is hard to predict how the compiler an...
An interesting but rather unknown usage of Active Patterns in F# is that they can be used to validate and transform function arguments. Consider the classic way to do argument validation: // val f : string option -> string option -> string let f v u = let v = defaultArg v "Hello&quo...
Time and date come in a number of different types in Java: The now historic Date and Calendar, and the more recent LocalDate and LocalDateTime. And Timestamp, Instant, ZonedLocalDateTime and the Joda-time types. On the database side, we have time, date and timestamp (both time and date), possibly wi...
A container will stop if no command is running on the foreground. Using the -t option will keep the container from stopping, even when detached with the -d option. docker run -t -d debian bash
Although this works only for WebKit based browsers, this is helpful: /* ----------- Non-Retina Screens ----------- */ @media screen and (min-width: 1200px) and (max-width: 1600px) and (-webkit-min-device-pixel-ratio: 1) { } /* ----------- Retina Screens ----------- */ @media scre...
Overridable Allows a property or method in a class to be overridden in a derived class. Public Class Person Public Overridable Sub DoSomething() Console.WriteLine("Person") End Sub End Class Overrides Overrides an Overridable property or method defined in the base...
In C, character constants and string literals are different things. A character surrounded by single quotes like 'a' is a character constant. A character constant is an integer whose value is the character code that stands for the character. How to interpret character constants with multiple charac...
To know the path of the directory your file is in you can use: Esc to enter command mode :pwd This will print the path to the directory at the bottom of the editor, like this I'm a ninja ~ ~ ~ ~ ~ /home/ubuntu/myfolder 1,5 All Now...
The canvas can be used to display video from a variety of sources. This example shows how to load a video as a file resource, display it and add a simple click on screen play/pause toggle. This stackoverflow self answered question How do I display a video using HTML5 canvas tag shows the following ...
Since Laravel version 5.2.31 the web middleware is applied by default within the RouteServiceProvider (https://github.com/laravel/laravel/commit/5c30c98db96459b4cc878d085490e4677b0b67ed) In app/Providers/RouteServiceProvider.php you will find the following functions which apply the middleware on ev...
It is unlikely for a developer to not come across a deprecated API during a development process. A deprecated program element is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists. Compilers and analyzers (like LINT) warn when a...
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 ...
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...
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...
As with docopt, with [docopt_dispatch] you craft your --help in the __doc__ variable of your entry-point module. There, you call dispatch with the doc string as argument, so it can run the parser over it. That being done, instead of handling manually the arguments (which usually ends up in a high c...
Manually open and close a file. # Using new method f = File.new("test.txt", "r") # reading f = File.new("test.txt", "w") # writing f = File.new("test.txt", "a") # appending # Using open method f = open("test.txt", "r&...
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...
Sometimes when destructuring maps, you would like to bind the destructured values to their respective key name. Depending on the granularity of the data structure, using the standard destructuring scheme may be a little bit verbose. Let's say, we have a map based record like so : (def john {:lastn...

Page 64 of 153