Tutorial by Examples: attribut

context.lineCap=capStyle // butt (default), round, square Sets the cap style of line starting points and ending points. butt, the default lineCap style, shows squared caps that do not extend beyond the line's starting and ending points. round, shows rounded caps that extend beyond the ...
context.lineJoin=joinStyle // miter (default), round, bevel Sets the style used to connect adjoining line segments. miter, the default, joins line segments with a sharp joint. round, joins line segments with a rounded joint. bevel, joins line segments with a blunted joint. <!doctype...
context.strokeStyle=color Sets the color that will be used to stroke the outline of the current path. These are color options (these must be quoted): A CSS named color, for example context.strokeStyle='red' A hex color, for example context.strokeStyle='#FF0000' An RGB color, for e...
context.fillStyle=color Sets the color that will be used to fill the interior of the current path. These are color options (these must be quoted): A CSS named color, for example context.fillStyle='red' A hex color, for example context.fillStyle='#FF0000' An RGB color, for example ...
context.lineWidth=lineWidth Sets the width of the line that will stroke the outline of the path <!doctype html> <html> <head> <style> body{ background-color:white; } #canvas{border:1px solid red; } </style> <script> window.onload=(function(){...
shadowColor = color // CSS color shadowBlur = width // integer blur width shadowOffsetX = distance // shadow is moved horizontally by this offset shadowOffsetY = distance // shadow is moved vertically by this offset This set of attributes will add a shadow around a path. Bo...
If we want to get the x-cordinate of origin of the view, then we need to write like: view.frame.origin.x For width, we need to write: view.frame.size.width But if we add a simple extension to an UIView, we can get all the attributes very simply, like: view.x view.y view.width view.height...
Throughout the topics and examples here we'll see many declarations of variables, functions and so on. As well as their name, data objects may have attributes. Covered in this topic are declaration statements like integer, parameter :: single_kind = kind(1.) which gives the object single_kind...
Validate that an attribute's value matches a regular expression using format and the with option. class User < ApplicationRecord validates :name, format: { with: /\A\w{6,10}\z/ } end You can also define a constant and set its value to a regular expression and pass it to the with: option. ...
You can check if a value is included in an array using the inclusion: helper. The :in option and its alias, :within show the set of acceptable values. class Country < ApplicationRecord validates :continent, inclusion: { in: %w(Africa Antartica Asia Australia ...
If you use the [NonSerialized] attribute, then that member will always have its default value after deserialization (ex. 0 for an int, null for string, false for a bool, etc.), regardless of any initialization done in the object itself (constructors, declarations, etc.). To compensate, the attribut...
Key is a field in a table which uniquely identifies each row/record in a database table. Use this attribute to override the default Code-First convention. If applied to a property, it will be used as the primary key column for this class. using System.ComponentModel.DataAnnotations; public clas...
When applied to a property of a domain class, the database will create a NOT NULL column. using System.ComponentModel.DataAnnotations; public class Person { public int PersonID { get; set; } [Required] public string PersonName { get; set; } } The resulting column wi...
[MaxLength(int)] attribute can be applied to a string or array type property of a domain class. Entity Framework will set the size of a column to the specified value. using System.ComponentModel.DataAnnotations; public class Person { public int PersonID { get; set; } [MinLength(...
Ada 2012(TC-1) with Ada.Text_IO; procedure Main is type Some_Float digits 8 range 0.0 .. 10.0; X : Some_Float := 2.71; begin Ada.Text_IO.Put_Line (X'Image); end Main; Result 2.71000E+00
Ada 2012(TC-1) with Ada.Text_IO; procedure Main is type Some_Integer is range -42 .. 42; X : Some_Integer := 17; begin Ada.Text_IO.Put_Line (X'Image); end Main; Result 17
Ada 2012(TC-1) with Ada.Text_IO; procedure Main is type Fruit is (Banana, Orange, Pear); X : Fruit := Orange; begin Ada.Text_IO.Put_Line (X'Image); Ada.Text_IO.Put_Line (Pear'Image); end Main; Result ORANGE PEAR
The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. The target attribute defines a name of, or keyword for, a browsing context (e.g. tab, window, or inline frame). From Tag with a target attribute: <form ta...
with Ada.Text_IO; procedure Main is type Fruit is (Banana, Orange, Pear); X : Fruit := Orange; begin Ada.Text_IO.Put_Line (Fruit'Image (X)); end Main; Result ORANGE
with Ada.Text_IO; procedure Main is X : Integer := 17; begin Ada.Text_IO.Put_Line (Integer'Image (X)); end Main; Result 17

Page 4 of 10