Showing posts with label black. Show all posts
Showing posts with label black. Show all posts
Tuesday, February 11, 2014
Single Table Inheritance
I'm currently building an app that needs to have a base model and sub-models. I wasn't sure how to do that, so I did some research online and found STI or Single Table Inheritance. The idea behind it is that the sub-models will inherit from the base model, so it will be able to use all of the attributes of the base model. In the migration of the base model you must have a type field. This is how rails knows that other models will be inheriting from this model. In the example below the singer and dancer models will inherit from the entertainer model, so now we can create a new entertainer object an be able to use the attributes associated with entertainer on that object.
Monday, January 20, 2014
Anatomy of a JavaScript function
JavaScript functions are very different from Ruby methods. While reading Intro to Functions I became quite confused because I am so used to the way methods work in Ruby. I did understand some of it. Here is what I observed.
In JavaScript defining properties of pure functions is that they always return the same values when given the same arguments.
A function is built by first using the word function then the name we want to call the function followed by the names of the argument/s in parenthesis. Last would be the body of the function. Ex:
Return is used to define the value that the function returns. If there is no expression after return the function will return undefined
In this example both the top level variable and the local variable are named variable. The function printVariable is called inside of the function test. Even though printVariable was called inside of test the local variable is not available to the printVariable function.
Lexical Scoping is when a variable visibility is determined by the functions placement in the program text. Both local variables and top-level variables are visible. In the example because the child function was defined in the parent function the local variable from the parent function is the only variable visible to it.
In JavaScript defining properties of pure functions is that they always return the same values when given the same arguments.
A function is built by first using the word function then the name we want to call the function followed by the names of the argument/s in parenthesis. Last would be the body of the function. Ex:
Return is used to define the value that the function returns. If there is no expression after return the function will return undefined
In this example both the top level variable and the local variable are named variable. The function printVariable is called inside of the function test. Even though printVariable was called inside of test the local variable is not available to the printVariable function.
Lexical Scoping is when a variable visibility is determined by the functions placement in the program text. Both local variables and top-level variables are visible. In the example because the child function was defined in the parent function the local variable from the parent function is the only variable visible to it.
Sunday, October 20, 2013
Accepted into the Flatiron School!
Hello all. On Friday October 11th I found out I was accepted into the Flatiron School Fellowship program. I'm really excited and I hope that I excel while I'm here. Since then I've been trying to get the prework done. Currently I'm doing the Ruby Foundations on Treehouse. I will also try to write a post daily. Until next time.
Wednesday, August 7, 2013
Ruby
I'm trying to get a better grasp of Ruby so along with reading Zed Shaw's book I've been doing the lessons on RubyMonk.com. RubyMonk is a pretty good site for learning Ruby, so I'd recommend it. I'm still not the best I Ruby, but I've definitely gotten better. Practice makes perfect. I still haven't solved my Michael Hartl's tutorial issue. Sunday I plan on going to hacker Meetup, so I hope I can get help there. I really can't wait to get back into the tutorial. Once I finish it I want to work on my own Rails site. Not sure what it will be as yet. That's all for now.
Labels:
african american,
black,
coding,
hacker,
programming,
rails,
ruby
Sunday, August 4, 2013
Introduction
Hello! My name is Keturah, I live in Brooklyn, NY and I'm studying to become a junior rails developer. I got the idea to create this blog from Josh Kemp. He was on this same journey last year and he currently has a job as a junior developer. His story has definitely kept me motivated. If you are interested in becoming a rails developer you should check his blog out Josh Kemp. Right now I'm doing Michael Hartl's tutorial, "Learn Ruby the Hard Way" by Zed Shaw, and Chris Pine's "Learn to Program". All three are great learning materials. Currently I'm stuck on chapter 8 of MH's tutorial. I keep getting this error: rails_projects/sample_app/app/controllers/application_controller.rb:3:in `<class:ApplicationController>': uninitialized constant ApplicationController::SessionsHelper (NameError). So far I haven't been able to solve this issue. I'm thinking maybe it's a formatting thing. I'll see if someone on Stack Overflow or someone at a hacker Meetup can help. Recently I have finished the Ruby 4 Kids airplane laser game, and the ball game. I'm going to push them up to GitHub once I'm done making my own little changes to them. I'm also going to create my own Ruby game. I so excited about all of this. I really want to become junior developer. That's all for now
Subscribe to:
Posts (Atom)






