Friday, February 28, 2014

Links/Do You Even Do Age, Bro?

  Today, as I'm sure the job-weary are aware, is Friday! And that means I'm at the coffee shop! I had a big frappé, and it was delicious! Now to capitalize on this energy! As I said in the last post, I finished the HTML course(olé!) and this has a good side and a bad side. The good side is that I am happy with what I learned, the bad news is that in the next course HTML course that I'm taking starts with the basics. While I appreciate going over the fundamentals, it means that I really don't have anything HTML/CSS related to report today. Bear with me while I slog through and get to a place that I don't know about. I should have something by Monday unless they really want to explain elements, or something along those lines. The new course is on Udacity (<<--link)for those of you looking for a place to learn HTML. They don't cover CSS, sadly. I'll have to look for somewhere that does. Now that the frappé has been imbibed, and Grooveshark is going(again). It's time to plug in and plug away!



JavaScript




      Today we're going to be writing a validation script. It's going to check if a person(under the premise that they're being honest) is old enough to enter a website. It's about 8 lines of code, but it really shows how much you can do with just 8 lines of code in .js. We start off with this:

var userAge = parseInt(prompt());
Notice the new word: parseInt; it's a fairly obvious term. The variable <userAge> returns a string, so rather than setting userAge equal to the prompt, you put a function around the prompt that will return the value that prompt() gets from the user into a number, and that means you parse an integer with <parseInt>! pretty nifty, eh? I thought so.

Next up we have this:

if(isNaN(userAge)){
    console.log("Not a number,bro.");
}

It's checking to see if the response wasn't a number. ParseInt can only turn a string into a number if it is a number, obviously. So, you make an <if/else> that makes sure that the person entered what was wanted. This is a good practice for pretty much anything ever when it comes to this kind of thing.
You should also notice the use of <isNaN>. isNaN stands for is not a number. Like many things in .js there are tons of these little words that are so useful, and this is definitely one of them. So, next time you need to have something that checks if something is returning a number, it's <isNaN> to the rescue! You just stick your parameter in there, userAge in this case, and it's good to go.

The next step is a simple < else if/else> setup:

else if(userAge<18){
    console.log("You're not allowed in here, young whippersnapper!");
}else{
    console.log("Come on in!");
}

That pretty much explains itself, so here's the whole script:

var userAge = parseInt(prompt("Do you even do age, bro?"));
if(isNaN(userAge)){
    console.log("Not a number,bro.");
}else if(userAge<18){
    console.log("You're not allowed in here, young whippersnapper!");
}else{
    console.log("Come on in!");
}

That should be enough info to take in for now. I hope y'all have an amazing weekend, I'll see you on Monday! It might be a late post, it's possible I'll have a million things to do. See y'all!

--Martin

Wednesday, February 26, 2014

I Finished the course!/.js is still a-happening.

     I already know that this is late because I'm writing the intro last. What, I can do that. It's called mixing things up. I do that sometimes. The good news is that I finished the HTML/CSS lesson! Olé! The boring news is that I still have a ways to go with the .js. Not really sure that's boring since that just means I'll be learning a lot more new things. Learning new things is always fun. So, I take the back the boring other news is that .js is still going on.  Ye olde(See, I did it again!) grooveShark is still blazing away. No coffee today. Just pure gumption over here! Time to plug in and plug away!

HTML/CSS


     Working away ye olde(I say ye olde too much) HTML/CSS again. Remember that website about an angry puppy from a while back? right around when I started CSS. They had me build it now. Which was weird, because; I knew what they were talking about! Whaaaaat?? That is just weird. The play on words was delightful. I'm working on positioning(still) and I am using it to make a "resumé" and they said how to "position" yourself. I laughed. Good grammar and a funny play on words is always delightful. Today was review. Lots of review.
     And now I know why! I'm done the lesson! Good thing I've got plenty of classes elsewhere that use HTML.


JavaScript


     First up are the notations. I've already gone over them, but today's theme seems to be review.
First there is Literal notation. "Literal notation creates a single object. It uses curly brackets { } and the object's default properties are defined within the brackets using <property:value> notation.
I find this to be the quickest when it applied to a small number of elements.

     Second is the Construction notation. "Constructor notation involves defining an object constructor. And like defining a function, we use the function keyword. You can think of this constructor as a "template" from which you can create multiple objects. To create a new object from a constructor, we use the new keyword."
I use this one when you have multiple elements with same properties.  For example:
//this one is the Construction notation.
var james = {
    job : "programmer",
    married : false
 
};
//This one is the Literal notation.
function Person(job, married) {
    this.job = job;
    this.married = married;
}

var gabby = new Person("student",true);

     See how many lines of code are needed in a Construction notation for one Object?
The Literal notation has more lines of code up front, but then you're able to add more in one line later on. The Construction notation has its uses, but, usually, in a more singular case. I say usually, because; everyone has their own way of doing things, and I'm sure that for some people, the Construction notation is their go-to trigger. My go-to trigger is my laptop. I found my old laptop, which means that I might be talking about a game soon. It's running ElementaryOS. I think I'll try and get Sublime Text or something along those lines and take a crack at it. That's all for today, folks! See y'all Friday!

--Martin

Monday, February 24, 2014

500, What?/Nothing Of Importance.

     It's Monday. Again. It keeps happening, man! No matter what I do, there's Monday! No-one gets away from Monday. I've had my coffee, but I'm still exhausted! I can barely keep my eyes open! I'll try to get this thing going quickly. Sound City is playing from G music. "From Can To Can't" is my favorite song in the album. Now, time to plug in and plug away!


HTML/CSS




      It seems that I've done 500 lessons! That's nifty. The lesson says I'm about 70% complete with HTML/CSS. Again, that's nifty. Really, I need to find out how to make a game with my new-found powers. Right now I'm working on positioning. Working with Margin, Padding, Border, and Content; you get abbreviations like 'TP' 'TM' 'TB' The 'T' stands for 'Top' the other are: 'Padding', 'Margin', and 'Border' respectably. I've already worked with margin somewhat, you have: auto, but you can also do something like:

div { 'margin-top: 5px; margin-right: 10px; margin-bottom: 5px; margin-left: 10px;}

Or, you can do:

div{margin:5px 10px 5px 10px;}

it's the same thing. You would use the first example when you're trying to specify less than all of the aspects of a tag's properties. Maybe just the left and the right, or something similar.
      You also have the same thing with Padding. You can also use negative positioning. Such as: div{margin-left:-20px;} instead of moving the object twenty pixel's worth to the right from the closest border, it would move it 20 pixels closer. Maybe even past it.
      Then there's float. You can move that left or right. Unfortunately, sometimes large floating elements get mixed with non-floating ones, and elements do end up on top of each other. To combat this, you use <clear> you can clear left, right, or both.
      If you don't specify an element's positioning type, it defaults to static. This is when you use <position>. You have absolute, which means that it's going to stay the same distance from its first parent element it has that doesn't have position: static. If there's no such element, the element with position: absolute gets positioned relative to <html>.
      Relative is another term, but also more straightforward: it tells the element to move relative to where it would have landed if it just had the default static positioning.
      Finally, we come to fixed positioning. Fixed anchors an element to the browser window; you can think of it as gluing the element to the screen. If you scroll up and down, the fixed element stays put even as other elements scroll past. Hipster websites loved that trick for while there.


JavaScript




      Nothing of importance to report on this one. I'm working away, but it's just reinforcement. I'll have more on Wednesday. See y'all then!

--Martin

Friday, February 21, 2014

Groovy, Man!/ Friends In Address Books

     Here I am at the coffee shop once again. I've got GrooveShark going. Click the link for the playlist that I'm playing. I've been on this one for a while, and I still like it! Always a solid electronic song going on. I've had a latté, I may get a regular coffee at some point to keep my eyes open. Friday being its usual self, I'd rather get this over quickly, but I need to put some time in. So, time to plug in and plug away!


HTML/CSS





      I'm sorting my friends! It feels a bit like circles in g+. They're even using Google colors. Anyhoo, it's the CSS I'm looking at. they pretty much don't care to teach you how to make a circle border. It's just there. Seriously. Don't just throw things at me, tell me what they are! Good thing ye olde Personal Initiative is still around.
div {
display: inline-block;
margin-left: 5px;
height:100px;
width:100px;
border-radius:100%;
border:2px solid black;
}
And that's how to do a circle border.
Now they teach me something cool. You can have an <id> and a <class> in the same tag. That is definitely nifty! Lots of uses for that. And I finished. That was quick. Looks like we're about to get into this:

I'll continue with that in the next post.












JavaScript




      Isn't it funny how normal it can become that a single letter being incorrectly capitalized eventually is not so stupid any more? It's perfectly logical that the computer would have a binary (heh. I made a play on words) track. It's either right, or it's wrong. There is no such thing as close. That's totally normal for me now! How strange... The Address Book of happening is still happening. I was trying to get it to print out a return on a search and it just wasn't working. It wasn't until I hunkered down and really scrutinized the code that I discovered my error. A lower-case 'l'. How thoughtless of me. I shall endeavour a better attempt at correct grammar today. After smashing my way Neanderthal-style through the lesson I moved on to adding more people in an easier method.
Starting off with this function:

var add = function(firstName,lastName,email,phoneNumber){
    contacts[contacts.length] = {
    firstName: firstName,
    lastName: lastName,
    phoneNumber: phoneNumber,
    email: email
};
It allows for any additions to be done with one line of code like this:

add("Mookie","Chess","example@example.com", 9003006000);

It doesn't print anything, it just adds that person to the address book. In order to see if actually worked, we use this:

list();

If you recall, that was part of the earlier code.
Turns out, it actually has a use.
And project Address Book is complete!










Olé!
Now it is time to bid you adieu. See y'all on Monday!

--Martin

Wednesday, February 19, 2014

Headway/Nothin much.

     Well, I have a donut, a coffee, some random music, it's time to plug in and plug away.

HTML/CSS



     Nothing of any interest to report on this front.

JavaScript



      Hey, it's the .js time! I actually made some headway!  Olé!
I am still on Objects! What? Yup. Still working on ye olde Objects... BUT the good news, as I said, is that I made some headway! I finished a 33 section chapter today, and in the last section, I did in one try, and knew what I needed to do! So, yay for that! And now onward to the next ones. I am now working on this: var bob = {
    firstName: "Bobi",
    lastName: "Jones",
    phoneNumber: "(650) 777-7777",
    email: "bob.jones@example.com"
};

var mary = {
    firstName: "Mark",
    lastName: "Johnson",
    phoneNumber: "(650) 888-8888",
    email: "mary.johnson@example.com"
};

var contacts = [bob, mary];

function printPerson(person) {
    console.log(person.firstName + " " + person.lastName);
}
var list = function(){};
var contactsLength=contacts.length;
for (var i = 0; i<contacts.length; i++){
    printPerson(contacts[i]);
}
Here's the thing, half of that code isn't needed. Like the array <contacts>, take it out and it still works just the same. Am I missing something here? I feel like I'm missing something here.

Monday, February 17, 2014

Beautiful Weather/ Not A Walk In The Park

     It's a beautiful day here in Texas. I had to take a break from my studies and go for a walk to enjoy this gorgeous weather. One of my friends told me that Katie Herzig was giving all of her music away for free today. So, that's what I was listening to. It was pretty good. I actually got my studies on a roll today. So, this is actually going to go out on time! No coffee today. I'm awake enough from all the amazing weather. So, time to plug in and plug away!


HTML/CSS






      I've been doing HTML just long enough for that picture to make my eye twitch just a little. Ever since I started learning HTML I've been writing these posts in HTML and I'll get little error messages if a tag isn't closed, or something. So, I'm more perceptive to tags lately. Mainly because I don't like the error messages. I'm pretty sure that I don't really care for the <nth-child> tag when it comes to calling a specific element. I mean, what's wrong with class or id? Although, I suppose that maybe some tags can't have those in there. So, maybe that's when they're useful. Hopefully.
I earned a badge! Olé!





JavaScript




      JavaScript. So useful, and yet so daunting. I seriously need to start doing some real world applications to have some real knowledge under ye olde metaphorical belt. I have the most basic ideas of .js, but some of the more esoteric practices can be overtly foreign on such a frequent basis that the only way to retain knowledge is to do the lessons over and over and over and over... As long as it actually helps me attain something in the end, I suppose it's worth it. The code that I'm starting with today is pretty much just simple math. Which should be easy, except that it isn't always easier said than done











 If you want to do cool code snapshots like this, go here.  It's called Marmoset.
      Anyhoo, the age bit was OK. I just had to do an <if/else> statement. Although, I'm sure I could do a ternary operator and have it all done better. I'll try that next time I need an <if/else> statement.
Seriously, remembering the names to these things can be hard! I tried three different ways before I got this. Like I said. remembering things in .js is hard sometimes! Remembering all the operators and objects and whatnot. I'm going to eventually remember them all, but it isn't exactly a walk in the park. Not that anyone said it would be. OK. That's the end for today.
See y'all on Wednesday!


--Martin

Friday, February 14, 2014

Relocating/#smh

      Right now it is 12:11 pm and the internet is out. Again. If it doesn't get fixed soon, I'm going to have to go to the coffee shop. I didn't really want to do that, but I gotta do my studies, man! I was able do get some studies done before, it went out, but not enough to really count for anything. I do know that I found some interesting things in one of the .js lessons, and I'll cover that later. Right now, I'm going to wait thirty minutes. If there's no WiFi by then, I'm outta here!
There is no WiFi. My life is empty and meaningless. Time to go to the coffee shop! For me, that’s twenty minutes. For you, it’s the next character over -> Someone has my chair. I’m not happy about this. The light is all wrong, the pillows are weird, there’s only one armrest, I sound like Sheldon Cooper! haha! I’ll wait until they leave, and then strike!


HTML/CSS





      Psuedo--class selectors; that's what I'm starting with today. Lesson people say: "A pseudo-class selector is a way of accessing HTML items that aren't part of the document tree (remember the tree structure we talked about earlier?). For instance, it's very easy to see where a link is in the tree. But where would you find information about whether a link had been clicked on or not? It isn't there!" Example: You know how when you click on something, it usually changes color like, blue to purple? That's what this is. And then there's the CSS thing where something changes when you hover over it:
a:hover {
color: #cc0000;
font-weight: bold;
text-decoration: none;
}       So, now that we have that weapon in our arsenal, let's take it to the battlefield; the console.
Alright, so now we have something to go with. Here's an e.g:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title></title>
</head>
<body>
<div>
<a href = "https://www.google.com/">Google</a>
<a href = "https://www.yahoo.com/">Yahoo</a>
<a href = "https://www.bing.com/">Bing</a>
</div>
</body>
</html>
This looks just like regular HTML that has some links to some search engines. But when the CSS comes in, we get something else:
a:link{
    color:#008b45;
    text-decoration:none;
}
a:hover{
    color:#00ff00;
}
a:visited{
    color:#ee9a00;
}
If you want to test this out, go here. Unless you don't use Chrome. In that case go here follow the instructions, and then click the first link and be amazed. And with that, I'll leave this segment, and head over to the next.


JavaScript





      As I mentioned before, I found something interesting in my .js lessons. Yesterday, I was going over some lessons I'd already done. And realized something. I was looking at this code:

var bob = new Object();
bob.age = 30;
// this time we have added a method, setAge
bob.setAge = function (newAge){
  bob.age = newAge;
};

bob.getYearOfBirth = function () {
  return 2013 - bob.age;
};
console.log(bob.getYearOfBirth());

And I realized something. This section:

bob.setAge = function (newAge){
  bob.age = newAge;
};

is completely unnecessary! I took it out, and the lesson still worked! I seriously don't think these peopele really knew what they were doing. Their newer classes look better, but I think this one should still be in beta. Once I got past that I went on to the rest of the lessons. I'm still on the constructors because they're taking their time teaching this, which I'm totally OK with since they are difficult to learn. Here's what they said about constructors: "Constructors are a way to make objects with the keyword <new>. The most basic constructor is the <Object> constructor, which will make an object with no methods or properties."
     Ooooooh my. These people! Seriously shaking my head right now. I just passed my lesson using five different ways!! And most of them were just <undefined > or something similar. Which is just poop. There is no way that undefined is going to be ok in a real world situation. Here's the code:

function Rabbit(adjective) {
    this.adjective = adjective;
    this.describeMyself = function() {
        console.log("I am a " + this.adjective + " rabbit");
    };
}
var rabbit1 = new Rabbit("fluffy");
var rabbit2 = new Rabbit("happy");
var rabbit3 = new Rabbit("sleepy");
rabbit1.describeMyself();

At first, I tried to use <console.log> but apparently I was defining something wasn't there by using that, and then I tried a whole bunch of things, and they all passed, but I wasn't getting the return that I wanted. That's how I ended up with the code you see above. Kind of nifty. You just have to define a rabbit, and the words are already done. You don't have to write out each one, you just do it once! How neat!
Ok, this post is getting a little long here guys, so I'm going to call an end here. Remember to visit the links! Also, huzzah for beards.

--Martin

Wednesday, February 12, 2014

I Got Glomped!/.js Is Hard!

      
     It's a Wednesday here in my timezone, and that means I gotta pump out some juicy coding goodness. Also, that's the nerdiest thing I've said since.... yesterday. My gf sent me an HTML script that said she loved me. Yup we're nerdy. There should be a nerd pride parade! that would be so cool with blinking lights and whatnot! Maybe make the GPS route that we follow spell out NERD. *Ahem! ANYhoo... I'm actually at the coffee shop today. I know, it's not Friday! You're wasting gas! ACtually, I have to run errends when I'm done, so I thought: why not study at the coffee shop today? And that's what I'm doing. I switched back to the dev channel on my Pixel because the beta channel was getting laggy, so now that I have a smoother UX I'm happier. The music of choice today is "Programming Electric&Alternative" on Grooveshark. It's actually OK as long as they don't hit me with some Drake or similar stuff. Alright, I have my coffee at hand, my music going, it's time to plug in and plug away!


HTML/CSS





      So, on this front, we have Class and ID selectors. I love these guys; they make my day so much easier! I can now call things directly without worrying about disrupting something, and still have differences in something with the same tag as something else. Here's an exapmle:
<h2 id="intro">Introduction</h2>
<h3 class="standout">Classes and IDs in CSS</h3>
<p class="standout">Classes and IDs are super easy in CSS.
                                                  You're using them right now!</p>
<h3>Regular HTML Selectors</h3>


      Notice that there are tags with the same name,but they have <id> or <class> inside the tag, and those equal a name. So, the CSS side to this would look like this:
#intro{
    color:#b83c3a;
}
.standout{
    color:#f7ac5f;
    font-family:Verdana;
}
     Again, notice a few things that are different. There's the <#intro>, but then there's <.standout> tag the <id> tags get the<#> in front of their name, and the <class>  tags  get a period<.> in front of them.  You can have the same name for an <id> and a <class> and they won't interfere with each other. Why have the two different types of ways to call something specifically? I have no idea. They both work the same way. But I suppose I'll figure that out at some point.


JavaScript





      I swear... Every time I'm about to get the .js going stuff happens. It's already 6:02 PM here, and I'm just getting this part going. I got glomped by a friend that I hadn't seen in a while and I regret nothing. We had a great time catching up. I believe I made the right choice. I had a ball and now I'm scrambling to get some .js going. So, if this part of the post is skimpy, you know why. Also, I need to ramp up my .js times of studies. It's getting into the technical part, so I have to study twice as much to get what I'm being taught.
      Alright here we go. Still on constructors, sadly. They're really giving me the run-around. I just can't seem to memorize how to do this. I'm going to get it, it just isn't going to be easy. Right now, I'm working on this:

function Rectangle(height, width) {
  this.height = height;
  this.width = width;
  this.calcArea = function() {
      return this.height * this.width;
  };

  function calcPerimeter(height, width){
      this.height = height;
      this.width = width;
      this.calcperimeter = function(){
          return this.height * 2 + this.width * 2;
      };
  }
}

var rex = new Rectangle(7,3);
var area = rex.calcArea();
var perimeter = rex.calcPerimeter();

I wrote the calcPerimeter Method, but I can't seem to call it right, or it's missing something... I don't know. Turns out I had a lot of fluff in there... Typical me, add too much junk. I need to get that under control! Here's the finished code:
function Rectangle(height, width) {
  this.height = height;
  this.width = width;
  this.calcArea = function() {
      return this.height * this.width;
  };

this.calcPerimeter =function (){
    return this.height * 2 + this.width * 2;
  }
}

var rex = new Rectangle(7,3);
var area = rex.calcArea();
var perimeter = rex.calcPerimeter();

Notice the much smaller addition that I added. Pretty much, I just got carried away and added those two lines that got deleted because they said use the code already there as a model, but they didn't mean everything. Well, now that I got that out of the way, I done! I shall see y'all on Friday! Unless I get glomped again, but I doubt it since I'll be at home. So... bye! 


--Martin

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.