Bored Again - Time to Create

On Repeat

Tomorrow is my three-month reunion for Hack Reactor. I’ve done some cool things since I graduated, but I’m still not doing everything I wanted to. I want to be the change I want to see in the world, or however that goes. I just became a mentor for Hackbright Academy so I feel a little less adrift without a social purpose, but I’m still itching to create things.

I’ve started knitting again, but it’s not solving the itch. I have half-finished things on the needles again, but I’m still bored. I think there is no hope for me. I just need to be coding.

About a year ago. I was sitting in a crappy gelato shop in downtown Burlingame with two of my best friends who already lived in California. I was still living and working in Oregon, but I knew I needed to be moving on soon. I was getting restless. That day we made a pact, all of us before this crazy thing called a dream turned us into a software engineer, a software engineer, and a novel writer. We were The Clever Girls and we were going to create something amazing together eventually. Part of that dream is how I ended up down here and now I’m realizing I need to start doing my share.

So I’m going to dive back into programming completely solo, completely public, with my work, as shitty as a lot of it probably is, committed for all to see on Github. I hope soon the three of us can get back on the same page and actually make something amazing. For now I’ll just leave you with the copy I wrote for a fake starter page a year ago when The Clever Girls were still fresh in my mind:

“Computing is too important to be left to men.”
Karen Spärck Jones

Women are underrepresented in computing not because they aren’t good with computers but because they are never given the opportunity to fall in love with them. The Code Girls‘ goal is to create fun, educational games geared toward younger girls that will teach them the basics of how programs work. Using an easily readable language like Python, girls will code their way through the platform challenges and create fully functioning programs as they progress.

Code Girls present Octavia and the Clockwork Code is the first game in the series. It tells the tale of 12-year-old Octavia, a precocious tween who sets out to win a mechanical competition. Along the way she codes her way through puzzles and helps out friends and competition alike.

The Code Girls is a fledgling startup created by three women who are passionate about women in computing.

Lindsey - The Creator

Founder, primary coder and herder of cats. Lindsey always wanted a game like this when she was growing up. Now that she’s technically grown up, she decided to take the idea into her own hands.

Ava - The Teacher

Our resident little girl expert. Ava has a Masters in Education and a passion for teaching children using methods that create a deeper understanding.

Alyssa - The Storyteller

World builder and character flaw creator. Alyssa creates and drives the stories we tell. She lives and breathes the Code Girl worlds.


Week 2: Ticking All the Checkboxes

How is it possible that I’ve already been working for Udacity for two weeks?!

I have done real tangible things since last week (I did real, tangible things my first week but nothing I could really point you to). This week, I integrated Github linking!! If you have an account on Udacity, you can now link your Github account to it here. This doesn’t actually do much more at the moment, but it’s all a part of a master plan. If you don’t have a Udacity account (why not?!) or aren’t using Github, here’s an action shot from my account:

My first contribution to Udacity

I’m settling in to my place a little more (I also discovered the spider I threw outside was not Selma, but Selma is in fact outside now too). I have a new whiteboard that is currently just practical (groceries and upcoming things), but I’m sure it will end up with weird pictures of animals and penises.

The Whiteboard of Doom

My plans this weekend involve groceries and finally getting a San Mateo County library card, so I’m pretty excited!



Inside My Head: Learning JavaScript

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:

1
2
3
4
5
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.


Time Complexity in Algorithms

Time complexity is a useful concept in programming. It’s essential for job interviews, but beyond that to really be a good programmer you need to know how cumbersome your algorithm is going to be. For 10 items, something that takes 2 seconds per item is only 20 seconds, but what if you have a million items?

In general, time complexity is measured by how long it takes a number of items (n) to be processed. It is the relationship between the number of things you have to do and the work to be done. Something that takes the same amount of time no matter have much of it you have to do, would be constant time. If I had 10 items or 1 million it would only take me 2 seconds to process. On another extreme is something called the handshake problem. If you only have two people in a room they only have to shake one another’s hands (one handshake). If you have 10 people, they each shake 9 other hands (55 handshakes total, we’ll get to the math in a moment). This is quadratic time.

Here’s a visual of the common programming time complexities:

Time complexities!

Lets start with constant time again. In programming, constant time is like deciding whether a number is even or odd:

1
n % 2 = ?

This is just one expression. You run and you’re done. It’s always going to take a certain amount of time, no matter what n you give it. In big O notation we would write this as O(1).

Next, my favorite, as far as understanding goes. Linear time. In programming, linear time, is like running through a loop of n numbers and doing something.

1
2
3
for( var i = 0; i < n; i++ ){
   do something..
 }

The more things (‘n’s) you have, the longer the algorithm is going to take. It’s a 1:1 ratio. If 1 thing takes 1 second, 2 things are going to take 2 seconds. This is O(n).

Quadratic time is worse than linear time. It’s like the handshake problem or in programming terms a for loop within a for loop. For each n we need to run through all the numbers 1 through n.

1
2
3
4
5
for( var i = 0; i < n; i++ ){
   for( var j = 0; j < n; j++ ){
     do something..
   }
 }

Each n thing is done n times. This is n * n or in big O terms O(n2).

Logarithmic time is all kinds of magic. It tapers off to a near constant for larger ‘n’s. This is possible because of the magic of halves. In a binary search tree there are only two options to descend, left (options lower than the current value) or right (options higher than the current value). Either choice will cut off roughly half of all the possible values. On the next level, you have the same choice, either you’ve found your value, or you go left or right, halving your options again.

1
2
3
4
5
6
7
8
while ( low <= high ) {
   var mid = ( low + high ) / 2;
   if ( target < list[mid] ){
     var high = mid - 1;
   } else if ( target > list[mid] ){
     var low = mid + 1;
   } else { break; }
 }

If you’re constantly halving the amount of things you have to check, eventually you hit a roughly constant time for an n search. This is O(log n).

This post has been brought to you by a forum post on time complexity, bits and pieces of the wiki article on time complexity, and this inspirational code class ad featuring my lead instructor from his Twitter days.


Lindsey Learns APIs

Starting this countdown to California/Hack Reactor has brought back my love of learning in ways that online classes couldn’t do. I love to learn. I’m the kind of girl that if I don’t know the answer to your question (“Are inch worms an inch long?” - bad example as I do know that they get their name from the way they “inch” forward, but still), I will stop the conversation immediately, whip out my phone and find you the answer. I’m sure I’ve pissed off friends and relatives, but I think they are used to me by now. It’s something that I just have to do. Some people will make up things or say “who cares”, but I really want to get down to the truth, learn a new bit of trivia, something.

So now that I’m learning more things I keep coming up with questions. Like suddenly the veil has been lifted and JSON isn’t this mythical acronym but something I can actually parse and use. But my brain of course took it a step further. APIs are similar, right? - said my brain. But what exactly are they? I’ve pulled data out of one but it was very hand-holdy. How does that data even get there? How does an app get an API? To Google, my friends.

According to API Evangelist, APIs are tools individuals can use to access companies’/individual apps’ data and functions. They allow external users to access internal info safely. There’s _lots_of stuff on this page though and my eyes kinda glazed over about half a page down. Time for a new track.

I learn better by doing so maybe make our own little API? Unsurprisingly, the internet has us covered. Let’s Create your first API. This is in PHP and very straightforward. But if you’re like me, you may want something in our own favorite web app language: JavaScript! So let’s go ahead and try Creating a REST API Using Node.js.

Obviously I’ve only just scratched the surface of this stuff but I want to try and play around with this and more in my last two weeks of down time. One last link for good measure: How to Design a Good API


Regex for Fun and Profit

I’ve always been a bit intimidated by regex (or Regular Expressions for the uninitiated). In a nutshell, regular expressions are these archaic looking bits of symbols that when put together look bizarre but actually are used to search for specific characters in a chunk of text/input. For example [^0-9] means search for the first non-numeric character (the ^ is a not, so [0-9] would be search for the first numeric character). I’ve used them a few times, but only by looking up other peoples versions and mucking around with it until it it gives me something like what I want.

Then Ava introduced me Regex Crossword and I knew that if she could do it I could sure as heck learn it too. I breezed through (or to be more accurate bashed through utterly confused) the introduction and part of the beginner puzzles and then got royally stuck. I had never formally learned regex and still didn’t have a clue what half of it meant. Off I went searching for a good tutorial, which was harder than I thought.

I first found Learn Regex the Hard Way, and while I normally like the Learn Code the Hard Way stuff the regex version isn’t finished and wasn’t really helping. I like interactive things that tell me whether I am even on to the right track of a clue. But then I found RegexOne which checked all my boxes! It gives you a bit of a lesson on each new character and then makes you test it out before you move on to the next lesson. I completed the beginning tutorials on there and decided to try the Crosswords again, feeling much more confident.

I got stuck again almost immediately. It was time for some good old fashioned cheating. I discovered Regexper and at first didn’t think it would be much of a help, but let me tell you, I was wrong. You can copy a regular expression into the text box and it will give you a humanized version with actual words and descriptions. With that in my tool belt I was no longer stuck and am now halfway through the intermediate challenges.

I’m not sure I’ll ever really enjoy regex, but at least now it doesn’t just look like magic.




On Track

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!