Day 41: Continuing in Free Code Camp Using Treehouse

Update from 7/8/2015: So, I actually wrote this last night. i thought I saved it. I guess not. I was tired!

So, I am hanging out right now in my treehouse while attending Free Code Camp!

Seriously, though, I tried Codecademy’s jQuery lessons and just found them hard to understand. In one section of the jQuery track at Treehouse it just clicked and I understood how jQuery works. I highly recommend it!

I think the difference, for me at least, is having a teacher in a video showing and explaining what is happening. So far Nick Pettit, Jason Seifer and Andrew Chalkley have been great at telling me what I need to know and explaining the hard stuff. Programming isn’t about memorizing tons of info. Its about understanding the system used to create and develop stuff. With the framework down, and an understanding of how each language works, you can build things if you have the perseverance and determination.

Introduction to jQuery badge

Creating a Spoiler Revealer badge

Day 40: Starting Free Code Camp

I thought a lot today about which direction to go in my journey to become a web developer. I want to finish Ruby on Rails but I also know Javascript is important and everywhere. I also read a lot about FreeCodeCamp and how awesome the program is. I decided today to head that way. I figure it gives me more practice plus a useful skill base. They also help in building a portfolio by assisting non-profits, a worthy endeavor for an MSW looking to become a web developer.

So far I have completed the Basic HTML and CSS section,  the Responsive Design with Bootstrap section and I just started the jQuery section.

Day 39: Continuing Treehouse Rails Development Track

So, like before, I am doing a very quick HTML and CSS refresher.

CSS: Cascading Style Sheets badge

Customizing Colors and Fonts badge

Styling Web Pages and Navigation badge

Adding Pages to a Website badge

Responsive Web Design and Testing badge

Sharing a Website badge

Debugging HTML and CSS Problems badge

OK, I finished up the refresh of HTML and CSS. Now on to Javascript Basics.

First part is just an overview of all the uses of Javascript, which is very impressive! It is definitely a language I want to learn more about.

And then, a few quick exercises. Using this index.html:

I added a simple JavaScript code inside it:

and then in a separate file:

These both caused message boxes to pop up in the browser.

Here is my progress so far while heading down the Rails Development track:

As you can see, I have completed the How to Make a Website stage, and previously completed the Ruby Basics Stage. I am currently in the JavaScript Basics stage. My next one after that will probably be Console Foundations.

Back for more tomorrow!

Day 38, part 2: Back to ride the Rails

I will be studying the Michael Hartl Ruby on Rails tutorial. First, however, I want to do a quick refresher to catch up to where I left off. I’ll use Treehouse for that. I am glad there is a speed up function there. Here we go! BTW, I am going to speed through these and just post the badges I earn. I want to get going and fast.

Beginning HTML and CSS badge

HTML First badge

Creating HTML Content badge

OK, I will be continuing tomorrow. For those wondering why I am going back through this again, well, that is twofold:

1. Refreshers are good. I want to know this stuff really well. While HTML and CSS are markup languages, it is important to understand them.
2. I’m a completionist. Here is what the path ahead on Treehouse looks like:

I completed the Ruby Basics course already. I am a quarter of the way through the “How to Make a Website” stage. I want to be competent and refreshing my knowledge is a good way to ensure I know my stuff.

Day 38, Part 1: First App Finished

I just finished my Book Tracker app. I decided to only add a print function as I would want to put out the whole list as I go. I may go back eventually to add search, but for what it is for I believe a list function is best. I am using it to track as I go.

I created a video to detail the app and show how it works:

and here is a look at the code. You can also see the code at my GitHub profile.

First, the main file:

and the the file where I create Book.class:

and then the YAML file… where the data is stored.

OK, I am moving on to Ruby on Rails tonight. I will return shortly!

Day 37: Working on my App and Finishing Exercise 39 at Learn Ruby the Hard Way

I had a day off from work so spent a good portion of the day enjoying being off work. I am back now to finish the long lesson last night from Learn Ruby the Hard Way: Exercise 39: Hashes, Oh Lovely Hashes.

So, the second portion of the Exercise had a module, dict.rb, and then another file full of hashes to run using the module. Here is the code:

and the test file:

demosthenes131@rails-tutorial:~/workspace/LRTHW (master) $ ruby ex39_test.rb
———-
NY State has: New York
OR State has: Portland
———-
Michigan’s abbreviation is: MI
Florida’s abbreviation is: #Dict.get(states, ‘Florida’)}
———-
Michigan has: Detroit
Florida has: Jacksonville
———-
Michigan
MI
New York
NY
Florida
FL
Oregon
OR
California
CA
———-
CA
San Francisco
OR
Portland
NY
New York
MI
Detroit
FL
Jacksonville
———-
Sorry, no Texas.
The city for the state ‘TX’ is: Does not exist

And now back to my app!

I added a way to preserve added data today via YAML

Here is the BookTracker main file:

the Book class file:

and what happens when I add information:

First session:

demosthenes131@book_tracker:~/workspace (master) $ ruby book_tracker.rb
Select an option from the below choices
a: Add a Book
p: View the Books
s: Search the Books
e: Exit
a
Book title: Storm Front
Author: Jim Butcher
Genre: Urban Fantasy
Have you read it, listened to it, or is it a wish list item? Listened
Write a short, one sentence, review! Amazing
Select an option from the below choices
a: Add a Book
p: View the Books
s: Search the Books
e: Exit
e
[#]

At this point I was having a lot of trouble originally. Everytime I restarted the app and entered a new book the previous book was deleted. I fixed this by adding the open() to the run method which would then populate the array. Next session after this (also after I removed a few items that I will re-add later):

demosthenes131@book_tracker:~/workspace (master) $ ruby book_tracker.rb
Select an option from the below choices
a: Add a Book
e: Exit
a
Book title: Hounded
Author: Kevin Hearne
Genre: Urban Fantasy
Have you read it, listened to it, or is it a wish list item? Read it
Write a short, one sentence, review! Fun
Select an option from the below choices
a: Add a Book
e: Exit
e
[#, #]

And here is the YAML output file:

My plan tomorrow is to work on the search and print functions!

Day 36: Splitting Time Between Writing a New App and Learning Ruby the Hard Way

So, I want to get back to finishing Learn Ruby the Hard Way while also applying my new found knowledge to the app I am creating.

I will start with Exercise 39:

and the results:

demosthenes131@rails-tutorial:~/workspace/LRTHW (master) $ ruby ex39.rb
———-
NY state has: New York
OR state has Portland
———-
Michigan’s abbreviation is: MI.
Florida’s abbreviation is: FL
———-
Michigan has: Detroit
Florida has: Jacksonville
———-
Oregon is abbreviated OR
Florida is abbreviated FL
California is abbreviated CA
New York is abbreviated NY
Michigan is abbreviated MI
———-
Oregon has the city OR
Florida has the city FL
California has the city CA
New York has the city NY
Michigan has the city MI
———-
Oregon is abbreviated OR and has city Portland
Florida is abbreviated FL and has city Jacksonville
California is abbreviated CA and has city San Francisco
New York is abbreviated NY and has city New York
Michigan is abbreviated MI and has city Detroit
———-
Sorry, no Texas.
The city for the state ‘TX’ is: Does Not Exist

OK, I have more to do this lesson but spent the rest of my night reading through my code and trying to figure out how to get my user input to go into a hash then have that hash go into an array. I will continue tomorrow.

Day 35: Getting Closer to a Finished First App

So, i made more progress today, especially thanks to Jesus Castello of BlackBytes.info who helped me understand the difference between instance vs. local variables. So, here is how the Book Tracker is looking tonight. Also, feel free to take a look at it on GitHub.

The book class:

and the main book_tracker file:

And here are the results for this:

Select an option from the below choices
a: Add a Book
p: View the Books
s: Search the Books
e: Exit
a
Book title: Ender’s Game
Author: Orson Scott Card
Genre: SciFi
Have you read it, listened to it, or is it a wish list item? read it
Write a short, one sentence, review! Awesome
Select an option from the below choices
a: Add a Book
p: View the Books
s: Search the Books
e: Exit
a
Book title: Storm Front
Author: Jim Butcher
Genre: Urban Fantasy
Have you read it, listened to it, or is it a wish list item? listened
Write a short, one sentence, review! Amazing
Select an option from the below choices
a: Add a Book
p: View the Books
s: Search the Books
e: Exit
p
Book List
#
#
Select an option from the below choices
a: Add a Book
p: View the Books
s: Search the Books
e: Exit
e
[#, #]

I will continue hacking away tomorrow!