Tutorial by Examples: and

HTTP describes how an HTTP client, such as a web browser, sends an HTTP request via a network to an HTTP server, which then sends an HTTP response back to the client. The HTTP request is typically either a request for an online resource, such as a web page or image, but may also include additiona...
Retrofit2 comes with support for multiple pluggable execution mechanisms, one of them is RxJava. To use retrofit with RxJava you first need to add the Retrofit RxJava adapter to your project: compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' then you need to add the adapter when building yo...
Variable tensors are used when the values require updating within a session. It is the type of tensor that would be used for the weights matrix when creating neural networks, since these values will be updated as the model is being trained. Declaring a variable tensor can be done using the tf.Varia...
A Bag/ultiset stores each object in the collection together with a count of occurrences. Extra methods on the interface allow multiple copies of an object to be added or removed at once. JDK analog is HashMap<T, Integer>, when values is count of copies this key. TypeGuavaApache Commons Collec...
This multimap allows duplicate key-value pairs. JDK analogs are HashMap<K, List>, HashMap<K, Set> and so on. Key's orderValue's orderDuplicateAnalog keyAnalog valueGuavaApacheEclipse (GS) CollectionsJDKnot definedInsertion-orderyesHashMapArrayListArrayListMultimapMultiValueMapFastListMu...
When you create a function in TypeScript you can specify the data type of the function's arguments and the data type for the return value Example: function sum(x: number, y: number): number { return x + y; } Here the syntax x: number, y: number means that the function can accept two argum...
Example: function hello(name: string): string { return `Hello ${name}!`; } Here the syntax name: string means that the function can accept one name argument and this argument can only be string and (...): string { means that the return value can only be a string Usage: hello('StackOverfl...
Android Studio can configure Kotlin automatically in an Android project. Install the plugin To install the Kotlin plugin, go to File > Settings > Editor > Plugins > Install JetBrains Plugin... > Kotlin > Install, then restart Android Studio when prompted. Configure a project Cr...
In order to include plots created with matplotlib in TeX documents, they should be saved as pdf or eps files. In this way, any text in the plot (including TeX formulae) is rendered as text in the final document. import matplotlib.pyplot as plt plt.rc(usetex=True) x = range(0, 10) y = [t**2 for t...
The following example creates a canvas with 2 points and 1 line in between. You will be able to move the point and the line around. from kivy.app import App from kivy.graphics import Ellipse, Line from kivy.uix.boxlayout import BoxLayout class CustomLayout(BoxLayout): def __init__(se...
It's a VBA Best Practice to always specify which workbook your VBA code refers. If this specification is omitted, then VBA assumes the code is directed at the currently active workbook (ActiveWorkbook). '--- the currently active workbook (and worksheet) is implied Range("A1").value = 3.1...
Stackage is a repository for Haskell packages. We can add these packages to a stack project. Adding lens to a project. In a stack project, there is a file called stack.yaml. In stack.yaml there is a segment that looks like: resolver: lts-6.8 Stackage keeps a list of packages for every revision...
Example uses of $(document).ready(): Attaching event handlers Attach jQuery event handlers $(document).ready(function() { $("button").click(function() { // Code for the click function }); }); Run jQuery code after the page structure is created jQuery(function($) ...
Get Focus Swift textField.becomeFirstResponder() Objective-C [textField becomeFirstResponder]; Resign Swift textField.resignFirstResponder() Objective-C [textField resignFirstResponder];
vagrant up By default the box will be provisioned.
Modules can be used to add new functions to existing Modules and Types. namespace FSharp.Collections module List = let pair item1 item2 = [ item1; item2 ] The new function can then be called as if it was an original member of List. open FSharp.Collections module Testing = le...
The following examples show 3 main methods for installing Erlang/OTP on FreeBSD. Method 1 - Pre-built Binary Package Use pkg to install the pre-built binary package: $ pkg install erlang Test your new installation: $ erl Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:2:2] [async-threads:1...
It's common to structure a program as building up a data structure and then collapsing it to a single value. This is called a hylomorphism or refold. It's possible to elide the intermediate structure altogether for improved efficiency. hylo :: Functor f => (a -> f a) -> (f b -> b) ->...
CREATE TABLE table_name ( id INT NOT NULL AUTO_INCREMENT, json_col JSON, PRIMARY KEY(id) );
The width and height attributes designate the dimensions of the rectangle. These values are in pixels by default The fill value sets the color for the rectangle. If no value for fill is specified, black is used by default <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="h...

Page 42 of 153