Tutorial by Examples: co

First of all, we will need to create our Dockerfile. A good example can be found on this blog by Nick Janetakis. This code contains the script that will be executed on our docker machine at the moment of start.For this reason, we are installing all the required libraries and ends with the start of ...
The following method will take a second or two depending on your connection to retrieve a web page and count the text length. Whatever thread calls it will block for that period of time. Also it rethrows an exception which is useful later on. public static long blockingGetWebPageLength(String urlS...
In the example below, the calculateShippingPrice method calculates shipping cost, which takes some processing time. In a real world example, this would e.g. be contacting another server which returns the price based on the weight of the product and the shipping method. By modeling this in an async ...
mView.afterMeasured { // inside this block the view is completely drawn // you can get view's height/width, it.height / it.width } Under the hood inline fun View.afterMeasured(crossinline f: View.() -> Unit) { viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlob...
(from official doc) fun main(args: Array<String>) { launch(CommonPool) { // create new coroutine in common thread pool delay(1000L) // non-blocking delay for 1 second (default time unit is ms) println("World!") // print after delay } println("He...
git diff-tree --no-commit-id --name-only -r COMMIT_ID
--from * Email From: --[no-]to * Email To: --[no-]cc * Email Cc: --[no-]bcc * Email Bcc: --subject * Email "Subject:" --in-reply-to * Email "In-Reply-To:" --[no-]xmailer ...
OptionExplanation-zoutput diff-raw with lines terminated with NUL.-poutput patch format.-usynonym for -p.--patch-with-rawoutput both a patch and the diff-raw format.--statshow diffstat instead of patch.--numstatshow numeric diffstat instead of patch.--patch-with-statoutput a patch and prepend its di...
#include "cuda_runtime.h" #include "device_launch_parameters.h" #include "cuda.h" #include <device_functions.h> #include <cuda_runtime_api.h> #include<stdio.h> #include <cmath> #include<stdlib.h> #include<iostream> #include...
Let's consider situation when you parse number of pages and you want to collect value from element that's optional (can be presented on one page and can be absent on another) for a paticular page. Moreover the element itself, for example, is the most ordinary element on page, in other words no spec...
var sck = "wss://site.com/wss-handler"; var wss = new WebSocket(sck); This uses the wss instead of ws to make a secure web socket connection which make use of HTTPS instead of HTTP

Page 248 of 248