This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DATA FRAME OPERATIONS IN R | |
# Create data frame | |
# A dataset is ~ table (list of vectors) | |
id <- c(1,2,3) | |
name <- c("John", "Kirk", "AJ") | |
age <- c(21,27,18) | |
employees <- data.frame(ID=id, Name=name, Age=age) | |
employees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Ball() { | |
var self = this; | |
var full = false; | |
self.inflate = function() { | |
full = true; | |
}; | |
self.isFull = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the render method in the `ItemView` in my Backbone.Marionette plugin. | |
// It's a giant method - far too much happening in this one method, and poor | |
// use of memory with all of the methods that get re-defined on every use. | |
// | |
// It desperately needs to be cleaned up. But I can't do something quite as | |
// simple as just move the inner functions on to the ItemView itself. There | |
// are too many methods on the ItemView already. | |
// | |
// Suggestions? What are some good patterns to clean this up? | |
// |
NewerOlder