Thursday, July 31, 2014

This Dip Thing: What I'm up to

I've been trying to learn about the MVC model the past couple of days, working through a project in a book. I think it's one of those things I need to let simmer in my head for a while. I can understand the surface of it, but going out there and using it for something on my own isn't in the stars for me just now. I'm going to need to go through a few sample projects before this clicks. Too much procedural programming, I guess. I'm taking notes and trying to explain it to myself at the moment.

I'm also trying to start getting some DOM access techniques down. I've been doing programming in javascript but not learning how to do the everyday things you expect JS to do, like changing items on a page. I want to memorize some of the basics so I can make sample pages with interactivity. I don't want to have to look up the basics every time I do it.

The dip is rough, and there's a skin on it. My chips keep breaking when I try to dig in. The stuff underneath the skin is still good though. I hope. Or is it I have a bowl of dip that's been sitting out and I'm trying to break the surface? Either way, it's going to be awkward.

Monday, July 28, 2014

Reminder: It's Not You

Scary thunderstorms tonight. I woke up at 3 a.m. after the worst of it had blown through. Still sleeping funny.

I've been watching some youtube videos for motivation, and it reminded me of a story from my past. I guess my brain wanted to reminded of a time when I was able to succeed, because I'm so doubtful of myself now. Here it goes.

Somehow, someway, I found myself in AP Calculus during my senior year of high school. I was in a small class with the valedictorian and salutatorian of our class, two unpleasant foreign exchange students, the future music teacher, and me. I was able to make it through the homework all right, but I'd bomb the tests. Our grades came out quarterly, and my grades went B, C, D, a nice, orderly downfall. Since the class was small, and my teacher was a jerk that liked to call out the scores after he handed the tests back, we all knew how got the worst score. No one ever said anything.

The teacher would always rant about stuff in class not related to math. I don't think he ever actually taught anything. While the conversations he'd have were semi interesting in a Mel Gibson Conspiracy Theory Lite kind of way, I wasn't getting much out of it. Toward the end of the year it looked like I was going to fail this class, and I told my parents because I didn't know who else to go to.

They got me a tutor. She was a student at Capital University. I think she might have been a business major. She would sit with me in the college library and walk through the problems with me. I'd do them, wondering if I was making any progress. It didn't feel like it.

That last quarter before graduation, I got a B in AP Calculus.

I remember years later hearing that the teacher was let go for being intoxicated in class. I never got close enough to smell the guy, but that matches what i saw back then.

In the end it wasn't that I was stupid, but I needed to take a different approach.

I just wanted to reminded myself that I can figure things out some way some how. It's just that right now I have to be my own tutor, so things are a lot slower. Trying to find an angle on my own is an uphill battle.

I just wanted to remind myself that I there's potential in me, I just have to get to it.

Friday, July 25, 2014

One good thing is being back on the exercise wagon. After watching several videos of an particularly good looking guy swing his bulging arms around, I decided to get cracking on my arms, because they are flabby and have been for a long time. I found a couple of decently sized resistance band workouts to do and I'm on my second day of it. It warms you up pretty well. Light sweat, nothing too serious. I'm hoping I see a result of the tricep exercises. I did plain jane bicep curls in the past (like in high school) to tone my arms, but I really want that floppiness to not exist anymore.

Tonight I'm going to find a good leg work out and start combining them. This way, even if I'm not doing cardio I'm at least doing something during the week.

What I've liked so far is that it starts off like "Yuck!" but after I get through the first set of curls and the burn starts to creep in things get very meditative. I'm only worried about getting through the current set and my mind clears out. I'm trying to keep that in mind to keep me going, because that feeling is very pleasant. I hope I get addicted to it enough to get a nice body out of it. Well, as nice as possible.
My burnout continues. The past couple of days have been spent sleeping, occasionally getting something to eat. I feel very wrung out. I read a little bit, trying to read through some code in my head to see where it turns out, but I don't think I typed. That's the thing, I'm not sure if I did or not. I'm thinking not, because I opened Sublime and there wasn't anything looking back at me except for a couple of notes I'd taken on what I COULD be typing.

I'm working on a little piece of something this morning (yes, morning) and trying to work out a bug I found. I bet that takes weeks. No, I can't let that happen. If my concentration fails I just need to switch to something else for a bit and come back to it.

I picked a database class and the web server class I was looking at before for fall semester. The database course was almost full; the web server class had 23 out of 25 spaces available. This doesn't look promising. If they cancel that class I at least have one left. My other Web Dev class had like 6 or 7 people in it, so there's a chance.

I also love how it took me about an hour just to find the payment deadline date. They could have put that on a main page, but nope, I wasted a bunch of bandwidth clicking on links that led to large pdfs of shit no student ever needs to see. I don't know why they do it like that. Maybe because tech ain't their strength and all the people that were good at web development left! That's my theory.

At least I don't have to pay for books. We'll see how this goes. The classes are online, but I figured I can tell mom that I need to go up there once or twice a week. It will give me a block of time to do my homework so I don't slack too much. Plus I want to get out of the house for a bit. I've been stuck here all summer and I hate it.

Even if I have to hang out at the lackluster campus for 2-4 hours a week, it's better than two hours at home. I can read a book or attempt to use their wi-fi (it's throttled all to hell). I can walk and get some fresh air. It'll be a productivity thing.

I think I'm going to look into another school to transfer to that has the stuff online Maybe a school further east near the Research Triangle? I dunno.

ETA: Oh, I heard back about that Google Scholarship to Code School thing. I didn't get it. I was so underwhelmed at the time I didn't even bother to write about it. But yeah, no 3 months free for me.

Wednesday, July 23, 2014

Monday, July 21, 2014

Itty Bitty Experiment in CSS is DONE

Yay, I finished up my scooped edge divs. You can take a look at the code here:

Sunday, July 20, 2014

Good old CSS

I found this example of scooped corners in CSS. It uses a circle gradient positioned over a div to give that hole punch effect.

Scooped corners with only one gradient

I've been playing around with it make some variations. So far I have big hole in the middle (it could be handy) and an old fashioned movie ticket style with punches on the side. Once I get something really nice I need to put it on my free site. I haven't used it much since my class ended, and it needs to happen. I was using Firebug to try tweaks on the fly. I felt like a developer! It was nice.

I've been away from CSS study for a minute; it's easier to look up how to do things than it is with programming. It's a nice break for my brain, since I've been in the Javascript doldrums the past few days. At least I feel like I'm getting stuff done. I want to get some basic stuff down, like centering, so I'm not referencing it all the time. Just a few useful rules. There's usually more than one way to do things, but I want to find something that fits most situations. I can look up special cases as they occur.

I should split my study between multiple subjects so I don't get so burned out. It could spark an idea.

A note about truthy/falsy in Javascript

What's falsey/falsy in Javascript

  • undefined
  • null
  • 0
  • empty string ("")
  • NaN

Everything else is truthy. 
TRICKY: A string that just has a space in it (" ") is not an empty string.

Tuesday, July 15, 2014

Well, that didn't go as planned.

I tried to code last night. Tried.

I got an example typed out of a book, then I just couldn't focus. I was downloading podcasts, and watching videos, thinking I needed a break, but I kept going back to the little bit of code and not doing much. Got stuck on a problem, and was thinking it might be me again, (barely) googled it, retyped stuff thinking it was a logic error. Now the sun's up and the problem was on purpose and explained on the next damn page.

Yep, I'm insanely fuzzy. And now I'm getting sleepy on top of that. Monday night was a bit of a bust. I'm not sure if I'm reaching my limits or if it's something else.

Try, try again.

Monday, July 14, 2014

The Command Line the Hard Way

The Command Line the Hard Way

I went through a few parts of this tonight. I need a refresher, and it's something I need to know how to do a little bit faster. I was working with the command line all through my networking class, so I figured it's time to add one more way of doing things to my belt.

It might even help with those dang blasted git commands. I got through it the other night without too much trouble, but when you make a new repo the page lists what you need to type, so it was kinda cheating. Just a little. But I did the add and the commit stuff all on my lonesome, and I had to merge a conflict, which meant editing a file. Good times. So exciting. I learned something though, so that's something.

If I'm not sick out of my mind tomorrow I hope to get to some basic scripting or something like that. I haven't done one of those since my operating systems class at CSCC.

Saturday, July 12, 2014

Other goings on, mostly non computer.

Also in this week's news, I finished that last George R.R. Martin book in A Song of Ice and Fire series, aka Game of Thrones.

It was mostly a chore, with chapter after chapter of slice of life dullness. The first two thirds of the book, when I thought something exciting might happen, it was a red herring. Chapter 50 something stuff started to happen because some of the story lines were finally meeting in the same place and thing went up in flames (so to speak). Something not boring happened on The Wall. Cersei had to atone and shit got real with her. Theon got his junk back (metaphorically), and, as everyone knows, the Boltons and the Freys are gigantic assholes and no one likes them, even the people that they work with. Still, most of this was scattered between stuff that made me fall asleep and kill my ipod battery until the last 4 or 5 chapters.

When they described the inside of that banner room at the Wall that no one uses anymore,and he listed every coat of arms, I could see the huge block of text in my mind's eye and I yelled to no one "PADDING, MUTHAFUCKA, PADDING!" Because it was.

Now I can wait like everyone else that's hip for book 6. I'll probably have forgotten most of this by the time it comes out.I have to find a new audiobook to listen to. I guess I could try Tolkien again. At least the radio play, maybe? Eh, I should switch the type of fantasy up. I have some stuff on my iPod that I haven't touched yet, and baby needs to make room for other stuff, so the sooner, the  better.

The bugs are eating me alive and I hardly go outside. I bought anti itch stuff last night, and forgot what I really needed (Aleve). I hope I don't cramp too much, because the red menace has started, and I don't do too well during it. I might not code again until this time next week.

I cracked open Anki and looked at my kanji flashcards. I've retained some, but it's going to take a while to reforge the associations I have in my head. I've been thinking about this for a while now, and thought I should add this back in because studying nothing but javascript can be boring. I'm hoping my passion will rekindle brighter for both this way, and I can kill two birds with one stone.

I still haven't picked anything out for school. I want to try to call them to see what their database class is about. If it's worth it, I'll take it. Otherwise, right now it's just the questionable web server class.

I downloaded Vim. I don't know if I'll install it, but I downloaded it. I was thinking about reinstalling an IDE now since it might be helpful, but I don't know what to pick at the moment. Now I'm reading that Aptana is sketchy for javascript, Netbeans is okay but it doesn't support Rails, which I would like to try, and Webstorm costs money. There isn't that much to choose from after that that isn't web based and that means bandwidth I don't have (Exede...*shakes fist*). So I downloaded an old as dirt text editor that Linux. It looks like the stuff a system admin would find useful. It also looks like something that would be more useful on a giant monitor. I don't have a one of those,

That's it. I really need to lay down.


I mentioned previously (I think) that someone else on Codecademy had suggested some code to help with the "no match" found situation.

I finally added it to my code and it worked. Why? Because I needed another damn variable.

My logic looks like this in pseudocode:

For every item in the contact list

IF the first name matches the search term:
print the first name, last name and phone number
print out address line 1
print out address line 2
print out address line 3

IF the search term is not a match for the name:
Print "No match found."

I was trying IF/ELSE on this, but what was happening is that the ELSE was catching the non-matching entries and causing that message to show up.

After however many weeks (just before I decided not to look at it again until I was stronger), I was messing with it and decided to use another conditonal outside the intial iteration. The reason for this is I want the no match message to appear after I've gone through ALL the entries in my contact list. That's why sticking it in an else statement wasn't working out. I thought that was the way to go.

That still wasn't working because I couldn't find a decent condition to meet. Without that, the iteration would end, jump to the next part of the code and print no match found anyway, because my test condition didn't make sense or because I left it out. I think I tried both. Some of this might have been when I wasn't uploading to GitHub. If it wasn't working there was no reason to upload the same file, so I let I'd close it without saving changes. I tried the throw thing but that didn't work either. I was trying to write a condtion along the lines of "if the search term doesn't match any of this, tell me", but I couldn't break my people logic down to computer logic. I tried to do some forst of nested conditional thing I learned in a video about a week ago, but that didn't fly, either.

So fast forward to the present moment, I say "Hell, I'm awake, the sun is coming up, let's look what that Codecademy person said again". They use a match variable in their code. I used it to add a "_ matches found" message that made me feel productive on the damn thing for the first time in weeks.

I tried if(match == 0) and that still wasn't coming out the way I wanted it to. I know I changed a couple of things and instead of the No Match message it just came up undefined. Finally, after the for loop but before the end of the function, I used if(match == 0) return "no match found". I figured if this doesn't work nothing will and fuck this, I must have the common sense of an earthworm and it just doesn't go very far. It finally worked. I might have thought about adding a counter variable at some point, but threw it out because why would I need that...


I'm glad this is over. And I thank the kind soul that put me on the right track. The not so helpful guy came back too. They tried but it wasn't working. Call me biased. The link they provided didn't give me any more insight.

I'm very happy, because it means I can move on. I know how to work this out now, and it might come in handy for something else. Also, I can try to add another feature to this code, like adding the want to search again prompt and possibly expanding the search to include first and last name, in case I have 20 johns in the list so I don't print them all out. It seems easy in my head, but it probably isn't.

It's going to have to wait for a time when I'm alert. I've hit backspace so many times on this post because my brain is in need of sleep. I was rudely awakened a few days ago and I've been really tired ever since. Thanks mom. You're a doll.

Anyway, time for something fun, like a cold beverage or something.

Sometimes it's not you, it's the machine.

The past week or two I've been practicing writing little pieces of code to do perform a certain task, like substring matching and whatnot, and when I ran the code in the console I'd get an error back and wonder what I did wrong. I was going through tutorial code and get errors. Yes there's a chance for typos or errors but it just kept happening. I didn't know what was going on and, since I'm prone to doubt when I get stuck, I started worrying the hell out of myself.

I was having one of those crisis of faith (in my own abilities) moment last night, when after two hours or so messing with the same little program in Firebug, I said "I can't be THAT damn wrong" and cleaned out my cache and reloaded the browser and tried again. The damn thing worked.

IT'S NOT ME IT'S THE DAMN TOOLS!!!! If I test a function three times to test it for different results it only spits out the last one, which wasn't happening before. Sometimes it doesn't seem to be taking my edits into account. I'm not sure if I need to reinstall it or what. And if that doesn't work...I get to muck up Chrome Dev Tools instead.

I'm not appreciating inanimate objects trying to gaslight me and make me feel stupid. I really don't.

Monday, July 7, 2014

Useful web development links

Here is a site that offers suggestions for web development projects. It even has rank beginner stuff for newbs like me.

Practice Your Skills!

Coderbyte might also be some good practice.

This Creative Punch tutorial shows you how to make a post-it note graphic with HTML and CSS. I like stuff like that, simple and clean. I got everything but the head of the pin to work.

A list of javascript frameworks that might be useful to me later on.

Sunday, July 6, 2014

Something to remember about generating random numbers in Javascript

This is something I picked up when looking how to make a random number generator. It's something I want to remember, so here's the blog post!

Math.random() picks a number between 0 and 1, not including 1, at random.

To get random whole numbers, multiply Math.random by the  number you pick as your upper limit plus 1. In other words, if you need a number between 0 and 4, the multiplier would be 5.

Then, if you want a whole number, wrap this calculation in Math.floor() to round the number down to the nearest integer.

What you end up with is:

To get a number between 0 and 4.

I remember this from my javascript class now, when we had to make a random number function to place pieces on the board for our Whack-a-Mole game. I hope more comes back soon.

Friday, July 4, 2014

School rears its ugly head again

I was looking at what was being offered fall semester at the community college I attend, trying to decide what to take. Again, I'm mad underwhelmed.

There's a web server class and a database concepts class I could take. I want to learn about databases so I can start digging into the back end of things, and making pages that present that information. The big time stuff. Both classes are online and require no books. Considering the other class I took that required no books consisted of downloading GIMP, a free trial of Dreamweaver and some outdated plugins, I'm not sure it's going to be worth the $600+ dollars they'll have the nerve to charge for the privilege.

I'm really wary. There's a computer upgrade and repair course I could take. I was considering this because it could lead to a part time job or some side work. I've always wanted to learn how to build my own PC with confidence, but it's not directly related to my future career goals.

I could take the next Cisco course, but again, that's not web development. I'd take a programming language, but their math requirement is still bugging me. In fact, taking a programming language isn't even required for their damn degree. Not like the degree would be worth that much anyway, from what I've seen so far.

I can't stop though. If I don't take a class mom will just think I've given up even more. I'm doing all this self study and on the computer every night, but she still thinks I'm toying around. It's because we can't communicate. She's already forwarding these spammy looking emails from a third rate job search site. They're spammy because they contain bullshit claims about the jobs available in the area. Even with the nearby towns along the freeway, there can't be 10,000 jobs in a single field sitting open, just waiting for me to find them.

I don't know. It's just another thing to think about right now.
4th of July.

This firecracker is burning out.

But I'm trying to alleviate the problem by changing my focus a bit.

It's mostly practicing what I've learned so far. I'm looking at a different book that has exercises in it to see if I can code them without looking at the hand holding parts of the text. I relearned a couple of functions I learned a loooong time ago in my JavaScript class at school: Math.random and Math.floor. I also got a new look at structuring code. There was a short program to write that had a lot of nested if/else statements, and after I wrote it up I commented my code. I'm hoping that sort of solidifies what I was looking at better in my head.

I'm thinking at this point of trying to look at my old jquery code and see if it makes sense. If I can find it. All I remember was that I wrote a lot of functions and in the end they all called each other. Maybe if I stare at it long enough, I can think of ways to make improvements or use it as the basis for another project. But I'll be happy with understanding the flow of it.

I should lay down for a bit. Think about if I'm going to the grandparents' for the holiday or if I'm just going to be a hermit in my room again. Ugh, holidays.

At least my neck doesn't seem to hu...ah, never mind, there's still some tightness there if I turn too far. But it's well enough for everyday things, like checking both ways before you pull out into traffic. So there's that! Thinking positive!