W4D2: Harder, Faster, Stronger


Intensity: FULLY BLOWN. They're starting to dial up the difficulties of the toy problems, sprints, and self-assessments. Honestly, I've been clueless for the past few sprints. Starting from the backbone sprint I've been having a lot of trouble trying to figure out what's going on -- a good portion of the first day of each sprint was spent staring at the screen, with minimal movement in my fingers, trying to grasp the big picture of what is going on inside the files. Needless to say, it was frustrating.


As previously mentioned, I've been noticing the trend of the sprints (day 1 = despair, day 2 = relief), I I mentally prepared for this and did a better job managing my emotions during day one.

On a good note, I finally got the island count toy problem to pass! I started over on my code 3 times and took a total of 3 days to figure out this problem, I first tried to solve the problem using two for-loops, but in the end implemented the recursion algorithm that a lot of my cohortmates used. From this, I learned not to be too stubborn, especially when solving algorithm, else I'd be wasting a lot of time like I did with this particular toy problem. Learning new things everyday!



For this sprint, we were to go back to our chatterbox client and replace the remote server (which is set up through parse API) to our custom back-end server. Instead of trying to explain in my words what node.js is all about, I think it'd be better if I listed some of the important takeaways for this sprint.. because I'm still not understand a lot of server-side.


  1. Node is a library that allows you to run Javascript-written apps outside of the browser, typically in the command line
  2. Data is just a bunch of text that is transferred from/to server and client through the form of packages
  3. Since node runs locally on your computer, this means we have to install our dependencies (like underscore, jquery) directly onto our master folder through npm, a JS package manager run through the command line.
  4. Modularity and readability is maintained through exports and requires - explain more about this tomorrow!


What we did today:
1. Toy problem

Power Set

Return an array that contains the power set of a given string. The power set is a set of all the possible subsets, including the empty set.
Make sure your code does the following:
  1. All characters in a subset should be sorted alphabetically, and the array of subsets should be sorted alphabetically.
  2. Sets of the same characters are considered duplicates regardless of order and count only once, e.g. ‘ab’ and ‘ba’ are the same.
  3. Duplicate characters in strings should be ignored; for example, ‘obama’ should be evaluated as if it only contained one ‘a’. See the result below.

Examples

InputOutput
string:
"a"
[ "", "a" ]
string:
"ab"
[ "", "a", "ab", "b" ]
string:
"horse"
[ "", "e", "eh", "eho", "ehor", "ehors", "ehos", "ehr", "ehrs", "ehs", "eo", "eor", "eors", "eos", "er", "ers", "es", "h", "ho", "hor", "hors", "hos", "hr", "hrs", "hs", "o", "or", "ors", "os", "r", "rs", "s" ]
2. Continue pair programming on the node.js sprint

3. Townhall

02,02.16

No comments:

Post a Comment