Tutorial by Examples: l

public void doSomething() { DialogTestBinding binding = DataBindingUtil .inflate(LayoutInflater.from(context), R.layout.dialog_test, null, false); Dialog dialog = new Dialog(context); dialog.setContentView(binding.getRoot()); dialog.show(); }
Pulls the code from a certain specified file into another file where the call was made. E.g. inside example.php <h1>Hello World!</h1> Inside page.php // header code get_template_part('example'); // rest of page code Output: // header code <h1>Hello World</h1> /...
Any middleware registered as routeMiddleware in app/Http/Kernel.php can be assigned to a route. There are a few different ways to assign middleware, but they all do the same. Route::get('/admin', 'AdminController@index')->middleware('auth', 'admin'); Route::get('admin/profile', ['using' => ...
This is a basic polymer element that show a list of names. <link rel="import" href="../bower_components/polymer/polymer.html"> <dom-module id="basic-list"> <template> <style> </style> <div>Name's list</div&g...
Angular 1 is at heart a DOM compiler. We can pass it HTML, either as a template or just as a regular web page, and then have it compile an app. We can tell Angular to treat a region of the page as an expression using the {{ }} handlebars style syntax. Anything between the curly braces will be compi...
Alfresco logs live in $ALFRESCO_HOME/tomcat/logs/catalina.out.
int[string] aa0 = ["x": 5, "y": 6]; //int values, string keys auto aa1 = ["x": 5.0, "y": 6.0]; // double values, string keys string[int] aa2 = [10: "A", 11: "B"]; //string values, int keys
int[string] aa = ["x": 5, "y": 6]; // The value can be set by its key: aa["x"] = 7; assert(aa["x"] == 7); // if the key does not exist will be added aa["z"] = 8; assert(aa["z"] == 8);
Let's assume an associative array aa: int[string] aa = ["x": 5, "y": 6]; Items can be removed by using .remove(), if key exits will be removed and remove returns true: assert(aa.remove("x")); if the given key does not exist remove does nothing and returns false:...
content-model.xml : .... <constraints> <constraint name="my:aConstraintList" type="x.y.z.project.model.constraint.AConstraintList"> </constraint> .... <property name="my:aValue"> <title>My Value</title> <typ...
Scala's implementation of type classes is rather verbose. One way to reduce the verbosity is to introduce so-called "Operation Classes". These classes will automatically wrap a variable/value when they are imported to extend functionality. To illustrate this, let us first create a simple ...
An element capable of scrolling if it's Content requires. ScrollView contains layouts and enables them to scroll offscreen. ScrollView is also used to allow views to automatically move to the visible portion of the screen when the keyboard is showing. Note: ScrollViews should not be nested. In a...
An element that displays content with a control template, and the base class for ContentView.
AbsoluteLayout positions and sizes child elements proportional to its own size and position or by absolute values. Child views may be positioned and sized using proportional values or static values, and proportional and static values can be mixed. A definition of an AbsoluteLayout in XAML looks l...
A Layout that uses Constraints to layout its children. RelativeLayout is used to position and size views relative to properties of the layout or sibling views. Unlike AbsoluteLayout, RelativeLayout does not have the concept of the moving anchor and does not have facilities for positioning elements ...
StackLayout organizes views in a one-dimensional line ("stack"), either horizontally or vertically. Views in a StackLayout can be sized based on the space in the layout using layout options. Positioning is determined by the order views were added to the layout and the layout options of the...
Small Core, Small Module :- Build small and single purpose modules not in term of code size only, but also in term of scope that serves a single purpose a - "Small is beautiful" b - "Make each program do one thing well." The Reactor Pattern The Reactor Pattern is t...
Authentication in Django REST Framework can be configured globally as a subkey of the REST_FRAMEWORK variable in settings.py, just like the rest of the default framework configurations. REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.BasicAuthen...
The most interesting package for managing real tokens is django-rest-knox which supports multiple tokens per user (and cancelling each token independently), as well as having support for token expiration and several other security mechanisms. django-rest-knox depends on cryptography. You can find m...
A simple example of Vehicle hierarchy can be taken for single table inheritance strategy. Abstract Vehicle class: package com.thejavageek.jpa.entities; import javax.persistence.DiscriminatorColumn; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persi...

Page 543 of 861