Monday, February 10, 2014

Caret of Knowledge/Whoo Hexadecimal Color!

     Hello, all! I'm back again! Do I seem awake? That's because I am! French press FTW! So, Google music was being weird, I first played Foo Fighters radio on Pandora. I'm still in a Foo Fighters sort of jam, I suppose, but then I didn't want to make an account, so I'm on Grooveshark. Today I had an adventure in the world of ChromeOS! I downloaded about five text editors, but most of them just weren't my thing. I was down to Caret, and Tailor. I like Tailor better, but it's missing some key features like being able to save my work, but beside that and not being able to preview my work, I actually liked it. Yet, that was not to be, so I'm on Caret. Which is awesome. You can do HTML and CSS at the same time. Which I didn't think I'd be able to do on ChromeOS so, that saved me some bookoos (how DO you spell that word?) of money. Now I'm less poor than I could have been, it's time to plug in and plug away!


HTML/CSS





      Ah... Good 'ol coding! There's nothing quite like it! Well, the colors are coming out! the hexadecimal colors to be exact. I knew that this was gong to happen, I just thought it was going to a long time ago. But now that these colors have come out, I'll be coloring all the things!

     One of the things I was doing with Caret earlier was HTML. I had HTML and CSS running together. I save it to the computer and then open it and and it open up into the browser. You get a live preview of what you're working on. And that is so cool! I just have to figure out how to get .js into the mix. I assume that's coming down the road really fast. Also, I need to get Crouton going correctly so I can do some Linux stuff. Like Github. Anyhoo... back to the HTML/CSS. I am now on a review of the CSS that I've already done. It's pretty easy to remember the names of things in CSS because a lot of the names are the same.
     Now, if y'all remember, I said there would be more .js today, and there is! So, once I finish the review we'll head over there. Aaaaand yup. Nothing to write home about!


JavaScript





      We're still on <this>, folks. And I don't mind. This thing has a lot of different uses. I love it! Over the weekend, I did not get a chance to do any classwork(family birthdays, social protocols, yada yada yada) and this was the first weekend where I actually was excited to get back to my studies! I'm having so much fun doing this! Ok. The lesson that I'm working on had this:
var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function() {
 return this.sideLength * 4; };
 // help us define an area method here

 var p = square.calcPerimeter();
 var a = square.calcArea();
The instructions said to create a <calcArea>  function that gave the area, and to use the square.calcPerimeter as a guide. All I had to do was:
var calcArea = new Object();
square.calcArea = function(){
    return this.sideLength * this.sideLength;
};
Which, in hindsight was easy, but what to return was an issue,  because I had the wrong idea about area. I got it in the end. They've got me working on constructors now. They're like an Object, but more global. Here's an example:
function Person(name,age, gender) {
  this.name = name;
  this.age = age;
  this.species = "Homo Sapiens";
  this.gender=gender;
}

var sally = new Person("Sally Bowles",39, "f'male");
var holden = new Person("Holden Caulfield",16,"f'male");
console.log("sally's species is " + sally.species + " and their age is " + sally.age + "and their gender is " + sally.gender);
console.log("holden's species is " + holden.species + " and their age is " + holden.age + " and their gender is " + holden.gender);
Notice that I just write out everything on one line. This way, if I were to be working on something that would need a lot of the same thing with changes applied to the individual, this would work a lot better than the regular Objects. So, we have constructors. But, Objects are still useful in a smaller case-use.Well, that'll about do it for me, folks! I've had a blast getting into things. See y'all on Wednesday!

--Martin

Friday, February 7, 2014

Powercord + Bad Memory = Two Trips/ Finally Using The 'This' Keyword

     I did it! I got the coffee, which saved my life, AND I got more of the JavaScript done than I said I was going to. It was very frustrating, but now I know how to use the <for/in> loop stuff. I think.Today, I finally get to see what the <this>  keyword does. I've seen it all over the place in other people's code, but I've never used it. So, now I finally get to learn about it. Today is Friday, so I'm at the coffee shop, for the second time... I got here, got some tea, because; I'm a rebel like that, aaaaand no power cord. Seriously. I can't believe that I forgot it; I was going to work without it, but my Chromebook was dead. So, I drank my tea in peace, and then I had to go all the way back home and get my power cord. I'm back now and jamming to the Foo Fighters thanks to +Tejas Richard . I've got four of their albums on random, so I should be good to go for a very long time. And now it's time to plug in and plug away!




HTML/CSS




      Today I'm getting my first real taste of CSS. Now to see that I can keep up. First, they're making sure I can do tables with HTML so that I can use the tables for pictures, I think. It would seem that I was right. I'm making a table of pictures that link to stuff. You know, <a href> and shtuff. So, now to do the nine cells in the table and get this thing imaged up! I now know something new. The image that you see when the picture hasn't loaded yet, or doesn't load, is the HTML bits doing their thing. Well, consider me impressed. Here is a page laid out with just HTML:

And here is the same thing except that this code(<link type="text/css" rel="stylesheet" href="stylesheet.css"/>) was added in. That's it. And you get this:
That is very cool! Not really sure how that all worked, so let's go study what they're telling me.  
     So, the stylesheet bit is actually referencing a page called stylesheet.css(it's one tab over from the one I'm working on.) I didn't see the tab that had all the CSS goodness. So, as I thought, the(<link type="text/css" rel="stylesheet" href="stylesheet.css"/>) bit was referencing the CSS tab not just one line of code that does amazing things. And I feel stupid for thinking that could ever be a thing. OK, so now that the confusion is out of the way...
      Time for a coffee break! Delicious delicious coffee. Yeah, I couldn't go without it.



JavaScript





     Now for that fabled <this> keyword does! According to the lesson:"The keyword this acts as a placeholder, and will refer to whichever object called that method when the method is actually used." That's clear enough, I suppose. So, to break it down even more for youse guise, here's an example of when to use the <this> keyword thingie:
// here we define our method using "this", before we even introduce bob
var setAge = function (newAge) {
  this.age = newAge;
};
// now we make bob
var bob = new Object();
bob.age = 30;
bob.setAge = setAge;

// make susan here, and first give her an age of 25
var susan= new Object();
susan.age=25;
susan.setAge=setAge;


// here, update Susan's age to 35 using the method
susan.setAge(35);
So, anything with the (.age) at the end of it, is going to be run through the setAge function(if you do things correctly/ you want them to connect) it will patch you through and you have the magic of <this>! pletty cool, eh? I sure thought so! Which is where I'm going to end this! I know, I know, why so little on the .js, Martin? Well, it's hard that's why! Well, that and it's Friday. I promise to have more next time. So, I'm going to go study some more and report more on Monday. Have a nice weekend, y'all!

--Martin

Wednesday, February 5, 2014

So Late.../Debugging

     Well, it's a Wednesday, as we all know, and I'm at the house about to get a French press going again. My music of choice today, is one of my favorite modern singers. Allen Stone has done some amazing work. I love the jazzy style in his music. Today, I have hit my first real debugging issue ever. I was doing some lessons earlier today, and did exactly as the instructions said. That didn't really get me anywhere. Again, I have issue with the specialized console that I'm working with. It was giving me errors because I had an <else> to my <if> which is just crazy. There is no way that should interfere with anything, right? So, after getting through that craziness, I'm doing it again to ensure a better memorization of this lesson, there will be more after the HTML. So, now that I'v got that out of the way, time to plug in and plug away!
I really do love Allen Stone's music.


HTML




     So, the HTML, contrary to the JavaScript, is actually going quite nicely.  After finishing the tables section about monsters, I'm on to <div> and <span> I've already been dealing with <div> for a little while. I saw it on here, and did some research and found out how useful it is. I love it! You can make colors apply to exactly where you want it to. I'm so familiar with <span>, but I'm pretty sure I can take a stab at what it means. I suppose I'll find out when I get to it. So, <span> gives you more finite control. Let me give you a visual demo:
     Hello, my name is <div> and I make it so that when you hit enter things stay the same, but when I get
brought in
things get pushed around and there's not much you can do about it.
     See? I didn't put a <br /> tag in there or anything, that's just how it does things.
OK, let's try <span>:
      Hello my name is <span> and I don't mess things up. So, When I get called, You barely notice.
The <span> is around the "I" in case you didn't notice. Sly, right? Indeed. OK. Back to business!
     Well,I've been working away and now it looks as though I may need to have HTML/CSS as the header on this section. All done here for now!


JavaScript




      Man. Today the .js has been winning instead of the other way around. I just don't know about this, man. I think I need to take a step back and maybe a few chapters as well. They're just brushing over things that I barely have even heard of! So, What I'm going to do, is go back a few chapters and reexamine them tomorrow. This won't upset my progress, because; I'll be where I am now by Friday.       So, with that in mind, I'm going to finish what I'm working on now. I seriously did not like the debugging experience, but I know that it's a part of the process. So, just to clarify, I'm not discouraged, I just realize that I have so more to learn and need to reinforce certain areas. Which I think, is a good thing to do all the time anyways.
      I am getting it to work! Which is where I'm going to end this! The coffee, by the by, was TERRIBLE and I am definitely getting something tomorrow better than what I found lingering in the cabinets. So, tomorrow, I have two things: One: get some good coffee beans from the coffee shop. Two: Analyze the last few chapters of .js. I'll report back on Friday! See y'all!!

--Martin

Monday, February 3, 2014

I'm Blind, But Awesome Still Happened!

     Well, it's no longer pleasant outside. It's actually frigid out there. Which is why I'm indoors with a nice cappuccino. After Fighting valiantly against the elements, I made it to my coffee shop of choice, and quickly got some hot caffeine. I have a Flightless Bird by Iron and Wine themed playlist going, I have my cappuccino, I've done some cursory puttering, so it's time to plug in and plug away! 


HTML5



      Well, after having some issues getting my text to align on the center, turns out I needed to say text-align, not font-align, seems it depends on things. Not sure what those things are, but they're there.      Anyhoo, back to the lesson at hand. So, as I'm sure all of us are aware, you need to make sure that when you write some code, spacing matters!! I can't believe I just spent seven minutes thinking I had the syntax of the code incorrectly laid out, when really, I just needed a space! I am so blind...
     And now the internet is down. That's ironic. I come here, because; the wifi is better than what I have at my house, and now it's dead.
     Aaaaand it's back.
     OK, so, I'm dealing with tables now. Table data is pretty much cells and columns. I just created a single-column table. So, that's what you'll probably see on here at some point. Pretty much, once I learn something in HTML, I'm able to apply it to here.
      These guys really like the monsters and super heroes and such. +1 for them! Here's an example:
<html>
    <head>
        <title>Table Time</title>
    </head>
 
    <body>
     
        <table border="1px">
            <tr>
                <td>King Kong</td>
                <td>1933</td>  
            </tr>
         
            <tr>
                <td>Dracula</td>
                <td>1897</td>
            </tr>
         
            <tr>
                <td>Bride of Frankenstein</td>
                <td>1935</td>
            </tr>
        </table>
     
    </body>

</html>
 
     At first, I saw the year by Dracula backwards. I was like: Dracula is not my age! 1987, what? But then I saw that it was 1897 not 1987. It would seem I'm suffering from a mild case of dyslexia today.

JavaScript

     Continuing with the whole Arrays and Objects things, I have been working on them in my lessons once again. This time I'm working on Object constructors. They're pretty much a way to assign things to an Object more easily. Here's an example for those that don't know what that looks like:
var me = new Object();
me.name="Mookie";
me.age=24;
The capitalization of the 'O' in Object is, as in everything in .js, quite important.

THAT WAS AWESOME!!

     The lesson was to create a an array with a first element  that should be a number, its second should be a boolean, its third should be a string, and its fourth should be... an object. They didn't say how to do it, you have to look at the hint, but I figured it out how to do it and it worked! Olé! That makes me feel good about myself that I was able to figure it out and get it to work. I feel like they're trying to get me to do more, but not stuff that I can't handle. I like it. 

     Today has been quite the adventure! I had to relocate after the HTML because life happened, butI was still able to get everything done. I'm very happy about the fart that I was able to work those arrays, and get the Objects and arrays working together. 

Friday, January 31, 2014

Syntax, My Dear

     It is a lovely Friday here in Texas and I am back at it! I'm here at the coffee shop getting ye 'ol caffeine going. I have been true to my lowering the caffeine amount, but I sure do miss it. So, I'm happy to have my cup 'o Joe today. So, now that I've got that and Freaks by Hawk in Paris playing, I'm ready to plug in and plug away!


                                       HTML5


     After acing the test for all the HTML that I've learned over the course of the last few days, I moved on to a social networking profile for King Kong.  That's not something you say every day.   To start they want me to make ME a profile. This:https://lh5.googleusercontent.com/-gq0oYM8KXyA/UupJccVf9NI/AAAAAAAB-tg/_F3b13eH30Q/w852-h608/but-first-coffee_0.jpg
was the picture that I went for my profile pic. I think that works just fine. I'm actually really picking up this HTML stuff really well! I think I'm starting to get how to learn how to learn programming more easily. Pretty sure my synapses are starting to realign themselves so that I remember text better. 
     I finished the social profile! I am now the social profile maker of awesome!

Olé! Now, onward to the JavaScript!



                                    JavaScript                  






     And we're meeting the Logical Operators again! There are three Logical Operators in JavaScript and they are: 'and' (&&), 'or'(||), and 'not'(!) I've already dealt with these, but now they're being again. Starting with: 


var iLoveJavaScript = true;

var iLoveLearning = true;

if(iLoveJavaScript && iLoveLearning) {

  // if iLoveJavaScript AND iLoveLearning:
  console.log("Awesome! Let's keep learning!");
} else if(!(iLoveJavaScript || iLoveLearning)) {
  // if NOT iLoveJavaScript OR iLoveLearning:
  console.log("Let's see if we can change your mind.");
} else {
  console.log("You only like one but not the other? We'll work on it.");

}
Which works out well, because; I do love learning.  
     And now to work on a Choose Your Own Adventure game involving a troll. I'm making a game, on the internet, about a troll. Irony thy name is Choose Your Own Adventure.
     So, it would seem that yet again the people writing out the lessons forgot to tell me something important... Let me explain; here's what they told me to do: do a variable that includes a prompt. Make the prompt have a <.toLowerCase> or a <toUpperCase> at the end and then create some switch statements. This is what I made:

var user = prompt("What is your quest?","Answer here.").toUpperCase();


switch(user){

    case "Bacon.":
        console.log("That's not a quest!");
        break;
    case "To seek the Holy Grail":
        console.log("Right. Off you go.");
        break;
    case"To be bored and alive":
        console.log("That's not a quest, that's what a teenager says.");
        break;
    default:
        console.log("That... isn't in the records, but whatever. Go away.");
}

     Now, at first, I didn't know why I was only getting the default switch statement. Turns out, you need to uppercase your cases like this:

  case "BACON.":
        console.log("That's not a quest!");

        break;
so that they will be the same. They didn't tell me that. Deductive reasoning alone got me through that lesson after some loss of time. Seriously, I think someone that didn't really know what they were doing made this entire series and was overseen by someone who just glanced around to make sure things ran. There should be some kind of beta testing or something for anything like this. But, I digress. Onward to the rest of the studies! 

     So, after battling my way through that, I am now moving on to Arrays and Objects. Which, I know I've gone over before, but it's never a bad thing to brush up on things already studied at this stage. You can put arrays inside other arrays? Array-ception! 

     So, you can nest other arrays in Dimensional arrays: var array=[["Hello", "Hi"],[23,46]];
Which all have the same  amount of elements as nests (number of[]'s) how many dimensions the array has is governed by how many nests it has. So, in this case, it's a two dimensional array.
And Jagged Arrays: var array=[["burp","Pizza"],["questions",42,"life"],[13]];
Which don't have the same amount of elements in their respective nests, but can still be used in the same manner. 
     Well, a lot has been done today! Good thing for the coffee!  I just have to remember syntax! Syntax,syntax,syntax!! From what I've heard, that's just something any programmer has to be aware of. So, keeping that in mind, I'll see y'all Monday!

--Martin