Tutorial by Examples: am

JavaScript: Vue.component('props-component', { template: '#props-component-template', // array of all props props: ['myprop', 'calcprop'] }); new Vue({ el: '#app' }); HTML: <div id="app"> <template id="props-component-template"> ...
This is an Example which print rectangle and fill color in the rectangle. https://i.stack.imgur.com/dlC5v.jpg Most methods of the Graphics class can be divided into two basic groups: Draw and fill methods, enabling you to render basic shapes, text, and images Attributes setting methods, whic...
import javax.swing.*; import java.awt.*; public class MyPanel extends JPanel { @Override public void paintComponent(Graphics g){ // clear the previous painting super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setColor(Co...
Suppose there is a peak of normally (gaussian) distributed data (mean: 3.0, standard deviation: 0.3) in an exponentially decaying background. This distribution can be fitted with curve_fit within a few steps: 1.) Import the required libraries. 2.) Define the fit function that is to be fitted to th...
The function EventEmitter.eventNames() will return an array containing the names of the events currently subscribed to. const EventEmitter = require("events"); class MyEmitter extends EventEmitter{} var emitter = new MyEmitter(); emitter .on("message", function(){ //list...
To successfully create a sparkpost email api setup, add the below details to env file and your application will be good to start sending emails. MAIL_DRIVER=sparkpost SPARKPOST_SECRET= NOTE: The above details does not give you the code written in controller which has the business logic to send em...
Here's an example on how to use the values in the registry to check for dotNET 4.5 or higher. I'd recommend putting this snippet of code somewhere like .OnInit as this will execute before anything else happens; this way it checks for .NET before any files get copied or registry changes take place. ...
ExpandoObject (the System.Dynamic namespace) is a class that was added to the .Net Framework 4.0. This class allows us to dynamically add and remove properties onto an object at runtime. By using Expando object we can add our model classes into dynamically created Expando object. Following example e...
var casper = require('casper').create(); casper.start('http://casperjs.org/'); casper.then(function() { this.echo('First Page: ' + this.getTitle()); }); casper.thenOpen('http://phantomjs.org', function() { this.echo('Second Page: ' + this.getTitle()); }); casper.run();
import java.util.*; class Book { int id; String name,author,publisher; int quantity; public Book(int id, String name, String author, String publisher, int quantity) { this.id = id; this.name = name; this.author = author; this.publisher = p...
import java.util.*; enum days { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } public class EnumSetExample { public static void main(String[] args) { Set<days> set = EnumSet.of(days.TUESDAY, days.WEDNESDAY); // Traversing elements Itera...
Object pollAnswered = getCurrentSession().createSQLQuery( "select * from TJ_ANSWERED_ASW where pol_id = "+pollId+" and prf_log = '"+logid+"'").uniqueResult(); with this query, you get a unique result when you know the result of the query is always going to b...
Atom is versatile and flexible text editor and has hundreds of community-made, open-source packages that can compile and run source files, for many languages. This guide will show how easy it is to code Python with the Atom editor. This guide assumes you do not have Python nor Atom installed in you...
$data = $result->mysqli_fetch_array(MYSQLI_BOTH);
Prepare helloworld.go (find below) package main import "fmt" func main(){ fmt.Println("hello world") } Run GOOS=linux GOARCH=arm go build helloworld.go Copy generated helloworld (arm executable) file to your target machine.
Lets look at a gamma correction kernel __constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR; __kernel void Gamma(__read_only image2d_t input, __write_only image2d_t output, __c...
{{#bs-form model=this onSubmit=(action "submit") as |form|}} {{#form.element label="Email" placeholder="Email" property="email" as |el|}} <div class="input-group"> <input value={{el.value}} class="form-control" place...
A camera situated at the average height of human eye level (1.6 meters or 1.75 yard or 5.25 feet). <a-entity camera="userHeight: 1.6" look-controls></a-entity>
When the active property gets toggled, the component will notify the camera system to change the current camera used by the renderer: var secondCameraEl = document.querySelector('#second-camera'); secondCameraEl.setAttribute('camera', 'active', true);
To fix entities onto the camera such that they stay within view no matter where the user looks, you can attach those entities as a child of the camera. Use cases might be a heads-up display (HUD). <a-entity camera look-controls> <a-entity geometry="primitive: plane; height: 0.2; wi...

Page 122 of 129