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 

Saturday, December 7, 2013

Day 62

Here is a pretty fun site to learn Rails with if you have the time http://railsforzombies.org. When I get stuck on something or need a break from a project, I try to rack some points up on there. They explain things pretty well, too.


- Kyle

Friday, December 6, 2013

Thursday, December 5, 2013

Day 60

In the middle of http://ruby.railstutorial.org/ aka "The Hartl Tutorial" so this post will be short. Here is a little overview of my Sublime tracking for the last 7 days and since I started.

Amount of time I have spent typing code in my text editor since we started. About 125 hours--not bad.







I seemed to be most productive in the afternoon. Must be a glitch in the system or something. That is usually when I am the most tired, especially after pizza day....


- Kyle

Wednesday, December 4, 2013

Day 59

Finally started to use the rails server to make some stuff. Here is just one of the rails practice exercises we had to do.


So, when you first load the page and want to see all of the posts you have made, you go directly to the "Listing Posts" page on the rails server. This is called posts in the views folder as well. So to get to the page, it would look something like, http://localhost:3000/posts. If you decide you want to make a new post, you click "new post" and it will take you to the "New Post" page (http://localhost:3000/posts/new). You can also "Show" which means you just display that post by itself. You are able to also edit and delete any of the posts if you want. All of this magic is done by code in the files, which are connected through the Rails server.











Don't worry about the spelling and stuff above. This was just practice.

Still a little unsure on this Rails "magic" and how it works.

- K


Tuesday, December 3, 2013

Day 58

Decided to work on Rails again today. Okay, maybe not "decided' because literally have to get this stuff down, ha. Below is part of an assignment we had to work on today. It took a little bit longer than expected. Obviously it was my computer's fault or something...  

This needed to be generated into Models using Rails.


Using the text editor, I controlled what each one of the Models did. To the right is the "User" model. Which says you need a valid email, first name, and last name. That is what the :presence => "true" is for.





Here is some of that code (<--) on the command line. This is the Message model with 5 different entries in it. Each Message belongs to a post_id and user_id. Those corresponding Id's have many messages. An author and message is required for these to work. The created_at and updated_at are automatically updated by SQlite. Must be nice, right?



- Kyle

Monday, December 2, 2013

Day 57

Here is a little piece of what we had to do with Rails today.

Had to turn this,


Into this, using SQlite.











With some of the common commands including, .all, .valid?, .where, .order, .save, .create, and .errors. These are just a few of the many commands you need to know for Rails.

- Kyle

Sunday, December 1, 2013

Day 56

Today, I took my first day off since I have been here. I didn't write any code or open any editors. Was also, only the second day since we started that I did not head to the classroom. I decided to take some other programmers advice on the whole "burning out" thing.

Here is the productivity for the week. I am pretty sure that if I didn't take today off, I would of reached my 60 hours goal. O well. There is always next week. I can only say that for a few more weeks though....


- Kyle

Saturday, November 30, 2013

Day 55

It has been really dead around here with everyone still gone for break. With that said, I have just been messing around with some Parallax and doing some of the Rails practice all over again. I need to get all of the basics down before I can really move on.

I just did the Rails practice with the Command Line--instead of using the Powershell. Just a few different commands, most notably "dir" or list all. Thankfully, Google is there for you to look this stuff up.


Here is the Parallax I was messing around with. When you scroll down the top image gets "scrolled" over or replaced with the page beneath it. I was just going to make the main page pretty simple because, well, less is more. As of now, there is just some plain font with the menu bar at the top (hard to see) and kyleande.com in the middle. Like I said, I was just messing around, ha.


- Kyle


Friday, November 29, 2013

Day 54

Been working a lot today with Ruby on Rails (Rails) and the command line. Some of the things it can do is somewhat "magical." <- I am pretty sure it even says that in the documentation. Instead of typing everything out on the text editor or in the database, you just directly input things with the rails console. This makes things a lot faster. Also, Rails uses "gems" or plugins that have commands already done for you, so it is a lot more efficient.

Here are some of the tables I created in the database using SQLite and the command line.

So, this is how the database looks on the command line if you don't use the 'hirb' gem. This gem formats the db tables really nice and makes it easy to read (below).




- Kyle

Thursday, November 28, 2013

Day 53

                                      Packed house tonight on Thanksgiving.

                 

No days off,

- Kyle





Wednesday, November 27, 2013

Day 52

This blogging everyday thing is really starting to take its toll on me. There is only so much stuff I can come up with before people start asking, "what is this guy talking about?'

Today, I just messed around with some Parallax for my personal website (currently under construction). Here is one of the pictures I am thinking about using for my main background. High resolution pic of course.



- Kyle









Tuesday, November 26, 2013

Day 51

This week so far has been pretty dead, due to that fact that everyone is on "break." I am trying to get as much time in as possible--with the short amount of time we have left.

Since I now know how to add friends to my Facebook project, I am going to be attempting to add that in, as well as making everything with objects. I wanted to know how to make it so the request was pending, before I started this, but our instructor helped me with it. I just need to add another category to the friend table, which just needs to be a Boolean. Either stating NULL or unknown, "true" meaning we are friends, or "false" meaning friendship was rejected.

Here is a little of the code I was working on today with Ruby. One of the easier problems.

The neat thing about Ruby is that it makes everything so simple. I still am a little indifferent about not going on further with Python, though. The double basically multiplies the 2.double by two and you get 4, then 8 for the next one. 4.prev just returns the number before 4 or 3. Lastly, the 2 ".skips" just returns 5. Difficult, right?                                                                            








Should probably post some more difficult problems,

- Kyle

Monday, November 25, 2013

Day 50

Since I only have about 25 days left here, I am going to put in 12 hour days, everyday, for the next 25 days. That is really no different from what I have been doing, but this will just get me an extra 300 hours of programming (<-cool story). This last week I only put up 42 hours--which seems a bit off. The upgrade to the software must of messed up my tracked time or something.









Lackluster post,

- Kyle

Sunday, November 24, 2013

Day 49

It is weird to think that we only have 3 weeks left until we are done here. I still need to start my project--that I have yet to think of.... I would like to make an iOS app, but I don't have a Mac (yet) nor do I know Objective-C (yet). <- See how I set that up? Emphasis on yet.

I spent a little time today going over past PHP stuff and doing some more Ruby. I just did the third assignment, which took quite a while and two people to figure out (http://rayfarias.com)... The assignment was too simple and we were over thinking it. Also, I am still a little new to the syntax for Ruby. Those are my excuses.

Here is the code for what we were trying to figure out.

    a = {:first_name => "Kyle", :last_name => "Anderson"}
    b = {:first_name => "John", :last_name => "Rogers"}
    c = {:first_name => "Kory", :last_name => "Tony"}
    d = {:first_name => "Mike", :last_name => "Smith"}
    e = {:first_name => "Kirby", :last_name => "Puckett"}
    names = [a, b, c, d, e]
    name_string = names.count

    puts "You got " + name_string.to_s + " names in the 'names' string"
    names.each do |name|
puts "The name is #{name[:first_name]}, #{name[:last_name]}"
    end

This just went through and printed every first and last name out on the same line. Kind of like this (pretend the comma is not there),

Or, exactly like this, because this is the answer....






- Kyle

Saturday, November 23, 2013

Day 48

This error is going to be the death of me (<-- just a saying). I have been coming back to this, on and off, for the last 5 hours, but still, I keep getting this error. I have gotten the error before, but what I used before to fix it is not working and the answer sheet also has the same error. It is probably my computer, as it seems to be fighting me a lot lately. Before I just had to switch the position of my header('location : _____') ; on the process page, and that usually fixed the problem. Now that I am using classes, something is making it unhappy and wont let me proceed to the next page. This might be a sign of where I still need to spend a little time on classes before I move on to Ruby....


To be continued,

- Kyle

Friday, November 22, 2013

Day 47

Just got back from the downtown Mountain View (MV) with some of the fellow classmates. It was nice to get away from the computer for a little bit. Surprisingly, downtown MV is quite the happening place. Well, that is coming from someone who's from Michigan. So, by Cali standards it may not be "happening."

It is crazy to think that we only have 3 more weeks left here. We have next week off, but I will be here everyday--just like any other week.

I also finished the basic II assignment today. Yes, I actually did some work. Here is an example of one of the Ruby problems I had to figure out.

You had to generate an array with 10 random numbers between 55-100. Then place all of those numbers (not required) on the same line. This was done with the following syntax below.  Pretend the commented out line is not there. This was just for displaying the maximum value or highest number in those 10 random numbers. Not a big deal or anything.








Prints out the following. Easy stuff, right? -->


Since I got a shout out from a fellow classmate, I will plug his page on my blog. Check out http://binhnguyen.me. His first post is especially good. Well, it's okay haha..

- Kyle

Thursday, November 21, 2013

Day 46

Today was a good day because I finally got Rails version 4.0 installed on my computer! I am pretty sure my computer noticed the amount of time I was spending on Apple's website checking out their Macs. Luckily for my computer, the desperation attempt to get me to not buy a Mac will not work. Was a valiant effort though. "You miss a 100% of the shots you don't take" - Wayne Gretzky.

Here is the code for the basic Ruby assignment below. Let me remind you, by basic I mean the first one and supposedly easy. It may or may not have taken me a half an hour. I plead the fifth.

The top code is the "advanced" way, and the bottom is the way a noob like me would have written it as. I take full credit for both though.


Basically, this just takes an array of mathematical operations and gives them a number value from 0-3 and the .rand selects the random number. Whatever number is it, it will go with the corresponding operation in the array, and display that operation on the command line.

So, if the random number is 0, it will display "+" on the command line (we start with 0 around here). I am pretty sure that is the symbol for addition in California. Don't quote me on that.



- Kyle

Wednesday, November 20, 2013

Day 45

Sure would be nice if I could come up with some better titles for my posts....I guess I could go with, "Day 45, Coding and Such", or something... Ehhh, I think I will just stick with the safe bet..

I started to tackle Ruby today and it seemed like I have done it a little before because of how similar it is to Python. Similar because of how you use the command line in combination with your text editor. The syntax is a little different, especially when you have to say "puts" instead of print. Besides that, it shouldn't take too long to get used to. I really didn't get too deep into it, but I did mess around with the lessons and some command line jargon. 


========^

Blogger decided it wanted to fight me on the position of the blue. I just gave in. 

Not sure if it is the correct code on the left for what is being "put" on the command line (blue), but this just shows how these two work together. Get it--because in Ruby you use puts to print something.....?




- Kyle 

Tuesday, November 19, 2013

Day 44

I spent a little time today doing the styling of my Facebook project. I want to try and get at least one major part of it done each day. Here is what I have done so far with the search-bar. I want to make the search-bar connect to the database and pull out the names with an auto-complete of the name. Shouldn't be too hard, right? I think I wall have to make this a form, then send it to the process page and have some code to make it look like magic haha. I still have some work to do on the styling of the search-bar though. I need to get the placeholder font and placement exact.




Here is the code I used to get the search-bar to auto-complete. The '#tags' are for the input id in the HTML, that corresponds to the search-bar. When you click in the search-bar, the function runs (below) and if what you have typed in the search bar matches any of those four, you can select the one you want. I only put four for testing purposes.

<script>
$(document).ready(function() {
$(function() {

     var availableTags = [
     "Kyle Anderson",
     "Reggie Smith",
     "Amy John",
     "Bob Bobby",
   ];
 
       $( "#tags" ).autocomplete({
     source: availableTags
   });
 });
});

</script>

^ will probably be messed up when this is published.. Sigh...

- Kyle

Monday, November 18, 2013

Day 43

Here are all of my updates from last week on how I spent my time on the computer. Cool, I know....

Here is the total amount of hours I was actively on my computer for. I did not make 60 hours like I wanted to, but I will get there this week. I spent a little more time on Facebook than normal because I was doing my project and needed to reference it.


To the left is the amount of time I have spent thus far typing on my text editor. 100 hours isn't bad, but I thought it would have been a lot more. I guess I spend most of my time debugging the code than actually writing it. Kidding.. No, but, seriously.





Interesting to see that my most productive time was in the afternoon this time. This might change though since I have been getting up at 530 and I feel more awake when I arrive in the morning. We'll see how long this 530am nonsense lasts though.


- Kyle