1. Character Class
Character class is denoted by []. Content inside a character class is treated as single character separately. e.g. suppose we use
[12345]
In the example above, it means match 1 or 2 or 3 or 4 or 5 . In simple words, it can be understood as or condition for single characters (...
Observe the notifications UIKeyboardWillShowNotification and UIKeyboardWillHideNotification, update the scrollView content insets according to keyboard height, then scroll to the focused control.
- (void)viewDidLoad
{
[super viewDidLoad];
// register for keyboard notifications
[[...
In order to read a cookie use the following code:
$value = \Yii::$app->getRequest()->getCookies()->getValue('my_cookie');
Note: this code allows read cookies that has been set using cookie component (because it signs all cookies by default). Therefore if you add/update cookie using JS c...
Because of security reasons, by default cookies are accessible only on the same domain from which they were set.
For example, if you have set a cookie on domain example.com, you cannot get it on domain www.example.com.
So if you're planning to use subdomains (i.e. admin.example.com, profile.exampl...
In case of autologin or "remember me" cookie, the same quirks as in case of subdomain cookies are applying.
But this time you need to configure user component, setting identityCookie array to desired cookie config.
Open you application config file and add identityCookie parameters to use...
A less known builtin feature is Controller Action injection using the FromServicesAttribute.
[HttpGet]
public async Task<IActionResult> GetAllAsync([FromServices]IProductService products)
{
return Ok(await products.GetAllAsync());
}
An important note is that the [FromServices] c...
The ng-mouseenter and ng-mouseleave directives are useful to run events and apply CSS styling when you hover into or out of your DOM elements.
The ng-mouseenter directive runs an expression one a mouse enter event (when the user enters his mouse pointer over the DOM element this directive resides i...
This directive is useful to limit input events based on certain existing conditions.
The ng-disabled directive accepts and expression that should evaluate to either a truthy or a falsy values.
ng-disabled is used to conditionally apply the disabled attribute on an input element.
HTML
<input t...
The ng-dblclick directive is useful when you want to bind a double-click event into your DOM elements.
This directive accepts an expression
HTML
<input type="number" ng-model="num = num + 1" ng-init="num=0">
<button ng-dblclick="num++">Double...
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...
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...
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 ...
The dot product between two tensors can be performed using:
tf.matmul(a, b)
A full example is given below:
# Build a graph
graph = tf.Graph()
with graph.as_default():
# A 2x3 matrix
a = tf.constant(np.array([[1, 2, 3],
[2, 4, 6]]),
...
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...
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...