Tuesday, December 17, 2013

Wrap Up

This will be my last post for this blog. I started out wanting to make a blog for everyday while we were in class because nobody else had done this before. I wanted to give insight to future students who searched around the web for information about the school, but couldn't find any info from past students. Though it was a struggle to write a post every night @ around 1130pm, I am glad I did it.

The amount of knowledge I acquired in the last 10 weeks and the stuff I can do now, compared to before is remarkable. Especially trying to learn Ruby on Rails. I don't think I would have been able to piece it together and how the "magic" works by myself. Just getting Rails installed and running on your computer is a challenge in itself. Rails is probably my favorite language now because of all of the different scripts you get to use. Plus, you get to use the command line. Along with Rails, I am now proficient in HTML/CSS, jQuery, Ajax, Databases (MySQL & SQLite), PHP, and Ruby. Though I still need to work on all of them, it is nothing that I can't figure out for myself or look up on stackoverflow (http://stackoverflow.com/). <= Had to throw at least one link in here for old times sake. I mean, let's be honest, I did not even really know how to use a <div> correctly before I started this class.

Here are my hours and productivity chart for last week and the last 3 months. I managed to do 59 hours in basically 4 days. This goes to show how much more time you spend on things when the clock is ticking. By that, I mean, I only had 5 or so days to figure everything out--before we "graduated".



Here are my total hours for December (left), November, & October. In total I put in about 535 hours on the computer. That is actual time with movement (doesn't account for reading code, documentation, & looking for hours to find that one error). In total, I think I took 3 days off from actually going to class. Those were all on Sundays and I still ended up coding the whole day anyway. So, basically, I did not take a day off at all since starting school. You really can't take any days off though because of the amount of stuff that needs to be learned and with everything always changing. You need to stay on top of things. Below are months November and December.

Here is my total count on Sublime text editor for the duration of my time. It ended up being a little over 136 hours. I guess I would of thought it to be more, but the magic of Rails allows you to use little lines of code.





Now that I am done, I need to finish my two projects and build my website. I don't even know how long it will take me to finish the Facebook one because I kind of have to redo the whole thing using objects. I hope to be done within the next month and then fly back to sunny California.

(see how how referenced the title of my blog in my last sentence?)

- Kyle

Friday, December 13, 2013

Day 68

Just returned back from going out one last time with the fellow classmates. I will make a closing post in the next couple days. Most likely, I will do some more Rails tomorrow and finish out the week with an ending post on Sunday.

On a coding note, I figured out why my Bootstrap styling would not work when I was changing the title for each of the pages. I needed to add (below) to the stylesheet I was working on because I was changing the layouts for each of the pages--away from the default application layout/stylesheet. Was something pretty simple, but I was stuck on this for a little bit today. Even the smallest change to your code can cause a ripple effect.


- Kyle

Thursday, December 12, 2013

Day 67

With all the time I have been spending on Rails, I forgot to mention that tomorrow is our last day (oops). I guess I don't really see it as ending anything because I am going to be doing the same thing everyday--from now on--anyways. Which is coding for 10-12 hours a day. The only thing I really want to do anyways haha.

Here is the latest Rails assignment I have been working on. It only has a registration, login, show, and comments page. This took me over 20 hours to finish. But, it has little styling, so it's not pretty. The important thing is that I got it to work!

Directly below is the registration page code and what happens when that code actually works (where is says register). The code that makes it work is on the controller page, which is what took up the majority of the 7 or so hours to get this working. Due to time contrasts, I will not be pulling that up.




After you register, you are taken to a login page, which will pull up your user information from the database (if it matches) and will log you in. Below is database for users, followed by the login page.



Here is where users can make comments on other users and that user who's page we are on can also make comments. This was quite tricky to figure out with the database. The middle two rows in the database represent the two comment fields needed. The first one is the user that is logged in and the second one is the user that the user (who is logged in) is commenting on. So, 22 is commenting on users 23 page. Looking at id 9 below.



Disregard the "Register" part below. This is for comments. I forgot to change that. O well. Had 2 minutes to finish this.



Got to love Bloggers formatting,

- Kyle

Wednesday, December 11, 2013

Day 66

I forgot to post my time for last week. Not sure what I was doing to have such a bad week. Seems very low, until I take into consideration that I went to San Francisco on Friday night and all of the football games were on Saturday. Already have more time logged in right now, than did for all of last week. That is mostly due the difficulty of getting the "magic" of Rails. Take a look, http://guides.rubyonrails.org.




Priorities,

- Kyle

Tuesday, December 10, 2013

Day 65

I finally figured the problem I was having trouble with last night. Basically I needed to have a new hidden input field, just as I did with the regular HTML form. The :product_id or the comments-product id needed to be the name and the value needed to be the product id for which you are commenting on, for that instance. The hidden_field just makes the form invisible to the user. The name is for the parameters that get sent to the controller page, which verifies if the form is correctly filled out. The second snippet (below) has the parameters that the comment form needs in order for it to work. You need the author, some content for that comment, and the product_id--or the product you are commenting on.


- Kyle

Monday, December 9, 2013

Day 64

I think Rails is finally starting to come together. The more advanced things like connecting the controllers is still a little tricky, but I feel like using SQLite over MySQL is making Rails easier to process.

This is the part that I am having difficulty with. Getting the comments for that particular product, to show up on the same page, is something I have yet to figure out.

The code to the right works, as far as when the form is submitted, but the only issue is getting it to display it back on the show page as well.
There are comments for the product, but that was done in the db, which displays on the page you tell it to. This is all done through the controller.







This is part of the products controller where you control what gets displayed on the pages--through methods or functions. You can create, delete, edit, update, etc., different parts of your views.















I am running out of time for the night, so I will try and peice this together tomorrow.

- Kyle

Sunday, December 8, 2013

Day 63

Another good resource to try and learn Ruby is http://ruby.learncodethehardway.org. I have done the Python version and found it was one of the best free learning tools out there. Even the command line crash course is extremely helpful. Especially for Ruby because you need know the command line. Just make sure you don't type in the wrong command on your command line. Something like 'rmdir Documents' would not be the smartest thing to do. But, the good thing is your computer will ask you if you really want to delete everything in the folder. If you are really feeling lucky, well, then. you type in 'Y'. 

- Kyle