Monday, June 30, 2014

Arrrgh. The process of verbally climbing out of the hole you dug yourself into, aka Newbie Coder Woes

Just realized I'm only checking identical pairs of numbers for this Euler 4 thing. Oopsie. This is what I get for messing with stuff like this late at night. And thinking I can handle this.

But I am getting numbers that are right, just not all of them.

I'm dumb.

I'm going to find a possible math formula I can translate while still tired (Didn't sleep that much).

ETA: Yuck, I might have to scrap this one. I guess that's why the study guides I'm following don't really require these problems.

I should think of the situation this way: Is this going to help me make a functional web page? Probably not. Should I worry about it? No. Should I dump my GitHub repo? Maaaaybe...

But then my brain butts in and says "What if you need to know how to do that for a web app?"

Then I reply with "Seriously? It's not that damn difficult, is it?"

Then my brain into all the reasons why it might be. Mostly because only the people that have been at it a while blog about javascript coding, and they're talking over my head, so things seem harder than really/probably are.

Beginners don't blog because everyone's afraid to look stupid. I've been made to look stupid more times than I can remember, and that somehow makes me brave enough to type this stream of thoughts coming out of my brain in this public blog.

I noticed this in my networking class, I thought I was the slow one in class because people weren't asking questions. Even I wasn't asking that many questions, hoping that I could beat it out on my own after I got home. When finals roll around, I found out a bunch of people are getting really low grades and I was one of the better people in class.

I try to remember this stuff, but it never seems to stick. I can do this.

But I could use some friends. Damn my shyness. I need to find a place where people will talk to me.

tempus fugit: Project Euler 4

I decided to work on Project Euler problem 4 since my eyes were rolling up when I tried to read. I don't like math all that much, but I figured if I do this for a living, I'm going to be doing a lot of stuff I hate, so might as well get used to it.

I take two nights from typing anything because it hurts too much to sit at the PC and I forget every damn thing, it seemed. The math problem is something out of my comfort zone, but I kept working on it anyway.

I just spent the past three hours looking up stuff I haven't read about, and fucking with Firebug. I've  got two revisions up already. I was sitting there wondering why my counter was going over the limit, then I realized I should set the counter to match my initial variable values, so they stay the same. Yep, that's me. I am sort of sleepy. Does this happen to the pros?

But I got to a place where I at least got some usable numbers (I don't even know if I understood the question at this point). What's left is getting the output to look the way I want it, so that it's informative and well-formatted. I might be able to put this all in a function, which would give me an excuse to branch my repo, something I haven't needed to do yet.

I also watched a few Youtube videos for mental health breaks. I sure as hell needed them.

Hopefully when I get up I can look at this and it'll make sense. Right now I can't spell worth a damn, and my mind is wandering.
I'm in a cranky mood tonight. Inspiration to write a new short program is not coming.

I'm all wrapped up in reading my book and waiting for my neck to heal. My neck doesn't hurt as much as it did, but it's still tender. Saturday I thought I was pretty much done with it, but then I fell asleep the wrong way and woke up with the pain back to full intensity. Today is better. I almost have full range of motion and it's not burning like it was. I even worked out today after a day or two of not being able to move very well.

I uploaded one small bit of code tonight, but it was basically copying out of the book. It was using a custom comparison function to sort an object array by a property value. I made up a pretend stock of fruits, each one an object with the fruit and the amount, then sorted them by quantity. I put comments on it to explain it to myself. It might be useful in the future, so I wanted to maybe learn by typing. Muscle memory, you know.

Back to work.

Thursday, June 26, 2014

My contact list update

Remember that contact list I was doing on Codecademy and couldn't get any help about showing a "No Match Found" message? I had a little breakthrough: the throw statement.

I switched books and started reading Professional Javascript for Web Developers because JS: The Definitive Guide is really dense. I was getting all sorts of detail but I wasn't able to put it to work very well. It's a badass reference book, but I think that's what I'm going to relegate it to for now. In the Pro JS book (I'm shortening it because I'm tired) I was rereading material that I'd already reviewed in the other book and came across how to use label with break or continue. Thought it might work with this code so I could search again if nothing was found. It didn't work.

I went to MDN to read what they said about labels and they suggest throwing an error instead. Looked at that, added a line, and now I got a nice little error message without using a console.log statement. That's something, right?

ETA it still does the no match thing if I do find a match. There's a logic error in there that my brain isn't seeing.This is could be an opportunity to do a try/catch block, maybe...I'm making lemonade out my lemons here.

I probably need to call the search function again to get it to start over, but I want to modify it with a search again or quit type of option. I'm not going to work on that tonight because my neck still hurts badly and I'm sleepy. But I uploaded it to GitHub. That went smoothly for once. I may memorize the basic commands yet.

Please take a look at my repo if you'd like. Don't be rude if you comment; you know I have that douche IT person phobia:

I'm out of here. Wanting to sleep this time of night is a good thing. I might go back to semi "normal" soon.

Tuesday, June 24, 2014

Things I Felt Good About Today

  1. I read a tweet in Japanese and remember the kanji readings and understood it after all was said and done
  2. I got to enjoy some time in the house alone.
  3. I listened to some music really loud and sang along (in Japanese)
I listened/read some story a long time ago about trying to cultivate gratitude. I keep trying to do this, but I often have to dig because my life is on the empty side.

Now I'm going to take some naproxen so I can turn my head without too much pain. I'll be grateful it works.

It probably won't.

Can't win.

WTH GitHub o_o

GitHub is a bitch.

My very first night of adding and committing. The first one went fine, I uploaded that to do list code. I made some changes to it and tried to update again, and that's where the weird messages started. I was ahead 2 commits, I need to push, but that didn't do anything, etc.

I got it sorted out, but I'll be damned if I remember how I did it. The changes didn't show up on my repo page right away, either. Like showing up 10-20 minutes afterwards. I don't know if it's because my connection is so slow (I'm seeing unstyled HTML when things load, bad) and or if that's how it works, but it was frustrating as hell. I tried writing down the commands like I did with Cisco's CLI, but it wasn't happening.

Hey Exede, can you make your speeds more consistent? No? Okay. Still mad at mom for signing up for this bullshit.

I have to find a Git book or tutorial I can understand. I watched some of GitHub's youtube videos, but that didn't help me all that much. They were talking about individual commands and not going through a sequence of what you would do.  I'm hoping an O'Reilly pocket guide can bail my sorry ass out.  All I know right now is you add a file, adding that file stages it, then you commit the file. Then you push it? I think? Fuck. I don't know.

Anyhow, I'm going to try to work "Do a Commit a Day" into my schedule now. Even if my account is full of silly code snippets, it's something.

Since yesterday I finally started doing some exercise again. I was sitting there being listless, didn't want to watch videos, didn't want to read computer books, and finally my "fuck this, I should do something" reached my feet and got me up. Someone told me once that my motivation is inverted, so that instead of being inspired, I have to do start doing something before I know I want to do it. That doesn't apply in every case, but it does with a lot of those "things a grown person should do to be responsible" tasks. If I force myself too start, it's not that bad. Eventually I don't have to force myself anymore.

My neck hurts more than ever. I got a light endorphin rush yesterday after I was done, so I was busy today trying to get that feeling again. All I got was neck pain. From a low impact mostly walking in place workout. The hell.

Still going to do it. I need to be healthier and it might help my learning.

Monday, June 23, 2014

Baby Steps

I made the form for that To Do list project I had been tossing around. It's just barely styled right now, and it made me realize I should memorize some basic layout things that I can whip out without using a framework. So I have some videos to watch and stuff to read. I'm going to try to glean what I can from these, but it's going to be secondary to the scripting part of this, of course. It's functional, just not pretty.


I finally set up a GitHub account. I held off on it for the longest because I didn't have anything significant to upload, but since this going to be skill-proving type of exercise, I thought I should upload it somewhere so I (and others) can see my progress. I got the stuff installed, now I need to figure out how to use it without royally screwing something up. Command line, of course. I've gotten comfortable with CLI again after taking that networking class. I wish the web dev courses at that school were so engaging.

Once I get going, I'll make a link to it here. I'm thinking about making another Twitter account for tech matters as well. I'm afraid to put my real name out there, though. I guess I can change it when the possibility of work/collaboration gets there. I don't see that happening any time soon though. Keep it simple, computer stuff with some regular current events/life sprinkled in. I probably won't talk on it as much unless I start getting followers. I can use the account to ask questions, too if I get really brave and/or stuck.

For mental health breaks and entertainment, I'm going to watch more Castle and start Sherlock over since it's been that long since I watched the first season. Then I'll catch up like the show binger I used to be. Some other movies and shows are lined up, too.

Sunday, June 22, 2014

This weekend has been rough and long. Waiting for the sun to set enough to drive to the store.

I don't wanna learn code today.

I already took a day off, because sleep was needed. I should do a little, but the back of my mind is preoccupied with things. With things that immediately affect my life, and will probably hinder my success if they continue. I could cry, but that won't really help.

I should type a few lines at least. Once I do it I'll be sitting here for a few hours at least. Maybe some pseudocode at the very least. Been thinking of coding a Task List app. Not the most original project, but I think it would give me some serious DOM manipulation practice. Creating objects and properties, taking them away, changing the way they look on screen. I imagine uploading it online now as the start of some sort of portfolio, but then a dark cloud floats over and rains on me.

I think I'm still tired. I wish I had people to talk to.

Friday, June 20, 2014

Finished Codecademy's jQuery course. Yay! Going to do another tut just to make it solid.

Coding Motivational speech.

I'm listening to this presentation called Programming is Terrible, and it's sort of lightening the cloud I have in my journey to become a developer. The speaker is talking about the jackass computer science teachers I had in Columbus and addressing most of the doubts I've had lately. It's negative, yet positive!

Thursday, June 19, 2014

My sense of time.

Just realized it was Thursday.


My day in a sweaty, smelly nutshell

I changed my blog theme. I thought it would be more summery. Not sure that I love it, though. I should have the skills at this point to make a custom template, but I don't feel that motivated to mess with it right now. It's been a long day.

I thought someone was coming over to work on my ceiling fan today, so I left the house during the day. In a car with no a/c and windows that don't work. I don't have to say it. Okay, I'll say it. MISTAKE.

There's a reason I usually do everything in the evening. And since I have the dubious luxury of being able to take advantage of an open schedule, that's what I do. But since most people work during the day around here, I figured I'd save myself the shame of being half-asleep/not dressed/drenched in summer sleep sweat in front of people. I bought a Monster and left the house.

Spent the day looking for shade trees and hoping a breeze would blow. Left the car for a few minutes to get a drink and it was too hot to breathe when I came back. Summer is so damn ridiculous. I sweated like a pig, and there was not much I could do about it. A few big rumbles of thunder but the cooling rains never came. The heat and not eating much and lack of rest is probably what gave me the raging headache I drove home with. I'd planned on reading the whole time, but I ended up not touching a page.

Got home, looked at the fan. Nothing changed. All that for nothing.

Something about this town seems to be allergic to setting a damn time...that's the city mouse in me getting annoyed. I thought I liked moseyin' until I started living here. They might come Thursday, if they feel like it.

That's enough of that.

I'd just gotten the window that was sliding down all the time up. I think I'm going to have to wiggle it back down again.

When I got home, I washed off the ick and tried to read some of an outdated CSS book to see if I could glean any tips that could stand the test of time. Only thing that got through the headache was developing with an internal stylesheet to minimize tabbing back and forth, then when you get it right, cut and paste it to an external file and link it. Since I'm not a high roller with dual monitors and auto refresh and all that, I should have known this *smacks forehead* I think the tabbing makes me feel busier than I actually am, something my life lacks. It's also weird because when I was messing with javascript for that form the other day, I pasted it into my html file for that very reason.

Oh, what am I doing? Ending this blog post, that's for sure. I should try to finish that Codecademy jquery tutorial. And push the vanilla javascript stuff I learned the rest of the way out of my brain.

Tuesday, June 17, 2014

AAAAH! I made some progress in my client-side form validation project.

I tried finding something to read, but that was getting long. The stuff I found that I can stand so far are tutorials on DOM scripting, which I am reading for better understanding. For the immediate gratification part of it, though, I turned to Youtube.

I found a couple of videos that showed some basic stuff, but have only watched one so far that covers validating multiple fields. So I have a chain of if/else if with alert boxes. I have to find out how to do something besides alert boxes though. Hopefully I find something that I can put onscreen. Maybe try a switch statement. I don't know.

I also discovered HTML5's built-in validation functions by using the required attribute. It's nice looking, and for a dead basic form like the one I'm testing it would be mostly okay, but it cuts my javascript off at the pass, so I had to take it off for this test, since my purpose is to learn javascript.

I also delved into the headache of finding validating an email address field. Looked at way too many "this is the best regex to use to validate". It was nothing but an argument, so my newbie self is going to be content with just knowing that the field isn't empty for now. No sending a confirmation email afterwards either, unless it's simple to do. I probably haven't learned the command for it yet. Plus there are probably a lot of prepackaged solutions that professionals use anyway.

It's mostly done, though. Since I put radio buttons and check boxes on the page, I should probably check those as well,  even though in real life they wouldn't be crucial. I just put them there to show that I could code different form elements. You know, sampler style!

I spent a good hour or two on that, so I'm putting it away for now. I have to work on my retention.

Monday, June 16, 2014

Finally getting to some DOM scripting. Reading about it, anyway. I've been learning to use Javascript as a programming language so far, but not in the way I'd be using it the most, modifying web pages.

The form validation project on Codecademy requires I do some of this to pass, so I spent the past couple of nights trying to find a tutorial on the basics. If I can get the project done, then I can read about it more detail. All while trying to keep all the stuff I learned from falling out of my head. It seems like that's what it's doing, especially the past couple of days.

I would have been done sooner tonight, but I had a nausea attack that wouldn't go away. I usually have some form of ginger to calm things down, but it seemed to make it worse rather than better, and I had to back away from the computer for a while. I meditated for a while, and now I'm cool, calm and collected. But dawn is fast approaching, and I didn't get much done except read a few web pages, fiddle with a couple of lines of code that didn't work and watching the Game of Thrones season ender (after plowing through those audio books, the payoff was still satisfying).

Still, it was better than wondering when things will get better.

Now, off to do more reading before my body decides to phantom baby kick me in the guts.


Sunday, June 15, 2014

I finally finished Codecademy's Javascript track the other night. The last part about objects seemed to keep going and going, but it was probably the most interesting part. I'm hoping I can keep it all straight in my head.

I've done a few of the web projects. So far, One of them had jquery in it so I skipped that, but will come back to it. There's a form validation one I want to do, but it's late and I should probably do that with a fresh mind.

Now I can catch up on my reading and try to think of a coding project that isn't a calculator. I did that up to a certain point in Python and while it was fun at first, it got dry pretty quick.  I'll probably do it again anyway, just to get something fully fleshed out.

My cramps have been literally cramping my style this week, but unlike past months I've actually seemed to power through them. Which means I get on the computer for a little while when it doesn't hurt so much. No hocus-pocus there. If there was no respite, this week might have been a bust. When it's rough, it's really rough. I'm glad I found a way through the muck, because I might have forgotten quite a bit if I hadn't.

I didn't do much computing until after midnight (it's early Sunday morning as I write this). I work up around noon and watched a so-so Korean cooking show, some Regular Show and How to Train Your Dragon, a movie that I wanted to see but was never in the mood for. Basic cable came through for me this weekend. Tried to eat something despite a nonexistent appetite, ice pack, the usual.

Other than that it's just been waiting out my off week. That comes monthly. Ah, something something testing me something something hallelujah.

Tuesday, June 10, 2014

A little coder talk that slides talk about life, money and the "pursuit of happiness"...and a little depression

Last night Codecademy has me messing with javascript objects a lot. Custom constructors, using the this keyword, putting a function inside a constructor to calculate properties. Objects, objects, freaking objects. 

It was all really neat, but I'm afraid I won't remember it the next time I log on (which will be tonight at some point, because my internet's throttled until the new billing cycle starts...fucking Exede). 

I made notes, commented the shit out of everything, but I might not understand them later. At least i got something done because I've been trying to get through the objects chapter of my book for a few days now and I can't seem to read it. This is why I want a tablet. If I'm doing nothing else but long form reading, I despise sitting at the computer to do it. A news article or something short, fine, but a book? I'm tempted to take so many breaks that it nearly becomes unproductive.

I used to be able to read manga on a screen all night long, I can't even do that any more. I don't know if it's getting older or something else that keeps me from doing the stuff I love. I still want to read manga, but I have to be in the mood, and the mood hasn't come in ages.

But yeah, a tablet would be nice. Plus when I'm not at home I can still read, while I'm trying to get out of this stuffy house. I'd get a hell of a lot more done that way. A tablet would give me what I need, storage space for ebooks, download a few apps that don't need a connection to work one night when the bandwidth is free-flowing, and maybe enough room for a couple of videos for amusement's sake. I could practice kanji away from the computer, too. 

Which reminds me. School really busted up my Remembering the Kanji goal. I was damn near done when school started, but trying to get used to school again caused me to edge that out in favor of doing the required reading. That little kid in me that's afraid to get a bad grade crept back up. It's summer. I need to do it again. Getting back to speed is going to be rough at first, but if I make a go of it I can catch up. It's not like I have much else to do, and I can't study javascript 10 hours a day. Plus I think having more than one activity will be good in helping me get things done. It's like a handful of hundreds of characters (maybe 400 left?).

Now if I can squeeze in regular exercise and some daily meditation into that schedule, I might see some changes. Positive ones, I would think. It would feel like...I had a full day, something I haven't felt since I moved to this place.

One thing I'm trying to do is find another online job to do. Mturk used to keep my bank account in the black the first few months I was on it, then the bottom fell out and it's been feast or (mostly) famine ever since. Literal nickel and dime work. The writing jobs are hard to find, and when they come up they're not topics I feel comfortable writing about. 

I miss those dollar blog posts. That was a hundred extra bucks a week for an hour or two's worth of work a day. I wish I could just write about anything but the stupid keyword requirements and the limited sources they allow make it really unpleasant. And stupid shit like "never use future tense". If that made sense to me I'd be making decent money with my own canned content business.

Someone besides me might read this blog, too. Eh. That I can take or leave. It's like talking out loud in public and no one seems to notice. I would say that's thrilling, except I'm probably in the corner of the Internet equivalent of...western North Carolina! No1curr, as the youth say. 

Which probably why this post is coming out the way it is.

When I first moved down here, I had the idea of trying to schedule my day like a monk, every waking hour having a purpose. I imagined I would get so much done. It died before it even started. Because I realized that I was really by myself, and that my already inverted motivation was getting dangerously low. Despite being an only child, my imaginary friends don't really cut it when it comes to getting and staying fired up. I'm not ashamed to say that I would really like and need some sort of support.

I've tried finding online equivalents of a support system, but it's not gone too well because online, people are flaky and tightly wound up in themselves. Myself included, I guess. I try to reach out to people when they seem upset, but the people seem to pull away before a connection is made. I say "if you need to talk" and they never do. It makes me feel like my dark cloud is visible online, too. It makes me feel rotten. I second guess myself and wonder what I said that made the person not trust me. It's not like I'm asking for money. I'm not that gauche.

The rest of the time it's a lot of people fangirling about hot/cool whoever. Day after freaking day. Because it's the internet, people can choose to show the world only a slice of themselves. I'm getting the most repetitive slices out of people. I join in it too on occasion, but sometimes I want to talk about what's going on in the news, or about a story I just read, something I heard about on a podcast or just bullshit about life. 

Can't get it. Haven't seen an opening to broach a new subject, either.I guess I'm not special enough to know. It's part of the reason I stayed away from twitter for nearly a month, because the amount of noise was deafening. I got back and it was like CNN when they're stuck on a single story: You can turn the TV off, come back 8 hours later, turn the TV on and it's like you just hit the pause button. 

Try it one day, you'll see what I mean. CNN, not Twitter. Your Twitter friends might be the freaking Algonquin Round Table for all I know.

Well, that's enough laying it on the table for today. Eventually I'll come back and talk about computer stuff. Eventually.

Sunday, June 8, 2014

While Loops

The while Loop

While loops are used when you don't know how many times you need to execute a block of  code.

    code to execute

As long as the conditions are met, the loop continues. To prevent an infinite loop, you have to make sure the condition eventually becomes false. In other while(true) keeps going unless you add something to turn true to false. If you need to iterate in a while loop, put it in the code.

var i = 0;

The do/while Loop

The do/while loop is used when you want the loop to execute at least once. Then, while the condition is true, the loop iterates.


This code is silly, but it seems to work. It's not the best example.

var fruits = ['apple', 'peach', 'pear', 'orange', 'strawberry', 'mango'];
var i = 0;
    console.log("we have " + fruits[i]);
}while(i< fruits.length);

Note the semicolon at the end of the while statement.

For the love of loops: The for and for/in Loops

I wanted to take a break from reading to write out some things I've learned that I think I understand. This post is going to be about loops, for loops specifically.

The for Loop

The syntax is pretty simple.

for(initialized variable; condition; increment){
    block of code

The first part is the initialization of some sort of counter variable. The second part is a condition that needs to be checked, and finally the increment is what moves the loop along to the next task. Here's what a for statement might look like:

for(var count = 1; count<100; count++){
    console.log("I just counted " + count);
console.log("I counted to " + count);

The count is initialized before everything else, then the condition is checked. If the condition is true, the code block is executed. Then the variable is incremented by whatever number you like. I chose to just go up by 1, but it can be whatever you need it to be. You can count down by using -- instead of ++, for example.

If the condition is false, the loop ends and the program jumps to the next block of code. The little blurb about prints out a statement to the console about what number it just counted, then tells you how high the count got at the end when the count reaches 100.

I've been using this loop mostly for counting lately, or going through an an array and doing something with the information.

The for/in Loop

for(variable in objectName){
    execute this code

The for/in loop goes over the properties in an object and does something to them. The thing about this loop is that looks through the object in no particular order. The variable name is one of your own choosing. I've been doing for(each in objectName) because that's how I think.

This loop goes through the object called names and prints each name to the screen.

var names = {
    name1: 'Amy',
    name2: 'Jeff',
    name3: 'Sam',
    name4: 'John'

for(each in names){

If you just wanted a list of properties in the object, you would console.log(each) instead. Add an if condition and you can search for a specific name. I haven't used this a bunch yet, but I'm sure it's going to get some use. But let me say again this loops goes through an object IN NO PARTICULAR ORDER. I've just been getting lucky that it spits out things in order. There are other structures that handle that problem, but I have not learned them yet.

Wednesday, June 4, 2014

Knowing when to let go (of relatively minor things)

Last week, I finished the contact list project on Codecademy. It was frighteningly easy.

Then I have come to the part that always trips me up: Adding additional features.

They have this bit at the end that's like "How would add other functionality like x?" and since in real life this shit may happen, I decided not to rest on my laurels and try to add something to the code. I added a search prompt and formatted the values it pulled out of the array to make it a little prettier.

Then I got the bright idea of adding a message that would tell you if no matches were found. That was three or four days ago, and it STILL DOESN'T FUCKING WORK.

I asked a question in the forums, and got the kind of answer that makes me not want to ask questions there anymore. Bye, wide-eyed naive me that thought the culture had changed a little bit. Just a little. I'm not expecting miracles. At least the response was just vaguely disinterested and assholish instead of full-on nasty.

I've decided that since I was spending too much time on it that I haven't learned whatever I need to know to make this happen. That's my own overachieving ass' fault. This is why I would really like to have a mentor.

I could ask somewhere else, but I got sort of fixated on it and haven't been doing the required reading. So I need to let alone. It's freaking June and I want to be somewhat done in the suggested time frame.

I would also like to get a decent burrito today, but I am broke.