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