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

Sunday, November 17, 2013

Day 42

Finally finished the intermediate II assignment with the Ajax incorporated. Here is what the Ajax looks like.

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

$('#country_form').submit(function()
{

  $.post
  (
      $(this).attr('action'),
      $(this).serialize(),
      function(response)
     {
  // console.log(response);
         $('#results').empty();
$('#results').append('<h4>Country Information</h4>');
          $('#results').append('<p>Name: ' + response['Name'] + '</p>');
         $('#results').append('<p>Continent: ' + response['Continent'] + '</p>');
          $('#results').append('<p>Region: ' + response['Region'] + '</p>');
         $('#results').append('<p>Population: ' + response['Population'] + '</p>');
         $('#results').append('<p>Life Expectancy: ' + response['LifeExp'] + '</p>');
         $('#results').append('<p>Government Form: ' + response['GovForm'] + '</p>');
     },
      "json"
   );
return false;
});

});
</script>

Basically, this is getting the information from the process page and displaying it or "appending" it to the results id on the bottom of the index page. The .empty() makes sure that when the page is loaded there is nothing displayed until you select something.

Information (below) from the process page that is getting sent back to the index page. The information in the echo json_encode($country_data) is getting sent over and "caught" by the "function(response)" in the above script.



Here is what .empty() does. When the page is loaded, there is no info.

When a Country is selected, the information displays, with the page not having to reload to get the information.








- Kyle

Saturday, November 16, 2013

Day 41

Doing the intermediate OOP assignment the last two days has been pretty tough. I have probably spent over 12 hours just trying to get the assignment done without using Ajax. The Ajax portion is just for getting everything to update without the page having to reload. Getting all of the functions to work with one another and incorporating the database makes this assignment difficult. I don't even want to know what the advanced assignment looks like.

This is what the assignment is supposed to look like when it is finished. When you select a country, there is a drop down box that displays every country that is stored in the database. Then when you click on the "Check Info" box, the information will appear below.







This is what mine looks like without any styling and no Ajax incorporated into it. When it is finished it will just update the country information without the page having to reload.








- Kyle

Friday, November 15, 2013

Day 40

I am on 32 days in a row right now since I have taken a day off; that day off was just coding in my room at the condo. So, with an average of 12 hours a day (give or take a few hours... Mostly give) for 32 days, I have put in about 384 hours at school in that time frame. I would say that is at least 2 years of learning on my own or maybe even more because of how good the help is and the curriculum. Having a set course to follow with feedback given helps tremendously. Below is the formula I used to solve the amount of hours I have put in for the mentioned time. Many pieces of paper were ripped up solving this, haha.


- Kyle

Thursday, November 14, 2013

Day 39

Well, I started to do OOP again today, but I got side-tracked and just worked on my Facebook project for most of the day. All of the pages are linked to one another and are functional.. Well, as "functional" as they can be right now. The Forgot Password page displays errors if you don't meet the criteria that is required. I did that with an associative array and then calling them from the process page,to the Password page, I still have a lot of work to do with the styling and databases, but this is what I have done so far. I am using all of my own code, so it is taking me a long time with all of the minor details. I am learning a lot though.

Code (below) to set the error messages so far. I am still going to add some more and get the database to send a message (with the new password) to the user when the info is correct. Might take me awhile to figure that one out, ha.
















Login/Sign up page
Forget Password page
News Feed
Profile page






















Still have a lot to do with this project,

- Kyle

Wednesday, November 13, 2013

Day 38

I spent most of the day going back in the course material and doing the advanced Ajax assignment. It is an add-on to the first assignment, where we posted notes on the page, but now includes deleting and editing each post, along with adding a title to each post. I really had no idea how to start this one with the jQuery, but I got a lot of help with the assignment and I think I get it now. I am trying to do it on my own now, but it is going to take quite a bit of time. Here is what it is going to look like in the end. Well, hopefully.


To get away from coding and the computer for awhile, we head to a park in Sunnyvale to play some sports, every Wednesday. Here is a pic of some of the fellow classmates playing some basketball. I was on the sidelines because of injury prone factors. Not like I didn't get picked or anything. No, I really did not want to roll an ankle, so I chose to sit out. It was an executive decision.















- Kyle

Tuesday, November 12, 2013

Day 37

I am pretty exhausted today, as I am starting to get on this 530am wake up schedule, so I can work out. Been kind of slacking these last 5 weeks because, well, all I do is go on the computer. I did another 14 hours today and feel like I need to put a little more time in because I want to get done with OOP tomorrow. I want to start to work on my own site --> mranderson.co (surprisingly this domain was available) and make it parallax with the matrix numbers falling down the screen--giving it a 3D effect. Shouldn't be too hard, right..? 

Something like this, 



If you are looking for a site to use some good fonts, check out https://typekit.com/.. I am just going to leave this link as it is because for some reason they all turn out to be broken links when I mess with them on blogger. Should get that fixed, guys. 

- Kyle 

Monday, November 11, 2013

Day 36

I have really been all over the place the last few days.. Going from OOP (object-oriented programming), to Ajax, to my Facebook wall, to my own site. With all of that, I think I am finally starting to get OOP down. It is quite confusing at times--with all of the terminology, but it is also one of the most important aspects to programming. It saves you a ton of time from having to repeat yourself over and over. You can just use another instance of a class or "blueprint" and add on to it. Just like anything though, it just takes time before it finally "clicks." I also had some time to actually think and read to myself today. I went outside and worked for a few hours. Only in California (maybe) can you sit outside at 8pm on the computer, in 60 degree weather.


Not my best post,

- Kyle

Sunday, November 10, 2013

Day 35

I tried to work at home today because I have not taken a day off in a month. But, I wasn't getting anything done and have too much to learn--so I came in again. I think the only day I didn't come here was the first Sunday of the class. I still worked from home that day, though. Here's to hopefully not burning out....

As usual, here is my weekly update of my productivity for the week.  Next week I am going to shoot for 60 hours and a little less of a productivity rate haha. I need to do something besides software development at least for a little bit of the week. I guess a good thing is that I only spent 1% of my time on social media.










The new class comes in tomorrow.. So it should be cool to see some new people who are ready to learn how to build some cool stuff,

- Kyle

Saturday, November 9, 2013

Day 34

                                       --- 15 minutes to turn this in ---
I did some more of my Facebook replica today. I spent 3 hours doing it and I barley got anything done. I have come to realize that this is going to take me a lot longer than anticipated. Here is a pic of the wall part of it so far. I have the messages and comments working. Everything the user does gets logged into the database and then posted on the page. Each message is given an ID and then the users use that to match the comment ID. That is the tricky part. Many errors have arisen from trying to get this to work. It seemed liked getting it to work the first time went a lot smoother. The styling takes forever as well. Not sure how Mark (yes, we are on first name basis) did this all by himself, when he was like 19.

Here is a rough draft of what I have done so far.



Hopefully, I don't get a cease and desist letter haha.. But, seriously........


- Kyle

Friday, November 8, 2013

Day 33

---- I put this on my LinkedIn last night, so I apologize if the site is down from the servers not being able to handle all of the traffic.. ----

^ last thing that is going to happen

Just got back from a night out with some of the fellow classmates. It was one of our classmates "birthday" so we got some drinks to celebrate. Birthday is in quotes because his birthday is next week sometime, so it was a little premature of us to celebrate... Bros will be bros though..  It was good to get away from the computer for a little bit and just hang out, but the whole time I was just thinking about getting back to coding. Which might be kind of sad, but that is just how it is.

Today, I finished up the 2nd Ajax assignment and started to dabble a little into the Object-oriented programming section. This might be frowned upon a little because I still have two more assignments to go in Ajax. Good thing nobody reads this thing... The assignment I did was pretty cool. I used another sites API and got the temperature in a certain city in real time. The code is pretty short (below). The trouble was actually getting it to run though.....


I also needed to get away from the chair I sit in everyday for 12 hours, so I decided to go outside for a little. It was actually nice to see the sun for once.

To answer your question, yes, those are New Balance cross-trainers.

The life -->

-  Kyle

Thursday, November 7, 2013

Day 32

I tried doing the first Ajax assignment again today and for some divine reason, it did not want to work. Basically, I spent the whole day doing my Facebook wall and debugging the first Ajax assignment. I finally "kinda" got it to work a few hours ago, but not in the exact way I wanted, so I moved on. Here is what it looks from the first one I did.

This is what the first assignment of Ajax looks like.There is very little styling, so it does not look the best, but it does the job--or something. Basically, you type something in the box and it sends that text to the database and pics it back up and post it on the same page, without having to reload. Well, that and hundreds of lines of code that we wont get into.

What it looks like when you post some notes. I didn't really write anything of importance in the boxes. Cool story, I know.

Here is what a preview of my Facebook looks like. This is just a draft of the registration/login page. As you can see, I like that shade of blue. I like having the registration on the left because I feel it evens out the page. I am doing this all in PHP at the moment, so I might take awhile, ha. 

Please don't sue me Facebook--this is just for a project,

- Kyle 

Wednesday, November 6, 2013

Day 31

Today, I spent most of the day doing Ajax and the dreaded wall. This whole Facebook idea is really starting to become a pain haha. That and being a "perfectionist." I can't stop until it is perfect or until it starts to interfere with my other work. As for jQuery, I am still a little unsure of what each part of the jQuery syntax means because it has been a few weeks since we have done jQuery. Here is one if the main function we have been using with Ajax.

Ok, I am going to try and explain this; here goes nothing...
First when the document is ready it runs the function. Then skip the next line where the .submit is defined and goes all the way down to where it is called at $('.form').submit().
.form is just what the class of the form is called below (not shown, I only have so much space, give a guy a break). The .submit function is called and goes to .post, which needs 4 pieces of data (copying this from my notes on the page, don't judge). The first line is just saying where the form is going, which is called action="process.php." Goes to that page and turns the data from the form into a string. Then runs the response from the process page and logs the response in the console, which lets you see the string on the browser. Then it's going to alter the HTML on the results (#results) div with the response that was set to notes. The last line just turns it into an empty string (the value of the id message) when you submit.. "Explained" this super fast.

Did that make any sense? Ya, didn't think so. I only have 5 minutes to turn this in, so that is my excuse.

Will post the rest of my wall tomorrow (hopefully),

- Kyle

Tuesday, November 5, 2013

Day 30

I cant believe it has already been 30 days here. In those 30 days, all I have done is code, sleep, eat, and do laundry on Sunday. O, ya, and swim. How could I forget that one.. I don't really miss any of the things I used to do because learning new languages and writing code is a lot of fun to me. Blah, blah...

Anyways, today I started to do Ajax. I am still kind of amazed at what it can do from one of the lecture problems we had to do. It is a list of names with email addresses that is set up in the database. You can type in the name box and in real time it will sort the first letter of the first or last names in the table. Below, as in the picture below where I am typing (the first one), is the table with nothing typed in the text box. But, when you type "K" in the name box, it will sort all of the names (first or last) that start with K. It does this in real time, meaning the page doesn't need to reload. For this picture, please refer to the second picture located on this page. It would be quite an awful experience if every time you wanted to sort something, it would take time to reload the page. Personally, I would say (pardon my french here -->) F this, and close the page.



<- Letter K typed in the box (if you can't see)










Not sure how I feel about the lack of colors on this page,

- Kyle

Monday, November 4, 2013

Day 29

Well, the test did not go so hot yesterday and we will just leave it at that. There was a security breach or something on my computer....... I will just take it again this weekend and make sure I am ready for anything. I am not too worried though, because there is still a ton of stuff to learn about PHP. We only have scratched the surface in the 2 weeks we have been learning it.

Today I started to do Ajax because, well, I needed a break from PHP. Ajax allows you to send a receive data from the server without disrupting the page. An example of this is liking a comment on Facebook or typing in the Google search box and having the text complete come up for your search. Basically, the page doesn't need to reload each time you do something. The syntax for Ajax involves PHP and jQuery, but peicing those together could get a little tricky.


The most hours put it to date, since I have been at the Coding Dojo. I want to say that the most hours I have ever logged in a week was 70, but I could be wrong. Makes me think what I would of did for 70 hours on the computer earlier this year.

My Facebook log in page is almost finished,

- Kyle

Sunday, November 3, 2013

Day 28

Tomorrow we start week 5...? I think that's what it is.. I guess we will just go with that. The past 4 weeks have been awesome. I have learned so much in the time I have been here. From where I was a month ago, to where I am now, is truly remarkable. I am about a year ahead of where I would be if I kept learning on my own. Working with peers and getting help from the knowledgeable staff here accelerates the learning process tenfold. Again, if you want to learn this stuff, I highly recommend coming to the Coding Dojo codingdojo.co (<= Oh Blogger and your links, how you insist on always being a clicked link) or one of the other programming schools around the country. There are 6 or so in the Bay Area alone.

I am still working on my new version of the wall, but I have to take my belt test before midnight. I actually found out it is the green belt and not the red belt test. Same thing though, right? It should take about four hours, so I am going to start it now.



Wish me luck,

- Kyle

Saturday, November 2, 2013

Day 27

I said I was going to take today off, but I just had to come in and code. It might be sad, but it is just something I really enjoy doing. It is basically the only thing I want to do. I actually saw football on TV today and remembered how much I liked sports, ha.

I ended up going through old PHP assignments to prepare for the test tomorrow. I still need to get my yellow belt sticker, though. Whats up with that? Also, I am re-doing my wall to get everything down. The first time I did the wall it took me about 12 hours (more like 18), so hopefully I can kick it out in 6 this time.

Here is just the beginning of the new log in/registration page. It looks a lot like my last one, but I am going to wait until everything is functional first, before I style everything. I mean, I did make the buttons blue at least. The amount of code that goes into this is quite amazing. My finished wall from yesterday had about 600 lines of code and that was without a lot of styling on it. I cant imagine how much goes into making Facebook (facebook.com). <-- Plug, What up Facebook, if you want to throw some stock my way, I'm down with that.


Some of the guys working late at the Dojo in the "ThinkTank." All day, everyday.



Here's to the red belt test tomorrow,

- Kyle

Friday, November 1, 2013

Day 26 & Demo Day

         ----The title of this blog post has no affiliation with the R&B group Day 26.----

After 9 weeks of intense programming, the class before us had their demo day. Demo day is where students show of the project/s that they have been working on for the last few weeks, with the skills they acquired from the Coding Dojo. Some of them were pretty sweet and I think a couple of students were even offered jobs. You can tell a lot of the students put a great deal of time in them. Just to get an idea you had working on the computer is an accomplishment in itself.

After about 3 or so days, I finally finished my wall. All of the content works with the database and displays on the page. I am definitely going to do it again, before I take the red belt test this weekend. I feel like it is the best way to practice, since it involves everything you need from PHP. To the right is some of the code that I finally got to run and log into the database. The register and log in page let you either register if you are a first time user or log in if you already have registered. The database I created stores the log in info and uses the code to tell whether your log in is valid. I pretty much made the log in/registration page simple because I was more focused on getting everything to work, than the aesthetics of the page. Hopefully by Sunday I will have the prettier one up.


A little nervous now about demo day,

- Kyle