JavaScript Card Game: The Great Dalmuti (or look Ma, I used JavaScript to make a card game my friends won’t play with me!)

Hi, my name is Stephanie, and I’m a recovering board and card game addict.  My addiction has manifested itself in some very concerning ways over the years including a stint of playing DnD with nerds online over IRC chat in college, but the most recent iteration is by writing myself a small JavaScript app version of The Great Dalmuti/Daihinmin/President.

When I am able to coerce my friends to play this game, we all wear different hats to indicate our position in society, because unlike public schools you are allowed to wear hats in my home, and at times it is required like a construction site.  Only, instead of building apartment complexes, we’re building camaraderie?  Clearly, my preference is to give the dudes in our group the pinkest, prettiest hats I can knowing that society typically doesn’t approve of them embracing their love of lightish red and wanting to give them an opportunity where they can excuse their pink-embrace as the whims of a game addict while their hearts palpitate in an elation they had never previously knew possible from headwear.

Consequently, when I threw together cards based on a stick person I was able to create using arial font, they all had different hats to help simulate this very important part of the Dalmuti experience.  My only regret is that the 12 and 11 needed far more different hats than I provided due to a lack of inspiration in the last 5 minutes of my 30 minute hat making adventure.  Which is why those will not be cards I show you intentionally.  Instead, have an apple merchant:

Or, you know, a red blob saleswoman.
Here we have an apple merchant. 

She has large feathers in her luxurious purple cap and has done well in an apple-deprived market. Apple pies, apple crisps, and apple cider are the mainstays in the realm, and she is rolling in apple dough so much her feathers are bigger than her arms. Life is good for the apple merchant.

Totally did not make her an apple merchant because apples are easily distinguishable at small sizes.  It was definitely a lore thing.  Definitely.  Same with this carrot guy.  Lore.

Or, the amazing orange stick salesman.
The carrot merchant. 

A man with small feathers to signify his small wealth in comparison to the other merchants, especially that darn apple merchant. There was a time in his life where he spent day in and day out trying to convince the members of the realm that orange is the new red, but after being threatened with incarceration by the Great Dalmuti himself, he resigned to his fewer boxes of unwanted carrots and accepted his lot in life. After all, he could be a peon.

Look at that well-developed story line.  It makes you want to play a card game with robots because your friends won’t play with you, doesn’t it?

On a more technical note, this was fun to practice for some of the different things I’ve learned and a nice break from my behavior tracker app I’m working on.  I added some changes from my original based on suggestions from friends and spouse (ex. delayed listing of what the script in the browser has played rather than it showing as it loads which is instantaneously from a person’s perspective).  There are still some aspects of the game I need to implement (wild cards, revolution, greater revolution, taxes after the 1st play through), I want to make a much better UI, and I need to refractor my code a bit more since in some places I’m pretty sure it’s a bit awkwardly put together.  I’m also likely going to put together a multiplayer version using me some node and socketIO, but that’s for later because if I could get friends to play with me in the first place I wouldn’t have needed to make a computer version.

In the mean time – hats.  Hats are the answer.

Advertisements
JavaScript Card Game: The Great Dalmuti (or look Ma, I used JavaScript to make a card game my friends won’t play with me!)

My nemesis: AngularJS docs.

Hello neglected blog!  I’ve missed you and your beautiful blue-ish pages.  I’m sorry it’s been so long since I’ve interacted with you (and my faithful 15).  I am drowning in the sea of AngularJS as I dig around the MEAN stack.

And I do mean sea.  As anyone who has attempted to read AngularJS’s docs can tell you, the experience is special in the way you describe a friend you personally love but are very aware that anyone who hasn’t spent the time getting to know them will need to invest a large amount of time disliking them to find the love.  With AngularJS docs, as you stumble upon the first page that you’re almost 100% certain any other documentation page for such a large scale project would include the information you’re looking for about the module you want to implement to make your HTML page not look like, well, this:

Yeah...learning is fun.
An uncomfortable mixture of unreadable and mid-html logic intensive that will inevitably be reused when I get back to my login page again and failing to be DRY.

When you navigate to that page in the Angular docs, it starts to answer the question, letting you step into the sea a few inches, feeling the sand between your toes, certain this is the relief your mess was looking for.  Then, as you inch in further, suddenly you realize the sea was not a sea but instead a decapitated kraken in a kiddy pool who wants nothing, as it is mindless and headless, and instead will grab you by the ankles and throw you about the bouncy edges of its plastic entrapment until you resign, regretting your trip to the sea, and crawl away onto the dried out, dying lawn.

Which then leaves me digging around blogs.  The bad thing about bloggers (such as myself), is often we don’t update for years in a row.  So while we had a solution that would have worked a few versions ago, we don’t have a great one for the moment – or even a mediocre one.  So essentially it’s like looking for the sea and finding a puddle.  Sometimes this puddle can offer a bit of relief, but more likely than not if you try to drink from it you’re going to get a disease (in my case, looking at other blogs in hopes for a bit more detail) that will result in hours wasted and no actual relief.

Then I decide the solution is to use vanilla JavaScript, but then I look back at the rest of my code and see how odd that little chunk seems in comparison to everything else.  It’s like meeting an adorable toy poodle with a very unfortunately uneven haircut that looks like missing blocks in a LEGO recreation of the Tower of Piza.  So then I hang my head in shame, crawling back to Angular, apologizing for my failures, and begging to be taken back as a negligent neophyte.

You talk to mentors, peers, anonymous strangers on the internet, but they all respond the same.  “You check Google?” because JavaScript is often perceived as the bastard child of programming languages, and so finding those dedicated to it is like trying to find a bastard child in good standing who will dedicate themselves to live on a giant wall of ice without reasonable comforts in celibacy without being forced there (i.e. Jon Snow).

Consequently, Google frequently leads to this:

xkcd reading. Wait, no. StackOverflow. I’m pretty certain DenverCoder9 moved on, tried something else, and succeeded. (Un)fortunately, I am the embodiment of perseverance (read: stubborn), so…

Unrelated, I’ve interacted with some dev bootcamps & their former students lately out of curiosity (or more realistically wondering if they had a magical instructional model that the internet and bookstores did not), and decided against pursuing it any further, at least not for the foreseeable future.  Maybe I’ll write a post about that later once I’ve finished finding some body of water of AngularJS knowledge that won’t beat me senseless in a kiddy pool, act as a massive time sink without much gain, or simply fade into nothingness.

In summary, AngularJS docs are my nemesis and why I’ve been a negligent blogger.  Google overlords, you have failed me 😥  If anyone happens to know a resource to find information on modules that isn’t painfully out of date, I would LOVE a link.  Love.  Like I would marry that link, eagerly wake up to see it every morning by my side, and grow old with it.

My nemesis: AngularJS docs.

Getting MEAN: Building My First Web App for Realsies (and also fries are the worst food gift)

You heard me, for realsies.  I even got to self-create security violations, but thankfully as the app works now it doesn’t include usernames.  Unless you’re capable of inferring.  Then, yeah, definitely an issue.

Not THE Batman.
I AM Batman.

I love you, internet, you’re a great outlet for all of my weird.

But first?  Fries.  Three nights in a row, my husband has eaten out for dinner due to working crazy hours recently (poor, handsome bastard).  Since he knows the secret to a happy marriage is food, he brought me home left over fries.  Now, I love fries.  When I was a kid and I got fries from McDonald’s, I would happily eat those hot, salty, death sticks as soon as I could get my fingers on them.

I ate them before my cheeseburger.  Not because I didn’t love the hot, cheesy, non-compostable burger as much as the death sticks, but because the death sticks would gradually develop a weird texture and consistency as they grew cold.  This is especially true with fries that will actually decompose over time such as those that you get from a sit down restaurant.  That crispy, crunchy, delicious starchy stick just turns into a cold, lumpy, limp, soft wad.  It’s like coal in your stocking on Christmas.  Complete disappointment unless you happen to live in a town running on coal power that is running low, and for Christmas you want to give everyone around you warmth again.

So I tried a few solutions.  One: microwave.  BAD idea.  Ten times as soggy.  Two: oven.  Took way too long.  Still quite soggy.  Three: Toaster oven.  Still soggy, but warm fast.  This may have been improved if I could cook directly on the toaster rack without complete and utter fear of causing a small fire.  This may have been a fear exacerbated by the quantity of “in case of fire!” signs all over my toaster oven, I admit, but also fries slide through thin cracks quite easily so it may also just be a common sense thing that I wish didn’t exist.

I tried to think of other food gifts that came home as bad as fries.  Don’t get me wrong, anything that is a starch to which you add sauce isn’t great (burgers, sandwiches, etc), but a quick run in the toaster oven can fix all of those.  Fries though, too thin to be toaster ovened without aluminum foil.  Tis truly a shame.  If anyone has a leftover fry solution, let me know, cause I have quite a bit left.

(Side note: Dear Husband, if you happen to read this, please don’t take this to mean that I do not appreciate the lumpy food gift, but rather that I am desperately seeking a way to improve my enjoyment of the lumpy food gift as google has not provided an answer that works with the cookware we currently own.  This was a pretty close answer though.)

Now onto the programming portion of our lecture.  A couple months ago I followed a django tutorial that told me I made a web app, and once I finished the site I had loaded congratulated me for my amazing endurance for all of the 5 minutes it took, but I knew the truth.  I knew I had accomplished nothing.  When I attempted to make my own web app at that point, my brain laughed at me and called me names, so I knew I had more work ahead of me.

I landed on learning the MEAN stack because it could all be done in JavaScript.  At that point, I’d finished a majority of the Headfirst Javascript book (2 chapters away from the end, I believe?), so I really wanted to learn something that I could use to help solidify what I had learned about JavaScript.

I have an idea for a program I want to make for some of my old teacher buddies to make life a bit easier, and while I have an idea of the kinds of data I need and some of the objects, I decided it’d probably be better to start with something a little simpler.  There were a good dozen plus websites going through MEAN stack tutorials creating a to-do list (the “Hello World” of web dev), and a few making chat programs.  I decided to be awkward and make a chat program where you talk to yourself and no one else.  Why?  It felt right and had the kind of functionality I knew would be a good stepping stone into the future.  It also allowed some really awkward test cycles where I posed as Batman and used the classic trilogy throat-tearing voice every time I posted a test.  It made the whole experience feel way more epic.

Using a combination of resources including the documentation for node.js, angular.js, MongoDB and express.js, multiple websites, blogs, and video lectures from strangers, it took me about a week of working on it after work to get it together.  I learned that express.js is a beautiful blackbox where I don’t know anything about what goes inside, but I should probably learn what happens in that blackbox.  Finally, the best learning tool of all was learnyounode.  The reason for this is because it is called learnyounode, which automatically makes it amazing.  Plus it just gave you problems to solve using the JavaScript you hopefully know to start creating a web server.  Pretty good times.

Here’s a link to the outcome.  More importantly, here’s a link to all my testing posts.  It gets weird in all the right ways with Batman, Joker, and Robin being the stars of my tester accounts.  This page would look a lot less awkward if I tagged the users who post, but since, again, my intent is to only see MY posts alone when I sign in, I don’t see this as an issue.

I think my next step will be to start working a bit more on the app I’d like to build for my teacher friends.  I’ll need to plan out what it needs to do and how it will work a bit more first so I can get my MVC on.

Getting MEAN: Building My First Web App for Realsies (and also fries are the worst food gift)

Simple JavaScript Image Slideshow: Refactoring = Progress!

Now, I know the posts about me programming are a bit dull since I’m still very much a beginner, but since I didn’t have any activities scheduled this weekend and no work stuff to take care of, I felt like I was finally able to make some significant growth in my programming powers.  Admittedly, compared to anyone who is even remotely competent, I’m still a babbling baby, but still, it’s pretty cool to go back to something I made about a month ago from going along with a webmonkey post to going through and making it my own AND more easy to read, change, and follow along with.  I think the combination of those two things are something I really love about coding.  You can look up just about anything online (at least for the kinds of problems my beginner butt is running into), and then you can recreate bits of what you find with other knowledge you have to make them more simplistic or elegant.

CS vocabulary has been a bit new to me.  There are a lot of words I know in completely different contexts that have a very different definition in CS.  I’ve been trying to track new words I learn as I read about them and trying to see if I can understand them without my brain hurting while looking it up.  Sometimes I’m completely able to get it, and other times I sort of brain fart and feel like a toddler again.  So, for example, I read an article about a person who was working as a recruiter for a company.  This company was concerned about gender/racial bias interfering with its interview process, so together with the recruiter decided to do the programming portion of the interview with the candidates completely anonymously online.  Aside from written language (which one might argue could give some of this information away), he never saw or spoke with the candidates.  He gave them a refactoring challenge where they were to identify code smells.  When I read through the rest of the article, I was completely and utterly confused about exactly what it was he was having them do, but from what I could guess at the time he was having them look for hints of something being inefficient or problematic in the code then restructuring it.  Thanks to some quality time with my overlord Google, this turned out to mostly seem accurate.

Refactoring is when you alter the internal structure of the code without changing its external behavior.  When I wrote the first draft of my slideshow code I hadn’t any experience with objects or events, so when the site I followed along with pointed out different events, I just sort of rolled with it without really fully understanding what was going on beyond that when something was clicked, I told it to execute a function.  I also used global variables quite liberally, because that was the only way I really knew how to get some of the work done that I needed.  Even after I switched out all my functions to be methods instead, this hasn’t really changed too terribly much if I’m honest, but the beginning value of the variables is all easily accessible at the beginning of the method object.

Now, with the original script I had made a slight change to it.  I had added a while loop to create the imageArray[] since typing them in individual was not on my future desires list.  At the time I felt slightly successful being able to make that change, but ultimately I had mostly ended up with code very similar to the article as I wrote it after reading what needed to be done, and then I compared to what they had with functionality.  Not a great strategy, but again, the event handlers were a bit over my head at the time.

When I went through it to refactor, I renamed some variables to names that made more sense to me.  I added comments.  I restructured it to have the functions sorted as methods in objects and all the variables within objects as well.  None of what I did was really ground breaking, and a lot of it was work I honestly will probably change again as I continue learning in the next few weeks, but it helped me practice the skills I have learned and apply them, which is always helpful for retaining information and being able to use those skills creatively in the future.

You can go to my GitHub account to check out the code and the revision in a Gist.

One thing I need to revisit when I’m less sleepy is the event handlers.  I left them in HTML like I had before since I was running into strange errors when I tried placing them in the JavaScript instead.  I believe this was caused by setting the onclick handler and trying to pass it an argument, which I don’t believe is supposed to happen.  Without the argument, the rest of the code was no longer interested in functioning.  I checked some JavaScript documentation, but I wasn’t able to come up with an alternative that would work any better than just leaving the event handlers on the HTML page.  I will likely need to review options when I’m less sleepy, and with any luck, I’ll keep thinking about it while I dream and wake up with an answer!  I love code dreams.  So productive.

Next: to improve the Battleship game.

Simple JavaScript Image Slideshow: Refactoring = Progress!

Another New Year! (sort of) and Other Sources of Reflection

Happy Year of the Goat!  For the first time, I was part of hosting the Chinese New Year celebration rather than mooching food and butchering my knowledge of Mandarin to say thank you.  Much food happened, we made the best spring rolls of all time, then we ate them all with friends and family.  Everyone was happy.

This allowed me an experience I typically have twice a year.  Once during New Years Eve and again on my birthday in August, I typically have this moment where I reflect on where I was this time last year and realize what an idiot I was.  Without fail, I think about myself a year ago and always know that I’ve grown a lot and that if I met myself in the past and had a conversation, I would stand in disbelief staring at myself and my actions, regarding myself as ignorant, naive, and childish in comparison to the present iteration.  This is one of the many reasons I’m incredibly against any attempts at time travel and time travel movies just make me uncomfortable while I suffer through their infinite plot holes.

If I had to meet my past self, we’d inevitably get into a fight.  My present self would be frustrated that my past self didn’t know what my present self does even though they’re technically the same person, and my past self would feel my present self was awfully sure of herself and borderline arrogant.  This most likely would stem from the fact not enough time had passed that I feel like there should be a significant difference in our awareness, and given that it is essentially me who isn’t living up to my standards, I’d get irritated, where as with anyone else who doesn’t live up to my standards I’m generally pretty supportive and encouraging to help them improve.

If, however, I was able to meet up with a past self that was a significant amount younger, say a decade or so, I imagine we’d get along quite well and spend the time figuring out what age I actually was when something happened rather than assuming I was 8.  My present self would admire how dorky and awkward my past self was, feeling accomplished that as an adult I had managed to cover it enough that when I announce it to people who know me at a professional level they don’t believe it is true, but as soon as that boundary crosses into friendship they can’t help but be awestruck at how long I managed to cover and compensate for my social flaws thanks to a large amount of confidence making it appear as though everything I did was normal.  My past self would look up to my present self, proud of the fact I had a dog and finally started studying coding rather than hesitantly colliding with it before running away over and over again.  They’d be a bit perplexed about how the husband happened, but probably accept it if they happened to meet present husband as well.

So, yeah, time travel should never be a thing.

On Chinese New Year, I briefly thought back to where I was last year, and I, as always, just ended up feeling sort of weird about myself.  This time last year my husband and I had been engaged for a couple months and felt sort of weird about it (as a former commitment-phobic who didn’t like spending more than a week with someone), had a sinus infection thanks to one of my dear students snotting all over me in the most epic sneeze in the history of mankind during a math lesson, and I couldn’t imagine doing anything in my career that wasn’t teaching.  This year, I’m married to my dear husband and feel amazing about it, have a shoulder injury I spend hours each week at PT to resolve due to a very angry student, and really want to become a programmer.

Those are all some pretty big changes.  I’m especially grateful that my husband has been as supportive as he is about my desire to change careers, though I know the news has been very shocking to a few of my colleagues since I am very good at my job.  The reasons for it are pretty strong too.  With my injury, I’ve no longer been able to look away from the severe problems in the education system that when you’re working with students on a day to day basis you come across and bump heads with trying to get resources or assistance needed to work with severely impacted students with emotional and behavioral disorders from district administrators who do not respond to phone calls or emails.  I was pretty much shoved directly into it, both figuratively and literally, staring at it and observing it for hours on end every day with no way to ignore it, and those issues are ultimately what lead to the injury in the first place when I received no response.  I could write a novel about these challenges and their implications for the safety of children and teachers let alone the education of students, but I’ll save that for another time.

Since I was eventually placed on actual light work duty, the work I was asked to do was mostly paperwork and on the lucky days helping teachers improve their paperwork to make a positive impact for students.  This meant I was doing a job I no longer took home with me, and the hours extra beyond the typical day were nearly nonexistent aside from attempting to compensate for hours missed due to physical therapy.  I had a lot of time to think about and explore interests, particularly ones I could do without intense use of the right side of my body.  I tried something I had spent most of my life avoiding fully exploring: programming.

I was hesitant at first when I realized I loved it as I gained very basic knowledge of C++ and made silly little programs that did very basic things such as a calculator that no one but me would ever use.  I knew myself well enough to know what when I learned anything new my instant gut reaction was blind love and adoration but that this was caused largely by the novelty of the knowledge and when you first start learning something you see great improvement without much effort.  As I kept going though, even tuckered through scripting in HTML and CSS which were very less mentally stimulating, I still found I enjoyed applying what I learned to actual projects I could improve, make more efficient, and see the changes almost immediately.  Don’t get me wrong – I’m all for delayed gratification.  I love teaching where I wouldn’t see a student’s behavioral growth for at least a month after the initial intervention had been implemented, but that month was hard and often involved multiple instances of unsafe behavior in the mean time.  But the quick way of being able to test and  compile your code, find test cases that would potentially break it and making sure you’ve worked around it, it’s almost like the whole game-ification movement in educational websites.  You get little rewards for your success, but rather than being entirely superficial like the badges on those sites, your reward is simple, functional code.

I love it.  I love everything you can do with programming, the possibilities that can be unlocked, the way computers can do so much that as a human being would take me exponentially longer to process and compute.  I love thinking about a problem then making a simple solution and writing a program to implement that solution then addressing cases that break it.  I love the constant improvement, and adore talking to other people about solutions to problems to learn from what they have to share and how they explain their approach.  My poor mentors have no shortage of me staring at them with love and adoration as I show them my horrible scraps of code and searching the internet for other ways people have solved similar problems with their explanations to the approach.  The constant learning and problem solving is something I loved about teaching, and I similarly love it about programming.

Ultimately, one of the aspects I love most about coding is the fact you get to have that “New Years” feeling of looking back and thinking, “I KNEW NOTHING!  I WAS SO FOOLISH!” on nearly a daily basis – sometimes even multiple times an hour.  In a world without time travel, who doesn’t love a feeling of constant growth every time they figure out a problem they were stuck on?

Some very good news: my physical therapist last estimated that we were just a few more weeks away from me never needing to see her again.  I like the lady, but I really would love not seeing her more than I see most of my friends and family.  On my last progress report day, I scored a “4 to 4-” on a 5 point scale, with 5 points being normal and no need for any interventions.  When I first went in back in December I was at a 2, meaning I had limited range of motion and couldn’t move my arm against gravity very well.  A 4 to 4- means I have most of my range of motion back and can handle some resistance, but still not quite the normal range.

Also the application for ADA closes tomorrow at 5PM.  It’s a web development bootcamp for ladies that would start up in May.  Their programs used to be 6 months in class and 6 months at an internship, but now it’s 7 months in class and 5 months at an internship through one of their sponsoring companies.  I think the extended class time in comparison to other boot camps would be beneficial since typically short term cramming doesn’t lead to long term retention for anyone.  On top of that, I like the fact they have an internship tied directly to it in order to get some experience in a work environment where it’s pretty well accepted that you’re there to work but also very much to learn.  After all, that’s why programs like University of Waterloo’s are so effective.  They place their students in internships constantly so they can apply what they know to real-world scenarios, or in my case work with legacy code.

I submitted my application last week after accepting that talking to a web cam was not my strong point and something I gradually grew worse at doing the more I practiced.  This was disconcertingly similar to my attempts of learning how to dance in middle school prior to our first school dance.  I hope ADA will find it in their heart of hearts to find out I’m actually marginally articulate in person.  If not, I’ll resign myself to continuing to explore other options.

Complete self-study is supposedly a reasonable option, but I would rather have more experience coding with people instead of in isolation since that’s more what the work environment is like in my experience, and I know you learn more from others than you will ever learn alone.  Other boot camps are on the table as well, but the Seattle-local ones typically advertise that in the same time frame it would have been to attend ADA’s classroom only portion but without support or colleagues for half of that time, you will be work ready.  In the mean time, I intend to continue independently studying as I have been in my free time after work and hope I will be contacted for an interview.

There isn’t a doubt in my mind that I will become a programmer; it’s really just a matter of how I’m going to get there rather than if I will.

Another New Year! (sort of) and Other Sources of Reflection

Chinese New Year (Goat version) & JavaScript Slide Shows

This past Saturday was Valentine’s Day, and I have to tell you, mine was quite wonderful.  I went on multiple walks by the beach since it was sunny and dry in the greater Seattle area, wore purple PJ pants with polar bears (there’s that alliteration again!) while working on my website so the “Father’s Photos” section would actually lead somewhere, and played some League of Legends with the husband where we died repeatedly in the most epic fashion possible until his little brother joined us to end our losing streak.

All in all, a very productive day, topped off by trying to figure out what exactly I’m supposed to cook for our Chinese New Year party after deciding my dear husband and I needed to establish a new tradition.  So far I’m at jiaozi (potstickers or gyoza for my Japanese-culinary related friends) for prosperity, oranges because it sounds like the word gold and tangerines for the word luck, long noodles for longevity, pomelo because it sounds similar to the words prosperity and status, spring rolls for wealth, tea eggs for fertility since I know a couple just had a bun in the oven, and a whole fish for prosperity again I believe.  I briefly thought about making jai, but it’s such a complicated recipe with ingredients I’m not familiar with that I’m a bit hesitant to try making it for the first time with a bunch of people coming over since it’s not very kind to feed guests mush!  Even if it looks amazing and would appease my vegetarian friends.  We’ve also made jokes that since it’s the year of the goat we should play the screaming goats videos in the background the entire time to set the mood.

On a nerdier note, following dedicating 4 days to completing my application to ADA (and accepting the fact that I was just getting progressively worse at talking to a webcam rather than improving so deciding to submit it), I had been struggling more than I anticipated at resuming learning JavaScript on Treehouse as part of their front-end web development track.  I think my biggest issue was that it’s enough repeat from what I’ve learned of Python that I felt like I could probably figure it out with some internet time instead of video time, but enough new material that I worried the end result would be slower.  Instead of avoiding it any further, I decided to see whether or not I was correct.  I had 2 sections on my website I hadn’t added yet – Father’s Photos which was intended to be a gallery of the pictures my dad has taken since he’s gotten his new camera for Christmas, and then another section which was either going to be a wedding photo gallery or notes from friends and family that fill me with warm fuzzy feels.  Currently it just has a place holder image while I decide what I want to do.  My issue with the track on Treehouse was that it wasn’t directly tied to what I wanted to do, and it didn’t look like I’d be learning the skills necessary to do it any time soon, and in the mean time it was a lot of repeat of basic programming knowledge I’d already gained elsewhere, so motivating myself was significantly harder.

So I plunked down, googled how to make a slide show or gallery, and came up with a bunch of options that were way over my head or were just downloading a script that used jquery rather than doing it myself.  Where’s the fun in that?  Finally, I found something that was a good starting point at Webmonkey.com.  This possessed a few issues, though.  One, while I understood the code while I went through it, I really didn’t want to type this line 32 times:

imageArray[imageNum++] = new imageItem(imageDir + "01.jpg")

Also, I knew about loops.  Beautiful, simplistic, time-saving loops.  I didn’t know how to do them in JavaScript, so I guessed at first and found out it worked without needing to look up syntax.  So while I mostly used the code described there, I made a few changes.  1) I used a while loop to make my image location array.  2) Instead of putting the script inside the HTML, I changed it slightly so it would locate the folder for the image files through the root directory and I could put my little JavaScript in a JS folder.  3) I wanted responsive image sizes instead of a set width and height, so I kept it set to 100% of its containing element.  After I finished, I stylized the CSS a bit so the options below the image for pause, play, previous and next where were I wanted them, rounded the corners on the photos, and called it good.  It didn’t take too terribly long, and I could definitely improve it with some buttons for the pause/play/previous/next buttons, but I sort of like how simplistic the text looks since it doesn’t distract from the photos.  I enjoyed this project since I learned a lot about how the script interacts with the HTML, and that was something that until doing this I didn’t quite understand – how to integrate purposeful scripts across html/css/js.

By the way, does anyone know if when you use Google as a verb if it’s supposed to be lowercase?  I feel like the answer is yes, but if you make a verb out of a proper noun, it feels like it may be appropriate to capitalize it.  Oh, linguistics and colloquialisms, I love you so.

Now, off to figure out what I want the last section of my website to be so I have another goal to independently study as I continue to improve the gallery section.  After finishing, I found the motivation to continue with Treehouse since I don’t feel like I’m avoiding working on something productive while I go through it.

Chinese New Year (Goat version) & JavaScript Slide Shows

Problem solving is an addictive activity

Did you see that alliteration in the title of this post?  My high school English teachers would have all taken some deep meaning correlated with that alliteration and tied it to problem solving, but in case anyone was wondering the author’s purpose, it’s just that I enjoy alliteration.  It feels right on my brain while I narrate what I type in my head.

Ahem, onto business.  So, life is pretty great for the Lady Liu currently.  Whenever I am looking at a new job, school program, etc…I always decide to google myself to see what’s out there.  My husband and I discovered that I am very likely the only white Stephanie Liu on the planet after spending an hour of trying to google myself on the internet and coming across an adorable Chinese Stephanie Liu who did informal modeling and was all over the first half of our search, a varied assortment of Asian ladies with the name Stephanie Liu, and finally a few white ladies named Stephanie who were photographed by a man with the last name Liu.  So, I went from having the most specific name in the history of mankind where I was the one and only to having a very generic name that only belongs to one of my race.

Now, my dear husband also had a multitude of theories about why this was probably true.  A few months ago we had gone to the jeweler where he bought my engagement and wedding ring, and while we were waiting for it to be cleaned and inspected, a young Asian American man came up to us to tell us how amazing it was to see another “Asian Male White Female” couple since he was convinced he and his fiance were the only ones.  He was absolutely adorable and ecstatic, and my dear husband and I were a bit thrown off, then immediately curious.  Our only regret was not chatting him up more about this.  So, my husband is also convinced that the reason for the uniqueness of my name with my race is due to the same observation the guy at the store made.

It’s possible, but more likely it was just hard to find due to the quantity of people on the planet named Stephanie Liu, and we didn’t try hard enough.  I couldn’t help but feel, though, that somewhere out there there was a computer program to help me resolve this issue and find another of my kind.

Why did I decide to google myself, you ask?  What job or school program was I looking at?  Well, as I’m sure you’ve noticed if you’ve read this blog more than just today, I’m trying to learn how to code, and then I gradually realized I love it because problem solving is addictive.  For example, I spent a few hours making myself a lovely abacus program in Python that would take any number through the billions and print out an abacus replication of that number.  It was likely incredibly inefficient, but after getting it down to 8 lines of code, I felt pretty good.  Trying to think of a simple solution to a problem that you can explain to a child then make a program based on that solution that’s equally simple to code is a fun activity – especially since I’ve noticed prior to this my brain had a tendency to make things far more complicated than necessary by taking in too many variables all at once.  Thinking through a single variable and its impact at a time before additionally complicating things is oddly fun for me.

So because of the above described love of problem solving which was still present prior to learning basic coding, I was drawn to it.  I think this is something I would really enjoy as a profession, especially after having a few experiences of working on my code with a couple other people.  It simulates a lot of my favorite aspects of teaching or even better it accentuates those aspects I love and makes them the focus.  Consequently, I’m currently applying to ADA, a year-long program for ladies with 7 months classroom instruction and 5 months of internship at a local Seattle company.

I’m enjoying the application so far.  Making my resume in markdown on Github was fun, and I finally put something on my Github account I had sitting there for quite a while and hadn’t spent the time to learn how to use.  The hardest part was likely that I had no idea what kind of information to include on my resume.  For example, on a traditional teaching resume, you are expected to include all your work history since you were 18 on some part of your application or resume due to background checks to make sure you aren’t a creeper.  Furthermore, for teachers with less than 5 years of experience including all your practicum and internships is typical.  Given I’m applying for a program I don’t technically have any related experience for, which is sort of the point, figuring out what to include was rather challenging.  Discussing this problem with a variety of people, I decided to go with my most recent experience, teaching, and technologically related experience, tech support from undergrad and a bit after.

The part of the application I’m currently working on involves using a CSV data file to get different pieces of information then explain how you did it.  The one I’m having some slight difficulty with, likely because I’m over thinking it, is a portion about whether the market is on public or private land.  Now, after consulting with the internet, apparently no one agrees what is considered public or private land, aside that it’s generally accepted that roads are public and some parks are.  Given this was a problem, I decided to contact a couple lawyer friends of mine.  Turns out, they also had no idea and after one checked in with a buddy who did land law, he came back saying the response he got was that whoever could BS better would win in court, which told me they were likely uncertain themselves.  So…yeah.  More research, I suppose?  If more research doesn’t solve that problem, I will do what many teachers do when asked to answer a question they suspect could use slightly better definition – define it myself!

Another bonus – the application motivated me to get the basic, basic website I’ve had on my hard drive finally uploaded to the internet.  Head over to stephanieleighliu.com if you’d like to see a very, very simple sample of what I’ve been dinking around with between Treehouse, Udacity and the rest of the internet.  It’s pretty simple for now, but I’ve definitely learned a bit about different features by making it.

Also, robots are amazing.  Mine is currently vacuuming my floor, and it feels right watching it work while I sit and type rambling blog posts.

Problem solving is an addictive activity