Friday 21 April 2017

Open Source Tooling and Automation Part 3

What I did:

In this lab I follow the guide lines to create an simple node.js server and REST API using the lab module that I have been working on. Additionally I deployed my little server to run on the Heroku a free clouding hosting platform so I could show my work to professor via the blog on CDOT wiki.

What I learned:

It is difficult to say that I learned about server or API, but with just this brief introduction to REST api and node.js I understand that there is much more to it than  what I thought and I am eager to find some time and learn much more.

Difficulties:

While I was following professor`s instructions I cam across a but whenever I was trying to log in to Heroku using my Git Bash command line.
By researching this bug on the web I realize that I was not the only one having the same problem. What I discovered was that the newest version of git was having compatibility problems coupling with Heroku sistem therefore a possible solution was to use windows command line to access my Heroku account.


That was enough to get read of the problem and move along with my lab instructions.

Open Source Tooling and Automation Part 2

What I did:

For this lab, I added the unit test to my code logic. The unit test is a method of checking if the code will survive different inputs to make your code more robust and full proof.

What I learned:

Doing this lab I learned how to properly set a unit test to check my code for possible bugs and weaknesses. I also learned that unity test is a very reliable way of somewhat create some documentations of your code since people can go and look what your code has already gone trough.

What I considered interesting and Difficult:

It is very interesting the fact that we can create our own set of tests. I understand that this lab was elaborated to introduce us the idea of unit testing and I think that made a really good impression on me. The difficulty was to wrap my mind around all this abstract idea of files relating to each other and we begin able to control input on our functions via another file.

A unit test was not a new concept for me since I had done some JUnit testing back when I was learning java. Back there I imagined that such a thing was only possible to be done in java using the Eclipse IDE and I was, as many other times, proven wrong.

Thursday 20 April 2017

Fourth Release

Brackets URL Hints doesn't list folders


Initial Challenges:  
To do this implementation to Thimble again I had to go back to brackets code and adjust it. This time I would be by my own and it took some time before I figure out what was I supposed to do exactly until I found the code that did the normal implementation by looking for images on the main directory and allowing the possibility to the user to use his webcam as well.



Approaching the Solution:
I started to try to break the code to understand its work flow and it actually helped me a lot.

Than I found This peace of code whit an very interesting comment:

I started my implementation by creating an method that would recursively get all files that exist in all the directories that exist on the main directory and it would insert the file name as a string into the array. 


This Fourth release was the hardest I had to do so far. As of now I have not manage to finish it properly. But I am convinced that soon it will be fully implemented!

Wednesday 19 April 2017

Third Release Blog

What I propose to do
This is the continuation of an UI update request by @humphd on issue mozilla/brackets#607. I will be implementing a new feature that display icon that shows whenever a user is not logged into his thimble account and its document are saved locally to the browser.
Steps to Reproduce
User must be logged out
User makes changes and wait for 5 seconds
User jumps through files
Expected behavior.
I want the user to be prompt whenever a save occur.
Actual behavior.
Nothing is displayed when the document is changed of user moves between files.
Instrument and Methodologies
I will be using Firefox and google Chrome browsers to guarantee cross-browser.
I will be using Visual studio Code to ensure that my indentation is compatible with what the development team requires.

 Initial challenges:
   The biggest challenge I had on my third release was that now I was on my own. I had to prove myself that I had learned Professor David`s lessons on how to deal with a situation where you might not be too comfortable with the code that you have to work.

   I reached to the Thimble community and for my luck, I met this guy Simon in my classroom who had dealt with a similar problem and he gladly shows me his implementation of the code.

First Solution:
My fist solution was easy. I simply modified the user view to prompt the user when the code was saved or the code was saving. That was not enough to please the reviewer since it was all hard coded in English and they explained me that thimble is  been used by people around the world in many languages.



Second Solution:
The reviewers asked me to use the localizing strings to make the implementation reusable.
I did so by modifying the files: message.properties, bramble-ui-bridge.js and userbar.html,

See my pull request: https://github.com/mozilla/thimble.mozilla.org/pull/1932/files

Finally David ask Gideon Thomas to step forward and review the code since he is an expert on the localization methodology.


Tuesday 4 April 2017

Visual Studio Code


The content of this blog is compiled inside this video. It was done by me and my friend Karan Randhawa and it is a selling pitch for Visual studio code enjoy!

Tuesday 7 March 2017

Second Release Blog


Well my implementation looked easy at first moment, but it proven to be a little bit more challenging than I thought.

I proposed on Issue #607 to prompt the logged out user if their files changes had been changed or if the file was already saved.

I discuss the first ideas with professor David and he guided me through out the logic behind Brackets saving files locally to the users browser. He showed me the file main.js had the logic hat whenever file was considered dirty it will wait five seconds before save it or immediately if the user jump between files.

Later after a few other ideas exchange inside the issue page professor David trying to make the problem more understandable he told me to look for how other developer had approached events that happened between brackets/bramble and Thimble.

That made the code much easier to navigate and understand, I was able to implement a few lines of code, but I could not test it since I was unable to create the path reference between the files which hold the logic.

Finlay after much struggle I had to look for professor's help again since I could not figure out how to create a variable with the path to the file and finally test my changes.

It was very challenging and I learned a lot about JavaScript and even more how to rely on the community and other people that are willing to help me understand complicated code.

Right now the initial idea is partially implemented, but I will create another issue this time on Thimble repository and use the second part as my release #0.3.

 

Monday 27 February 2017

Lab Blog

The fix that I proposed to complete is not exactly a bug. It is acutely an accommodation and facilitation to the user of thimble.  

After I fix a but on the saving pattern when the user was logged in. Professor David Humphrey asked me to go further and now display something now whenever the user is not logged in and make changes to the code and those get saved locally by brackets to the browser. 

I also invited Luke Pacholski to give some hints and his opinion as a designer to how it should be done.

 The biggest challenge is to handle the references between Brackets and Thimble, but Professor Davide showed me how to find in the README.txt other methods that are using a similar reference that I might have to use.