Tutorial by Examples

Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to explicitly define a type first. The type name is generated by the compiler and is not available at the source code level. The type of each property is inferred by the compiler...
Parameter TypesReturn TypeInterface()voidRunnable()TSupplier()booleanBooleanSupplier()intIntSupplier()longLongSupplier()doubleDoubleSupplier(T)voidConsumer<T>(T)TUnaryOperator<T>(T)RFunction<T,R>(T)booleanPredicate<T>(T)intToIntFunction<T>(T)longToLongFunction<T>(...
You can define a function to be recursive with the rec keyword, so it can call itself. # let rec fact n = match n with | 0 -> 1 | n -> n * fact (n - 1);; val fact : int -> int = <fun> # fact 0;; - : int = 1 # fact 4;; - : int = 24 You can also define mutually re...
General Imports, using jinja2 to populate templates into htmls. import jinja2 import webapp2 Important import to use Users API: from google.appengine.api import users Setting of Jinja environment: [into the example the tehcnology selected to populate the information into the frontend] JINJ...
I used for this example webapp2 to cover the routing. from webapp2_extras.routes import RedirectRoute as Route Import from views: from views import MainPage MainPage is the handler set into root "/": urlpatterns = [ Route('/', MainPage), ]
Simple extract of index.html: <div class="sign-in"> {% if user %} [Passing the url we have the opportunity to logout the user] <a href="{{ url|safe }}">LOG OUT</a> [You can include here operations for user authenticated] ...
Once you're up with a new project with the basic template provided in the Introduction, you should be able to add a LUISRecognizer like so - var model = '' // Your LUIS Endpoint link comes here var recognizer = new builder.LuisRecognizer(model); Now, recognizer is a LUISRecognizer and can pa...
If we want our app data to be protected against iTunes backups, we have to skip our app data from being backed up in iTunes. Whenever iOS device backed up using iTunes on macOS, all the data stored by all the apps is copied in that backup and stored on backing computer. But we can exclude our app ...
IMPORTANT!! Valet is a tool designed for macOS only. Prerequisites Valet utilizes your local machine's HTTP port (port 80), therefore, you will not be able to use if Apache or Nginx are installed and running on the same machine. macOS' unofficial package manager Homebrew is required to properly...
Suppose we have a POJO class User we need to validate. public class User { @NotEmpty @Size(min=5) @Email private String email; } and a controller method to validate the user instance public String registerUser(@Valid User user, BindingResult result); Let's extend the U...
Component: <md2-select [(ngModel)]="item" (change)="change($event)" [disabled]="disabled"> <md2-option *ngFor="let i of items" [value]="i.value" [disabled]="i.disabled"> {{i.name}}</md2-option> </md2-select> ...
Tooltip is a directive, it allows the user to show hint text while the user mouse hover over an element. A tooltip would have the following markup. <span tooltip-direction="left" tooltip="On the Left!">Left</span> <button tooltip="some message" ...
Toast is a service, which show notifications in the view. Creates and show a simple toast noticiation. import {Md2Toast} from 'md2/toast/toast'; @Component({ selector: "..." }) export class ... { ... constructor(private toast: Md2Toast) { } toastMe() { this.toast.show(...
Assume that, we implement a simple API and we have the following models. class Parent(models.Model): name = models.CharField(max_length=50) class Child(models.Model): parent = models.ForeignKey(Parent) child_name = models.CharField(max_length=80) And we want to return a respo...
This command allows you to change or view the TLD (top-level domain) used to bind domains to your local machine. Get The Current TLD $ valet domain > dev Set the TLD $ valet domain local > Your Valet domain has been updated to [local].
Datepicker allow the user to select date and time. <md2-datepicker [(ngModel)]="date"></md2-datepicker> see for more details here
Md2Collapse : Collapse is a directive, it's allow the user to toggle visiblity of the section. Examples A collapse would have the following markup. <div [collapse]="isCollapsed"> Lorum Ipsum Content </div> Md2Accordion : Accordion it's allow the user to toggle vis...
Detailed instructions on getting avr set up or installed.
DirectByteBuffer is special implementation of ByteBuffer that has no byte[] laying underneath. We can allocate such ByteBuffer by calling: ByteBuffer directBuffer = ByteBuffer.allocateDirect(16); This operation will allocate 16 bytes of memory. The contents of direct buffers may reside outside ...
creating custom exception 'P2222': create or replace function s164() returns void as $$ begin raise exception using message = 'S 164', detail = 'D 164', hint = 'H 164', errcode = 'P2222'; end; $$ language plpgsql ; creating custom exception not assigning errm: create or replace function s...

Page 1254 of 1336