Tutorial by Examples: ctan

// rectangle objects { x:, y:, width:, height: } // return true if the 2 rectangles are colliding // r1 and r2 are rectangles as defined above function RectsColliding(r1,r2){ return !( r1.x>r2.x+r2.width || r1.x+r1.width<r2.x || r1.y>r2.y+r2.height || ...
// rectangle object: { x:, y:, width:, height: } // circle object: { x:, y:, radius: } // return true if the rectangle and circle are colliding function RectCircleColliding(rect,circle){ var dx=Math.abs(circle.x-(rect.x+rect.width/2)); var dy=Math.abs(circle.y-(rect.y+rect.height/2));...
// var rect={x:,y:,width:,height:}; // var line={x1:,y1:,x2:,y2:}; // Get interseting point of line segment & rectangle (if any) function lineRectCollide(line,rect){ // p=line startpoint, p2=line endpoint var p={x:line.x1,y:line.y1}; var p2={x:line.x2,y:line.y2}; // to...
Tests if an [x,y] point is inside a rectangle. // rectangle objects: {x:, y:, width:, height: } // var rect={x:10, y:15, width:25, height:20} // Return true if the x,y point is inside the rectangle function isPointInRectangle(x,y,rect){ return(x>rect.x && x<rect.x+rect.width...
Members of objects or classes can be accessed using the object operator (->) and the class operator (::). class MyClass { public $a = 1; public static $b = 2; const C = 3; public function d() { return 4; } public static function e() { return 5; } } $object = new MyCl...
What is a "Shape"? You typically save your shapes by creating a JavaScript "shape" object representing each shape. var myCircle = { x:30, y:20, radius:15 }; Of course, you're not really saving shapes. Instead, you're saving the definition of how to draw the shapes. Then put...
Create blank Multi-Device (Firemonkey) application. Drop Rectangle on Form. In Object inspector window (F11) find RotationAngle click on drop down button, and select "Create New TFloatAnimation". Object inspector window is automatically switched to a newly added TFloatAnimation, you...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Draw two rectangles on the canvas</title> <style> canvas{ border:1px solid gray; } </style> <script async...
The Comprehensive TeX Archive Network (CTAN) is indeed that, the comprehensive repository of LaTeX packages. Most if not all quality packages (and more) are on there, and all the good ones include documentation. Enter the package name into the search bar. Select the package from the list...
A shader program, in the OpenGL sense, contains a number of different shaders. Any shader program must have at least a vertex shader, that calculates the position of the points on the screen, and a fragment shader, that calculates the colour of each pixel. (Actually the story is longer and more co...
public class DrawRectangle { public static void main(String[] args) { //Load native library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); //image container object Mat goruntuDizisi=new Mat(); //Read image in file system goruntuDizisi=Imgcodecs.imread("C:\\i...
Add the required libraries into the dependencies section of your Android module's build.gradle: android { ... defaultConfig { ... testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } dependencies { ... androidTestCompile 'com.android.su...
Once you've installed react and react-router, Its time to use both of them together. The syntax is very simple, you specify the url and the component you want to render when that url is opened <Route path="hello" component={ HelloComponent } /> This means when the url path is hell...
Scenario: You need to select an implementation of address validation when a sales order is submitted, and the validator is determined by the country to which the order is shipping. The factory needs to inspect some value passed as an argument to select the correct implementation. First, write an in...
Processing provides method rect() to draw a rectangle. This code draws a white 50 X 50 rectangle on black background. void setup() { size(500, 500); background(0); fill(255); noStroke(); } void draw() { rect(225, 225, 50, 50); } The signature of method rect() is thi...
This example will list the preferred resolution for all the connected monitors. The Code: On Error Resume Next strComputer = "." strQuery = "SELECT PreferredMonitorSourceModeIndex, MonitorSourceModes " & _ "FROM WmiMonitorListedSupportedSourceModes" ...
MSDN-GetObject Function Returns a reference to an object provided by an ActiveX component. Use the GetObject function when there is a current instance of the object or if you want to create the object with a file already loaded. If there is no current instance, and you don't want the object ...
Let say you want to build your API to comply jsonapi.org specification and the result should look like: { "article": { "id": "305", "type": "articles", "attributes": { "title": "Asking Alexandria&q...
JSON_OBJECT creates JSON Objects: SELECT JSON_OBJECT('key1',col1 , 'key2',col2 , 'key3','col3') as myobj; JSON_ARRAY creates JSON Array as well: SELECT JSON_ARRAY(col1,col2,'col3') as myarray; Note: myobj.key3 and myarray[2] are "col3" as fixed string. Also mixed JSON data: S...
I'm in a controlled room with a single minew beacon that use IBEACON protocol. BLEController needs to extend CBPeripheralDelegate I'll use the first BLE to connect after the search has stop. Modify the method StopSearchBLE() class BLEController: CBCentralManagerDelegate, CBPeripheralDelegate...

Page 2 of 3