Pages

Sunday, April 30, 2017

Day 104

In case you are wondering why no update has been published for quite a while now, I've created a blog with the static site builder Jekyll and forgot to tell you about it. ;-) It's hosted on GitHub Pages.

I mainly did so to have more control over my blog, since as I'm digging deeper and deeper into CSS I wanted to be able to customize it which is a rather difficult thing to do here on Blogger. I also didn't want to have all the jazz that would have come along with a CMS like Wordpress. Thus, Jekyll is the perfect tool to create a clean, plain blog like mine. Besides, the blog is served a lot faster and hosting websites on GitHub is for free.

Check it out! :)

Wednesday, March 15, 2017

Day 60

Current Challenge: Show the Local Weather

Progress: I've finally managed to overcome all Advanced Algorithm obstacles! HELL YEAH!



At last, I was also able to crack the "No repeats please challenge" implementing the Heap Algorithm in a recursive manner. However, I did not make use of the pseudocode on Wikipedia but instead found a useful video on youtube laying out the code both in a visual fashion and using Python. The key task here was to transfer the idea into a working Javascript program and to actually understand what's going on. Another resource which I think might be useful to some folks is a post on the FCC forums since it provides some more general suggestions on how to approach the problem. Additionally, you might want to check out the FCC Algorithm challenge guide. There you can find more tips and tricks as well as the solutions, in case you are on the verge of going bananas. ;-) Last but not least you can find my code on GitHub (which may not be perfect yet).


Thoughts: I'm relieved that I can eventually leave the Algorithm section behind me. It was pretty frustrating at times and almost made me throw my laptop against the wall several times. But it was worth not giving up, because I feel much more comfortable with Javascript now, though I'm quite aware that despite all the progress there is still much, much more to absorb.

I guess I'm well equipped now to tackle the last part of the FCC Front End route before finally obtaining the Certificate: completing the remaining projects. I figured that due to my detour to the algorithm section I probably have to get reacquainted with some Bootstrap / Flexbox stuff as well as jQuery, which I still am not that much used to, partly due to the poor documentation and my reluctance to buckle down, since I'd like to focus more on vanilla JS for now (in the end, jQuery is just a JS library using a somewhat different syntax, which takes some time to get to know).

I'd also like to mention that I got accepted to join one one the CHINGU cohorts, called Iguana, starting off on Monday, March 20th. I'm pretty excited and looking forward to boosting my skills even further, build stuff and make some connections with other like-minded people around the world.


For those who are wondering what I'm actually talking about, check out the CHINGU page.


My plans for the next days:
  • Complete all Intermediate Front End Development projects
  • Start reading the YDKJS book series

Follow me on GitHub

Follow me on FreeCodeCamp

Monday, March 6, 2017

Day 52

Current Challenge: No repeats please
Progress: I've been pretty busy the last couple of days and hence hadn't much time to make real progress. However, I figured how to pass the "No repeats please" challenge by just using some combinatorics but could not manage to generalize the idea, which really caused some frustration. Unfortunately, I found this article on StackOverflow only after I already figured it out myself, which could have saved me quite some time spent on thinking. Still, one major issue remains: finding a generalizable formula that handles both an arbitrary set of repeating and non-repeating characters, like "aaabbbbcccccdeffg" for instance. The solution to the problem can be abstractly described as "TOTAL - INVALID + OVERLAPS".

As long as we only have one character set with just one repeat, we are done after subtracting the INVALIDs from the TOTALs.

"aab": 3! - (2! * 3!) = 2

"abcdefa": 7! - (2! * 6!)  = 3600

If more than one character set with repeating letters is occurring we have to take care of the OVERLAPS as well since we deduct some permutations twice (or more) when subtracting the INVALID ones:

"aabb": 4! - (2! * 3!) - (2! * 3!) + (2! * 2! * 2!) = 8

"abfdefa": 7! - (2! * 6!) - (2! * 6!) + (2! * 2! * 5!) = 2640

Things start to get hairy if you have something like "aabbccd", i.e. more than two character sets with repeating letters since you have to add back all the overlaps, which are not as easy computable as above.

The same goes for character sets with more than 2 repeats like "aaab". Those two issues combined, say we have something like "aaaabbbccd", is way too complicated to grasp at the moment due to the different grouping possibilities you have to account for. If I'm trying to compute it manually I'm sometimes right but more often than not wrong. The thing I can't get my head around is recognizing a pattern.

Thoughts: For now, since I haven't made any real progress and it continues to discomfort me, I'll focus on just passing the tests with the next best algorithm I come up with.

My takeaway from this challenge is that I spent way too much time on figuring something out I'm not supposed to. But it has been nagging me ever since I had the idea of a somewhat "universal" formula, where you can just toss in the letters and it outputs the correct number, especially because seemingly no one on FreeCodeCamp has managed to solve it in this manner yet. I'm still convinced that there is a way but I've to put it back for the sake of my actual goal, learning to code.

My plans for the next days:
  • Work through the remaining "Advanced Algorithm Scripting" challenges
  • Finish chapter 9 on Regular Expression (including exercises; 'Eloquent JavaScript')
  • Gradually upload my work on GitHub

Follow me on GitHub

Follow me on FreeCodeCamp

Follow my Pens on Codepen

Wednesday, February 22, 2017

Day 48

Current Challenge: No repeats please
Progress: This is just a short update on how things are going at the moment, to keep you in the loop. Well, frankly speaking, I'm deeply stuck on the "No Repeats Please" challenge.

The thing is, though I know that most folks use the "Heap algorithm", I think this may not be a very efficient way to solve the task, since you create an enormous amount of permutations, thereby using up a lot of memory space. However, the only thing actually required as output is a mere number.Thus, I assume it might be better to approach this problem by just thinking in terms of possible combinations. I don't know how to better explain it yet, but if I'll manage to solve it that way, it not only will be much more efficient but also less complicated to read (at least that's what I aim for). I'll definitively explain it in more detail once I cracked it either the one or the other way.

Thoughts: Unfortunately, I have to take a short break until Sunday, because I've to take care of a few things of personal interest, but I'll be back before you know it. See you around! :)

My plans for the next days:
  • Work through the remaining "Advanced Algorithm Scripting" challenges
  • Finish chapter 9 on Regular Expression (including exercises; 'Eloquent JavaScript')
  • Gradually upload my work on GitHub

Follow me on GitHub

Follow me on FreeCodeCamp

Follow my Pens on Codepen

Friday, February 17, 2017

Day 43

Current Challenge: No repeats please
Progress: Since my last update I was able to finish a few more "Advanced Algorithm Scripting" challenges. "Record Collection" was actually not that hard to crack. All it basically needed was proper 'if/else' structure. You can find my code on GitHub.

On the contrary, the  "Symmetric Difference" challenge was a bit tougher to get along. It took me some time to translate the logic into code but I eventually came up with a pretty neat and precise solution.

However, "Exact Change" was really challenging to get by. There were several problems literally popping out of nowhere and my browser hung up every now and then since I accidentally created an infinite loop somewhere in my code. That was really driving me mad!

System freezes
Codepen freezes

The trickiest part, tough, was to find a way to handle floating point numbers. I don't want to elaborate too much on it, but it can be frustrating at times. You just don't expect, say, 0.1 * 0.2 to be something like 0.020000000000000004 instead of just 0.02, but it has something to do with how a computer in general (not just JavaScript) processes numbers internally (binary instead of decimal representation). For a short introduction, I recommend you to watch the following video on YouTube. If you want to immerse yourself even more into the topic try Google. It's a well-known issue with lots of more or less detailed explanations.


Once you understand what's going on behind the curtain, there are several approaches you might want to use to circumvent the issue. Instead of floats, I decided to use integers for the internal computation of the function by simply multiplying all values with 100. To display a proper money format as output, you just have to divide each value by 100 again. It took me quite a while, but after some refactoring rounds, I managed to find a very clean approach to passing the provided tests. Check it out!

In turn, the "Inventory Update" was less troublesome again. You just have to stay focused because of the sometimes slightly confusing way of accessing multi-dimensional arrays.

To recap, the advanced algorithm challenges are definitively more difficult to get your head around so far but also more rewarding and satisfying once you found a viable solution at last.

If you have any questions or something in particular that troubles you, feel free to ask at any time by sending me a message or just leaving a comment below. :)

Thoughts: If I can maintain the current pace I might be able to obtain the Front End Certificate by the end of next month at the latest. That would be a first great milestone in my development. Wish me the best of luck!

My plans for the next days:
  • Work through the remaining "Advanced Algorithm Scripting" challenges
  • Finish chapter 9 on Regular Expression (including exercises; 'Eloquent JavaScript')
  • Gradually upload my work on GitHub

Follow me on GitHub

Follow me on FreeCodeCamp

Follow my Pens on Codepen

Monday, February 13, 2017

Day 39

Current Challenge: Record Collection
Confused Jackie ChanProgress: Short update on the algorithm front. I spent the whole morning trying to figure out the proper regular expression to match and validate those telephone numbers.

That admittedly was pretty confusing but I eventually nailed it! Overall, I thought it might be a good occasion this time to learn about RegExp more thoroughly (made it halfway through chapter 9 in 'Eloquent JavaScript'). I also almost always use MDN as a supplement (mainly via DevDocs, which is a really convenient tool for quickly looking up things).

The last couple of times I worked on algorithms using RegExp I just hacked it together somehow and was lucky that it worked, but this time you really have to understand what's going on since the final expression is rather elaborate compared to what I've done so far.
Thoughts: Also helped some campers on Gitter today, which does feel pretty good indeed! On the one hand you can give back to the community and on the other hand, you are able to repeat some challenges and see loads of different approaches. Therefore you not only support others but also tremendously benefit yourself.

Note: I'm probably going to transition my blog to its own server using Wordpress as a CMS, which I think is better suited to meet my needs. I really want this to become a great platform!

You will be the first to know when it's finished! ;)

My plans for the next days:
  • Finish chapter 9 on Regular Expression (including exercises; 'Eloquent JavaScript')
  • Work through the remaining "Advanced Algorithm Scripting" challenges
  • Gradually upload my work on GitHub

Follow me on GitHub

Follow me on FreeCodeCamp

Follow my Pens on Codepen

Saturday, February 11, 2017

Day 37

Current Challenge: Validate US Telephone Numbers
Progress: As of this morning, I've successfully finished the "Intermediate Algorithm Scripting" section on FreeCodeCamp, Yay! ;)


Minions celebrating

Looking forward to solving the "Advanced" ones. Pretty excited how the difficulty level will rise.
Thoughts: Though I almost solved everything on my own so far, I'm trying to dedicate an hour each day to help others (mainly on Gitter). I mean it's not like I would decline help in general, but I mostly found everything I needed after a quick search on Google, Gitter or in particular the FCC forums. More often than not I didn't even need to search since I was able to figure it out myself (although it probably took me way longer than on average). I also tried to refactor a lot and find alternate approaches, whereby the Wiki section on the FCC forums turned out to be a great source of inspiration. As a result, I noticed how my way of coding actually got a lot cleaner and more readable from challenge to challenge. Additionally, I had the opportunity to implement some more advanced programming concepts like "closures" or "recursion", which until now I only read about (e.g. Eloquent JavaScript*).

*Note: I stopped reading after chapter 6 for now because I felt like I needed more practice, which I eventually got thanks to FCC. The book is well-written and very concise but I wouldn' recommend it to a total newbie since it can be a bit overwhelming at times (e.g. "Polymorphism" in chapter 6 was difficult to grasp and some exercises may be very challenging). A far better book for someone completely new to programming or JavaScript is Head First JavaScript Programming.
Anyway, once you've picked up the basics Eloquent JavaScript is absolutely worth reading. I heard YDKJS is supposed to be pretty awesome as well, but unfortunately, I haven't had the occasion yet to read it. But I'll put it on my bucket list for sure! Maybe I'm gonna write some reviews later once I finished those books.

My plans for the next days:
  • Work through all "Advanced Algorithm Scripting" challenges on FreeCodeCamp

Follow me on GitHub

Follow me on FreeCodeCamp

Follow my Pens on Codepen