The document discusses Dijkstra's algorithm and its use for finding the shortest path between nodes in a graph. It includes code examples implementing Dijkstra's algorithm to calculate routes on a subway map with nodes and lines stored in CSV files. Additional topics summarized include using Vagrant to configure a development environment, the PHP microframework Silex, dependency managers like Bower and Composer, and the JavaScript task runner Grunt.
18. var stage = new Kinetic.Stage({
container: ‘container’,
width: 500,
height: 500
});
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({
x: 100,
y: 100,
radius: 10,
fill: 'red',
stroke: 'black',
strokeWidth: 1
draggable: true,
dragBoundFunc: function(pos) {
return {
x: pos.x - pos.x % 10,
y: pos.y - pos.y % 10
};
}
});
layer.add(circle);
circle.draw();
19.
20.
21. # -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "lucid32"
config.vm.network "private_network", ip: "192.168.33.14"
end
22. $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2200 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/konstantinchukhlomin/PhpstormProjects/subway
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.