Monthly Archives: July 2015

Hack Reactor: Day 15 – Strategic Partner Picking

First off, getting home early last night was amazing. The sun was still up when I left class, Kerry was still awake and in the living room, and even Benson was finally happy to see me. After unwinding (and meditating) I went to bed at around 9:30PM and only ended up waking up once (from around 3:30AM to 4:15AM).

But I still managed around 7 and a half hours of sleep! And even got up for a 3 mile run with Benson.

Basically, I did everything possible to try and ensure that this would be a good day. And you know what? It was!

So, knowing that our instructors said that “this week is going to suck,” I decided to be a bit more strategic about picking my partner. I sent a message to the young kid who gave a presentation last week on building a ray tracer, and asked if he wanted to pair up. He said sure!

I’ve wanted to work with him for awhile. He’s just absolutely brilliant and probably the smartest person in class. After hitting so many walls last week, I thought it’d be interesting to work with someone who is able to pick up these new concepts easily. I suppose it sounds like I’m trying to get someone to “do my homework” but that’s not it. I ensured I got as much out of it as I could. Anyway, more on that later.

We started with our usual toy problem. This time, navigate a tree and return all elements using a “depth first search”. I don’t entirely understand what that means, but we were basically traversing a tree and returning all values that matched some criteria as a flat array.

I didn’t haven any trouble building a recursive function that could traverse a tree (amazing!), but I had a hell of a time trying to apply a provided filter function to my array. I just couldn’t get it working and only got 4 out of 7 possible points.

Ah well. After this, it was our sprint reflection / feedback session. It turns out, this is one of the last times Hack Reactor is doing this because it was happening so frequently and students weren’t finding much value in it. I thought there was a good compromise, like maybe once a week or so, but ah well. I guess our lecture schedule is getting bumped around and this will give us more time to code! Yay!

We went to lecture and had a brief overview of the Model-View-Controller architecture in general. I think most of us understand it from a high level. It’s getting down and dirty and figuring out where things get plugged in that get crazy.

After lecture, we had some time to explore the problem on our own. It took me 45 minutes of looking at documents and source code to even get an idea of what we were going to work on. I was getting a bit worried. This was going to be intense.

Lunch involved people asking me where I was going (cheap Bahn Mi sandwiches nearby) and 5 others coming along. Hah!

We came back from lunch and had another 45 minute lecture on “The Secrets of Backbone JS” which gave us some hints to get started. And then it was time to pair up! We claimed a workstation and chatted about our expectations for this sprint. The goal was to build a playlist / queuing system for a music web application.

I told him that I didn’t feel completely comfortable with the material so far, but I wanted to do everything I could to get a better understanding of it. He was completely onboard.

One of the first things we had to do was draw out a “system architecture diagram”, which kind of explained how our app was supposed to work. By the time I was done drawing it out, it looked like a drunk person tried to make a circuit board. I have some work to do there.

We started off with me navigating (so I was telling him what to do) and basically kept those roles for the rest of the day. When I would get stuck on a problem, he would gently prompt. “so, where have you seen that function used before? What do you expect to happen here? Can you explain to me exactly what is happening here at line 57?”

It was awesome. He was patient, enthusiastic when I figured something out, and knew how to ask questions that didn’t give away the answer. We made some pretty significant progress!

Things started to slow down right before dinner — I guess I was hitting a mental wall. For dinner, we split up, I went to the mall to get a mean bowl of soup. (Man, that sounds so sad that we often resort to going to a food court for meals — though other people in our cohort often go to a nearby Subway. Uggggggh).

The after-dinner lecture was given by a fellow student who recently graduated college (so many young kids around here — feeling old over here in my 30s!) and shared her college thesis project, which was studying the rise of Bitcoin in Argentina and whether it could be used as an alternative currency compared to the Argentinian peso. It was an interesting premise, though I have to admit that I have less than flattering thoughts about Bitcoin.

We went back to our workstations and made some significant progress again. It’s nice to step back from a problem for a bit and come back to it later with fresh eyes and a fresh mind. By the time 8PM rolled around, we had finished all the basic requirements. It was amazing!

I feel like I really learned a lot about how this particular MVC library works, and it’s going to be very helpful going forward. I’m not sure I could build an application from scratch right now that utilizes this architecture, but I’m sure that will come in due time.

After hours, we spent some time helping out our neighbors who were trying to get their own web applications to work. It was fun to see my partner in action, as well as get to test my own chops and explain how this stuff was supposed to work to others.

I spent another 45 minutes or so working on the day’s toy problem, trying to get my filter function to work, and I’m not sure what’s going on. I ended up leaving the building at about 9:30PM. Tomorrow, we’re going to work on some of the “extra credit” portion of this sprint and try to build in some new functionality. Also, I’m going to go climbing with a few people from class during our extended lunch. I haven’t done that in ages, so I’m looking forward to it!

Hack Reactor: Day 14 – ZZzzzZzzzZzzzzzz

After getting home and going to bed last night, I woke up about 4 or 5 times throughout the night after dreaming of various whiteboard problems. It felt like my mind had an actual electric current going through it and it was just buzzing with nonstop activity. Needless to say, I’ve been absolutely wiped out today. This explains why it’s 8:15pm and I’m heading home on BART. The sun is still literally above the horizon right now. (Interestingly, I didn’t meditate last night, so it might be a good experiment for tonight.)

After taking BART to school this morning, there was a crazy bum on the sidewalk yelling. I accidentally made eye contact with him, so he helpfully walked me to school.

And by helpfully, I mean yelling things right into my face while waking next to me. “DO YOU KNOW WHY I DON’T LIKE YOU. DO YOU KNOW? DO YOU?! I’VE HATED YOU EVER SINCE I MET YOU.

He left me alone once I got in the building. The security guard in the lobby shook his head and said “welcome to my life every morning.” Anyway, it was an interesting way to start the morning. I never really felt threatened, just felt sorry for him.

Anyway, school was good.

We did our usual assortment of toy problems. This time, we had to find common characters between two different strings and return them. For example, you’re given ‘aeiou’ and ‘abcde’, the test would expect to get back a string containing ‘ae’.

I didn’t do it in the most efficient way but I did it! I finished with some extra time so I tried to refactor my code to use a more efficient method and ran out of time.

I feel like I’m getting to the point where I have the tools at my disposal to solve any of these problems, I just don’t know the most efficient way to do it yet. But I’m really trying to think about it more!

My partner and I continued to work on our current sprint and finished up adding a few “nice to have” features to our chat client before lunch.

One thing we encountered whenever we look things up online (this happens a lot to all of us and Hack Reactor actively encourages us to solve problems on our own this way) is that there is a universally hated site that pops up to the top of the search results for nearly any web development problem. It’s called W3Schools and has amazing Google ranking for some reason, even though their answers leave a lot to be desired. It’s really just an ad network.

Anyway, they are so derided that people at school generally call others out when they see them on this site. So, we made a little bet.

Each time one of us clicked a link to W3Schools, that person would owe the other partner a beer. So, we started keeping track on a whiteboard. I ended us losing the day and owe him a single beer.

Myself and another classmate (who was my coding partner a week ago), walked down to the Ferry Building for lunch. On Tuesday, Thursday and Saturday we have a two hour long lunch which is provided so that people can exercise or work out. It’s a nice way to get out and enjoy the day.

After lunch, we decided to split up for a bit so we could do some solo studying on the Backbone.js library. Our instructors strongly suggested that we try and complete the extra credit for our current sprint by converting it to use Backbone.

Holy crap, what a beast of a process. It’s probably because I don’t really understand much about something called the “Model-View-Controller” architecture right now. But it was some crazy hard shit!

We watched the solution video to this sprint (which included converting the project to Backbone.js) and we still didn’t understand it. We tried our best anyway but didn’t finish.

That said, even when things weren’t going well or we weren’t understanding some concept, we were never frustrated with each other and always having a great time. It was awesome!

Dinner was pretty uneventful and the student presentation was given by a friendly fellow who is visiting from Florida. His talk was about planning for retirement and “how to manage the piles of dollars we’re all going to get once we graduate.”

The rest of the evening was spent messing around and trying to get stuff to work with Backbone. We didn’t get very far (nor did many other people). Tomorrow is going to be interesting!

Looking forward to eating some sleep tonight though. I’m ready.

Hack Reactor: Day 13 – Monday, the 13th…

It’s kind of amusing that our 13th day at Hack Reactor is on Monday, the 13th. After the way things were going recently, you wouldn’t have been surprised if this day was coincidentally on Friday, the 13th instead.

Anyway! I am happy to say that today was downright amazing. Especially compared to last week.

We started off with a self assessment and I think I did as well as I could have. Pretty much completed all the problems — though this time 3 of them involved writing about time complexity. Not coding, but actual writing. This is something we lightly glossed over in an earlier lecture, but they really want us to understand it. I’m gonna need to spend more time studying it.

The other two problems involved translating something from one style of code to another style (mostly easy though something was breaking for me) and finally writing a function that can return an array of duplicate letters given some input (eg., Mississippi return an array of [i, s, p]).

I finished right as our hour long block of time expired. Then we started a new white boarding experiment (instead of the usual sprint reflection). This time, we had to whiteboard a problem that involved using recursion to traverse a tree and return every value in a flat array. I can’t even attempt to type that out, but you can see the results in the attached image for this journal.

We paired up based on who was sitting next to us, so my new partner was this fun Russian classmate who had hosted a meetup for a number of us prior to the start of the program.

One of the things that our instructors mentioned we should eventually do is to try to do this stuff in an interview style. One person sits and the other explains the problem. I don’t think anyone is quite ready for that yet so we both worked on this together.

Afterward, we went to lecture to learn about our new sprint: using jQuery and AJAX to interact with servers and navigate a RESTful API. We were going to build a chat app (and all the data was going to be shared and available amongst the entire cohort, which set up some epic trolling).

One of the things our instructor informed us about is that we’re going to be converting our web app later this week to a framework called “Backbone” and he said it’s generally one of the more difficult problems in the course. “Basically, this week is going to really suck for you guys.”

Whatever, I’m not scared!

(Oh shit oh shit)

We went back to our desks to work on the problem on our own before lunch. Most of the assignments we get involve a suite of tests that we need to complete and pass before we can move on. I was so excited to start playing with the API, I just dove in without looking at the tests. Oops!

What’s crazy is that I was getting things working pretty quickly. I think it’s because I have some familiarity with this sort of thing thanks to some previous projects. That said, it was pretty easy to figure out any potential problems that came up. It was a nice confidence boost.

Lunch came and went, and we had a brief lecture on cross site scripting vulnerabilities and how the browser security model copes with this sort of thing. It turned out to be especially relevant after everyone paired up and started coding.

My partner for this sprint was a fellow Oakland resident (like us, him and his wife also found out they were pregnant right before classes started). I met him the week before school as well, so we have a bit of history already.

Let’s just get this out of the way: he was awesome. He’s really sharp and I was able to learn a lot about debugging our web app from him. He has a pretty keen eye when it comes to spotting errors and deciphering what they mean.

We were able to pass all the tests relatively quickly. We did get hung up on the last test and asked for help. The HIR said, “eh, don’t worry about that test. It looks like your code works already, just implement the basic functionality of the app for now.”

And we did. It is soooooo refreshing to have a partner who is on board with that!

Anyway, since we were all building a chat app that wrote and sourced data from the same database, you can imagine the fun that people started to have. Building functions with 100 millisecond loops that would repeatedly post stuff like “8th floor rules!!!!!” And trading barbs with the cohort on the 6th floor (who were using the same database).

People also realized that they could inject JavaScript files into other students’ browsers that would change how the page was displayed, how certain actions behaved and even throwing up infinite pop up loops. It was mayhem. We basically invented another form of Reddit. (Didn’t I make that same joke on day 1?)

Anyway, it was getting obnoxious, so I found a function that sanitized user data and stripped out all these annoying XSS attacks. I posted it in our Slack chat channel (our official internal chat service as opposed to this thing that we were building). People seemed to be pretty happy that I found that.

Dinner was frantic because I was finishing up my PRESENTATION.

At 6:30, everyone gathered into the lecture hall and I gave a 5 minute presentation called “A brief (and animated) history of the GIF.” It went really well and people seemed to really enjoy it. It was fun!

After that, we spent the rest of the evening cleaning up the rest of our code. After hours, I started to watch a Lynda.com video on the Backbone library to try and get a head start on this week’s main topic. It’s going to be intense.

I left the building tonight at 9:30pm.

Hack Reactor: Day 12 – Ignore complexity. Ignore it. No really, stop it.

So, I got home last night and tried meditating thanks to a suggestion from Kerry and one of our neighbors. Basically, it’s been hard for me to fall asleep because I bike a mile from the BART station late at night on my way home, which gets my heart racing. On top of that, my mind is still so wrapped up from the events of each day that it just races like crazy.

So, I downloaded an app and tried it out and I think it really helped. It’s weird and crazy and strange, but I dunno. It was kind of nice to try and force your mind to not think about anything for 10 minutes or so.

Anyway, I woke up this morning and started to re-implement the project we were supposed to work on yesterday on my own. I made some pretty significant progress before I had to leave the house and head to school (wait, is it Saturday?? Oh man, it’s Saturday).

Today’s toy problem was a bubble sort. It’s one of the most basic concepts of computer science and we had to come up with a way to implement it from scratch. This means you’re given an array that looks like [5,1,3,4,2] and have to come up with a way to return [1,2,3,4,5].

It wasn’t too difficult though I don’t think I solved it in the most efficient way. I feel like I can work on that sort of thing later when I have more fundamentals down. Right now, at least I can solve the problem.

After that, it was pair time. I showed my partner the progress I made and he seemed impressed. So, he begrudgingly agreed to let us try modifying our existing code from my own source code. So we did! Mostly. But then we got stuck on stupid stuff and went to get help from an HIR who basically said “you guys really need to ignore this complexity. I know you talked to Marcus last night but that guy it a genius and probably explained things in excruciating detail. You don’t need to know any of that!”

No kidding. I’ve felt pretty comfortable not totally understanding how certain things work when it comes to these third party libraries and I think that’s important. I get the curiosity, but we don’t have the time to get hung up on it. The HIR left us with some more advice, “use whatever resources you have available to you to implement the code and then start trying to understand it once you compete your basic requirements.”

At this point, my partner gets bummed out and sad and I basically had to drag him through my code to get stuff implemented. Right before lunch, we FINALLY got about 75% of the basic requirements implemented. I told him to stand up and then gave him a hug. A bunch of people laughed, we all high fived, it was good.

It was still frustrating but I tried to have a much more positive attitude about things today. I think going into the day with that mindset is huge.

Before lunch, there was a final piece of the basic requirements to implement and we were having a lot of trouble getting things to work. I suggested that we should just look at someone else’s code to get an idea of what was going on. My partner was almost incredulous, “wait, do you mean another Hack Reactor student?!?”

Errr, yes.

Lunch came around and he took off. I walked over to some of our neighbors and asked what they did to get this feature working (basically how to get our web app to respond to mouse input and actually drag and drop elements around the webpage.)

The answers were amazing. “To be honest, I have zero idea how to do it. I just copied someone else’s code and it worked.”

“Oh! The drag and drop code? I just found this example and copied it.”

“Oh, hahaha. That thing? I copied the code from our neighbor. It just works.”

So, I did just that and went to lunch. We got back from lunch and I showed him the updated code. “Look at this crazy thing. It works! Amazing!!!”

That did it. We finished the basic requirements. Since it’s Saturday, the official learning portion of the class ends at 5:30 (before our weekly social night kicks off). So, at that point we had a few hours left. I ended up watching the solution lecture videos that Hack Reactor provides after each sprint and then worked on some algorithm problems.

After that, social night officially kicked off at 6:30. The theme this week was karaoke night. So, a bunch of us went down to the 7th floor lecture hall, had a few beers and sang the night away.

Hack Reactor: Day 11… or something

It’s about 9pm and I just left Hack Reactor. Today was an outrageously frustrating day that made me feel like I might not be cut out for this. It’s a stupid and over dramatic thing to claim, I know.

Anyway, there’s a lot of unhappiness and negativity in today’s journal.

I woke up early and worked on my “letter asteroids” game for a bit and ended up showing a number of people this morning before classes started. People were getting an absolute kick out of it and it was great seeing the reactions. Tons of people had suggestions and wanted to see me take it further. Awesome!

We worked on a toy problem to attempt to calculate the nth element of a Fibonacci sequence. I completely screwed it up and spent 45 minutes just spinning my wheels and doing absolutely nothing. So, that was great.

Then we had our standard sprint reflection for a bit before we broke for our mid-morning lecture for our new sprint. This was going to be focused on a data visualization package called D3. I’ve been really excited about learning more about this library for a long time and have considered this sort of thing to be one of my strong suites.

The objective for this sprint was to build a simple game using D3 to show how powerful it was and other ways it could be used. (Hey! Another game, alright)

Basically, we were going to be re-implementing a game that was written in another programming language and we’d be able to reference these documents whenever we needed. Alright, seems easy enough. That’ll leave some time to really have fun with this package!

Hahahaha.

Today, we switched up to new partners. Someone I hadn’t worked with with yet wanted to pair with me and I said sure. He’s been pretty interesting to talk to in the past and he’s one of the few I met from the meet up prior to school starting.

So, I think I said this yesterday, but I distinctly remember one of the things our lecturers said during the first week was how pair programming was going to make us better communicators. And they also had a warning that if you are someone who has a problem with a lot of other people, maybe the problem isn’t them, but it isn’t you.

Between the last few days and today, I’m starting to think the problem is me. I mean, I don’t think it is! But things just went wrong from the start. We came back from lunch and sat down to get to work and it turns out he hadn’t even read the intro docs yet (which by the way, we had 45 minutes set aside BEFORE lunch for this specific purpose).

So he wanted to do that before we began. Sure, sure! Then we started trying to implement the game — he was driver since he was less experienced and comfortable in D3 and I would navigate. But he second guessed every decision I would make and strongly suggested that I not look at the source code for the previous game (again, written in another language, mind you!).

The API documentation for D3 is about 2,000 pages. There is no way we’re re-implementing this stupid cheesy game from scratch without some sort of documentation or reference material. I said as much, but he wanted to really dig in and reverse engineer a bunch of complexity from scratch. One of the things our lecturers really stress is that we should avoid unnecessary complexity. I was going to try and help him walk through it but it wasn’t going well.

On top of that, he grabbed one of our whiteboards and started to write a list of words we should not say to each other! Stuff like:

  • I think
  • I feel
  • basically
  • actually
  • we should
  • actually
  • like

And he continued to update it whenever he heard a new word that he didn’t like either of us using. Great! I quipped that if he kept this up we wouldn’t be able to talk to each other.

Anyway, we continued struggle a bunch before dinner and I think people around us were picking up on our frustrations and realizing that we needed to clear our heads. A fellow student was sitting at the workstation next to us and asked me, “umm, want to get out of here for a bit and grab dinner?”

I ended up inviting my partner as well since he had no where to go. We had a pretty good chat about what was working and what wasn’t working and it was kind of nice to have a third person there to break the tension.

So, dinner was great! We returned to our workstations with renewed vigor and a sense of purpose.

And pretty quickly ran into the same problems again and again. Arrrrggggghhhhh.

On top of this, an HIR wanted to talk to me about Monday’s self-assessment test, which I had thought I’d done pretty well on. We sat down and he pulled up one of my problems and said, “I’ll be honest. I have absolutely zero idea what you were trying to do here.”

So, we went through this problem and 2 others, rewriting my code line by line. It was definitely helpful but I was a bit flustered from the day’s events and struggled my way through it. It’s stuff like this that fosters imposter syndrome and makes me wonder if I’m in over my head.

Toward the end of the night, I finally suggested that we should scrap everything we have, start over from scratch and reference the provided source code (since everyone else was doing that, too). My partner replies “Dave, I really don’t appreciate your negativity right now.”

I’m assuming a staff member heard us because a few minutes later Marcus, one of the cofounders (and a lecturer) came over to us and asked if everything was okay.

He has the patience of a saint. I felt like my partner was getting bogged down in the complexity of how the library worked and Marcus spent the next hour and 15 minutes explaining to both of us how this sort of stuff worked but why it was important that libraries abstract this stuff away from us. It was great spending one on one time with Marcus but frustrating to realize what sorts of things were blocking us from being able to move forward.

Ultimately, we accomplished approximately zero things today. I finally left “early” at 9pm because I couldn’t take it anymore.

Maybe a night of solid sleep will help. Reset, reboot, and head in tomorrow with a better attitude.

Hack Reactor: Day 9 – Spinning wheels while others spin games

I really started to hit a wall today in terms of energy level. I think Sunday gives a lot of time to cooperate, but by midweek we’ve run out of adrenaline and energy. From lunch time until I left at 9:40PM, I could barely keep my eyes open. I imagine most of my fellow students feel the same way. Nearly the whole class went home by 8:30PM.

But more on that later.

We started off the day with a toy problem called “IsSubsetOf?” Basically, you’re given an array that looks something like ['dave','kerry'] and you want to find out if it’s a subset of another array that contains ['dave','kerry','benson','tegan','tosh']. Which it is! You’re looking to see if all those elements are contained within another array.

I ended up finishing the problem with about 4 lines of code and it took me 10 minutes at most. It was deceivingly easy. Too easy. I kept looking over things to make sure I wasn’t missing anything. Finally I submitted it and ended up getting 8 out of 8 points from Taser. Awesome!!

The entire rest of the day was spent on our sun class sprint. So many people in the class were building actual games that would take user input, move elements around the screen, and react to user input and other elements. It was amazing.

Today’s student presentation was given by this sharp kid about how he wrote a way tracing app in JavaScript. I’ve talked to him a few times and have always been struck by his intelligence. He’s really young! We were chatting about where we grew up and he mentioned he moved away from the Bay Area when he was 10 years old.

“So, that was around 2005 I think.”

Hooooly crap. Believe it or not, there is also a 15 year old kid going through the program in the other cohort right now. Insane!

Anyway, we wrapped things up and went back to our desks. There was a lot of laughter and people were having fun showing their projects to each other.

Meanwhile, my partner and I had completed our “Sharknado” and he was searching for how many Jean Claude Van Damm images we could put on one page before it caused epilepsy and wouldn’t let us move on to adding interesting feature simply because a few images kept moving outside the bounds of our page.

One of our fellow classmates came over, laughed and remarked that it looked like a Geocities page from the early 1990’s.

Yea, no kidding. So, that was fun.

When we were finally able to move on, we had trouble trying to implement some features like detecting basic user input and both him and I were getting frustrated. Plus, we were all so exhausted too. It was hard to think!

It got to the point where he asked me what else we should add and I told him “nothing!” I was just done with this project. I don’t think he was that thrilled but if we couldn’t stop getting hung up on making everything perfect from the moment we add it, there was no point working on more stuff for our “Geocities” page.

The day wrapped up and him and most of the class called it at around 8PM. Despite being exhausted, I stayed and worked on a brand new project using some of the things we learned (or were supposed to learn) over the last two days.

After seeing all these other people create actual simple games, I wanted to try doing that too. So, from 8PM to around 9:45PM, I was furiously trying to my own game. And you know what? I have a pretty decent start!

Basically, think of the old video game “Asteroids”, where a player controls a spaceship on screen and has to dodge incoming asteroids. I decided to do that but with letters. The player is assigned a letter (e.g., “A”) and has to dodge letters that randomly appear and float down the screen. However, if they see their own letter appear, they need to capture it by running into it.

In about 2 hours I got most of that working on my own! Letters randomly appear, the player can move around their own letter, it’s awesome! Still need to add collision detection and scores but that shouldn’t be too bad at this point!

It was awesome to see that come together so quickly and I feel like I salvaged an otherwise wasted day! By the time I left for the night, I was one of 3 students still there.

Hack Reactor: Day 8 – Getting into a groove

I think we’re finally getting into a groove with how our schedule is supposed to work at Hack Reactor. We started the day by going over a solution to yesterday’s toy problem. It was ultimately a solution that involved some recursion and considering how to navigate through a decision tree.

My attempt at the problem wasn’t that great. But hey! It’s a learning process. We received our second toy problem, today. This time, we had to return the first non-repeating character in a string. For example:

AAB would return B
AACADE would return C

I implemented a proper solution in the time allotted. I can’t say it was the most efficient way, but it works! And it turns out that this was probably the first time that Taser (our test robot) said my code passed all tests. Absolutely amazing!

Rather than have a reflection to go over our recent two-day sprint, we ended up working in random groups trying to whiteboard a bubble sort problem.

Our mid-morning lecture involved introducing us to a new sprint called “Sub Class Dance Party.” The goal is to look at how various objects we create can inherit certain unnamed properties and methods from their parents.

It’s like having a factory that creates cars. Every car has certain rules it follows. 4 tires, 4 doors, seatbelts, etc. That is the parent class.

The children classes get created when you want to create new things based on that original object.“ Okay, we have the blueprint for a car. Now let’s turn it into a limo with a subclass.”

The only thing this subclass would say is that the car is longer. And maybe a bit more expensive.

But that’s basically it. Anyway, we had to create a cheesy little webapp that would display some random dancers on screen (represented by little dots though people were doing some crazy things with them by using images and GIFS).

After lunch, we paired up with new people for this sprint.

My partner and I worked well together and we were able to move through the exercises pretty quickly and polished off the basic requirements before dinner.

My sister was randomly in the area, so she stopped by and had dinner with a few of my classmates and I. It’s especially amusing since her old boss is one of my fellow classmates! It was good to see her and kind of fun to randomly run into my sister while we were at dinner. She seemed to enjoy talking to my fellow classmates.

After dinner, it was fun time!

We went back to our desks and started coding. By the point, most people had wrapped up the basic requirements, so they were going crazy. I wish I had screenshots or links to share. There were hamburgers floating across screens, dancing bananas, people making trippy scenes that looked like you were in drugs, etc.

We were all having a lot of fun. It was nice to have something a bit more low key to work on after grinding so hard over the last week and a half on heavy concepts.

My partner and I were randomly playing around with how to make our objects move on a sort of random fashion. We ended up adding an image of a shark and having some fun getting it to display and move on screen. My partner had to go to the restroom so I decided to try and quickly add an Easter egg. I created a function called “Crazy Shit Don’t Touch This Button Mode.” If you clicked it, it would randomly spawn 2,000 objects (in the case, sharks) all over our screen. I was having so much fun and laughing so hard I had tears in my eyes.

He came back, clicked the button and thought it was amazing. We then wrote a function that would take all these objects and move them to random locations. Something went wrong and our sharks started to spin around each other like a tornado. It resembled the horrible movie “Sharknado.” We were laughing do hard that people kept coming to our workstation to see what was happening. Hah!

We had an after hours chat tonight by the CEO of a product management company. He encouraged us all the consider becoming PMs within a few years because having a technical background was something that was valuable and hard to get for a lot of product managers. Overall, this particular talk was kind of a waste of time.

We went back to our desks and kind of messed around with out project a bit more. At about 9:45, I hit a serious wall and called it a night.

Tomorrow is day 2 of the sprint and I think it’s just going to be a ridiculously fun day since we get to mess around and finish this project!

Hack Reactor: Day 7 – Looking for solutions to so many problems

Today was another one of those roller coaster ride of emotions days. It started off with our second self-assessment test, which I’m finding immensely stressful. They aren’t gated, meaning if you “fail” or do poorly, the onus is on you to improve in the areas you’re weak in.

I thought I actually did much better this time, even though my score was 18 out of 28. I made a pretty valiant attempt at every problem at least! The test basically asked us to write a number of functions from scratch.

- Add and remove items from a stack.
- Explain difference between a stack and a queue.
- Write a function to properly detect collisions when adding values to a hash table (and be able to resolve them.)
- Write a “reduce right” function that basically reverses the content of an array.
- Extend the JavaScript array object to be able to return the first and last items in an array by simply attaching a method.

One of the reasons I was dinged was that I left a bunch of debug code beneath one of my files. So when the automated testing system ran, it picked up the wrong values. Oops!

Of course, maybe if I put more time into writing better code, rather than witty comments inside my code, I’d do better…

  // This is going to be ugly, 
  // please forgive me computer gods.
  // Iterate through our list of arrays...
  // ...which is an array!
  for (var i=0; i < length; i++) {
    // Now, iterate over the elements
    // within a particular the array.

    for (var j=0; j < list[i]; j++) {
      // Call our iterator function 
      // and pust values into it
      result.push(iterator(list[length], list[length-1]));
    }
  }

Fortunately, the raw scores don’t mean too much. The self assessments are also examined by humans, too. So they can at least understand our ideas and then work with us directly if we aren’t understanding something (e.g., when they worked with me last week about recursion).

After this, we took part in a “sprint reflection.” Basically, we talk to Hack Reactor about what we liked and didn’t like about the most recent sprint and suggested ways to improve it. I think I wrote about this a few days ago when we first did it.

Then we went to our first lecture of the day (only one of two today!), where we learned about a new type of algorithm to tackle the “N-Queens” problem. Basically, given a chess board of n size, how many queens can you add before they are able to see each other within their range of movement.

Conceptually, it makes sense. But we were going to be lucky enough to get to implement a programmatic solution on our own. Oh, joy. Fun times were about to happen.

Before we left for lunch, we were able to do some initial solo coding and start working on the problem set for this particular sprint. I was able to tackle a few initial problems without much difficulty and even helped a few of my neighbors.

After lunch, we had a brief introduction to CSS and HTML, which most of us felt was a bit below our skill level and not an entirely good use of our time. I looked around the lecture hall and saw most people working on their N-Queens problem.

Fortunately, after this lecture ended at around 2:30pm, we had the entire rest of the day to code — from 2:30pm until the day ended at 8PM. This was a very exciting proposition and a lot of us felt that we’d be able to make some major progress with this problem set. (Ha ha ha ha…..)

Anyway, this is another sprint where they wanted to partner us up with someone of similar experience. They put a list of 10 questions on the screen and we lined up based on how many we were able to say yes to.

Last time, my ‘score’ was a 2 when I counted up all the answers I knew, and we know how that whole thing went. So this time, I counted up the number of questions I knew and maybe padded an answer or two with yes, and oh, sure I read about that one on Wikipedia one time.

So, this time, my score was a 5. A nice number that places me right in the middle of the pack. Coincidentally, there were a lot of other people who were also 5’s. Suspicious!

Anyway, after the brief introduction to our new pair programming partners, we were again thrown in the deep end of the pool. My new partner and I sat down and went to work.

Go figure, we immediately encountered difficulties with the problem set. Hack Reactor really makes you work hard to figure this stuff out and it can be such a demoralizing experience.

Basically, we were trying to implement a way to check whether any queens were in conflict (able to see each other) on a specific diagonal line. The code looked good but stuff kept failing some automated tests. Argggggh!

It sounds like a lot of others were having this issue too. The group next to us was stuck on the exact same problem. After 2 hours of trying various things, I suggested we skip this particular instance and just move on.

The second part of our problem set involves solving boards that the computer randomly generates and then asks us to try to put “x” number of chess pieces on the board without any conflicts.

We immediately ran into trouble with that too. We broke for dinner and then regrouped to tackle it.

The crazy thing is that we’ll just sit there and grind, spinning our wheels and not get anywhere. Then out of nowhere, one of us will have a brilliant, ingenious solution that we furiously code, only to find out that it doesn’t work either. This happened to both of us a number of times last night.

We end up drawing the problems out on some portable whiteboards — it really helps when trying to figure something out (and it’s why I’ve been taking so many pictures of whiteboards lately). Eventually, we’re able to figure out where we went wrong and can fix it.

So, after another 3 hours, we finally, finally, finally solved the major problem we’d been working on. It was awesome! I jumped up, high fived the people around me and gave my partner a hug. (People probably think I’m weird, but whatever — we’re here to learn and have a good time, too.) We also solved it right as we were getting ready to leave at 9:30PM.

(The crazy thing is that the entire class was still coding at 9:00PM, an hour after the day officially ended — I think that shows how focused everyone was on trying to understand this problem. It was really cool to see!)

There’s still a lot to do tomorrow, but we left feeling much better.

A favorite Sublime Text shortcut: moving lines of code

3Ga4NL2mdm

Sublime Text is an indispensable tool to have in your arsenal of web development goodies. There’s a nearly infinite amount of shortcuts and tricks one can use to improve their workflow.

One of my favorite shortcuts is moving either lines (or entire blocks) of code up or down a page without cutting and pasting all over the place.

Simply select the line (or multiple lines of code) that you want to move, then simply hit

CONTROL + CMD + (Up or Down arrows) on OS X
CONTROL + SHIFT + (Up or Down arrows) on Windows

I guarantee if you do this in front of your friends or family, you will look like a wizard.

Where’s Dave?

For the time being, you can track some of my recent endeavors over on my developer oriented site, dave.ly.