100 Days of Code: CRUD, suckas

I’m about to vomit. I have my latest DoC as a PUT request. Now this is a code to be done in a day, and I’ve got 80 minutes before it’s no longer today, but I am happy with it. I can return and style it better an other day. I don’t care. Tomorrow is a day at the lake.

The important thing is that I can PUSH, GET, DELETE, and PUT. Things that once made me cry now make me dance. Yes, it does help that I’m not getting graded, and my house isn’t flooding. But even after the house was cleaned and I was assured that I’d eventually get it, I let fear and a severe lack of self-confidence become huge walls. I know walls. I’ve run a few marathons and done long rail-trail rides. Unlike those walls, I do not have glucose gels for my psyche. 

There will be another Ajax-like bug bear for me, but now I have this to look back on. Yes, I got stuck, but I got unstuck. Glad to have this for when I need it later.

Ahh. Now to fill that database with greyhound fosters.

100 Days of Code: Day Thirteen

Ermahgerd! That took forever!

I want to get into edtech. When I taught, I enjoyed creating my own games, songs, etc. to help the kids learn and enjoy learning. A typical exercise is unscrambling a word, so I wanted to try to make my own. 

This turned out to be quite the endeavour. I had to play around with the scope and reset. I could bore you with the long tale of it all, but I rather not. I asked for help from my cohort and former instructor. Was tempted to get needy (was probably very needy); however, I did not once say “Just tell me!”. That never is helpful. This is not an assignment. This is me playing around. Coming to a working exercise the hard way ends up teaching me more. Giving me the answers doesn’t make me feel good in the end. (Much happy happies to those who helped.)

Unscramble German words for animals

100 Days of Code: Day Twelve

Life got in the way. No regrets. The time away forced me to think and not do, especially on the two 15-hour road trip days. I could just think and plan. Couldn’t even write ideas down. My co-pilot was 14, so I couldn’t convince her to take the wheel. Not even for cookies. 

I took the daughter of some friends from a camp to their home (states away). I had a great time hanging out with a 14 year old who did not know me at all. Her mom and I hadn’t really thought about that too much. Didn’t matter. Even better was that aside from being delightful, she’s a talented artist. I asked her if I could use her drawings when I code. 

I wasn’t sure what to do first, but a basic experiment with hidden buttons and making them the shape of what they cover was plenty for me as a warm up. I’m just now getting my rest back. Oh, but I would do it again. I look forward to watching her skills take off.

Tevka’s dragonfly

Did you check out the wings? Are they not just perfect? 

Now I have to figure out how to honor her sister’s personality and swimming skills. 

100DoC: 1 week of intermission

My intentions were honorable, but life gets in the way. Currently, life is my own two pets (a greyhound and a cat), a foster greyhound, a friend’s greyhound, my mom’s Australian shepherd, and a friend’s daughter in town for a gymnastics camp. It’s a menagerie with day-long side trips. 

There’s no active coding, but the benefit is that I can’t do anything but plan and think. No jumping in. No making up something just to satisfy a goal. And there’s lots of codepen going on. 

But my god, am I ever scooping a lot of poop!

100DoC: Day 10ish

Yesterday I could not finish my memory game. I will. I need help. Or a rest. I’ll get both. Maybe even some ice cream. 

Instead of donning my cranky pants, I opted to do an -ish. This is day 10ish. Day 10 is still a memory game, and don’t you forget it. Although I could not get the code right (yet), I learned the Fisher-Yates Shuffle algorithm and revisited prototypes. Today I decided to play with both. 

I brought the Array.prototype.shuffle from yesterday’s code into today’s, and then wrote three more functions that used my very fancy and kind of sexy prototype. I scrambled eggs, which also was an exercise in CSS shapes and dynamically inserting elements into a hardcoded element. I shuffled my name, which was not at all challenging. I shuffled your name, which entailed my capturing the name from an input field, doing some .string() magic, and then shuffling. 

I kind of like making prototypes. Unfortunately, it sounds all robot like, and whenever I think of prototypes, I get that dumb Styxx song stuck in my head. If I should suffer, you should, too:

DNF and DNC

I didn’t finish my code last night and did not care. I still coded. Have gone only one day without coding since code school finished. I have not always completed a mini project, but I coded. Same goes for last night:

image

I swerz flipCard is defined. SWERZ! My abdominal muscles aren’t, but … c’mon. I know it is. 

I wanted to build a matching game that I could alter. After watching Adam Khoury’s video tutorials on building a matching game and creating an Array.prototype for shuffling, I got started building a matching game. Probably started too late, looking back with my hindsight shades. Maybe another few hours, and I’d have found my error(s?), but here’s the deal: yes, I love coding, but there are more important things in my life. I foster greyhounds. I got Gregory yesterday, one of the Pensacola Six to come in yesterday. Zero home experience. Obsessed by the mirror (such a teen). Clueless about sliding glass doors. Major velcro tendencies. Yesterday I could have started coding earlier, or I could have hung out with this fella: 

image

Admitting that I love something more than coding is not to say that I don’t still love it. I would hope that we all love something involving sentient beings more than coding. Getting back to my match game, to learn it, I’m starting with a simple (read: boring) matching of pairs of letters. I hope to change the “deck” once it works to something involving greyhound rescue or even my other love: foreign languages.

 I plan on finishing the memory game today, but let’s not end this defeated: I did have some wins. I can explain the Fisher-Yates shuffle in layman’s terms and can code it by heart now. I didn’t plan on memorizing it; memorization came from obsessive love, like your crush’s mobile number.

image

I want to shuffle all the things!

image

100 Days of Code: Day Nine

Probability.

Not really a lesson on probability, but an exercise for me in making random number generators and playing with JQuery.

I find that the hardest part is coming up with something to do and then not having that explode into something too large for the amount of time left. If I’m not struggling coming up with an idea, I’m getting too many and they’re vying for attention in the noggin. 

DRY! Yeah, I know that I did, but I just started out with doing 1 out of 2 and then 1 out of 100. I don’t know if it was boredom or greediness, but I did a bunch more in between. I think that interrupted the original plan, so where doing about the same code(ish) twice isn’t really repeating myself, doing it seven times is. If I were to revisit (and I might), I’d see where I can replace repeated code with a function.

Clearly I am on a math kick: 

You’re probably wrong

(Nothing done yesterday. Vertigo + dehydration + migraine = “Feck off, mate!”)

100DoC: Day Eight

Ha ha! Bite me, Leibniz.

And here I was thinking that redoing Day Seven’s Pi function took up my entire day. What on earth can I do with that leftover code? Hm… I was entertained by the Gregory-Leibniz Series and how it was more accurate the more iterations it made, so I wanted to have a little function to look at how close the output get to Pi when the number of iterations increases.

100DoC: Day Seven again

MORE PI

While playing with my code, I learned that toFixed goes out only to 20. How did I miss that, and, more importantly, WHAT IS THE POINT!? I wanted to take Pi out further. I don’t like to be limited with pie or Pi. Other than hardcoding the first 100 decimal places, how would I do it? 

I looked at Leibniz formula: 

I kept increasing i. The more iterations, the more accurate. See my problem there? If I just do i=5000, then it doesn’t even come out to 3.14159, the digits most people remember. When I’d take it out to i=1000000000, it was more accurate, but the program was slower. And I still couldn’t get it to show more than 20 decimal places. I downloaded some libraries to help (bigdecimal, decimal), but I am still stymied. 

I learned plenty, but I also learned that I’ll let the computer limit the user and change the system. I also added validation codes. I might know what numbers to enter, but I have to remember to code for weenies out there.

A lot learned. I’m sorry that I can’t do the Leibniz version. That was fun. I’ve kept it in the code but commented out for when I’m alone at night and want to nibble on German pi while ogling this sex machine: