I finished off Hack Reactor Prep this week. Precourse Accept kicked off! The week days aren’t too long, but the weekends will be all day. Think of it as a mini-bootcamp before Hack Reactor.
I got a much better understanding on HTML, CSS, closures and this this week. Not only that I learned (some) jQuery!
January 12, 2017
Getting closer and closer to Hack Reactor PCA.
- Hack Reactor Prep
- Completed the final problem “Divide and Conquer” which is just Binary Search. I did it recursively, however using a while loop is much more efficient and I will try to do that again later while at work.
- I got really lazy and didn’t map out my solution, so I ended up thrashing about missing a +1. Just goes to show that you cannot skip the process and expect good results!
- HACK REACTOR PREP COMPLETED
- Hack Reactor Precourse
- First checkpoint quiz – I messed up the CSS border question thinking it was TLBR, but it’s TRBL.
- READ: How to Use Terminal: The Basics
- COMPLETED: Git Immersion Labs 1 – 30
- I learned about tagging individual commits. You can checkout by tag name as well.
- Use git reset to reset the staging area.
- USe git amend -m to amend to the previous commit if there was only a minor change. This would’ve been a very useful command at times.
- git checkout -b < branchname > is a shortcut for git branch < branchname > followed by a git checkout < branchname >.
- YOUTUBE SERIES: GitHub & Git Foundations: Get Up and Running
- The seven rules of a great git commit message
- Finished Our Development Workflow: Git and the Command Line
- Missed one question in the checkpoint because I confused where the local repo was cloned from versus the original repo. My forked repo that I will clone from is the REMOTE and the repo I forked originally is the UPSTREAM.
Today is my last day at work!
- Hack Reactor Precourse – TESTBUILDER
- Got stuck thanks to some weird bug.
- People seem to be solving this problem without using very very simple default JS methods for Strings and Arrays. Weird. 😕
Finally free to focus 100% on coding!
- Hack Reactor Precourse Work
- Pro Git book
- Jennifer wrote a cool Medium post: The Secret to Becoming a Better Programmer is Speaking
- Things you probably didn’t know you could do with Chrome’s Developer Console
- WTF you can pass strings into Function and get a function out of it?
- Finished all koans except the Euler-esque bonus problems.
- Today I continued more work on my Precourse for Hack Reactor which included reimplementing a lot of the Underscore library’s functions.
- Hack Reactor Precourse: Underbar
- delay (learned more about using an anon callback)
- shuffle (Fisher-Yates shuffle algorithm)
- I spent 46 hours last week coding despite it being my last week at work! Dunno how I pulled that off.
- Feeling sick. All stuffed up and coughing. Best thing ever for first day of Precourse.
- Find largest palindrome of two 3 digit numbers.
- Wrote tests for the rest of the bonus functions (should’ve done this first).
- Finished all Extra Credit problems (all project Euler problems or very similar to them).
- Toy Problems for the next two weeks (1-2 hours a day)
- I will run through Coderbyte (or similar) and use Haseeb’s method to get high level with the solutions.
- Write out in plain english how I would solve the problem.
- Check solution. If my logic differs (greatly) from the optimal solution provided then I will go back and deeply understand the solution.
- Re-implement that solution from scratch.
- Negatives of anonymous function expressions
- Lexical scope
- Nested scope
- Eval keyword & With keyword
- Hack Reactor: Precourse Accept Class #1
- Opening lecture on expectations and the assessment (only 50% pass – no second chance).
- Undefined + Number = NaN
- Refactored detectNetwork to use objects instead of functions all over the global space.
- Refactored underbar functions map and filter using reduce.
- I think it’s best to use the parameters accumulator and current when using reduce. I find it best to do that when it comes to understanding how reduce works. It is such a damn powerful function.
- The first parameter is the accumulator unless we pass in an accumulator which can be an object like an array!
- Actually maybe it is better to use prev & curr since you don’t always have to return the accumulator, you can disregard that and return something else entirely.
- Reduce makes my brain hurt.
- Block scope and ‘let’
- Problems with ‘let’
- Dynamic scope
- Hoisting (let does not hoist!)
- The ‘this’ keyword
- Implicit binding
- Default binding
- Explicit binding (call or apply)
- Hard binding (using ‘bind’)
- The ‘new’ keyword
- Hack Reactor Precourse: Underbar
- CS50 Video: Command Line
- Hack Reactor Precourse: HTML & CSS
- Building Your First Web Page
- CSS Terms and Definitions
- Getting to Know HTML
- Getting to Know CSS
- Opening the Box Model (Every element on a page is a rectangular box.)
- Hack Reactor: Precourse Accept Class #2
- Implemented max and min in underbar.
- HTML/CSS: Positioning Content
- HTML/CSS: Working with Typography
- Code School CSS Cross Country Level 1-4
- Code School: Regex Course
Easy to brute force, however a Dynamic Programming solution is explained in the video and it’s insane.
Here I would create a set from the original array and then pass that Set object back into an array. Sort that new unique set array and from lowest to highest. Then return the 1st index and the value in the last index – 1. If there is only one value then return index  for both.
On this problem you would take the ceiling of (num1 / num2) to get the answer in the regular format. From here you need to convert the number to a string and put that string into an array of char numbers.
Also at this point it’s possible to just stringify the number to ‘123456’ and use regex to add in commas at the correct points. Without regex I would take 12346 and make it [‘1’, ‘2’, ‘3’, ‘4’, ‘6’]. Reverse this array to [‘6’, ‘4’, ‘3’, ‘2’, ‘1’] and then have a loop and counter than after 3 numbers have been passed it will splice in a ‘,’ character.
Once the end has been reached we reverse the array again [‘1’, ‘2’, ‘,’, ‘3’, ‘4’, ‘6’] which we join into the final result of 12,346.
Solution Review: It looks like the solution used Math.round instead of Math.ceiling so I messed that part up. Also see this StackOverflow post about using regex to insert the commas.
- Introduction to jQuery
- Traversing the DOM
- Working with the DOM
- Listening to DOM events
- Forked the repo and took a look. I want to get a deep understanding of how the data is generated so I will take 1-2 hours to read over that code and understand it.
- Once I understand the code I will make a list of reqs and maybe even put some tests in there if I’m really feisty.
- Only once all functionality has been completed will I being to style my page.
- My wishlist is really I want the page to:
- Automatically refresh the tweets and alert the user as to how many new tweets they have.
- The user clicks a button to see the new tweets.
- A user should be able to add their own tweets.
- A user should be able to see all the tweets for a person by clicking their profile name (user stream).
- Each tweet should have a timestamp.
- Each tweet should have a ‘seconds ago’ feature.
- Show a user profile picture and number of tweets they have created.
- Show a worldwide trends list depending on the hashtag counts.
- Have a ‘refresh now’ button to instantly refresh rather than waiting.
- I want each user to have a small avatar icon of their actual face.
- I want moused-over tweets to be highlighted.
- I want there to be “endless scroll” functionality
- Chocobo Icon and favicon
- Click hashtag and only show tweets that have that hashtag
- Have the title update showing the number of unread tweets. Example (50) Twittler
- Click a tweet to pop it out.
- Implement a simple search.
- Click a hashtag and only show tweets with those hashtags
- Helped out a fellow student for an hour or two working through some underbar problems involving reduce. I had never pair programmed before and it was fun. I tried my best to steer towards understanding why something wasn’t working rather than giving out an answer.
- I got much better understanding of closures because of my pairing.