Uncategorized

Lab 6: Brave Browser

Lab 6 was the worse experience I’ve had so far! We were required (in group) to follow the TDD way to fix the URL bar of the Brave browser. The problem is that the URL bar would not accept all query items that was given to it or it would not show some file typed in the url bar due to it not parsing file paths correctly.

Failing Item:

  • https://www.google.ca/search?q=dog cat” <- Would not parse the cat value
  • “/path/to/file/dog cat.txt” <- Would not render the text file because of space.
  • ” /path/to/file/dog cat.txt ” <- Failed because of space
  • ” C:\Path\to\file with space.txt” <- Failed because of the letter C

Setting up Debugging Environment In VSCode

Here comes the worst part. I was unable to proceed and help my teammates find the bug because I could not setup the debugging environtment in VScode with my machine. My machine is running Ubuntu 16.04 LTS. I followed their debugging.md file instructions which clearly stated that it should work on Linux though they only have tested on macOS…

Screenshot from 2018-04-24 16-00-49

I tried getting help from my classmates and teacher, however, we were not able to fix to get it working. Also, a lot of other students with Linux operating system were not able to get it working. Unfortunately, I was only able to try help my teammate by looking at what they were doing and help them find the files where the bug might potentially be. Alex Wang my teammate wrote a nice blog explaining all the details about the bug  link .

I was actually really angry at my teacher for giving us such lab … though it was not his fault…

Uncategorized

Lab 5: Bridge Troll

This weeks lab was quite interesting, it required a bit more coding and thinking. Our teacher decided to build a small project that will require us to fix or add a feature to project by first forking it and creating our own branch.

About The Project

Bridge Troll is a small app that shows us where bridges are located in Ontario. Leaflet is the map library that used in the project. Of course, Leaflet is an open source javascript library. I have used it before in one of my personal projects it’s a really cool and well built library in my opinion.

Screenshot from 2018-04-24 14-39-12

Required Feature

So, what was required from us was to implement a dark mode based on the sunlight using a library called suncalc. The suncalc library allows us to figure out if it’s currently sunset or sunrise. The most common approach for this lab was to first figure out how to get the sunrise/sunset time based on geolocation, and the next step was to get a dark theme for the map and toggle between a bright map and a dark map.

My Solution

Because I didn’t want to go through the trouble going through all the themes I decided to make use of the CSS brightness property. I would just toggle the value between 100% and %50 to create a bright an dark mood. Here is the code for the solution. Below is an image of the end result.

Screenshot from 2018-04-24 15-23-38

Its really nice to know that a library such as suncalc exist! I might use in the future or even build a version for Haskell, it didn’t seem too big just 300 lines of code!

 

Uncategorized

Lab: JavaScript (ecmascript) standard Testing

In this lab we learn how to use javascript test library https://github.com/tc39/test262.

The goal was to introduce the testing syntax that are generally used when testing javascript code. The test262 repo’s contributors had previously built there own testing functions to test there code, so our task was to convert some of these testing using the new standard way which was presented in the repo’s CONTRIBUTING.md file.

Test Function

Screenshot from 2018-04-24 14-20-27

So, we were given a file taken directly from the repo and convert their handmade test function with these standard functions link. Since, the function names were very similar to Ruby’s and Haskell’s test functions I felt right at home. Here is the gist of the file using some of above standard test function link.