Talk given at Mozilla's first View Source Conference in Portland, 2015. Details out the parallels between graphics and game developments compared to traditional web development.
The document discusses structures in Swift. It covers defining structures with properties and methods, initializing structures, mutating and non-mutating methods, computed properties, property observers, type properties and methods, copying structures, and using self within structures. Examples are provided for each concept to demonstrate how to implement structures in code.
The Ring programming language version 1.3 book - Part 43 of 88Mahmoud Samir Fayed
The document provides code examples for building graphical user interface applications using Ring and Qt, including creating a basic application with buttons and text fields, using layouts to organize widgets, displaying rich text in a QTextEdit widget, and populating a list of items in a QListWidget. It demonstrates basic GUI functionality and classes that can be used for desktop and mobile development with RingQt.
This document summarizes simulations of a mass-spring-damper system representing a bus. Simulation 1 examines the system's response to step inputs without and with increased force. Adding damping is found to significantly reduce displacement peaks. Simulation 2 models a 2-degree-of-freedom system for a bus traveling on a bumpy road. Initially, large displacement peaks occur. By adding damping with a ratio of 0.3, displacements are reduced by 30-40% and the system quickly compensates to match the road input.
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
This document summarizes different vector graphic options for use on the web. It discusses the differences between vector and raster graphics, and why vectors are preferable for resolution independence and smaller file sizes. It then examines SVG, Canvas, VML, and CSS3 as vector graphic options, outlining browser support, APIs, and common uses for each. While SVG is ideal theoretically, browser support is still limited, so libraries like SVG Web and Raphael.js are recommended to abstract cross-browser differences. In the end, SVG is generally better than Canvas for interactive graphics with events, while Canvas may be better for full-screen animations and games.
Graphics play an important role on web pages by conveying information visually. They can illustrate concepts through diagrams, show quantitative data through charts, and help explain topics. The most common graphic file formats for the web are GIF, JPEG, and PNG. GIFs are best for images with few colors like diagrams, while JPEGs provide high quality for photos. PNG supports transparency and compression. Proper use of graphics enhances web content and usability.
A presentation to Refresh DC about the emerging HTML 5 and CSS 3 standards, namely about aspects that are beginning to become applicable to web design and development. Given by Jason Garber and M. Jackson Wilkinson.
10 Ways to Deliver an Unforgettable PresentationAbhishek Shah
Whenever I have to speak in front of a group, this quote from journalist Roscoe Drummond always pops into my head: “The mind is a wonderful thing. It starts working the minute you are born and never stops until you get up to speak in public.”
Presentations are one of the best ways of delivering information, but not everyone is a natural public speaker. For me, it was always hard to talk in front of people I did not know. That’s why these tips have been collected to make the job that much easier for you.
This is a stylization of an article by Mary Walton, "10 Ways to Deliver an Unforgettable Presentation" on creator.wework.com
This presentation is designed to stand alone, without having to be presented in person. Enjoy
The document discusses structures in Swift. It covers defining structures with properties and methods, initializing structures, mutating and non-mutating methods, computed properties, property observers, type properties and methods, copying structures, and using self within structures. Examples are provided for each concept to demonstrate how to implement structures in code.
The Ring programming language version 1.3 book - Part 43 of 88Mahmoud Samir Fayed
The document provides code examples for building graphical user interface applications using Ring and Qt, including creating a basic application with buttons and text fields, using layouts to organize widgets, displaying rich text in a QTextEdit widget, and populating a list of items in a QListWidget. It demonstrates basic GUI functionality and classes that can be used for desktop and mobile development with RingQt.
This document summarizes simulations of a mass-spring-damper system representing a bus. Simulation 1 examines the system's response to step inputs without and with increased force. Adding damping is found to significantly reduce displacement peaks. Simulation 2 models a 2-degree-of-freedom system for a bus traveling on a bumpy road. Initially, large displacement peaks occur. By adding damping with a ratio of 0.3, displacements are reduced by 30-40% and the system quickly compensates to match the road input.
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
This document summarizes different vector graphic options for use on the web. It discusses the differences between vector and raster graphics, and why vectors are preferable for resolution independence and smaller file sizes. It then examines SVG, Canvas, VML, and CSS3 as vector graphic options, outlining browser support, APIs, and common uses for each. While SVG is ideal theoretically, browser support is still limited, so libraries like SVG Web and Raphael.js are recommended to abstract cross-browser differences. In the end, SVG is generally better than Canvas for interactive graphics with events, while Canvas may be better for full-screen animations and games.
Graphics play an important role on web pages by conveying information visually. They can illustrate concepts through diagrams, show quantitative data through charts, and help explain topics. The most common graphic file formats for the web are GIF, JPEG, and PNG. GIFs are best for images with few colors like diagrams, while JPEGs provide high quality for photos. PNG supports transparency and compression. Proper use of graphics enhances web content and usability.
A presentation to Refresh DC about the emerging HTML 5 and CSS 3 standards, namely about aspects that are beginning to become applicable to web design and development. Given by Jason Garber and M. Jackson Wilkinson.
10 Ways to Deliver an Unforgettable PresentationAbhishek Shah
Whenever I have to speak in front of a group, this quote from journalist Roscoe Drummond always pops into my head: “The mind is a wonderful thing. It starts working the minute you are born and never stops until you get up to speak in public.”
Presentations are one of the best ways of delivering information, but not everyone is a natural public speaker. For me, it was always hard to talk in front of people I did not know. That’s why these tips have been collected to make the job that much easier for you.
This is a stylization of an article by Mary Walton, "10 Ways to Deliver an Unforgettable Presentation" on creator.wework.com
This presentation is designed to stand alone, without having to be presented in person. Enjoy
Vectors are DNA molecules that can carry foreign DNA fragments into host cells. There are two main types of vectors: cloning vectors for propagating DNA inserts and expression vectors for expressing inserted DNA. Common vector types include plasmids, bacteriophages, cosmids, and artificial chromosomes. Vectors must have key characteristics like the ability to self-replicate, selectable markers, and origins of replication to successfully clone and transfer DNA.
Strategies to Drive Web Traffic in the Real Estate WorldRand Fishkin
Rand's presentation at Inman Connect 2017, on how SEO, social media, content, email, and advertising can work to successfully drive traffic to real estate websites.
The document provides information about the Zika virus outbreak, including how it spreads and symptoms. It notes that Zika virus is mainly spread by Aedes mosquitoes and infected mothers can pass it to fetuses. While there is no vaccine currently, people can protect themselves by preventing mosquito bites, using repellent and eliminating standing water where mosquitoes breed. The most important advice is to stay informed but remain calm.
We looked at the data. Here’s a breakdown of some key statistics about the nation’s incoming presidents’ addresses, how long they spoke, how well, and more.
How to Make Awesome SlideShares: Tips & TricksSlideShare
Turbocharge your online presence with SlideShare. We provide the best tips and tricks for succeeding on SlideShare. Get ideas for what to upload, tips for designing your deck and more.
SlideShare is a global platform for sharing presentations, infographics, videos and documents. It has over 18 million pieces of professional content uploaded by experts like Eric Schmidt and Guy Kawasaki. The document provides tips for setting up an account on SlideShare, uploading content, optimizing it for searchability, and sharing it on social media to build an audience and reputation as a subject matter expert.
1- Create a class called Point that has two instance variables, defi.pdfjeeteshmalani1
1- Create a class called Point that has two instance variables, defined as private, as follows: An x
coordinate and a y coordinate of type integer.
a) Write two constructors for the Point class as follows: A default constructor that sets the class
instance variables to zero and a constructor that receives two integer values and sets the instance
variables to them.
b) Write the set and get methods for the Point class to set and return the values of its instance
variables.
c) Write a toString() method for the Point class that prints the class name (Point) and the value of
its instance variables.
2- Create three classes called Circle, Rectangle and Square with the following properties:
- The Circle class has two instance variables – a position of type Point (the class that you just
created above) and a radius of type double. The instance variables position and radius specify the
position of the center and radius of the circle, respectively.
- The Rectangle class has three instance variables – a position of type Point (the class that you
just created above), a length and a width of type double. The instance variables position, length
and width specify the position of the top left corner, length and width of the rectangle,
respectively.
- The Square class has two instance variables – a position of type Point (the class that you just
created above) and a lengthof type double. The instance variables position andlength specify the
position of the top left corner and length of the square, respectively.
For each of the Circle, Rectangle andSquare classes do the following:
a) Define the instance variables as private.
b) Write two constructors for each class as follows: A default constructor that sets the instance
variables to zero and a constructor that receives values for the instance variables and sets them.
c) Write the set and get methods for each class to set and return the values of their instance
variables. For example, one of the get methods would return a Point.
d) Write a toString() method for each class that prints the class name (Circle, Rectangle or
Square) and the value of its instance variables.
e) Write two methods called getPerimeter() and getArea() for each class, which calculate and
return the perimeter and area of the class, respectively. For example, the getArea() method of the
Square class returns the area of the Square object.
3- Test the above classes by writing a class called GeometricTest.java that does the following:
- Creates instances of the Circle, Rectangle and Square classes as follows:
- Circle: positioned at x = 7, y = 3 and the radius = 4.5.
- Rectangle: positioned at x = 3, y = -1 and the length = 4.0 and width = 6.0.
- Square: positioned at x = 5, y = 8 and the length = 2.0.
- Prints each of the above objects.
- Changes the length of the Square object to 5.0.
- Prints the perimeter and area of each of each of the above objects.
- Compares the x coordinates of the Square and Rectangle classes and prints a message
spec.
This document discusses Swift and transformations. It begins by introducing typed transforms in Swift using protocols like AngleProtocol. It defines operations like addition and subtraction for angle types that conform to AngleProtocol. It also defines conversions between radians and degrees. Next, it discusses 2D points using a Point2DProtocol. It implements operations like addition and subtraction for point types. It then discusses affine transforms for points using a CGAffineTransform type. It shows how to apply transforms to points and concatenate multiple transforms. Finally, it provides an example of drawing a house shape to a graphics context after applying various coordinate space transforms.
05 Geographic scripting in uDig - halfway between user and developerAndrea Antonello
The document discusses using the JGrasstools library within Geoscript to perform geospatial analyses and processing on raster data. It provides examples of reading raster properties, creating new rasters, extracting features like pits and contours, and performing analyses like aspect modeling and network extraction. The library allows accessing the same raster processing modules available in uDig from within Geoscript scripts.
This document provides an overview of defining classes in Python. It begins with objectives for defining classes and using encapsulation. It then reviews the concepts of objects and classes. The remainder of the document discusses designing a cannonball simulation program, first as an unmodularized program and then refactoring it into a modularized object-oriented program using a Projectile class. It also provides an example class definition for modeling multi-sided dice.
Create a java project that - Draw a circle with three random init.pdfarihantmobileselepun
Create a java project that:
- Draw a circle with three random initial points on the circle.
- Link the points to form a triangle.
- Print the angles values in the triangle.
- Use the mouse to drag a point along the perimeter of the circle. As you drag it, the triangle and
angles are redisplayed dynamically.
Here is the formula to compute angles:
A = acos((a * a - b * b - c * c) / (-2 * b * c))
B = acos((b * b - a * a - c * c) / (-2 * a * c))
C = acos((c * c - b * b - a * a) / (-2 * a * b))
Solution
@Suppresswarnings(\"WeakerAccess\")
public class DragPoints extends Application {
@Override
public void start(Stage primaryStage) {
final PointPane pane = new PointPane(640, 480);
pane.setStyle(\"-fx-background-color: wheat;\");
Label label = new Label(\"Click and drag the points.\");
BorderPane borderPane = new BorderPane(pane);
BorderPane.setAlignment(label, Pos.CENTER);
label.setPadding(new Insets(5));
borderPane.setBottom(label);
Scene scene = new Scene(borderPane);
primaryStage.setTitle(\"Exercise15_21\");
primaryStage.setScene(scene);
primaryStage.show();
}
private class PointPane extends Pane {
final Circle circle = new Circle();
final Vertex[] v = new Vertex[3];
final int strokeWidth = 2;
final Color circleStroke = Color.GRAY, legStroke = Color.BLACK;
@SuppressWarnings(\"SameParameterValue\")
PointPane(double w, double h) {
this.setPrefSize(w, h);
this.setWidth(w);
this.setHeight(h);
circle.setStroke(circleStroke);
circle.setFill(Color.TRANSPARENT);
circle.setStrokeWidth(strokeWidth);
circle.radiusProperty().bind(this.heightProperty().multiply(0.4));
circle.centerXProperty().bind(this.widthProperty().divide(2));
circle.centerYProperty().bind(this.heightProperty().divide(2));
this.getChildren().add(circle);
for (int i = 0; i < v.length; i++) {
v[i] = new Vertex(circle, 2 * Math.PI / v.length * (i + Math.random()));
v[i].radiusProperty().bind(circle.radiusProperty().divide(10));
v[i].setPosition();
v[i].setStroke(new Color(i == 0 ? 1 : 0, i == 1 ? 1 : 0, i == 2 ? 1 : 0, 1));
v[i].setFill(Color.TRANSPARENT);
v[i].setStrokeWidth(strokeWidth);
this.getChildren().add(v[i]);
v[i].setOnMouseDragged(new EventHandler() {
@Override
public void handle(MouseEvent event) {
int i;
for (i = 0; i < v.length; i++)
if (v[i] == event.getSource())
break;
v[i].setAngle(event.getX(), event.getY());
moveUpdate((Vertex) event.getSource());
}
});
}
for (int i = 0; i < v.length; i++) {
int j = i + 1 < v.length ? i + 1 : 0;
int k = j + 1 < v.length ? j + 1 : 0;
v[i].bindLeg(v[j], v[k]);
v[i].leg.setStroke(legStroke);
v[i].leg.setStrokeWidth(strokeWidth);
this.getChildren().add(v[i].leg);
this.getChildren().add(v[i].text);
}
for(DoubleProperty p: new DoubleProperty[]
{circle.radiusProperty(), circle.centerXProperty(), circle.centerYProperty()})
p.addListener(new ResizeListener());
moveUpdate(v[0]);
}
void moveUpdate(Vertex vert) {
vert.setPosition();
double[] legLength = new double[3];
for (int i = 0; i < v.length; i++)
legLength[i] = v[i].getLegLength();
for (int i = .
Object Oriented Solved Practice Programs C++ ExamsMuhammadTalha436
The question asks to create classes to represent publications, books, and tapes. The Publication class has title and price attributes. The Book class inherits from Publication and adds a noOfPages attribute. The Tape class inherits from Publication and adds a playingTime attribute.
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdfaromanets
Creat Shape classes from scratch DETAILS You will create 3 shape classes (Circle, Rectangle,
Triangle) that all inherit from a single abstract class called AbstractShape which implements
Shape (also created by you). You are also responsible for creating the driver class
\"Assignment7.java\" (program that tests your classes and described on page 3) which does the
following reads input data from a file instantiates various objects of the three shapes based on the
input data stores each in a LinkedList outputs this list to an output file sorts a \"copy\" of this
LinkedList of objects outputs the sorted version of the list to the output file outputs the original
list to the output file This driver program also needs to \"ignore errors in the input file that breach
the specified input format as described in the Assianment7,java details (see page 3 1. Shape.java
This is an interface that has 2 abstract methods, and passes the responsibility of implementing the
compareTo method to the class that implements Shape (you may note, nomally Comparable is
\"implemented\" by a class. However, an interface cannot implement because interfaces can only
contain abstract methods. That said, an interface can only extend other interfaces and the
responsibility of actually \"implementing\" the abstract method(s) of the super class interface is
passed on to the sub-classes) public interface Shape extends Comparable public double
calculateAreal) Il This abstract method is implemented at the concrete level public Shape
copyShape); Il also implemented at the concrete level 2. AbstractShape.java public abstract class
AbstractShape implements Shape This class should contain an instance field to store the name of
each obiect. The constructor which sets this field should receive the name and a number to be
concatenated to the name and then stored in the name field Recall, when the super class has a
parameterized constructor, the sub-classes will need to call it AND the sub- classes will need to
also provide a constructor without parameters This abstract class will implement the compareTo
method passed on from the Shape interface and will pass on the responsibility of implementing
calculateArea to the extending sub-classes (compare To will use the calculateArea method when
comparing 2 Shape objects). Along with compare To, one more concrete method should be
included. The following will be used by the sub-classes\' toString method: public String
getName) II Simply returns the name field data
Solution
in7.txt
4.4
2.5 3
8.1 3.0 5.0
2.5 3 4
2.5
tuesday
-7
1.0
3 three
3 -9
3 5
1.0
Assignment7.java
import java.io.*;
import java.util.*;
public class Assignment7 {
/**
* This is the test driver class that will include main.
* This program MUST read a file named in7.txt and
* generate an output file named out7.txt. The in7.txt
* file must be created by you based on formatting
* described shortly.
*
* @param theArgs
*/
public static void main(String[] theArgs) {
List myList = new Arra.
The document discusses MontageJS bindings and how they can be used to define relationships between object properties. It provides examples of different types of bindings including property bindings, map bindings, and array range bindings. It also previews upcoming changes to how bindings will be defined and array operations will work.
The document provides information about using the canvas API to draw graphics on an HTML5 canvas element. It covers topics such as drawing shapes, paths, images, text, applying styles, transformations, gradients and saving state. Code examples are provided to demonstrate how to use various canvas drawing methods and properties.
1.what is the difference between a instance variable and an local va.pdfarchgeetsenterprises
The document discusses the difference between instance variables and local variables in Java, as well as the difference between call-by-value and call-by-reference when passing arguments to methods. Instance variables are variables that are created for each object and can be accessed throughout the class, while local variables only exist within the method they are declared in. Call-by-value passes the value of an argument to a method, while call-by-reference passes the reference of an object. Examples using classes Rectangle, Square, RoomDimension, and RoomCarpet are provided to illustrate these concepts.
1. The document discusses elementary programming concepts in Java such as variables, data types, operators, and expressions. It provides examples of computing the area of a circle and converting temperatures between Fahrenheit and Celsius.
2. Tracing the execution of a sample area computation program is demonstrated. Key steps include declaring variables, assigning values, performing calculations, and printing output.
3. Numeric data types in Java are explained along with various arithmetic operators for performing calculations on integer and floating-point values.
The document provides code for creating an analog wall clock using HTML5 canvas. It includes functions for drawing the clock face, numbers, and hands. To start the clock updating, the drawClock function is called each second using setInterval. Code is included to initialize the canvas, calculate radii, and transform coordinates. Angles are used to position numbers and set hand positions based on the system time.
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
Vectors are DNA molecules that can carry foreign DNA fragments into host cells. There are two main types of vectors: cloning vectors for propagating DNA inserts and expression vectors for expressing inserted DNA. Common vector types include plasmids, bacteriophages, cosmids, and artificial chromosomes. Vectors must have key characteristics like the ability to self-replicate, selectable markers, and origins of replication to successfully clone and transfer DNA.
Strategies to Drive Web Traffic in the Real Estate WorldRand Fishkin
Rand's presentation at Inman Connect 2017, on how SEO, social media, content, email, and advertising can work to successfully drive traffic to real estate websites.
The document provides information about the Zika virus outbreak, including how it spreads and symptoms. It notes that Zika virus is mainly spread by Aedes mosquitoes and infected mothers can pass it to fetuses. While there is no vaccine currently, people can protect themselves by preventing mosquito bites, using repellent and eliminating standing water where mosquitoes breed. The most important advice is to stay informed but remain calm.
We looked at the data. Here’s a breakdown of some key statistics about the nation’s incoming presidents’ addresses, how long they spoke, how well, and more.
How to Make Awesome SlideShares: Tips & TricksSlideShare
Turbocharge your online presence with SlideShare. We provide the best tips and tricks for succeeding on SlideShare. Get ideas for what to upload, tips for designing your deck and more.
SlideShare is a global platform for sharing presentations, infographics, videos and documents. It has over 18 million pieces of professional content uploaded by experts like Eric Schmidt and Guy Kawasaki. The document provides tips for setting up an account on SlideShare, uploading content, optimizing it for searchability, and sharing it on social media to build an audience and reputation as a subject matter expert.
1- Create a class called Point that has two instance variables, defi.pdfjeeteshmalani1
1- Create a class called Point that has two instance variables, defined as private, as follows: An x
coordinate and a y coordinate of type integer.
a) Write two constructors for the Point class as follows: A default constructor that sets the class
instance variables to zero and a constructor that receives two integer values and sets the instance
variables to them.
b) Write the set and get methods for the Point class to set and return the values of its instance
variables.
c) Write a toString() method for the Point class that prints the class name (Point) and the value of
its instance variables.
2- Create three classes called Circle, Rectangle and Square with the following properties:
- The Circle class has two instance variables – a position of type Point (the class that you just
created above) and a radius of type double. The instance variables position and radius specify the
position of the center and radius of the circle, respectively.
- The Rectangle class has three instance variables – a position of type Point (the class that you
just created above), a length and a width of type double. The instance variables position, length
and width specify the position of the top left corner, length and width of the rectangle,
respectively.
- The Square class has two instance variables – a position of type Point (the class that you just
created above) and a lengthof type double. The instance variables position andlength specify the
position of the top left corner and length of the square, respectively.
For each of the Circle, Rectangle andSquare classes do the following:
a) Define the instance variables as private.
b) Write two constructors for each class as follows: A default constructor that sets the instance
variables to zero and a constructor that receives values for the instance variables and sets them.
c) Write the set and get methods for each class to set and return the values of their instance
variables. For example, one of the get methods would return a Point.
d) Write a toString() method for each class that prints the class name (Circle, Rectangle or
Square) and the value of its instance variables.
e) Write two methods called getPerimeter() and getArea() for each class, which calculate and
return the perimeter and area of the class, respectively. For example, the getArea() method of the
Square class returns the area of the Square object.
3- Test the above classes by writing a class called GeometricTest.java that does the following:
- Creates instances of the Circle, Rectangle and Square classes as follows:
- Circle: positioned at x = 7, y = 3 and the radius = 4.5.
- Rectangle: positioned at x = 3, y = -1 and the length = 4.0 and width = 6.0.
- Square: positioned at x = 5, y = 8 and the length = 2.0.
- Prints each of the above objects.
- Changes the length of the Square object to 5.0.
- Prints the perimeter and area of each of each of the above objects.
- Compares the x coordinates of the Square and Rectangle classes and prints a message
spec.
This document discusses Swift and transformations. It begins by introducing typed transforms in Swift using protocols like AngleProtocol. It defines operations like addition and subtraction for angle types that conform to AngleProtocol. It also defines conversions between radians and degrees. Next, it discusses 2D points using a Point2DProtocol. It implements operations like addition and subtraction for point types. It then discusses affine transforms for points using a CGAffineTransform type. It shows how to apply transforms to points and concatenate multiple transforms. Finally, it provides an example of drawing a house shape to a graphics context after applying various coordinate space transforms.
05 Geographic scripting in uDig - halfway between user and developerAndrea Antonello
The document discusses using the JGrasstools library within Geoscript to perform geospatial analyses and processing on raster data. It provides examples of reading raster properties, creating new rasters, extracting features like pits and contours, and performing analyses like aspect modeling and network extraction. The library allows accessing the same raster processing modules available in uDig from within Geoscript scripts.
This document provides an overview of defining classes in Python. It begins with objectives for defining classes and using encapsulation. It then reviews the concepts of objects and classes. The remainder of the document discusses designing a cannonball simulation program, first as an unmodularized program and then refactoring it into a modularized object-oriented program using a Projectile class. It also provides an example class definition for modeling multi-sided dice.
Create a java project that - Draw a circle with three random init.pdfarihantmobileselepun
Create a java project that:
- Draw a circle with three random initial points on the circle.
- Link the points to form a triangle.
- Print the angles values in the triangle.
- Use the mouse to drag a point along the perimeter of the circle. As you drag it, the triangle and
angles are redisplayed dynamically.
Here is the formula to compute angles:
A = acos((a * a - b * b - c * c) / (-2 * b * c))
B = acos((b * b - a * a - c * c) / (-2 * a * c))
C = acos((c * c - b * b - a * a) / (-2 * a * b))
Solution
@Suppresswarnings(\"WeakerAccess\")
public class DragPoints extends Application {
@Override
public void start(Stage primaryStage) {
final PointPane pane = new PointPane(640, 480);
pane.setStyle(\"-fx-background-color: wheat;\");
Label label = new Label(\"Click and drag the points.\");
BorderPane borderPane = new BorderPane(pane);
BorderPane.setAlignment(label, Pos.CENTER);
label.setPadding(new Insets(5));
borderPane.setBottom(label);
Scene scene = new Scene(borderPane);
primaryStage.setTitle(\"Exercise15_21\");
primaryStage.setScene(scene);
primaryStage.show();
}
private class PointPane extends Pane {
final Circle circle = new Circle();
final Vertex[] v = new Vertex[3];
final int strokeWidth = 2;
final Color circleStroke = Color.GRAY, legStroke = Color.BLACK;
@SuppressWarnings(\"SameParameterValue\")
PointPane(double w, double h) {
this.setPrefSize(w, h);
this.setWidth(w);
this.setHeight(h);
circle.setStroke(circleStroke);
circle.setFill(Color.TRANSPARENT);
circle.setStrokeWidth(strokeWidth);
circle.radiusProperty().bind(this.heightProperty().multiply(0.4));
circle.centerXProperty().bind(this.widthProperty().divide(2));
circle.centerYProperty().bind(this.heightProperty().divide(2));
this.getChildren().add(circle);
for (int i = 0; i < v.length; i++) {
v[i] = new Vertex(circle, 2 * Math.PI / v.length * (i + Math.random()));
v[i].radiusProperty().bind(circle.radiusProperty().divide(10));
v[i].setPosition();
v[i].setStroke(new Color(i == 0 ? 1 : 0, i == 1 ? 1 : 0, i == 2 ? 1 : 0, 1));
v[i].setFill(Color.TRANSPARENT);
v[i].setStrokeWidth(strokeWidth);
this.getChildren().add(v[i]);
v[i].setOnMouseDragged(new EventHandler() {
@Override
public void handle(MouseEvent event) {
int i;
for (i = 0; i < v.length; i++)
if (v[i] == event.getSource())
break;
v[i].setAngle(event.getX(), event.getY());
moveUpdate((Vertex) event.getSource());
}
});
}
for (int i = 0; i < v.length; i++) {
int j = i + 1 < v.length ? i + 1 : 0;
int k = j + 1 < v.length ? j + 1 : 0;
v[i].bindLeg(v[j], v[k]);
v[i].leg.setStroke(legStroke);
v[i].leg.setStrokeWidth(strokeWidth);
this.getChildren().add(v[i].leg);
this.getChildren().add(v[i].text);
}
for(DoubleProperty p: new DoubleProperty[]
{circle.radiusProperty(), circle.centerXProperty(), circle.centerYProperty()})
p.addListener(new ResizeListener());
moveUpdate(v[0]);
}
void moveUpdate(Vertex vert) {
vert.setPosition();
double[] legLength = new double[3];
for (int i = 0; i < v.length; i++)
legLength[i] = v[i].getLegLength();
for (int i = .
Object Oriented Solved Practice Programs C++ ExamsMuhammadTalha436
The question asks to create classes to represent publications, books, and tapes. The Publication class has title and price attributes. The Book class inherits from Publication and adds a noOfPages attribute. The Tape class inherits from Publication and adds a playingTime attribute.
Creat Shape classes from scratch DETAILS You will create 3 shape cla.pdfaromanets
Creat Shape classes from scratch DETAILS You will create 3 shape classes (Circle, Rectangle,
Triangle) that all inherit from a single abstract class called AbstractShape which implements
Shape (also created by you). You are also responsible for creating the driver class
\"Assignment7.java\" (program that tests your classes and described on page 3) which does the
following reads input data from a file instantiates various objects of the three shapes based on the
input data stores each in a LinkedList outputs this list to an output file sorts a \"copy\" of this
LinkedList of objects outputs the sorted version of the list to the output file outputs the original
list to the output file This driver program also needs to \"ignore errors in the input file that breach
the specified input format as described in the Assianment7,java details (see page 3 1. Shape.java
This is an interface that has 2 abstract methods, and passes the responsibility of implementing the
compareTo method to the class that implements Shape (you may note, nomally Comparable is
\"implemented\" by a class. However, an interface cannot implement because interfaces can only
contain abstract methods. That said, an interface can only extend other interfaces and the
responsibility of actually \"implementing\" the abstract method(s) of the super class interface is
passed on to the sub-classes) public interface Shape extends Comparable public double
calculateAreal) Il This abstract method is implemented at the concrete level public Shape
copyShape); Il also implemented at the concrete level 2. AbstractShape.java public abstract class
AbstractShape implements Shape This class should contain an instance field to store the name of
each obiect. The constructor which sets this field should receive the name and a number to be
concatenated to the name and then stored in the name field Recall, when the super class has a
parameterized constructor, the sub-classes will need to call it AND the sub- classes will need to
also provide a constructor without parameters This abstract class will implement the compareTo
method passed on from the Shape interface and will pass on the responsibility of implementing
calculateArea to the extending sub-classes (compare To will use the calculateArea method when
comparing 2 Shape objects). Along with compare To, one more concrete method should be
included. The following will be used by the sub-classes\' toString method: public String
getName) II Simply returns the name field data
Solution
in7.txt
4.4
2.5 3
8.1 3.0 5.0
2.5 3 4
2.5
tuesday
-7
1.0
3 three
3 -9
3 5
1.0
Assignment7.java
import java.io.*;
import java.util.*;
public class Assignment7 {
/**
* This is the test driver class that will include main.
* This program MUST read a file named in7.txt and
* generate an output file named out7.txt. The in7.txt
* file must be created by you based on formatting
* described shortly.
*
* @param theArgs
*/
public static void main(String[] theArgs) {
List myList = new Arra.
The document discusses MontageJS bindings and how they can be used to define relationships between object properties. It provides examples of different types of bindings including property bindings, map bindings, and array range bindings. It also previews upcoming changes to how bindings will be defined and array operations will work.
The document provides information about using the canvas API to draw graphics on an HTML5 canvas element. It covers topics such as drawing shapes, paths, images, text, applying styles, transformations, gradients and saving state. Code examples are provided to demonstrate how to use various canvas drawing methods and properties.
1.what is the difference between a instance variable and an local va.pdfarchgeetsenterprises
The document discusses the difference between instance variables and local variables in Java, as well as the difference between call-by-value and call-by-reference when passing arguments to methods. Instance variables are variables that are created for each object and can be accessed throughout the class, while local variables only exist within the method they are declared in. Call-by-value passes the value of an argument to a method, while call-by-reference passes the reference of an object. Examples using classes Rectangle, Square, RoomDimension, and RoomCarpet are provided to illustrate these concepts.
1. The document discusses elementary programming concepts in Java such as variables, data types, operators, and expressions. It provides examples of computing the area of a circle and converting temperatures between Fahrenheit and Celsius.
2. Tracing the execution of a sample area computation program is demonstrated. Key steps include declaring variables, assigning values, performing calculations, and printing output.
3. Numeric data types in Java are explained along with various arithmetic operators for performing calculations on integer and floating-point values.
The document provides code for creating an analog wall clock using HTML5 canvas. It includes functions for drawing the clock face, numbers, and hands. To start the clock updating, the drawClock function is called each second using setInterval. Code is included to initialize the canvas, calculate radii, and transform coordinates. Angles are used to position numbers and set hand positions based on the system time.
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
1. Arrays allow us to store multiple values of the same type in a single variable. We declare an array by specifying its type, name, and size.
2. The Math class contains commonly used mathematical functions like trigonometric, exponent, rounding, and random number generation methods.
3. We can pass arrays to methods in Java. When an array is passed as a parameter, any changes made to the array inside the method will be reflected outside the method.
The document provides an overview of using the HTML5 canvas element to draw graphics and animations. It covers topics like rendering contexts, paths, styles, gradients, text, shapes, mouse/touch interaction, animation, and libraries. Code examples demonstrate how to draw basic shapes, handle user input, interpolate lines, add gradients, render to canvas, and more. The document is a tutorial for learning the capabilities of the canvas element.
package chapter15;
import javafx.application.Application;
import javafx.beans.property.DoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
/**
* Java Programming: Comprehensive (10e); Liang; Pearson 2014
*
* *15.21(Drag points) Draw a circle with three random points on the circle. Connect
* the points to form a triangle. Display the angles in the triangle. Use the mouse
* to drag a point along the perimeter of the circle. As you drag it, the triangle and
* angles are redisplayed dynamically, as shown in Figure 15.30b. For computing
* angles in a triangle, see Listing 4.1.
*
* {@code A = Math.acos((a * a - b * b - c * c) / (-2 * b * c))}
* {@code B = Math.acos((b * b - a * a - c * c) / (-2 * a * c))}
* {@code C = Math.acos((c * c - b * b - a * a) / (-2 * a * b))}
*
* @author ncoop
*/
@SuppressWarnings(\"WeakerAccess\")
public class DragPoints extends Application {
@Override
public void start(Stage primaryStage) {
final PointPane pane = new PointPane(640, 480);
pane.setStyle(\"-fx-background-color: wheat;\");
Label label = new Label(\"Click and drag the points.\");
BorderPane borderPane = new BorderPane(pane);
BorderPane.setAlignment(label, Pos.CENTER);
label.setPadding(new Insets(5));
borderPane.setBottom(label);
Scene scene = new Scene(borderPane);
primaryStage.setTitle(\"Exercise15_21\");
primaryStage.setScene(scene);
primaryStage.show();
}
private class PointPane extends Pane {
final Circle circle = new Circle();
final Vertex[] v = new Vertex[3];
final int strokeWidth = 2;
final Color circleStroke = Color.GRAY, legStroke = Color.BLACK;
@SuppressWarnings(\"SameParameterValue\")
PointPane(double w, double h) {
this.setPrefSize(w, h);
this.setWidth(w);
this.setHeight(h);
circle.setStroke(circleStroke);
circle.setFill(Color.TRANSPARENT);
circle.setStrokeWidth(strokeWidth);
circle.radiusProperty().bind(this.heightProperty().multiply(0.4));
circle.centerXProperty().bind(this.widthProperty().divide(2));
circle.centerYProperty().bind(this.heightProperty().divide(2));
this.getChildren().add(circle);
// create the vertices at random angles
for (int i = 0; i < v.length; i++) {
v[i] = new Vertex(circle, 2 * Math.PI / v.length * (i + Math.random()));
v[i].radiusProperty().bind(circle.radiusProperty().divide(10));
v[i].setPosition();
v[i].setStroke(new Color(i == 0 ? 1 : 0, i == 1 ? 1 : 0, i == 2 ? 1 : 0, 1));
v[i].setFill(Color.TRANSPARENT);
v[i].setStrokeWidth(strokeWidth);
this.getChildren().add(v[i]);
v[i].setOnMouseDr.
We all know, or should know, about SOLID. The question is, do we write C++ according to the SOLID principles?
https://platis.solutions/blog/2020/06/22/how-to-write-solid-cpp/
Similar to Graphics Programming for Web Developers (20)
AppSecCali - How Credential Stuffing is EvolvingJarrod Overson
This talk was given at AppSec California, January 2020.
Credential stuffing and other automated attacks are evolving passed every defense thrown in their way. CAPTCHAs don't work, Fingerprints don't work, Magical AI-whatevers don't work. The value is just too great.
How Credential Stuffing is Evolving - PasswordsCon 2019Jarrod Overson
Slides for talk given at PasswordsCon Sweden 2019. Credentials Stuffing is an automated attack that exploits users who reuse passwords by taking breached credentials and replaying them across sites.
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...Jarrod Overson
This document summarizes an analysis of an exploited NPM package called event-stream. It describes how an attacker gained control of the package and added malicious code that was downloaded by thousands of projects whenever their dependencies were updated. The malicious code stole cryptocurrency from wallets containing large amounts. It highlights the risks of supply chain attacks and emphasizes the importance of auditing dependencies, locking versions, and thinking carefully before adding new dependencies to avoid compromising entire projects and their users.
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...Jarrod Overson
Jarrod Overson presented on a supply chain attack that occurred in 2018 through the compromise of the event-stream Node.js package. An unauthorized developer gained commit access and introduced malicious code through new dependencies that was then installed by millions of users. The malware harvested cryptocurrency private keys from the Copay wallet app. While the community responded quickly, such attacks demonstrate vulnerabilities in open source software supply chains and dependency management that will continue to be exploited if not properly addressed through changes to practices and tooling.
Deepfakes - How they work and what it means for the futureJarrod Overson
Deepfakes originally started as cheap costing but believable video effects and have expanded into AI-generated content of every format. This session dove into the state of deepfakes and how the technology highlights an exciting but dangerous future.
The State of Credential Stuffing and the Future of Account Takeovers.Jarrod Overson
Jarrod Overson discusses the evolution of credential stuffing attacks and where they may go in the future. He summarizes that credential stuffing started as basic automated login attempts but has evolved through generations as defenses were put in place, such as CAPTCHAs and behavior analysis. The next generation involves more sophisticated imitation attacks that flawlessly emulate human behavior using real device fingerprints to blend in. Beyond credential stuffing, malware may start scraping user accounts and environments directly from infected machines. As defenses raise the cost of attacks, fraudsters will diversify methods to preserve the value of valid accounts and user data.
Workshop slides originally given at the WOPR Summit in Atlantic City. Use JavaScript parsers and generators like Shift combined with Puppeteer and Chrome to reverse engineer web applications
The life of breached data and the attack lifecycleJarrod Overson
OWASP RTP Presentation on Data breaches, credential spills, the lifespan of data, credential stuffing, the attack lifecycle, and what you can do to protect yourself or your users.
Shape Security analyzes 1.5 billion logins per week and protects 350 million user accounts. In 2016 alone, 1.6 billion credentials were leaked and sold or traded by criminals on dark web markets. Shape uses headless browsers like PhantomJS to automatically test leaked credentials on other sites, stopping over $1 billion in fraud losses in 2016. However, captchas intended to prevent automated attacks do not work and ruin the user experience.
This document discusses the dark side of web security, including automated threats from bots and attackers. It notes that traditional security like flossing is difficult to measure effectiveness. It outlines the OWASP top 10 vulnerabilities and automated threats attackers use. While captchas are meant to stop bots, services have made bypassing captchas easier. If a site has value like money, data, or content, there is value in exploiting it. Detection of attacks is difficult as attackers use many proxies and fingerprints to avoid detection. Patching is not enough, and spikes in traffic from many IPs could indicate an attack.
This was a talk given at HTML5DevConf SF in 2015.
Ever wanted to write your own Browserify or Babel? Maybe have an idea for something new? This talk will get you started understanding how to use a JavaScript AST to transform and generate new code.
This document discusses ECMAScript 2015 (ES2015), also known as ES6. It provides examples of new ES2015 features like arrow functions, template literals, classes, and modules. It also discusses how to set up a development environment to use ES2015, including transpiling code to ES5 using Babel, linting with Eslint, testing with Mocha, and generating coverage reports with Istanbul. The document emphasizes that while ES2015 is fun to explore, proper tooling like linting and testing is needed for serious development. It concludes by noting ES2015 marks a transition and thanks the audience.
The document discusses achieving maintainability in code through examining code quality with linters, generating visual reports on metrics like complexity and coverage, and automating processes like builds, linting, and testing through tools like Grunt and Gulp. It emphasizes setting limits on metrics like complexity, enforcing code style through automation, and treating documentation as important as code.
1) The document discusses achieving maintainability in code through analysis, automation, and enforcement of standards.
2) It recommends setting up linting, code coverage, and other analysis tools to examine code quality and automatically enforcing code style through build processes.
3) The key is to automate as many processes as possible like testing, linting, and documentation to make the code easy to work with and prevent issues from being introduced.
Riot on the web - Kenote @ QCon Sao Paulo 2014Jarrod Overson
Slides for the keynote given at QCon Sao Paulo 2014. Talk goes into the problems scaling Riot and how we've tried to solve them as well as what we've learned from the web and what lies in store next.
Managing JavaScript Complexity in Teams - FluentJarrod Overson
This document discusses managing complexity in JavaScript projects. It addresses coming to terms with the challenges of dynamic languages being messy, having an immature tooling ecosystem, and rapid evolution. It emphasizes respecting code style conventions, enforcing linting rules, documenting code, and using metrics like cyclomatic complexity to reduce testing difficulty. The overall message is that perseverance is needed to tame JavaScript's complexity through automation, visualization, honesty and acceptance of its challenges and opportunities.
The document discusses web components, which include HTML templates, custom elements, shadow DOM, and HTML imports. Web components allow the creation of reusable custom elements with their own styles and DOM structure. They provide encapsulation and help avoid issues with global namespaces. While browser support is still emerging for some features, polyfills exist and frameworks like Polymer make web components accessible today. Web components represent an important evolution of the web that will improve how code is structured and shared.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
High performance Serverless Java on AWS- GoTo Amsterdam 2024Vadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless community. Java is known for its high cold start times and high memory footprint, comparing to other programming languages like Node.js and Python. In this talk I'll look at the general best practices and techniques we can use to decrease memory consumption, cold start times for Java Serverless development on AWS including GraalVM (Native Image) and AWS own offering SnapStart based on Firecracker microVM snapshot and restore and CRaC (Coordinated Restore at Checkpoint) runtime hooks. I'll also provide a lot of benchmarking on Lambda functions trying out various deployment package sizes, Lambda memory settings, Java compilation options and HTTP (a)synchronous clients and measure their impact on cold and warm start times.
AppSec PNW: Android and iOS Application Security with MobSFAjin Abraham
Mobile Security Framework - MobSF is a free and open source automated mobile application security testing environment designed to help security engineers, researchers, developers, and penetration testers to identify security vulnerabilities, malicious behaviours and privacy concerns in mobile applications using static and dynamic analysis. It supports all the popular mobile application binaries and source code formats built for Android and iOS devices. In addition to automated security assessment, it also offers an interactive testing environment to build and execute scenario based test/fuzz cases against the application.
This talk covers:
Using MobSF for static analysis of mobile applications.
Interactive dynamic security assessment of Android and iOS applications.
Solving Mobile app CTF challenges.
Reverse engineering and runtime analysis of Mobile malware.
How to shift left and integrate MobSF/mobsfscan SAST and DAST in your build pipeline.
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
Conversational agents, or chatbots, are increasingly used to access all sorts of services using natural language. While open-domain chatbots - like ChatGPT - can converse on any topic, task-oriented chatbots - the focus of this paper - are designed for specific tasks, like booking a flight, obtaining customer support, or setting an appointment. Like any other software, task-oriented chatbots need to be properly tested, usually by defining and executing test scenarios (i.e., sequences of user-chatbot interactions). However, there is currently a lack of methods to quantify the completeness and strength of such test scenarios, which can lead to low-quality tests, and hence to buggy chatbots.
To fill this gap, we propose adapting mutation testing (MuT) for task-oriented chatbots. To this end, we introduce a set of mutation operators that emulate faults in chatbot designs, an architecture that enables MuT on chatbots built using heterogeneous technologies, and a practical realisation as an Eclipse plugin. Moreover, we evaluate the applicability, effectiveness and efficiency of our approach on open-source chatbots, with promising results.
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
What is an RPA CoE? Session 2 – CoE RolesDianaGray10
In this session, we will review the players involved in the CoE and how each role impacts opportunities.
Topics covered:
• What roles are essential?
• What place in the automation journey does each role play?
Speaker:
Chris Bolin, Senior Intelligent Automation Architect Anika Systems
"What does it really mean for your system to be available, or how to define w...Fwdays
We will talk about system monitoring from a few different angles. We will start by covering the basics, then discuss SLOs, how to define them, and why understanding the business well is crucial for success in this exercise.
"Scaling RAG Applications to serve millions of users", Kevin GoedeckeFwdays
How we managed to grow and scale a RAG application from zero to thousands of users in 7 months. Lessons from technical challenges around managing high load for LLMs, RAGs and Vector databases.
The Department of Veteran Affairs (VA) invited Taylor Paschal, Knowledge & Information Management Consultant at Enterprise Knowledge, to speak at a Knowledge Management Lunch and Learn hosted on June 12, 2024. All Office of Administration staff were invited to attend and received professional development credit for participating in the voluntary event.
The objectives of the Lunch and Learn presentation were to:
- Review what KM ‘is’ and ‘isn’t’
- Understand the value of KM and the benefits of engaging
- Define and reflect on your “what’s in it for me?”
- Share actionable ways you can participate in Knowledge - - Capture & Transfer
32. var i = 0;
function draw() {
if (i < 500) i++;
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillRect(i + 10, i + 10, 100, 100);
requestAnimationFrame(draw);
}
draw();
33.
34. var i = 0;
function draw() {
if (i < 500) i++;
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillRect(i + 10, i + 10, 100, 100);
requestAnimationFrame(draw);
}
draw();
First we update our state.
35. var i = 0;
function draw() {
if (i < 500) i++;
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillRect(i + 10, i + 10, 100, 100);
requestAnimationFrame(draw);
}
draw();
Then we render our current state.
36. var i = 0;
function draw() {
if (i < 500) i++;
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillRect(i + 10, i + 10, 100, 100);
requestAnimationFrame(draw);
}
draw();
And we do it all over again.
48. var system = new ParticleSystem(width, height);
system.emitters.push(new Emitter(new Vector(10, 10)));
system.particles.push(new Particle(new Vector(20, 20)));
system.particles.push(new Particle(new Vector(10, 20)));
system.particles.push(new Particle(new Vector(20, 10)));
function loop() {
system.render(context);
window.requestAnimationFrame(loop);
}
loop();
49.
50. var system = new ParticleSystem(width, height);
system.addEmitter(320, 180);
function loop() {
system.update();
system.render(context);
window.requestAnimationFrame(loop);
}
loop();
55. emitParticle() {
// Define a maximum angle range in radians.
let spread = Math.PI / 32;
// Use an angle randomized over a spread so we have more of a "spray"
var angle = this.velocity.rad() + spread - (Math.random() * spread * 2);
// The magnitude of the emitter's velocity
var magnitude = this.velocity.length();
// New velocity based off of the calculated angle and magnitude
var velocity = Vector.fromAngle(angle, magnitude);
// return our new Particle
return new Particle(this.position.clone(), velocity);
}
56. emitParticle() {
// Define a maximum angle range in radians.
let spread = Math.PI / 32;
// Use an angle randomized over a spread so we have more of a "spray"
var angle = this.velocity.rad() + spread - (Math.random() * spread * 2);
// The magnitude of the emitter's velocity
var magnitude = this.velocity.length();
// New velocity based off of the calculated angle and magnitude
var velocity = Vector.fromAngle(angle, magnitude);
// return our new Particle
return new Particle(this.position.clone(), velocity);
}
57. emitParticle() {
// Define a maximum angle range in radians.
let spread = Math.PI / 32;
// Use an angle randomized over a spread so we have more of a "spray"
var angle = this.velocity.rad() + spread - (Math.random() * spread * 2);
// The magnitude of the emitter's velocity
var magnitude = this.velocity.length();
// New velocity based off of the calculated angle and magnitude
var velocity = Vector.fromAngle(angle, magnitude);
// return our new Particle
return new Particle(this.position.clone(), velocity);
}
62. emitParticle() {
// Define a maximum angle range in radians.
let spread = Math.PI / 32;
// Use an angle randomized over a spread so we have more of a "spray"
var angle = this.velocity.rad() + spread - (Math.random() * spread * 2);
// The magnitude of the emitter's velocity
var magnitude = this.velocity.length();
// New velocity based off of the calculated angle and magnitude
var velocity = Vector.fromAngle(angle, magnitude);
// return our new Particle
return new Particle(this.position.clone(), velocity);
}
63. emitParticle() {
// Define a maximum angle range in radians.
let spread = Math.PI / 32;
// Use an angle randomized over a spread so we have more of a "spray"
var angle = this.velocity.rad() + spread - (Math.random() * spread * 2);
// The magnitude of the emitter's velocity
var magnitude = this.velocity.length();
// New velocity based off of the calculated angle and magnitude
var velocity = Vector.fromAngle(angle, magnitude);
// return our new Particle
return new Particle(this.position.clone(), velocity);
}
64. emitParticle() {
// Define a maximum angle range in radians.
let spread = Math.PI / 32;
// Use an angle randomized over a spread so we have more of a "spray"
var angle = this.velocity.rad() + spread - (Math.random() * spread * 2);
// The magnitude of the emitter's velocity
var magnitude = this.velocity.length();
// New velocity based off of the calculated angle and magnitude
var velocity = Vector.fromAngle(angle, magnitude);
// return our new Particle
return new Particle(this.position.clone(), velocity);
}
65.
66.
67.
68. 1. Application state modified and rendered independently.
2. Expensive mutations performed as little as possible.
3. Physics based animations.
71. The virtual DOM is an abstraction that saves you the cost of
expensive render-based mutation in a familiar package.
It's better, but a virtual DOM is not our application state.
72. While you're exploring JavaScript, explore graphics & games.
Go, do neat things with canvas!
73. Maybe you'll find a use for normal mapped backgrounds.
http://jsoverson.github.io/texture.js/demo/bricks.html
74. Or maybe you'll use it to understand the bounds of an optical illusion.
http://jsoverson.github.io/concentric-circle-illusion/
75. Or maybe you'll make some really awesome games.
https://ga.me/games/polycraft (turbulenz.com)