Tutorial by Examples: ctan

For the sample XML (without namespaces): This XPath, /r/e will select this element: <e a="1"/>
You can use the clearRect method to clear any rectangular section of the canvas. // Clear the entire canvas ctx.clearRect(0, 0, canvas.width, canvas.height); Note: clearRect is dependent on the transformation matrix. To deal with this, it's possible to reset the transformation matrix befor...
Comparable is one of the most popular modules in Ruby. Its purpose is to provide with convenience comparison methods. To use it, you have to include Comparable and define the space-ship operator (<=>): class Rectangle include Comparable def initialize(a, b) @a = a @b = b ...
In order to inspect an image, you can use the image ID or the image name, consisting of repository and tag. Say, you have the CentOS 6 base image: ➜ ~ docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos centos6 cf2c3...
Information The ABSTRACT and FINAL additions to the METHODS and CLASS statements allow you to define abstract and final methods or classes. An abstract method is defined in an abstract class and cannot be implemented in that class. Instead, it is implemented in a subclass of the class. Abstra...
Use module_info on Erlang modules you wish to inspect: iex> :math.module_info [module: :math, exports: [pi: 0, module_info: 0, module_info: 1, pow: 2, atan2: 2, sqrt: 1, log10: 1, log2: 1, log: 1, exp: 1, erfc: 1, erf: 1, atanh: 1, atan: 1, asinh: 1, asin: 1, acosh: 1, acos: 1, tanh...
This illustrates that union members shares memory and that struct members does not share memory. #include <stdio.h> #include <string.h> union My_Union { int variable_1; int variable_2; }; struct My_Struct { int variable_1; int variable_2; }; int main (void) { ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="10" y="10" width="50" height="100" stroke="black" stroke-width="5" fill="none" /> </svg> R...
The width and height attributes designate the dimensions of the rectangle. These values are in pixels by default The fill value sets the color for the rectangle. If no value for fill is specified, black is used by default <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="h...
Corner radius for all 4 edges: UIBezierPath* rectanglePath = [UIBezierPath bezierPathWithRoundedRect: CGRectMake(x,y,width,height) cornerRadius: 11]; [UIColor.grayColor setFill]; [rectanglePath fill]; Corner radius for top-left edge: UIBezierPath* rectanglePath = [UIBezierPath bezierPat...
You can test whether a point is inside a rectangle using Rectangle.containsPoint(): var point:Point = new Point(5, 5); var rectangle:Rectangle = new Rectangle(0, 0, 10, 10); var contains:Boolean = rectangle.containsPoint(point); // true
JavaFX 8 The following example demonstrates how to add custom properties that can be styled from css to a custom Node. Here 2 DoublePropertys are added to the Rectangle class to allow setting the width and height from CSS. The following CSS could be used for styling the custom node: StyleableRe...
In elm, a function's value is computed when the last argument is applied. In the example below, the diagnostic from log will be printed when f is invoked with 3 arguments or a curried form of f is applied with the last argument. import String import Debug exposing (log) f a b c = String.join &...
CAShapeLayer *mask = [[CAShapeLayer alloc] init]; mask.frame = CGRectMake(50, 50, 100, 100); CGFloat width = 100; CGFloat height = 100; CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, nil, 30, 30); CGPathAddLineToPoint(path, nil, width, 30); CGPathAddLine...
The Replace function in SQL is used to update the content of a string. The function call is REPLACE( ) for MySQL, Oracle, and SQL Server. The syntax of the Replace function is: REPLACE (str, find, repl) The following example replaces occurrences of South with Southern in Employees table: FirstN...
(This is a request for a good example that shows how to construct a SELECT using CONCAT, then prepare+execute it. Please emphasize the use of @variables versus DECLAREd variables -- it makes a big difference, and it is something that novices (include myself) stumble over.)
Express is based on Connect, which is what provides the middleware functionality of Express. To understand what connect is, you can see that it provides the basic app structure that you use when you use express const connect = require('connect') const app = connect() app.listen(3000) This wi...
ObjectAnimator is a subclass of ValueAnimator with the added ability to set the calculated value to the property of a target View. Just like in the ValueAnimator, there are two ways you can create the ObjectAnimator: (the example code animates an alpha of a View from 0.4f to 0.2f in 250ms) Fr...
Lets say we have a class Classy that has property Propertua public class Classy { public string Propertua {get; set;} } to set Propertua using reflection: var typeOfClassy = typeof (Classy); var classy = new Classy(); var prop = typeOfClassy.GetProperty("Propertua"); prop.Se...
This example adds a new rectangle to the canvas every 1 second (== a 1 second interval) Annotated Code: <!doctype html> <html> <head> <style> body{ background-color:white; } #canvas{border:1px solid red; } </style> <script> window.onload=(functio...

Page 1 of 3