Author Archives: Mason Ellwood

My Journey Of Learning Programming Through Flatiron School #32

flatiron school

My name is Mason Ellwood, and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

This week I finally finished one of the final project through The Flatiron School. With that final project we were supposed to write a blog post for the school, stepping out processes and procedures on how we approached this task. Below is the article I wrote for the school. This gives you a brief understanding of what was required of us for the project.

“Hi my name is Mason Ellwood and I finally did it! I created my first working gem. My approach to this came at a rough start. This was my first gem I have ever built and the first project that I have approached without the training wheels of the learn.ide or someone explicitly telling me what to do or how to do it. This was a big task especially when looking at a blank screen…

So for my app, because I have currently traveled I decided on building a weather app that when called asks what state you reside in. If on the chance you forgot how to spell the states, will list out the states as well. Once the user has typed a state they will then be prompted with a new message of which city they would like to know the weather off. If again the user does not know the names of the cities in that area, will also list the cities in that state. Once the user types the city they would like to know more about it will display the weather, all done with Nokogiri.

For this project, I closely followed the setup instructions supplied by Avi here (https://www.youtube.com/watch?v=_lDExWIhYKI). This follows the bundler preset setup instructions using (bundle gem GEMNAME). Using the rails casts (http://railscasts.com/episodes/245-new-gem-with-bundler) to get me started. Once my local environment, and getting my “hello world” message to display upon first initialization of the cli prompt I began to deviate from Avi’s video walkthrough.

For what I wanted to do, I first had to think of where I was going to get this information…. The best site I have found for this is (www.wunderground.com). With this site comes a lot of functionality right out of the box. First I noticed that their URL works great for user input and string interpolation. When I went to a site and searched a state it returned all the cities in that state which is just what I needed. In cli.rb document I allowed for a user input of a variable. With that, I then interpolated the user input of a state to the URL of the site (https://www.wunderground.com/cgi-bin/findweather/getForecast?query=#{USER_INPUT_OFSTATE}). With this, I was in business, now time to scrape.

I created a file that scrapped the state for all the cities in that state. This if prompted returned the user a screen that allowed them to place a city name or list the cities in that state. Depending on what the user wanted they could either place a city name or list out the city. If the user wanted a specific city input then they would just type the city name.

When they type the city name, it checks what city they imputed and then pulls that href from each city that was included on that state’s page interpolating the URL to the home URL. (https://www.wunderground.com/#{CITY_INPUT_URL}). This sends the user now to that URL and scrapes the relevant data they need.

This returns the weather information of that state at that instant displaying a message back to the user of the information they want. This then prompts if they want to get a new city’s weather information or go and get a different state’s information.

And there you have it a weather app! The main issue I did not foresee is naming convention… a weather gem already exists with the same naming conventions of my weather app. This caused issues when I wanted to push it to the rubygems.com website. So in the future, I will make sure to check before hand if something with these naming conventions already exists. This will save tons of time in the future, and major headaches.

Overall once I began to understand how all the files were related to each other, it was easy to proceed. Through this project, I learned how to create a ruby gem, how to create and plan a project from start to finish, how to publish a ruby gem, the importance of naming conventions, and how to build and install a gem to Bundle. Over it was an awesome project.”

Read More at My Journey Of Learning Programming Through Flatiron School #32


Source: Web Design Ledger

My Journey Of Learning Programming Through Flatiron School #20

My name is Mason Ellwood, and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

Within this post, I will cover something that I tend to dread. Backtracking. For me while learning, especially with code, there is always a small portion that does not quite make sense…. And with this, moving forward, the lessons build upon those concepts and the more and more you move forward, the more the material does not quite stick.

Usually, when this happens, I move forward anyways, full well knowing that what I just read does not quite make sense. But in my head, I’m assuming that the next lesson will clarify the previous. I then continue this cycle of confusion until is it too late. But like always, I move forward. This is the predicament that I am in right now. I am so far along in the lessons that I’m not sure how to proceed on a lot of the lessons, without reviewing someone else’s code. I am unsure where I took a hard left turn, but I did…

Moving backward and reestablishing by base knowledge, where my knowledge base cracked, is something I do not like doing. But I know the importance of this.

In school, especially in a subject that I was not too fond of, I would twiddle my thumbs and figured I would study like hell for the test. Which sadly works incredibly well. It probably should not but it does.

When learning a trade skill, like programming it is important to absorb all the material. When something does not make sense take a step back and establish yourself before you move forward. It is easy to not want to do this because it feels like progress is not being made. But what I found out is that, if you do not do this, when you know full well it is needed, you will have to backtrack even further than you thought you had to.

This is the position that I am in right now with The Flatiron Schools….

Somewhere along the way, I missed a core concept. Something did not stick, and I can’t quite pinpoint where exactly that was, but it happened. I am now working through ORM and Active Record, and any OO Ruby they ask me to write is fought with a lot of confusion and pain.

Working through the material that I have previously completed has been greatly beneficial to myself and Ruby is becoming more second nature.

Work slowly, and absorb. Learning is not a race and should not be treated as a race. When something doesn’t make sense ask questions and understand what exactly that is that does not make sense. I keep thinking to myself. Someone at the end of all this training is going to pay me to write code for a career. If I don’t know to do something, that is too bad… because that’s your job. 

I have learned to take my time, understand and absorb, then practice application to meet the knowledge goals I have set for myself.

Read More at My Journey Of Learning Programming Through Flatiron School #20


Source: Web Design Ledger

My Journey Of Learning Programming Through Flatiron School #19

My name is Mason Ellwood, and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

Back at it, SQL! Last post we created a database and learned how to add information to the database using a .txt file. Let’s learn a little more about SQL and a few rules to follow.

So when creating a table you need to make sure to include a name and at least one column. Remember from last post, we use a create statement by including a name and a data type. This allows SQL to know the kind of data that will be stored there. This allows you to have control over your data. Because the main purpose of SQL is to store a large amount of data, you should be very concerned with storing, accessing, and acting upon the data that you are storing. This makes defining your data very important.

Defining your data, or typing gives the ability to perform all kinds of operations with predictable results. Without typing, our data would be a mess or confusing; so we don’t want to do that haha.

Because we are using SQLite we will continue to explicitly talk about rules directly related to it. So anyways, SQLite only has four basic categories for defining data

  • TEXT: Any alphanumerical character which we want to represent as plain text. And example of this is the body of a paragraph, this would be considered TEXT.
  • INTEGER: Anything we want to represent as a whole number. Keep in mind, if it is a number and contains no letter or special characters or decimal points, then we should use an INTEGER.
  • REAL: Anything that is a decimal point. Example being 1.3, this would be considered REAL. In terms of decimal point, SQLite will only hold numbers that are 13 characters in length.
  • BLOB: This is generally used to hold binary code, so far in the lessons, we have not used this, so I am unsure at an example i can give you all.

The above creates a database. Then creates a cats table with an id, name, age, and breed column. Running .schema will display your database table structure to make sure you did this correctly,

As you review this, take notice that we use the INSERT INTO command, followed by the name of the table to which we want to add data to. In the parentheses, we put column names that we will fill with data.

Once your database if setup correctly, we can then add information to it!

This adds information about the cat Maru to your table. To retrieve your data to make sure that you have added it correctly, run the code below.

The * character is equivalent to all. Basically saying select and display all from the cats table.

Cool! Now you know how to create a database, add information to your database, and display that added data to the use (being you). Please post a comment and let me know if you have any questions regarding the material covered.

Read More at My Journey Of Learning Programming Through Flatiron School #19


Source: Web Design Ledger

My Journey Of Learning Programming Through Flatiron School #11

My name is Mason Ellwood, and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

Last week I was reading on wired that the next big blue collar job was going to be coding. I did not really know what to think of this. At first glance, programming lost its luster of being an untapped needed career, making me (a programmer) replaceable. This has always been the case but the recent boom of programmers is scary when entering a profession, competing against some of the smartest people in the industry.

On Wednesday I went to meet up with my weekly trivia team, and a new guy came who was a “full stack” developer. He used that term loosely because of the “what the heck does that entail” title that holds. But he kind of reaffirmed my fear of the article and agreed. Sure he said but this is no different than any other career now. It seems like everyone is fighting to stay ahead of the curve and automate as many processes as they can. Because technology has become such a cornerstone for many companies, automating and maintenance surly would follow. But because of this the need for “maintenance” increases especially within the dev community.

He agreed with the article, but development turning into the lusterless career path is not true. The need for developers is greater now that it has ever been. Being apart of the growing community of developers is a great place to be right now. And the need for “you” in a company setting is only going to become more prevalent.

Search Enumerables 

So picking up where we left off. Every method in Ruby must return a value. When we iterate or enumerate over a collection with #each, its return value is always the original constant. With this in mind, if we want to display the changed array values, dependent on what your method does, you may need to add an empty array ( new_array = [ ] ) to shovel ( << ) those values into.

There are many forms of #each, that can enact different outcomes. A few of the others are:

  • #select => When you invoke #select on a collection, the return value will be a new array containing all the elements of the collection that causes the block to pass a return value as true.
  • #detect/#find => #detect and #find can be used interchangeably. This will return only return the first element that makes the block true.  
  • #reject => #reject will return an array with the elements that return a false value

These listed above are all apart of the family of search enumerators whose purpose is to help you refine a collection to only matching elements.

A few that I use most often, I have found, is #each, #collect or #map (which are interchangeable), and each_with_index. A little more about enumerators can be found, and a quick reference that I have found very useful, is located here (http://ruby-doc.org/core-2.2.0/Enumerator.html). You will use these all the time, and I know how important this concept is. Locating and changing information based within your set of data is a key to programming. Essentially programming is the pushing and pulling of data and data manipulation. Being able to quickly and effectively iterate through data will increase your chances of landing a job, and becoming an officiant “blue collar worker” – as Wired so eloquently stated.

Read More at My Journey Of Learning Programming Through Flatiron School #11


Source: Web Design Ledger

My Journey Of Learning Programming Through Flatiron School #8

My name is Mason Ellwood and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

In the simplest terms that I can think of. To me, programming workflow (if you look at it in a broad sense) is very similar to a game most of you have played once in your life.

I know it is probably not the same one you have played when you were a kid, but bare with me. So with this game, you have a beginning point. to. You have to navigate through the different options (or pipe placement) to reach the outcome you want, the purpose. With this you can can navigate to the same end point in a few different ways, but all reach the same conclusion. Or they will navigate away from the expected output to a defined end point, where you have to either start over, or travel to a different outcome. As a programmer you have to be able to envision all possible outcomes from a single start point and what conditions need to be met to retrieve the outcome you want to meet to proceed.

Conditionals are one of the foundations of programming. If “something” is met, then do “something” else, and travel through the possible outcomes to reach the user’s goal.

Ruby conditional’s control the flow of the program that you are building. This includes if, else, and elsif.

This workflow looks something like this:

  • If (condition to be met)

    • code to run if condition is met
  • else
    • code to run if condition is not met
  • end

 

You can also add an elsif statement, which creating more conditional statements that could possibly be met. You can add as many elsif statements as you would like.

The control flow structure is a language feature which disrupts the normal progression to the next statement and conditionally or unconditionally branches to another location in your source code. This is controlled through if, elsif, and else returning true or false.

So far with the school I feel I have made some real progress. The school has been very enjoyable so far and I am learning and grown as a programmer immensely. When I started, I thought this would be very similar to other web courses I have gone through, which I am very grateful that is not the case. The Flatiron School really pushes you to think, and allows the student to write many different options for an acceptable correct answer.

Each lesson is setup with its own test suite, that basically checks that the output of your methods are correct but leaves it up to you to figure out the best possible way to retrieve and display that value. I have a long way to go, but I am amazed by the progress I have made so far and really looking forward to the other sections I will be dealing with soon.

Read More at My Journey Of Learning Programming Through Flatiron School #8


Source: Web Design Ledger

My Journey Of Learning Programming Through Flatiron School #6

My name is Mason Ellwood and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

Throughout my learning to program career, it seems like all I have and will be doing is learning and never actually be able to start my carrer. That seems like a stupid sentence, but a lot of the time it seems like the list of things I NEED to know does not stop. Every job listing you need to know 20 different abstract languages to even get your foot in the door, and I am constantly under qualified or lack enough experience to even land an interview. To put it frankly; that sucks. So where is the standard, what do I NEED to know, and what will actually be used on a daily basis; because if in my head I am constantly juggling 20 different language’s syntax on a daily basis, I may be over my head… I was discussing this with one of my good friends Paul Jackson who works in IT, and he helped me set everything straight. He said “If you master a language OOP (Object-oriented programming) concepts it will show in your work. Companies just want you to contribute in a certain way rather than to be an expert in all.”

As Eli eloquently touched on, most job postings come from a “pissed off IT manager” and a human resource person who both do not really know what they want. After the IT manager dumps tons of data on the human resource manager, he then writes a convoluted list of requirements that the developer needs to meet. When in actuality they only need you to do a few tasks, not all 20 “requirements” that are listed on the job posting. Thinking about the development world in this sense has better helped me personally prepare what I NEED to know to have a better chance at landing a developer job once I have completed the coursework for Flatiron Schools.

Alright let’s get into it, what is a Command Line Application! A Command Line Application, often referred to as a CLI (Command Line Interface) Application, are applications you interact with entirely through the terminal of shell. This includes no use of graphics or visual interface beyond what you see in the terminal. This birthed the software revolution!

“Write programs to handle text streams, because that is the universal interface”

– Douglas Mellroy, creator of UNIX Operating System

They are often times the most powerful interfaces you will interact with on a daily basis. This including GIT, Learn (the software Flatiron School is founded on), and Ruby’s CLI application interface. There are many more, but we will not talk about those.

So how do you use the CLI application logic with Ruby…. All files should follow a similar file structure with the top level directory being: bin, lib, config, spec, and something like app. You may also see .learn (specific to Flatiron Schools), .rspec, Gemfile, Rakefile, or program files like ttt.rb. If you are working in your terminal you can also use the bash command ls -lah which will show the list of files in your current directory, including hidden files (files starting in a period).

You can also use ls -a which displays all files including hidden files as well.

Inside the bin/ folder we generally want to place all the code that is relatable to running our actual program.

Inside the config/ folder you will place all the application environments. This includes all required files to initialize the environment of your program. These files connect to your database, and ensures your test suite has access to the files that contain the code it is testing.

Your lib/ folder is where a majority of your code lives. Within these files defines what your program can do.

Your spec/ folder is where test files go. These are written tests that makes sure your code behaves as expected.

Within the root directory of your Ruby program you may also file, if needed, your .rspec, .learn, GEMFILE, Gemfile.lock, Rakefile dependent on necessity.

Using Ruby’s CLI Application process, you are able to create dynamic programs that are able to capture user inputs to produces an interactive program. This follows a basic workflow:

  • Greet the user
  • Asks the user for input
  • Compares and stores the input
  • Do something with the input

As you can see by my beautiful artwork, running this program will first run files in bin/ and which are the instructions of how to execute. The file workflow sounds something like this.

  • Include the files need to execute (lib/hello-ruby-program.rb)
  • Greet user
  • Asks user for input
  • Captures that input using #gets
  • Uses user input to do something else, setting it to the value of name which is in the method of greeting
  • Sends that value to the lib/hello-ruby-program.rb
  • Execute method with user inputted value
  • Display return value to the terminal.

Using this logic allow users to input a value directly to the terminal, with a return value displayed to the user.

Calling the gets method captures the last thing the user typed into the terminal, which can be set to a variable. Calling gets freezes the program until user inputs some value.

Comment below if you need any further explanation on what was covered before, and I will do my best to elaborate.

Read More at My Journey Of Learning Programming Through Flatiron School #6


Source: Web Design Ledger

My Journey Of Learning Programming Through Flatiron School #4

flatiron school

My name is Mason Ellwood and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.

In the last post, I covered the definitions of a failing test and what data types Ruby, super fun stuff! Now that everything had a definition applied to it we are ready to get into arrays and interpolation! Heck yeah!

Arrays are used to store data as a collection. They do this by declaring literals or variable names separated by commas and wrapped in square brackets

 

Ex: this_is_an_array = [ “slot-one”, “slot-two”, “slot-three”, “slot-four”, “slot-five”, “slot-six”]

 

Remember!

*A class is a kind of like a template for creating objects in Ruby.

*A bundle is simply a bundle of information and behaviors.

*And a string is an object

Within your array, each element within your array is associated with a number that represents their order, this is called an index and they begin their index at 0.

 

Ex: this_is_an_array = [ “slot-one”, “slot-two”, “slot-three”, “slot-four”, “slot-five”, “slot-six”]

 

In order to call an element in the array you just created you must call the name of the array the number in which you want to call.

 

Ex: this_is_an_array[0] => “slot-one”

 

To assign a new value to a current index of that array, you can call the array index of the number you want to re-assign and define it to a new variable.

 

 

Or you can place, put, or take away whatever you want anywhere within this array. You can do this with a variety of different methods. I will not be covering every instance that was covered in the lesson, but for an example you can use the shovel method which employs the shovel operator ( << ) which allows you to add items at the end of the array. Similar to the shovel method you can also use #push method to do the same thing.

 

 

Moving forward I am finally ready to cover methods. Basically with arrays and methods you can do just about anything in Ruby and are the staple of the language. So what is a method…. It defines something new your program can do. They teach your Ruby program about a new routine or behavior it can use. This is an incredible tool because to my understanding they are the meat of your program and allow the practice of DRY or don’t repeat yourself logic. By defining your method once you can then call the method as many times as you would like.

 

 

The code above may seem dumb…. But if i encapsulate the repetitive strings within a method I do not need to repeat myself over and over again, remember to work towards  DRY haha. So the above method I wrote def a_bunch_of_strings is the method signature, which defines the basic properties of the method including the name of the method which is a_bunch_of_strings. Everything inside of this is considered the body, and remember this must in end. Once a method is defined you can call is as many times as you would like by using the method name. Then through string interpolation we can then make it dynamic (to check out more on string interpolation please check out this link: https://docs.ruby-lang.org/en/2.0.0/syntax/literals_rdoc.html)

 

 

Up until this point, I have not had any real issues with the Flatiron Schools, in fact it has been really enjoyable. This next post I may jump ahead quite a bit, so bear with me. But everyone I have met within the school has been great. What I really like is that once I finally do reach out to customer support with questions about the current course work, they don’t just belatedly tell you what the solution is, which is great. They allow me to work through it myself while they nudge me in the right direction. This can get kind of confusing though because you are communication over instant messenger. Which can be difficult when trying to work through which piece of your code does not work.

Read More at My Journey Of Learning Programming Through Flatiron School #4


Source: Web Design Ledger