Wednesday, December 25, 2013

Relative positioning and animations for my laser robot! (HTML, CSS, JavaScript)

Howdy everyone! This will be a short blog post because Ian is STARING AT ME and I feel obligated to rush.

So, last time I made a lovely robot out of divs. Well, I did that by stacking (literally) a few divs on top of each other and centering them to make a robot. That's pretty simple, but in order to have that robot move around on the page, its position needs to be relative to the edges of the page, not just centered in the middle of it.

By applying position: relative to the divs, I can move them around by using left: right: top: bottom: and giving pixel numbers to push them from those sides of the window.

While those move my robot pieces in two dimensions, I can also layer the pieces in the 3rd dimension, z-index: by using positive or negative numbers. If a blue circle has a z-index: -3 and a red circle has a z-index: 0 (which is the default, even if you don't apply a z-index) then the blue circle will be BEHIND the red circle.

Z-index does not scale the size of the elements. Also, if there is no declared z-index and two elements overlap, the one closest to the bottom will be shown first. (There's that cascade again!)


So here the wheel of my robot was moved up a little and given a negative z-index to be behind the torso. Also I made two other divs (inside the torso div) that contain J's, and rotated them and flipped one and pushed them behind the the torso. Woohoo.


As you guys can see above, I gave the right arm a special font, flipped it on it's Y axis (scaleY(-1)), rotated it, added some vendor prefixes for the whole "transform" thing, and then did other stuff to move it into place.

We also contained the pieces of the robot in one big robot div, and nested the divs for the arms in with the torso div:


BAM.

Now to animate those eyeballs.

Cotter, who is now much uglier than I remember, is yelling at me for his lasers. Those eccentric millionaires just don't know how to chill out..


So to do this, we're going to use an @ rule called keyframes. What @keyframes does is it modifies the state of something for a period of time, and then sets it back the way it was. We'll use this to modify the white glowy-eyes of our robot to become red for 50% of the time, over a duration of .5 seconds (.25 white, .25 seconds of red) that will loop for forever.

In order to do this, we need to define the keyframes rule and then assign it to the element it will be affecting.
Here is my definition of the keyframes rule, we've called it "blink":


Had to add in a bunch of vendor prefixes to be safe and make sure that it runs on all browsers.. but here's the breakdown of the syntax...
50% of the way through our timeperiod for the keyframe (which we'll define later, when we actually assign the keyframe), the background will take on the aspect of having a circle red gradient.


Above, I've assigned the animation "blink" to the brain div and given it a 0.5s time period and an infinite loop. This will modify the background of the brain div (the eyes) to be what we define in the animation (red) for 50% of the time (0.25 seconds) and to blink for FOREVER.

Cool. But Cooter--I mean Cotter still isn't happy. He wants to be able to turn the lasers on and off, not just have them shooting out for forever. I guess I get where he's coming from.. so we'll cover how to do that in the next blog post!

For now I need to go make some COOKIES. <3 bye="" christmas.="" guys="" merry="" p="">

Tuesday, December 24, 2013

Cotter loves robots. (HTML, CSS, JavaScript)

Here I am on my last segment of the Dash courses!
For this segment, my client is an eccentric millionaire named Cotter. He likes robots.


I'd be Cotter's best friend, because he looks kinda cute-ish maybe and he also has a lot of money. But alas, I am not anywhere near being a robot. Yet.

To please Cotter and provide a nice foundation for asking him if he'll be my sugar daddy, I'm going to have to learn about making shapes with HTML and CSS. Ian already had me so an exercise where I made a box that flashes back and forth between blue and red if I click it, but this may be more intense.

I'm also going to learn more about borders, and gradients, and background-size stuff. Sounds fun. LET'S GET TO IT.

So, by default a div is three things.. invisible, a rectangle based on the size of its containing element, and sexually frustrated. In the past, I inserted things into the div (color, text, pictures) to sate its burning desire to fornicate. This time, I'm going to shape divs and rub them all against each other in some softcore-porn-esque way to make them look like a robot.

...is it getting warm in here?


So since divs are born rectangles, it takes a little convincing to get them to loosen up and stop being so straight and just be a circle for a day or two. We do that with alcoho--I mean with border radius! Adding a border radius adds curves to your div. 

I just assuming that whatever value you give the border radius, it will reach out to the border and say "okay, from the center of the element, the border has a radius of this" and that makes sense to me. If you set border radius to one value, then you get something that's completely rounded. If the border radius is at least half the length of the shape, then you get a circle. 

The syntax is border-radius: top-left top-right bottom-right bottom-left; so if you only give some of the corners a radius to work with, you'll only have those parts of the rectangle rounded out. Simple enough.


Trapezoids are a bit more complicated. Because they have sharp edges, we don't use border-radius for something like a triangle. Instead, we move the border around the div.

Step 1: Make a div with some size (a size of 0 works, too)
Step 2: Add border thickness and color/transparency to create a shape that emanates from the div (which is invisible because it has no color).

Here's an example of a trapezoid I just made and some explanation below:


The div itself has no height, and a width of 140px. If it had no width, the middle square part would be gone and this would be a triangle.
The top border extends upwards 300px. Technically, the div's location in this picture is the very bottom border of the trapezoid. It has the 140px width and is invisible.
From here we create borders to the left and right of the div. Because there is no border on the BOTTOM of the div, the border on the sides stretches straight out from the center of the div, and connects to the top corners of the div. The color is transparent, so it kind of cuts triangles out of the div which would normally be a square.

Here's another illustration of the div (hooray MS paint skills):


My drawings should be in the fucking MoMA

Adding curves to the corners of this would let you shape it even more! I'm sure you guys could imagine the number of phallic divs I'm making right now.. tee-hee.

So I've done some fiddling and some rounding of edges and now I have a robot body, a wheel it rolls around on a-la the maid in The Jetsons, and a nice little head-shape. What he needs are glowy eyes. "How are the eyes going to be glowy?" you ask as you hang my illustration of my div above your mantle in your den... well I'll tell you how... RADIAL GRADIENTS.

Pop some radial gradients into the background and BAM, you got a big eye in the middle of the div. Adjust the background size of your (invisible) div, and the radial eye will start repeating, making two eyes! Or four! Or ELEVEN MILLION.

I'm not going to show you guys radial gradient things because this post is long enough.. but here is the syntax:
radial-gradient(shape, centercolor, outercolor);

In this case we made the shape circle, the center color "white 15%" and the outercolor "transparent 40%".. the percentages correlate to opacity so it makes it look more glowy.

Woohoo! After adding another little div to make an antenna, stuff is looking like a robot!


Hooray. Should put a Santa hat on him considering that it's Christmas eve... maybe later.
Anyway, the robot needs to do more stuff! It will start taking commands, moving its arms (which are yet to exist) and blinking its laser eyes. Exciting.

More to come.

Wednesday, December 18, 2013

Media Queries, the If-Then of the web! (HTML, CSS, JavaScript)

I love me some if-then statements, and media queries are what's up in CSS with that!
Here's the syntax for a media query:


Within the brackets are the condition that you're testing.
If that condition is TRUE, then the statements will execute on the elements of choice.
For example....


Above, when the page width is less than 501px, the font-size of h1 (header 1) is set to 50px.


FUCKING AMAZING. Remember to add your media query at the bottom of your style tags. Since CSS does "cascade" downward, you'll screw yourself if somewhere later in the style tag you modify what your media query is modifying. CSS pays attention to the modification that is closest to the bottom of the tag, so that's where you want your conditional formatting.

Anyway peeps I just got back from WINNING PUB TRIVIA, HELLZ YEAH, so I'm going to bed.
n00b, out!

Divs, mobile platform viewing, and sizing! (HTML, CSS, JavaScript)

So today I learn about how to make webpages look less horrible on mobile devices. Personally I hate hate hate mobile sites, because usually they change more than the way images scale and stuff.. they make an entirely new layout and it fucks everything up. But anyway, let us begin.

Apparently when making a website for that good-for-nothing whore Esha, I wasn't really understanding what I was doing when making div elements to hold photos and such of Esha's dishes. Specifically, the difference between making those photos the size of "cover" instead of "100%" or a specific pixel size.

We predefined the div height to 200px, and a div takes its width from the width of its parent element (Thanks Ian!) which, in this case, is max-width: 600px. Works out pretty perfectly for our photos... almost too perfectly...



Here's where stuff can get tricky. The body has a MAX width of 600, which is fine for the photos when the page is displayed in a bigger window. HOWEVER, on a mobile platform you probably don't have that 600px width unless you browse in landscape and the length is weird and shit. If these images were set to 100%, they would be resizing themselves to fit inside the div.

If the div goes down to 400px width, then in order for the picture to display 100%, the height of the picture must be scaled down to roughly 133px. If you remember, we made the height of the div 200px. That won't change. By default, there won't just be black-space for the other 66px of height.. it will be a repeat of the picture, like so:


For this reason, Cover is better because it just cuts the image off a bit and doesn't let it repeat. Looks slightly better.


HOORAY STORM OF SCREENSHOT'D PICTURES!

So, we'll use media queries (if, then statements) to fix this mess. But not after I watch American Horror Story with my bestie who is on her way over. EVAN PETERS IS A HOTTIE AMIRITE? I'd cover him, that's for sure.




Monday, December 16, 2013

"Gradients are a plague on humanity." - Hitler & Internet Explorer. (HTML, CSS)

Now now, guys. I haven't given up on coding just yet. Have some faith!

I've been extremely busy lately with family and friends, but now I'm a loser again and will have significantly less time away from home, so I'll be wrapping up my Dash tutorials tomorrow and continuing with codeacademy shortly thereafter.

HTML is pretty fun. Learning how CSS works is useful. I could probably be throwing some of that all in this post right now but it's almost 10 and I'm a grandpa who goes to bed early, so I won't even click the "HTML" tab here, let alone fuck with its contents.

Today I learned about how gradients aren't a default thing on the internet yet, and you need to add vendor prefixes to shit to make them work in Firefox (-moz), Chrome Opera and Safari (-webkit). IE is a loser and doesn't get any gradient goodness. Ever. Because it's a nazi and wants pure colors, all the way across. NO MIXING.


In other news, I got a new phone. THAT'S FUN. The camera is so good. HD dik pix coming ASAP, I swear guys. Those of you on my mailing list will not be disappointed.

But in all seriousness it's so much better than my old phone. I will not post about either of my phones because I know some fanboys and anti-fanboys will start yelling at me about phone things and IDNGAF.


Be good, y'all. Chat with you soon.

Wednesday, December 11, 2013

Esha can suck my div. (HTML, CSS, Javascript)


You know what, Esha? Why don't you make your own website for your shitty restaurant that ONLY HAS THREE DISHES AND ONE OF THEM IS A DESSERT. Also how about you learn how to describe your dishes? Here we go, let's do this one...


Are you fucking kidding me, Esha? Maybe your business sucks because you don't know what you're selling people and you're charging them 22 dollars for it. I don't think my super awesome HTML skills can help you, Esha. I really don't. BUT I'LL TRY ANYWAY.

In this lesson I'm learning about spans, gradients, transparency, and web fonts. Good ol' Ian tried to teach me about what a span was for a second and it basically was "it's kind of like a div but it's not"... that's all I remember, anyway. Gradients sound... fine? Transparency sounds fine as well... web fonts: comic sans all the way.

OKAY. But today I'm probably only going to do spans because I have videogaming to do. So.. SPANS. I guess I was really bad at listening to Ian because a span tag will let you change the formatting of whatever is inside the span, even if the greater tag, such as a paragraph tag, is telling it to do something else. You give each span a class name, and adjust the style from there in CSS. MAGICAL.



So then we encounter a problem... we're trying to take some prices and justify them to the right of the page, as opposed to the rest of the paragraph which is justified left. But then the span jumps up and is like "Whoa now, cowboy, I'm an inline element. I don't swing that way. I'm only block-element-curious when I'm like, really drunk".. which means that, because it's inline the element extends toward the end of the page and doesn't wrap around, so you can't be like "go all the way to the right" because it can do that for infinity. I think.

So then you have to float some more booze to our "totally inline" hot friend there and suddddenly he's so right-aligned you could throw a hotdog through the air and he'd catch it with his butt cheeks. Cuz floats will let you slide your element around inside the container element (in this case the paragraph, I believe) and you can just throw that bad-boy against the right wall and go to town.


So anyway that's what's up with spans. You can quote me.

MORE TO FOLLOW.

Monday, December 9, 2013

Ian helps me do some scandalous calculations...(javascript, HTML, CSS)

So, earlier today I was chatting with Ian on gchat (which I have up all the time during work guyz, add me) and he mentioned that he was making a javascript. He said it was a simple calculator, nothing scientific... add, subtract, multiply, divide... so I was dumbfounded.

"That sounds so easy, that sounds like your mom" I said, turning to everyone in the world to address their respective mothers. Then he sent me a link to this.


Immediately I was like WHAT. I have no experience with anything other than my silly python/javascript console. Never have I fiddled around with GUI stuff, or HTML.. or CSS... so we endeavored to play around with it and experiment via google Hangout later in the evening.

I was a HTML and CSS virgin. I asked Ian to be gentle. He rocked my world. Sometimes he was rough, sometimes he comforted me through the ordeal and through my frustration.. most of the time I felt amazing while I was workin' dat code.

So first Ian referred me to Dash to run through the introductory stuff and develop a light understanding of HTML. I had experimented before (literally for like, 5 minutes back in the MySpace days I think) and never came away really understanding what was going on.

All in all it was good. Hyper Text Mark-up Language and Cascading Something Something are TOTALLY my bitches now. Kinda. Sorta. They return my calls once in a while, is what I'm trying to say.



With that Ian helped me create the worst 'calculator' you could ever imagine, but it was something I didn't think I'd ever be able to do 12 hours ago.

It was really great having someone there with me, guiding me through and making sure I understood what was going on and testing me each time I did something wrong, or overlooked something. Brought me back to the times I'd harass good ol' Dan Miller and have him help me out.

Anyway, very excited to being a sort of pupil of Ian's. Stay tuned in if you want to read more boring shit about my n00bc0d3r adventures.


Thursday, December 5, 2013

TIL javascript and java aren't really related?

So javascript was named javascript because java was popular and for no other reason.

THAT'S weird.

Anyway I'm learning some js now because my horrible friend Ian (who I do adore) is learning it. He is, however, already a web ninja and works with code on a daily basis so I'm way behind.

So far I've covered some basics... making functions and stuff... (functions are variables wtf?).. remembering all of my semicolons;;;;;;

Time to stop posting and continue codeacademy-ing.

Thursday, August 1, 2013

Mono.py

So remember how I had this horrible flu? Haha... hahahahaha.... it's fucking mono.

Brb laying in bed for the better part of a month.

Saturday, July 27, 2013

So slow

Hey peeps. Posting from the comfort/discomfort of my deathbed (I have the worst flu in the history of forever)...

Sorry for my lack of content. Work has been shit. My new hire who I'm training is a nice woman, but she's in her 50s and is taking a while to catch on. Not much time during the day to fiddle around, and I'm naughty so I goof off after work.

Also this week I am dying of plague, so I've just been watching Dexter and updating my fb status too many times per day.

I'd insert a picture of my sick-face but nobody wants to masturbate to that.

Be cool. <3

Friday, June 28, 2013

Achievement Unlocked: You da you da best!

GUYS I DID IT. I finally finished that stupid problem. It took me like a few hours of kindof working on it at work, but with the help of PythonFiddle and a nice little notepad I've been scribbling on, everything is now so simple.

Things got SUPER EASY when I decided to make a dictionary corresponding to the days in every month when it was a leap year, and the days in every month when it was not a leap year:


yeardic = {"1True":31, "2True":29, "3True":31, "4True":30, "5True":31, "6True":30, "7True":31, "8True":31, "9True":30, "10True":31, "11True":30, "12True":31,"1False":31, "2False":28, "3False":31, "4False":30, "5False":31, "6False":30, "7False":31, "8False":31, "9False":30, "10False":31, "11False":30, "12False":31}


I know it looks kinda... gross... but it works! Before I only had 1:31, 2:29, 3:31, etc etc and I was trying to do some weird workarounds to determine when a leap year was happening and when to add +1 to my total accumulated days... silly me.

This new way is BOSS. Anyway here's a pastebin of the code if anyone wants to yell at me about how stupid it is: http://pastebin.com/wkNKPSUZ

Woo-hoo! Time to move on to the next unit.

Wednesday, June 26, 2013

Achievement Unlocked: You are a masochist.

So here's my problem, guys. I've finished a lesson in Udacity and I found out that my job does not restrict access to Udacity or Youtube, so that's pretty cool... but I'm hung up on one of the "optional questions" at the very end of the unity.

Just one.

Only one question. And I can't figure it out.

And it's probably there to just be like "haha look at this unreasonable question, you should strive to be such a baller that you can solve this one day" but I think the gaming culture of today is keeping me from continuing on without clearing EVERY. SINGLE. QUESTION as if I'll get some virtual trophy for being a cool dude.

And I'm probably overreacting, as well. The problem isn't that complex... here it is:

# Given your birthday and the current date, calculate your age in days.
# Account for leap days.
#
# Assume that the birthday and current date are correct dates (and no
# time travel).
#

def daysBetweenDates(year1, month1, day1, year2, month2, day2):
    ##
    # Your code here.
    ##

I feel like it's going to be very hard to determine what lies between two dates. I can't import any fancy stuff I can only use some loops and basic stuff.

If I figure it out throughout the day I'll post my code so you guys can be proud of me and draw me an achievement trophy and post it on f-book for everyone to see.

Sunday, June 23, 2013

Infinite loops are destroying the global economy.

Why are infinite loops destroying the global economy? Don't ask me.. ask them! But they won't respond to you. No they won't do anything but run around in little circles screaming nonsense and slowly destroying the tiny shred of humanity you left in you.

Thankfully I have enough experience through knowing my nephew that it didn't keep me from tapping away at my keyboard and slamming my head against my desk a few times today until I completed some fairy simple Python problems on Udacity. I did some simple crap with searching in strings and some math-stuff with nested loops, and was rewarded with THIS terrifying masterpiece after completing a "2 gold star" problem:


What the fuck, Udacity. I don't want your demonic lemon-head snake-eye people looking at me with the blood of my loved ones dripping off of their lips. I know they appreciate nested loops as much, if not more, than any other mythical beast, but keep that crap away from me.

Anyway, I'm slowly crawling back onto the code train. My head is already spinning a bit. I think it's because before today the only things I spent my spare-time with were True Blood (watched all 5 seasons in less than a month!), some boy I like (tee-hee), and most recently the second weekend of the third phase beta test for Final Fantasy XIV: A Realm Reborn (come play with me and my kitty-kat man!)


Half-naked man-felines aside, I hope you guys don't mind my posts which are 90% about me being silly and 10% about actually coding. I have more free time now and I'll be posting more regularly, hopefully with some higher quality content! For now, I leave you with my man-cat's butt.

Tuesday, June 11, 2013

Priorities

HELLO Y'ALL.

I know I haven't posted in a while and I have a very good reason for that.. I'm kinda trying to watch all 5 seasons of True Blood before the premier of season 6 on the 16th. Most of my free time is spent watching vampires have sexual relations with things, and now with my watching True Blood there's even MORE of that.

I'll be coding once I'm all caught up, I promise! Udacity is calling my name and twirling it's hair with one finger and such. I can only suppress my raging c0d3rb0n3r for so long.

Love you guys.

Monday, June 3, 2013

Databases suck. I luv Bucky Robertz.

So last week I posted about this amazing exciting new opportunity I have at work to do lots of cool things with databases and learn about coding and blah blah and IT and such.

WELL.. not quite. My interview with the guy I would be working under was really discouraging.. not only because he was super abrasive and asked me questions I clearly did not know how to answer, but because he was very "We do not make mistakes here. I do not tolerate it. We never have fun. We never have time to relax. You'll be in here Saturday and Sunday until 10 PM and will not get overtime pay. This is not IT. We do not use SQL. You will constantly be scrutinized and we will never tell you that you've done a good job. You won't be building anything for years, you'll just be doing bitch work. Blah blah blah."

And like.... okay... no. I kiinda liked MySQL? I guess? It wasn't BAD... it was just.. very limiting, in my opinion. It was useful and stuff to know about, but it isn't something I was crazy about. And to know that I wasn't even going to be doing THAT, for YEARS and I was going to be worked to death? No thanks. I'll just take my OTHER promotion that isn't as high pressure and likely to make me cry.

SO ANYWAY, MySQL is done with for now unless I need it at some point in the future. I got through 75% of the tutorials offered by The New Boston (omfg i love bucky roberts he needs to be my boyfriend)...

DO ME

SO BACK TO PYTHON! I think I've gotten BORED of the whole game thing.. partly because I already wrote a game just like that in college, so I don't want to just do the same shit over again.. so until I get some idea to write something, or someone says "hey write something that does X Y Z" I'm just gonna fuck around on Udacity.


Friday, May 31, 2013

An exciting job opportunity, and wtf is a database?

Hey peeps! I have exciting news to share with you all, my internet friends... it starts with me, unemployed, 5 months ago going on a job interview at Crum & Forster insurance in Morristown, NJ for a temporary position in their audit department.

I'm not a big fan of insurance. Nobody is, at first. But a job is a job and man was I unemployed as fuck. The way my soon-to-be boss described the situation was that they needed someone ASAP to help them with backlogged work, and that if I was good at the job and wanted to stay there may be a possibility for a full-time position.

In my interview she mentioned taking notice of my "Fundamentals in Python, Java, and JavaScript programming languages" under my Skills section. I said I really liked to code, and was interested even in positions in IT and the like. Computers were great, and I was going to enslave them all.

Fast forward 5 months and I'm being introduced to my future supervisor for a new team I'll be moving on to. She asks me all about my hopes and dreams.. so I mention my interests in programming and data, etc etc. I mention the name of a higher-up executive whose job I think is really cool.

With that, future supervisor lady talks to my current boss about how she'd love to have me on her team, but that I also seem very interested in something more IT.. She mentioned the executive, as well, that I had mentioned. My boss then tells that executive that if he has an opening, I might like to take it instead of going to this new team.

MADNESS ENSUES. Not really, but on Monday I'm going to be meeting him and possibly discuss working for him! There is one problem; I'm not entirely sure what he does.

I know he works with SQL and Access and Excel and some databases, but I've never done anything with SQL or Access, and I wasn't even sure about what a database was... So I started watching some mySQL tutorials through TheNewBoston on YouTube (man I love Bucky Roberts so much) and got a very general understanding from the first half hour.

Tomorrow, I'm diving deeper. Right now I feel like a database is just a huge collection of excel documents and there's probably (probably...) more to it than that.

So for the moment, Python is on hold! Haha... haha I say that like I've been just plowing through my Udacity courses. Whoops. Maybe Udacity should stop HATING EVERY FIBER OF MY BEING and let me be on the website for more than 5 minutes every half hour.

Anyway..

Got any experience with mySQL or databases? Give me a holla~

Love you guys even though you don't comment on my shit.

<3 <3 <3 <3 n00bc0d3r <3 <3 <3 <3

Tuesday, May 28, 2013

My struggle with a simple problem

Over the long weekend I took some small amount of time to continue with my Udacity class. Right now I'm on a little section of 5 exercises.. not really being taught any new material, but demonstrating understanding of basic concepts.

It's these kinds of exercises that I look forward to. I like being able to look at a problem, conceptualize the solution in my mind, and work through it with the basic building blocks I have been given.

I told a friend once that I thought my problem with Python was that I would encounter a problem and wonder "How can I solve this? How can I deconstruct this seemingly simple process into a step-by-step process?" Usually I'd give up after a while.. the last time I did this I was supposed to take a number of letters and print every possible combination of said letters.

One afternoon I sat in the bathroom at work on my phone, typing on my notepad how to maaaybe make this work. Lots of loops and some math.. I never really worked it out. Eventually, I got fed up and googled how other people did it; they'd just import some crap and throw the variable into a function within that package.

It was like cheating! How can we ever innovate if we just take what is given to us without trying to work through it ourselves first? I had this big mess of code and repeatedly failed at printing all the scrambled-up versions of "Asshattery" and some douche gives me 5 lines of code as the grand solution to my problem.. ridiculous.

---

I wrote to Mr Dan yesterday, after being in bed on my chromebook for 3 hours messing around on the internetz, about my current problem in Udacity. It was an incredibly simple process for a human.. but the instructor had given it a *GOLD STAR* which meant it was tough to code.

Define a function "median" which finds the median number in a set of three numbers. The numbers may all be different, or 2 or all of the numbers may be the same value.

Great! The instructor had given us predetermined functions, which we had made earlier in the class, called "bigger" which returns the bigger of two numbers and "biggest" which returns the biggest of three.

I sat there for a minute thinking about where to start.. then my brain was farting all over the place. I actually took a quarter, nickel, and dime and thought through the code visually. Using less-than and greater-than was annoying because the values could all be the same, and then what would I do? I only had if statements, while loops.. we hadn't even really covered "or" or "and" so I didn't want to use those.. even if I did I may not have figured it out on my own.

Dan and I figured sorting would be the best, since we had a set number of values and could just sort them numerically and print the 2nd item in the list. I couldn't use a sort function so a few lines of comparing numbers and switching them about eventually wound up in my code and I executed it. Everything worked out. I thanked Dan for his help, and felt disappointed in myself.

When I watched the instructor's solution, I felt even more ashamed.. it seemed so simple. Determine the "Biggest" number, then write a few if-statements..

if a == biggest(a,b,c):
    return bigger(b,c)
if b == biggest(a,b,c):
    return bigger(a,c)
if c == biggest(a,b,c):
    return bigger(a,b)

The solution Dan helped me with had a few less lines.. so I figured "Ha! We are superior! Dan the Man and Mike the... uh....dyke?" but my brief soiree into lesbianism didn't lift my spirits for long. I had failed to look at the plain-as-hell clues right in front of me. You have these tools, look at them! These functions which you can use.. just think about it! Understand why they make your life easier, how to utilize them to enhance your experience as a coder!

It will take some more time, but I'm getting over my weird issue, which I attribute to some ego I have. Sure, you could write every program known to man with just some if-statements, loops, and a little understanding of math.. but you'd be an idiot for doing so or even wanting to do so.

Use the tools that are available to you. When a new wrench or power-drill turns up on the market, don't look at it like it's some barrier in-between yourself and your dream of being the l33t3$t c0d3r 4L1\/3. Realize it's there to help you get there, to your end goal: to enslave all computers.

Friday, May 24, 2013

HAPPY BIRTHDAY

It's my Grandma's birthday today so I've been pretty busy during the week helping my mother prepare a surprise party for her.

I'd like to say that's why I haven't been updating the blog, but that's only part of the reason.

Learning through Udacity is great fun but I'm having trouble with YouTube in general (which Udacity uses a lot) and Udacity also kicks me off the site for 10-15 minutes at a time for no reason so it's pretty discouraging.

I submitted a little support thing on the forums and they said it's definitely my ISP, and they may be illegally limiting my bandwidth or something like that? So, being the passive-aggressive person I am and not wanting to have to call someone in India to discuss the issue with, I just kinda.. let it go for now.

We'll see if things get better. If not, I may write a very stern email to someone in India who will maybe forward it to someone somewhere else and after exchanging a few copy-and-paste emails with them finally maybe they'll forward me to a person with REAL authority who will be like "Suck my dick, we're not screwing with your internet, it's not our fault YouTube and Udacity hate you, you're a loser." and from then on I'll recede into my shell as a loner and a hermit, never speaking to or coming into contact with another human until the neighbors complain of a rotting smell emanating from the property. The end.

Sunday, May 19, 2013

"So one way to solve it is to have a big, complicated, nested if-statement.."

Hooray for Udacity! Boo for me not paying attention last time I learned Python.. I never *fully* understood the return statement.

I was watching an explanation to one of the exercises which I thought was very simple.. I'm way beyond this content, right? This is n00b stuff. I'm no n00b!


...what? No, no no.. stupid teacher man. CLEARLY since the "return False" isn't in an if statement, it will execute no matter what happens in those if statements. But, why doesn't it?

Oh....
.......yup, I'm a n00b.

I don't know why something as important as the return statement didn't stick into my brain. A way to completely end a function, in the middle of the body?! I put that knowledge to work on the next task and was almost surprised when my simple few lines of code did the trick for something that I would have made such a convoluted block of code for.

And then he said it. Right then and there. "So one way to solve it is to have a big, complicated, nested if-statement..." and my mouth kinda gaped open for a second.



I remember Mr Dan looking at some code of mine and being like "What the hell why are there so many if statements" and me being CONVINCED that I had tried alternatives and they weren't working. I probably could have made things a lot easier for myself. I've probably been building a bench with wood, nails, and no hammer.

Thanks Udacity, for reminding me that I am a n00bc0d3r. You're lucky I like you, because usually I would vow to destroy you for humiliating me, once I enslave all computers.

Saturday, May 18, 2013

More Udacity, some thoughts on D&D, and more.

So I decided to get back into Udacity and proceed on to Lesson 2 of their Introduction to Computer Science course. My first step in preparation of this was to go out to the store and buy a 4-pack of Monster Energy drinks (fun fact, Monster Energy is a client of my current employer).

It only took, like, 5 minutes for me to be reminded of a very important and basic concept in coding that I probably learned a long while ago. It involved procedures(functions):


It's kinda really embarrassing that I didn't have an active knowledge of this; variables input into a function aren't modified by that function, even if they have the same names.

Ah well. I did some simple exercises on functions before Udacity blew the rape whistle at me and decided to block my connection to the website for the evening... next time I'll bring it flowers and chocolate.

In other news I learned that my D&D character was introduced in my old DM's new campaign and managed to kill one of his players before dying, which is great. It brought back a bunch of nostalgia and nerdy warm-feelings. I'd love to make some online D&D tool... customize your characters, define abilities and such.. D&D was a zone I never wanted to venture into as a nerd but when I did I fell in love. Anyone who has tried to make, or knows someone who tried to make, something like this should drop me a comment.

ALSO.. my 1.5 year relationship kiiinda ended yesterday so I'm dealing with some weird feelings, which is why I haven't done more with Python this weekend. Tomorrow I'll try and devote myself to more rigorous training, and I will persist through Udacity's cold-shoulder it keeps giving me. Peace, Love, and Unicorns everyone. <3

Monday, May 13, 2013

Double the experience, double the fun!

So after being EXTREMELY FLABBERGASTED after finding out last night that half of my combat system was broken, I was convinced I had messed something up so bad with my code that there would be no turning back.

Turns out I just needed to hit "tab" on a few lines. Such is the way Python works...

So anyway, if you'd like to fight some enemies as well.. (they're sharks on roller-skates).. hop on over to my latest commit of The American Race!

ALSO, shout-out to the only person who actually subscribes to my blog, Mr. Justin Brown. You are the man.


Sunday, May 12, 2013

And this is why I need people to test out my code.

It's 11:15 PM, I'm about to go to sleep, and I realize that my latest blog post has a comment:

..........
.......................................................
...................
DOT DOT DOT DOT DOT DOT WTF

Did I REALLY not notice that almost half the code I have in my little test combat system is NOT FUNCTIONING?

Did I sit for 20 minutes trying to make enemy combat interactions sound funny/silly and completely ignore the fact that they weren't showing up in my game?

This, dear readers, is why people who develop need other people who are willing to test out the code and ask questions.

THANK YOU, Justin, for pointing this out to me.

Unfortunately, I don't really have any time to fix this, but I will work on it straightaway after work tomorrow afternoon.

Saturday, May 11, 2013

New version of the combat system for my game!

Mr Dan is amazing, and sat with me for like an hour and a half on Google hangouts to figure out my problems with Python.

Basically, I was stuck with the problem of taking information from a user, which could either have been a string or any kind of number, and trying to classify that as either a string or an int. It sounds so simple now that I think about it, but it still took 10-15 solid minutes of Dan and I figuring stuff out, Googling, and me praying to the StackOverflow gods.. and then another hour of us trying to indent properly and me rambling about bullshit.

And with my last commit for the night to GitHub I give you the newest version of the battle system for The Presidential Race. There may be some code in there that we didn't end up using and is just sitting there, so don't mind any if you find it.

Thanks again, Dan, for your patience and your constant aid to me.

Some content for my text game.

Woot! I've pushed some code up to GitHub, just one simple piece of the game that reflects the battle system. It's just modified code from a game I made in the past, but it's a start.

If you'd like to toy around with it or give me suggestions/feedback, PLEASE do. Just click here to view the code.

As I mentioned previously, the plot is.. you are a canadian racehorse who has given up on his cupcake kickstarter project to run for president, against a cross-dressing skateboarding shark. In this snippet of code, you fight some of the shark's rollerblading minions.

How exactly do sharks rollerblade and skateboard, you ask? Think Street Sharks.

Friday, May 10, 2013

More GitHub, my sickness, and adventuring with Udacity.

Hey peeps! So my last post with any substance in it talked about a flashcard app I found for Chrome.. which I kinda became frustrated with, so I'm just back to writing classic flashcards on index cards. Ah well... n00bc4rd$ for n00bc0d3s, I suppose.

I had a confusing evening and morning with GitHub.. I attempted creating a local repo and pushing it to GitHub but the GitHub app wasn't finding my local repo even though I had successfully committed everything.. I took screenshots of everything as I was excited to rant about it to you guys, went to bed, and then when I booted up and checked the app again suddenly my repo was there.

I think GitHub is toying with my mind. Perhaps an ex-boyfriend of mine died the moment GitHub was created and was reincarnated as the GitHub app? All the more reason to learn how to enslave GitHub once and for all...

...but before I moved on to do that, I had a lovely phone chat with Mr Dean Machine who I started learning Python with last summer. I kinda fell off the boat with Python after being discouraged, but he continued on and has made some amazing progress. Today he urged me to look at Udacity for learning some new things, and for further solidifying my foundation in Python. Despite the website kicking me in the balls every few hours and then running away acting like I'm trying to molest it, leaving me unable to access my course or continue with the exercise I was working on for roughly 30 minutes, I'm really enjoying it. Not sure why that's happening to me.

I didn't expect to learn anything in the first unit, but I've never done anything web-related and a big chunk of the first course is centered around web-crawlers and creating a search engine, so it's giving me a fresh insight into the potential that a language like Python has buried under its scales.

Here is a happy little drawing the instructor of the course drew when talking about procedures (or functions as I call them):

.
..if you don't get it, you're obviously not 1337 enough.

Anyway, I haven't started development of my text-based game yet. I plan on taking a crack at that tomorrow sometime. The winning idea was a combination of random ideas submitted by a Facebook friend, Ryan, combined by another friend, Justin, into the following:

"Perhaps combining some of Ryan's ideas would be the best approach. I think I'd play a game about a Canadian race horse who puts his cupcake-related Kickstarter project on hold to run for President against a skateboarding drag queen shark."
          ...sounds legit enough!

Right now, my brain is killing me because it's leaking out of my nostrils. I've been hit with a cold in combination with my horrendous allergies, and I'm all drugged up (as per usual) so I'll save the real work for when I'm slightly less zombified. 

Until then.. stay awesome, everyone!

Tuesday, May 7, 2013

Time management.

Things I had on my to-do list today for after work:
Eat dinner.
Buy Claritin for my allergies.
CODE HARDCORE.

Things I did today:
Watched Pawn-Stars marathon for 2 hours.
Watched "Counting Cars" because I'm a manly man for 5 minutes.
Browse Reddit.
Played a really good, free 5-minute indie horror game and pooped myself.
Read w.e.b.c.o.m.i.c.s.
Ate dinner.
Bought store-brand allergy medication.
Showered... and...
...made some flashcards on a chrome app to refresh myself on command prompt things(looks a lot better on the app..)

And now it's time for bed. Sigh. Maybe I'll continue tomorrow to put all of my Python flashcards online, then work on my GitHub ones, and finally start on my super awesome text-based game which you guys are giving me suggestions for. Currently the winning submission is one that was submitted to me on Facebook, but I'm still open for ideas!

Hit me up in the comments, even if (especially if) I don't know you. Maybe just to say hello. <3 Night.

Give me suggestions!

I think I've been reading too much and haven't been typing enough, guys!

Here's the deal. For fun, I want to make a little lame text-based adventure, a bit more complex than the one I mentioned in my previous post.

During my process of developing this short game, I'll attempt making the use of GitHub. Afterward, I will post a link to the game on GitHub and you guys can all play it FOR THE REST OF YOUR LIVES.

Now, since you'll be playing this for all of eternity, you should have input on a theme/plot of the game. Post your suggestions below! When I have a few gathered up, I'll start my work.

GAME FACE.

Monday, May 6, 2013

Gradual clarity

The weekend is over, boyfriend is gone for 2 weeks, and I now have ample time to learn about GitHub!

Thankfully, my day at work is shaping up to be slow, so I've copied some pages of the GitHub crash-course into a word document to covertly study up.

Here are some important things I've learned about today:

  • staging and committing
    • When you stage a file to be committed, at the moment you give the command, the file at that instant is what will be committed. If the file is modified after it is staged but before it is committed, you must "git status" and "git add <file>" AGAIN to update what will commit.
    • The "add" command is pretty versatile.
  • Branches
    • I understand what a branch is now. Mr. Ryan tried to explain them to me but I think he gave me a more advanced definition than what was necessary. Now I get it.
    • Branches are complicated when working in small groups because merging with the master branch may/probably will cause conflicts. Boo!
GitHub is shaping up to be a pretty cool tool.. I added a crap-ton of files to my repo yesterday, but mainly they consist of answers to python questions on CodingBat, Project Euler, and other misc projects. Nothing fancy. Most of it is bullshit, like a tiny text-based game I made for my friend Dean about thugs who steal swag, or a simple tip calculator that I also made for Dean, while we learned Python basics together.. 

..but anyway, I figured adding these to my n00bc0d3r repo would help me understand what GitHub has to offer. After I think I have a decent foundation concerning GitHub I'll start diving into the Flatiron Prework, experimenting on my own, and looking to projects that I can work on with others.

For now please enjoy perusing through my n00bc0d3 above or take a gander at this accurate artist's depiction of my computer:

Sunday, May 5, 2013

GitHub First Commit?!





So I woke up this morning, got some bagels, and it's still before 1 PM so boyfriend.exe is likely not to finish it's nap for another two hours.


Upon checking facebook I found that a young Mr. Ryan was online. This computer wizard, for sure, could help me with my prior issues with my first commit to GitHub. has informed me that it won't show characters when I type in my password, even though it's taking it.. so I just need to type it out and hit enter. Not even asterisks, git bash?! Come on..

Alrighty, so I tried again! I navigated to the folder with the README in it, entered my password and username.. and once again..


GitHub keeps screaming at me; "WHY ARE YOU DOING THIS I KNOW SOME POWERFUL PEOPLE YOU WILL REGRET THIS!"







Mr. Ryan thinks my install was funky. We uninstalled plain-old Git and just left GitHub on my machine, because I probably won't be needing Git until I've already enslaved a few computers...


I've managed to commit a few things to my repo, but I'm still like "What did I just do, I don't understand." but I figure Ryan said them to me, I did them, and they're floating somewhere in my brain.. so hopefully as I read the GitHub guide it will catch those fragments and solidify them inside my mind.


For now, this is good enough for me!





Saturday, May 4, 2013

Boyfriend.exe is disrupting my training.

Having the boyfriend down for the weekend is extremely distracting.

Since he doesn't bring down his horrific computer anymore, it's either I'm on the computer and he's doing something on his iPad trying to make conversation with me, or he's on the computer being entertained and I can't practice anything.

The good news is that I'm buying a chromebook in the next few days, the Samsung series 3 one, and then once I have that (provided I can get GitHub to obey me) I will be able to work while he trolls people on Team Fortress.

Tomorrow I will try and convince him to watch TV or play one of my playstation games so I can figure out more Git stuff. I realized this morning that I haven't been through 90% of the git crash-course, so that will be my goal tomorrow.. make some headway with that.

GitHub, why do you resist your inevitable enslavement?

..okay well maybe GitHub wants to stop me from enslaving all computers.

Mr. Dan suggested I get started up with it, and so I, once again, read the guide to what GitHub is and how it works. The basic idea seems really awesome, all your code is stored here, all the changes of your code are stored here, make a repository to put your code in.. okay, sure, sounds great.

So then I decided "It's time to do some basic stuff before this knowledge floats out of my head.." and followed along the guide to making a repo in GitHub.

I made a repository for keeping my n00bc0d3 in, used the command line to make a README file somewhere on my local drive (I guess I need to brush up on my command line flashcards), edited the file to say some corny basic stuff, and then tried to add it to the repo..



..well, GitHub won't have that, mister!! It kept asking me, in the shell, for my GitHub.com username, to which I would oblige (even though it made no mention of that happening in the guide..) and when it asked for my password it wouldn't let me type anything into the shell. I was forced to just press enter, to which it would yell at me like "WHO ARE YOU GET OUT OF MY HOUSE MY HUSBAND WILL BE HERE ANY MINUTE", which I'm used to... so I sighed and exited the shell and ate some horrific Japanese food with my boyfriend.

My adventure continues sometime today!!

Friday, May 3, 2013

ENSLAVE ALL THE COMPUTERS

Hi. My name is Mike. I have no idea how Blogger works yet, but one step at a time..

I am beginning my quest to ENSLAVE ALL THE COMPUTERS!

My good friend Dan Miller, as jazzy as he is, is helping to inspire me to further develop my skills as a coder.

CURRENT PLANS:

Step 1: Complete the Flatiron School Prework (http://prework.flatironschool.com/ roughly 80-100 hours worth of work) to learn great new things like Git Version Control, SQL and Databases, HTML, CSS, Javascript and jQuery, Ruby, and Ruby on Rails.

Step 2: Possibly collaborate with Dan on a few projects, just to test the waters of being a real programmer.

Step 3: Continue my studies, put as much money as I can from my current job into a savings account, accumulate enough for roughly 6 months of unemployment, and then enroll in a developer bootcamp such as Flatiron, Hacker School, or App Academy.


Please follow me on my journey. Also, hit me up on twitter (mkurtz424) if you want to yell at me, tell me I suck, or other things.

Peace.