A Pen by Secret Sam on CodePen.
#Lecture 1#
##Distributed Systems##
A system in which hardware or software components located at networked computers communicate and coordinate their actions only by message passing
A distributed system is a collection of independent computers that appear to the users of the system as a single computer.
A distributed system is a collection of autonomous computers linked by a network with software designed to produce an integrated computing facility.
##Distributed Systems vs Computer Networks## Computer Network: An interconnected collection of autonomous computers able to exchange messages based on protocols. Network entities are visible and they are explicitly addressed (IP address). Networks focuses on packets and routing.
(function() { | |
// Helper which turns class string into array | |
function getClassList(element) { | |
return element.getAttribute('class').split(' '); | |
} | |
// Add class with this name to the element | |
function addClass(name) { | |
var classes = getClassList(this); |
//spr_EnemyDead is a speparate sprite that contains the image of the enemy rotated slightly. | |
//Trying to get enemy once hit, to switch to spr_EnemyDead and then fall off screen, at the moment, as soon | |
//as player bounces off head he switches back to alive sprite. | |
//Enemy Movement | |
hsp = dir * movespeed; | |
vsp += grav; | |
sprite_index = spr_enemy | |
//Horizontal Collision |
#Core ##References Creation from
- Path String
- Parent Reference, child method
- In a list with push
##Sorting and Limiting
##Events
###Two Space Indents Do not use tab characters. All indents should be two spaces wide and the tab key should be set to insert soft tabs in your editor.
function action(intent) {
function compile(element, listeners) {
if(intent) {
element.addEventListener('click', listeners.click);
}
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<input type='checkbox'/> | |
</body> | |
</html> |
module.exports = function() { | |
var handlers = {}; | |
function _register(name) { | |
return handlers[name] || handlers[name] = []; | |
} | |
function on(name, handler) { | |
var event = _register(name); | |
event.push(handler); |
(function(window) { | |
// global module list | |
var modules = {}; | |
// require a module | |
window.require = function(name) { | |
return modules[name]; | |
}; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>No Problem</title> | |
<link rel='stylesheet' href='styles/base.css'/> | |
<link rel='stylesheet' href='styles/theme.css'/> | |
</head> | |
<body> | |
<div class='really'> |