Leaena

Inside My Head: Learning JavaScript

Nov
30

I have had a very productive weekend so far (and it’s only Saturday!). I am spending some of my day today going back through my easy Coderbyte solutions and cleaning most of them up. I will also be adding in comments for most of the lines explaining my logic. So a lot of the files will look like this:

 function FirstReverse(str) { 
   return str.split("")  //splits the string into an array of characters 
             .reverse()  //reverses the array 
             .join("");  //joins the array back into a string, with no space between the characters 
 } 

This is actually a lot of fun for me. Now that we’re getting into more abstract concepts like MVCs and servers it’s nice to just go back and power through some JavaScript code and understand exactly what it’s doing.

As always, you can find my coderbyte solutions on GitHub (I will be posting updates to it throughout the day), but I feel like I need to start adding a caveat, because of the amount of people who have said they found my blog looking for coderbyte solutions. Just staring at my code isn’t going to make you understand JavaScript. You need to do it for yourself. If you’re brand new to JavaScript, just seeing the cool tricks is not going to make you a programmer. I really recommend things like Udacity, Codecademy and other sites that talk about the fundamentals of comp sci/programming.

Week 3 – Less Work, More… Work?

Nov
28

School-wise, this week was very, very short. Today is Thanksgiving and I’m almost a little shocked that we got it off (although many of my peers are spending their day at the school if the emails about keys and door opening flying back and forth are a good reference). Because of the shortness I was thrown a bit off guard on Monday when I realized that it was time for our 3rd assessment already! This is week three! It feels simultaneously like I’ve been here for days and for years. The assessment went well and I actually remembered all my things from the previous week without too much panic. I did have a hilarious nightmare afterward that involved me being forced to code a merge sort algorithm using a pencil and a very limited amount of paper and my lead instructor yelling at me for my terrible handwriting (this is why I love computers! I have terrible penmanship).

Because of the short week we basically just went straight into Backbone.js this week, which for my non-coding followers is a JavaScript library that allows you to structure your app cleanly by dividing the work that must be done into the actual data “models” and the way you represent that data to individuals “views”. This concept is what’s called an MVC, which is one of those trendy/useful buzzwords you hear a lot in coding. Anyway, it’s what we did in class this week and I plan on working on it a bunch over my long weekend.

Unfortunately because this is the longest break I have besides solo project time during Christmas break I think I’ve put more on my to-do list than is physically possible (especially since I promised my platonic life partner Ava I would help her with her Hackbright project too). Lets run down what I have on my list:

  • Review algorithm time complexity (Big O notation)
  • Practice recursive problems
  • Make business cards:
    Personal business cards of awesome
  • Work on my Backbone project (we are working on it through next Tuesday, but I want to tackle some of the extra credit)
  • Redo/refactor some of my Coderbytes code – I’ve learned a bunch, I can probably do better
  • Research getting involved in some open source stuff/get some pull requests in to bigger projects
  • Maybe try learning Ruby on Rails (we might lose out on the Ruby on Rails sprint because of the timeline of holidays)

So yeah, I’m probably a crazy person. Today I will eat and hang out with friends and be merry though. Tonight I will allow the code to creep its way to the front of my brain again. I also plan on writing a more technical article on time complexity sometime this weekend if I can wrap my brain more fully around it so I can pass along the tips I find.

HackReactor , , Comments Off on Week 3 – Less Work, More… Work?

Week 2 – Programmers Do It Algorithmically

Nov
24

I have less pretty pictures for you this week. The most I saw of the sunshine looked similar to this:

View from the 8th floor

At least it was sunshine. It “rained” for like a minute one day and the umbrellas came out en masse. I was perfectly happy in a hoodie, but I definitely felt like an outsider. I might need to buy an umbrella, this whole trying to not look like a tourist thing is harder than I thought. Although I’ve had more people ask me for directions this week than I ever have in my life combined so I think the hair and the nose piercing are good SF camouflage.

This week was a teensy bit rollercoastery for me. We started out with a fairly easy CSS/fun jQuery tricks problem and then tackled a pretty epic sprint on the N-Queens problem. N-queens is the idea that you need to place n (a number) of chess queens on an nxn chess board so that none of the queens can attack any other queen. I think they’ve only solved it up to 27 ( and that was people from Hack Reactor). I got a little flustered with that one as algorithms were never my strong suit before this (it’s why I got the “conditionally acceptance” at App Academy – thank god, might I add). I think though I’m just being too hard on myself. Not every software engineer deals with something as crazy as the n-queens problem on an everyday basis. Our more traditional daily toy problems (similar to tech interview questions) are fairly straight forward and I can code a bubble sort algorithm in about 5 minutes (maybe 10 with one hand tied behind my back).

I think that’s what Hack Reactor has done for me more than anything else. It’s made me accept my flaws, but know that everyone has them and there is always more to learn. I’m a good intuitive coder, but I’m no good with the lingo of it. We all are here to learn to become great coders Software Engineers.

Short post this week, sorry. I have dinner with friends to go to and my Sunday is too peaceful and sunny (and full of awesome 50th anniversary Doctor Who) for any more words.

HackReactor , , Comments Off on Week 2 – Programmers Do It Algorithmically

Week 0, Day 3

Nov
06

Still pretty quiet here. I’ve been helping Ava with her game and looking at some basic tutorials for Backbone and Angular. Then I got sidetracked into learning VIM.

I did hike up the epicness that is Taylor St on a lunch break with Ava to go look at Huntington Park. The views were amazing and I love that I can still wear a T-shirt (no sweater/coat necessary) at all times, even on my evening trek to the BART station and “home” home (Ava was upset by the quotes around the word home so I had to change it).

On the way up:

Up Taylor St

Looking down:

Looking Down Powell St

Looking at the Bay Bridge through the buildings (another thing I love, it looks like stereotypical San Francisco everywhere, tall buildings, funky old fixtures, and a strange mixture of people types):

<img src=”http://res.cloudinary.com/leaena/image/upload/c_scale,h_800/v1391709300/2013-11-06-12_47_39-768x1024_p9tbab.jpg” alt=”Bay Bridge on California St width=”600″ height=”800″>

HackReactor , , Comments Off on Week 0, Day 3

Impostor Syndrome

Sep
05

Impostor syndrome describes a situation where someone feels like an impostor or fraud because they think that their accomplishments are nowhere near as good as those of the people around them. Usually, their accomplishments are just as good, and the person is being needlessly insecure.

Geek Feminism Wiki

The lack of posting this week is entirely related to the above quote. I spent the long weekend working on my pre-course work for HackReactor. It was awesome and fun and sometimes frustrating but I was powering through it. Then somewhere on Sunday, I got stuck. It was a stuckness of monumental proportions and looking back on it now I find it funny.

I have a method to my madness with coding. I add things, test them and add some more until I get stuck at a point where either I’m not sure how to implement something to make it do what I want or something I thought I’d implemented isn’t doing what I expected it to. Then I do a bunch of Googling, look at some examples, hack those examples to fit into my code and all is well again.

And that’s how it should have gone when I got stuck on Sunday. Instead I kept banging my head against the brick wall of stuckness, moving some code bits, rewording some code bits, and finally starting all over again in frustration. By Tuesday night as I had a Google Hangout date with my best friends, I was freaking out. Please keep in mind that I’d received this homework on Friday and I don’t have to finish it until I start school in November and at the point of my stuckness I was about half way through with all of it.

So yeah, the freak out was definitely unwarranted. I made it this far but I’m still worried I’m making a bad choice/going to be that one person in their program who doesn’t get a job/nobody will ever love me. You know normal fears.

It’s a day by day process telling myself I’m good enough. Today I finally came back to the thing I was stuck on and sorted out my issues in about an hour. Now I’m on to the last step, my best friend recursion.

On Track

Aug
27

2nd interview with HackReactor today! This time it was an actual tech interview so I was even more nervous. Once again my interviewer was a pleasure to talk to and very calming. I also picked up my new favorite phrase: “You nailed it with a nail gun.” This was in regards to one of the functions I had to implement. It’s crazy how different my experiences with interviewing for two different schools where. AppAcademy just was not warm and fuzzy at all which I guess is OK, but they just never seemed to care who I was, just what I could do with code. I did OK (got a conditional acceptance pending a final interview) but I felt like they put so much emphasis on logic puzzles, which, heck, shouldn’t they be helping me with in prep to get me a job? I’m also not sure how I feel about the lack of finding out whether I’m some crazy mouth-breather who can’t even interact with people. I just wonder what types of people end up in the class.

HR on the other hand has been surprisingly FUN to interview with. It hasn’t been exactly easy, but it has been fun to play with JavaScript. The first interview was nice and lite and I got to show off that I knew what recursion was (but forgot to add a base case initially – d’oh). Then the take home work was well designed and pushed me along to learn some jQuery and how to pull data using AJAX. Then the last tech interview had me creating my own versions of some Underscore.js functions which was fun and thought-provoking and definitely tricky but not in a gotcha sort of way but more of a pushing me in the right direction to learn it myself. If this is what the class feels like, sign me up!! HR just seems so nurturing and I love to learn.

I should know if I got in (or if I have to try again, because goddamnit I’m trying again if I don’t make it this time) by Friday. Keep your fingers and toes and eyes crossed for me!

Fresh Air

Aug
20

I had my first interview with Hack Reactor today. That was awesome. It was a 180 from my two App Academy interviews. Doug from HackR was amazing. First of all, he was on time! I figured that was a good omen. But then he was also funny and sweet even though my Skype was being funky initially. I felt very at ease by the time the initial coding assessment came around. It was actually kinda fun and straightforward and he told me I’d moved on to the take home and technical interview! We scheduled it on the spot and I took the first opening available (next Tuesday). We then chatted a bit more (I learned that they take about 30 students now and had 5 women the last go round).

Basically I’m just really, really excited and beyond glad I decided to focus on just this program. I think it is exactly what I’m looking for.

Programming , , Comments Off on Fresh Air

Doctor JavaScript?

Aug
16
Programming , Comments Off on Doctor JavaScript?

I Did All the Things

Aug
15

Finally finished up the last 6 Coderbyte challenges. I had planned to finish them on Tuesday but I got home from an all day work “thing”, took a shower and passed out. On Wednesday I had a much-needed pajama party with relatives and watched some old Downton Abbey (season 2, Matthew just got the use of his legs again *sniff*). The last 6 challenges were plagued with me forgetting what variable type I was juggling. Most of my errors were fixed by type conversions. I still believe nothing was as hard as that stupid Array Addition. Everything else I was able to piece together on my own, but I don’t think I would have ever solved that one without a bit of a nudge from other coders. I think I need more math logic. I should probably take a class or find a good book (oh the torture) on the subject. I plan on reading through Professional JavaScript for Web Developers over the weekend and maybe running through all 26 again (no peeking!) on Sunday as prep for Tuesday’s interview. After I get in (I need to tone down the bravado), I want to go back and try the harder challenges. Wish me luck on everything! Also, as always, my Github with the updates. My favorite code this time was MeanMode which checks to see if the mean and the mode of an array are the same. It’s probably my favorite because I literally couldn’t remember what the mode of an array was and had to look up remedial math stuffs. That was humbling.

function MeanMode(arr) {  
  var mode;  
  var modeCount = [];  
  var count = 0;  
  var sum = 0;  

  for (i = 0; i &lt; arr.length; i++) {  
    sum += arr[i];

    if(!modeCount[arr[i]-1]){   
      modeCount[arr[i]-1] = 0;  
    }

    modeCount[arr[i]-1] += 1;  
  }  
  for(i = 0; i &lt; modeCount.length; i++) {

    if(modeCount[i] &gt; count) {  
      mode = i+1;  
      count = modeCount[i];  
    }  
  }

  var mean = sum/arr.length;

  if (mean === mode) {  
    return 1;  
  } else {  
    return 0;  
  }  
}  
Programming , Comments Off on I Did All the Things

Solver of Problems

Aug
12

I figured it out! Sort of on my own, sort of studying how others had “solved” it in different languages (a few of the “solutions” didn’t seem to work). Array Addition I is now my bitch. Also the next 10 easy problems from Coderbyte are on my GitHub. 6 more to go (well 7 actually, I gave up on ArithGeo, but the solving of Array Addition gives me hope that I will figure it out tomorrow). Problem description: Using the JavaScript language, have the function ArrayAdditionI(arr) take the array of numbers stored in arr and return the string true if any combination of numbers in the array can be added up to equal the largest number in the array, otherwise return the string false. For example: if arr contains [4, 6, 23, 10, 1, 3] the output should return true because 4 + 6 + 10 + 3 = 23. The array will not be empty, will not contain all the same elements, and may contain negative numbers. And my solution: (basically grabs the largest value out of a provided array and it runs through all the possible sum combinations of all the other numbers to see if one of those sums equals the largest values)

function ArrayAdditionI(arr) { 
  arr.sort(function(a,b){return a - b})
  var largest = arr.pop();
  var sum = 0;

  for (var i = 0; i &lt; arr.length; i++){
    sum += arr[i];

    for (var j = 0; j &lt; arr.length; j++){
      if (i != j) {
        sum += arr[j];
        if (sum == largest) {
          return true;
        }
      }
    }

    for (var k = 0; k &lt; arr.length; k++) {
      if (i != k) {
        sum -= arr[k];
        if (sum == largest) {
          return true;
        }
      }
    }

    sum = 0;
  }

  return false;      
}