[https://gist.github.com/theRemix/bf147e5f06542cdce3d0](MultiDimensional Arrays)
- create and work on a new branch called two_dimensional
- sample chai spec https://gist.github.com/theRemix/848d0c2e3224e783a021
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function List(){ |
(function() { | |
var STAGE_HEIGHT = 480; | |
var STAGE_WIDTH = 800; | |
// var GROUND_Y = 450; | |
var GAME_ASSET = { | |
IMAGES: { | |
blah: '/assets/images/mario.png', | |
// bg: '/assets/images/bg32_32.png', |
[https://gist.github.com/theRemix/bf147e5f06542cdce3d0](MultiDimensional Arrays)
//get a reference to the main element in your HTML document(DOM) | |
var mainElement = document.getElementById('main'); | |
for (var i = 0; i < window.geemails.length; i++) { | |
var x = document.createElement("P"); | |
var t = document.createTextNode(window.geemails[i].sender + " " + window.geemails[i].subject + " " + window.geemails[i].date); | |
x.appendChild(t); | |
//append to the main element to attach new element as a child of main instead of document.body | |
mainElement.appendChild(x); | |
} |
//generate new messages - need to append | |
//just pass the name of a function you created and an interval, this is just a reference to what function you want to execute | |
//at the specified interval | |
var newMessage = setInterval(getNewMessage, 5000); | |
//this is the actual function that will get called and execute at the configued interval in setInterval above. | |
function getNewMessage() { | |
console.log('get new message'); | |
} |
###Good Morning Agents
Your challenge this morning is to create a function that implements an algorithm using the concepts we've covered this week.
###Challenge
find
parameter is found in the source
parameter if source
were circular in nature. Meaning there is no end to the source
string.Ex.
###Console History Sim Stack Trace Challenge
Using a linked list, we are going to demonstrate a use case for a linked list and simulate a stack like you see in a stack trace (similar to what you see in your console when an error occurs), that replays the history of what we typed.
save
and dump
.###Email Hell
We just found out that there is a bug in production that our e-mail function was iterating errantly and sending duplicate e-mails to many users. We need to fix this quickly but we don't want to send out a mass apology letter to all of our users.
Our sysadmin gave us the SMTP logs and we need to process the logs and identify which users received multiple e-mails so that we can directly send them a follow up e-mail explaining the situation and offer super cool swag to keep them on as customers.
Also, the boss wants this done ASAP, we don't have time to do this manually...HAAALLLLPPP!
###The Fix
Reflection is a common utility in Object Oriented languages for inspecting classes and deriving information about what properties/methods they expose and other classes they inherit from. We will be writing our own JavaScript reflector today!
We are going to write a simple utility that will inspect a given object, and tell us about the object and it's inheritance chain.
We are going to be building an in-memory cache to improve performance and extend the getElementById()
and querySelector()
functions of the DOM. Querying the DOM for elements can be an inefficient operation and if we are finding elements in the DOM repeatedly we would like to improve performance but we also don't want to clutter our codebase with many variables to hold references to the various elements we will use and to keep things a bit more dynamic.
Write a module that anyone can add to their project and call your module's functions instead of the native DOM functions.