Progress #6

Past few days, I have been occupied with Cryptocurrency (Digital Currency). Lots to learn about Bitcoins and other altcoins. I will write a blog post on this later.

Currently reading the book, JavaScript and Jquery by Jon Duckett.

1.jpg

I am half way reading this book, about 600ish pages.

Pros:
Lots of good content
Good explanation and in detail

Cons:
Lots of jumping to pages (eg. on pg 300 etc)
Too much information
Not much practical, pretty much a bible

Overall it is a good book. I think for me, I am more a practical person like doing video tutorials. In the past, I learned Visual Basic from a book and it worked for me. I guess the VB book was pretty much explanation, write this code and do it yourself. I haven’t coded much since JavaScript 30 for the past few weeks. Maybe I am losing motivation cos JavaScript is a mind-blowing programming language like #wtf? I think reading the book is boring me to bits and trying to finish it before I head to the next step.

#Keepgoing #Keepfighting

Progress #5

Doing project #15 – LocalStorage and Event Delegation.

The instructor seems to like to use lots of emoji’s and I think he has a mac. I am on normal windows and I always seem to not able to read the emoji’s on my PC. The last project, it also had encoding emoji problem, had to find unicode/html code for it. Probably have to display it as [ ], [X] or an image.

Left: My PC, Right: Instructor PC
12

At the moment, implementing new features clear all, check/uncheck all.

Update: Managed to code a clear all function

Update #2: Created the check/uncheck all function but doesn’t seem to be saved into LocalStorage

Update #3: Code works but give’s a console error

Uncaught TypeError: Cannot read property 'done' of undefined

Update #4: Posted Question on SO and error gone but code got buggy. When clicking check all and refreshed page, couple more items has been added and listed as undefined. Oh man! Couple minutes into debugging, managed to fix it all up.

Time spent almost 3 days! Troubleshooting, debugging and problem solving! Woooooooooot! 🙂

Via JavaScript30

 

Progress #4

Currently doing JavaScript30. It’s a free course. 1 JavaScript project per day for 30 days.

Doing project number 11 – Custom HTML5 Video Player
In Chrome (ver 58), it doesn’t display the play, pause and etc buttons. It show’s weird characters instead of a play button.
play

Tried to getElementById but got really messy.

document.getElementById('A1').value = '►';
document.getElementById('A1').value = '❚❚';

JS30 Tutorial:
In the scripts.js file. Under the function..

function updateButton() {

const icon = this.paused ? '►' : '❚❚';

Solution:

const icon = this.paused ? '\u25ba' : '\u275A\u275A';

But then again, I changed it back to ascii form ► and now I can see it. Very odd bug!!
Maybe, it’s Chrome first time not seeing it. Changed the symbol with a different source code and changed it back again now works.

Rookie Mistake:
Syntax error. Missed the word “All”. Haha!!

player.querySelector
meant to be:
player.querySelectorAll

 

Via http://stackoverflow.com/questions/16930905/why-does-the-html-symbol-for-%E2%96%B6-not-work-in-document-title

Progress #3

Was doing some studying with JavaScript via http://www.learn-js.org/en/Loops.

I was testing this code:

var i = 99;
while (i > 0)
{
    console.log(i + " bottles of beer on the wall");
    i -= 1;
}

It worked fine in Chrome Developer tools, Console menu.
It displays from 1 to 99 bottles of beer on the wall in a loop.

Crazy me, I switched – sign to a + sign without thinking. DO NOT ATTEMPT THIS!!

var i = 99;
while (i > 0)
{
    console.log(i + " bottles of beer on the wall");
    i += 1;
}

Guess what happened? My Chrome crashed, It will go from 99 and beyond space. In an infinite loop…I couldn’t close the tab. Silly me, should read the code carefully before executing it.

Solution:

In Chrome: Either Shift+ESC or Menu → More Tools → Task Manager.
Find the tab and click End process. It will stop the tab from running.

Progress #2

Past 2 days, it has been a frustrating yet rewarding.
The past few days, I have been following the How to learn JavaScript properly roadmap.
When I reached the end of the roadmap, I had to create a “simple” quiz.

At first, I was like oh yeah, no worries. It’s simple right?
Oh boy, I was obviously wrong. It was very frustrating, head banging. Wanted to shoot myself in the head. I didn’t know where to begin and start.

Day 1: Tried to attempt to write the code. No results. Lots of headaches. Lots of reading and researching. Looked at few past sample quiz done by past students.

Day 2: Managed to code it but not fully from scratch. Lots of reading from Stack Overflow, Reddit, Facebook groups to get help. Realised why my code wasn’t working. I was working on a local copy on my desktop, not an online editor like CodePen or JSFiddle. **Light Bulb (!) moment** Couldn’t write it from scratch, tried my best and I had to follow (and understand how it works) a basic skeleton quiz code which I managed to improve it’s functionality and added more features. I can see the light end of the tunnel!

Day 3: Fix some code and it’s a working progress.

Rookie Mistake #1: Forgot to call jquery in the script.

Lesson Learnt: Keep going. Do lots of research. Don’t be afraid to fail. It’s OK if you can’t write it from scratch but also understand how and why someone’s code works. Start from there and reverse engineer it and write your own based on it. Tell your friends what you are working on and they can lend you moral support.

Here’s a link to my simple and basic JavaScript quiz.

Found this article as well which helps.

Resources:
Lots of stack overflow reading. Lurking.
https://www.w3schools.com/js/js_arrays.asp
https://learn.jquery.com/using-jquery-core/jquery-object/
http://idratherbewriting.com/events-and-listeners-javascript/
http://stackoverflow.com/questions/28535226/javascript-show-next-div-and-hide-previous
https://www.w3schools.com/JSREF/met_document_getelementsbytagname.asp

Progress

After a month studying programming for 8-12hrs per day. My mind finally gave in the last 2 days. I think I woke up on the wrong side of the bed. Couldn’t think properly and had to reset. Currently learning JavaScript and it’s a pain in the ass but I will never give up! Now, I am revitalised  and back at it again!

Currently following Javascript Is Sexy site.

 

Happy Easter Everybody!

We are not defeated by adversity but by the loss of the will to strive. However devastated you may feel, so long as you have the will to fight on, you can surely triumph.