Tutorial by Examples: e

A deadlock occurs when every member of some group of two or more threads must wait for one of the other members to do something (e.g., to release a lock) before it can proceed. Without intervention, the threads will wait forever. A pseudocode example of a deadlock-prone design is: thread_1 { ...
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...
Custom Renderers let developers customize the appearance and behavior of Xamarin.Forms controls on each platform. Developers could use features of native controls. For example, we need to disable scroll in ListView. On iOS ListView is scrollable even if all items are placed on the screen and user s...
Cheatsheet DODON'TControl flow with control statementsControl flow with exceptionsKeep track of ignored (absorbed) exception by loggingIgnore exceptionRepeat exception by using throwRe-throw exception - throw new ArgumentNullException() or throw exThrow predefined system exceptionsThrow custom exce...
ng-app Sets the AngularJS section. ng-init Sets a default variable value. ng-bind Alternative to {{ }} template. ng-bind-template Binds multiple expressions to the view. ng-non-bindable States that the data isn't bindable. ng-bind-html Binds inner HTML property of an HTML element....
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...
RxJava is handy when making serial request. If you want to use the result from one request to make another you can use the flatMap operator: api.getRepo(repoId).flatMap(repo -> api.getUser(repo.getOwnerId()) .subscribe(/*do something with the result*/);
You can use the zip operator to make request in parallel and combine the results eg: Observable.zip(api.getRepo(repoId1), api.getRepo(repoId2), (repo1, repo2) -> { //here you can combine the results }).subscribe(/*do something with the result*/);
C++11 introduced core language and standard library support for moving an object. The idea is that when an object o is a temporary and one wants a logical copy, then its safe to just pilfer o's resources, such as a dynamically allocated buffer, leaving o logically empty but still destructible and co...
Placeholders allow you to feed values into a tensorflow graph. Aditionally They allow you to specify constraints regarding the dimensions and data type of the values being fed in. As such they are useful when creating a neural network to feed new training examples. The following example declares a ...
To perform elementwise multiplication on tensors, you can use either of the following: a*b tf.multiply(a, b) Here is a full example of elementwise multiplication using both methods. import tensorflow as tf import numpy as np # Build a graph graph = tf.Graph() with graph.as_default(): ...
In the following example a 2 by 3 tensor is multiplied by a scalar value (2). # Build a graph graph = tf.Graph() with graph.as_default(): # A 2x3 matrix a = tf.constant(np.array([[ 1, 2, 3], [10,20,30]]), dtype=tf.float32) ...
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...
Type synonym families are just type-level functions: they associate parameter types with result types. These come in three different varieties. Closed type-synonym families These work much like ordinary value-level Haskell functions: you specify some clauses, mapping certain types to others: {-# ...
Data families can be used to build datatypes that have different implementations based on their type arguments. Standalone data families {-# LANGUAGE TypeFamilies #-} data family List a data instance List Char = Nil | Cons Char (List Char) data instance List () = UnitList Int In the above de...
Set MONGO_URL to any arbitrary value except for a database URL and ensure no collections are defined in your Meteor project (including collections defined by Meteor packages) to run Meteor without MongoDB. Note that without MongoDB, server/client methods alongside any packages related to Meteor's u...
XSS attacks consist in injecting HTML (or JS) code in a page. See What is cross site scripting for more information. To prevent from this attack, by default, Django escapes strings passed through a template variable. Given the following context: context = { 'class_name': 'large" style=&...
The intent attribute of a dummy argument in a subroutine or function declares its intended use. The syntax is either one of intent(IN) intent(OUT) intent(INOUT) For example, consider this function: real function f(x) real, intent(IN) :: x f = x*x end function The intent(IN) specif...
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...

Page 338 of 1191