Author Archives: jeffersonbourguignoncoutinho

Apprenticeship Patterns Chapter 1 and 2-6 introductions Summary

I found interesting that a lot of the practices mentioned in the book are probably day to day patterns that we practice involuntarily. Some patterns are surprisingly new and offer a good way to cope with the workflow of continuous learning. The comparison with medieval ways of artisanship in which the learning takes a practicum meaning and the theoretical is stripped out in favor of physical interaction which is very interesting. I am an enthusiast of the theoretical realm, but I must agree that expertise which people wrongly associate with the illusion of talent only comes with continuous long-term repetitions of small actions on limited theoretical content.     

The book showed me that there is more than one way to navigate through a lifelong learning journey. It is comforting to know that in the Software Development work environment the continuous improvement presented by the authors is not only present but encouraged. The idea of sharing these patterns and improving on them is very open source like. It shows the developer understanding of the need for each other and that there is no downside to help the general improvement of the community.  

The chapter that talks about perpetual learning is enlightening. It absolutely homes in on the greatest obstacle to learning which is distraction.  I agree to it but have my reservations because it also mentions that if you love learning you get over these distractions. What I think is truer is that focus is also the most important skill to be practiced. It involves more than a set of actions and habits; it also involves chemical reactions and sensorial exposure as well as countless parameters out of our control. I confess that as I navigate through my undergrad incursion, I came across supplements to improve focus and used them even if just for placebo effect. I have set controls such as continuous study times, set brakes, meditating 20 minutes for every hour, sleeping a minimum of 8 hours, balancing topics by due date and importance, not consuming alcohol even in social events, ignoring people and everything that is not study. Which is why I have a pile of mail and bills after every semester. But even after all the controls I still must continuously adjust and adapt to optimize focus. Without focus there can be no real learning.        

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

Breakable Toy Pattern

The breakable toy pattern is something I practice often without realizing it was considered a pattern for good learning practice. I must say at times I find it to be a double edge sword. Sometimes I look for things beyond my abilities and end up stuck, depressed, and put it in the back burner, but I end up unpacking them later [because I’m stubborn] sometimes over multiple iterations and when I finally get them working the achievement felt is increased in the same order. I think this pattern probably pairs well with other patterns such as confront your own ignorance maybe I’ll write about this one next. Anyway, I want to talk about how he describes the pattern in his own way.

The author makes a good point in the first few paragraphs that the point of a breakable toy was to be able to work on things you don’t usually work on. This description enforces that this pattern helps you learn without side effects on the systems you work on that are not toys. I believe that he makes this distinction to allow for a daring approach, one that would allow you to try something just to see what happens. This allows for a much deeper understanding of any problem. It is like testing to find boundaries, critical systems may not allow such playful adventures but even these critical systems had to be prototyped at some point and someone stress tested the system so you could have a safe playpen.

I know stress testing is an idea that could be consider a little alien to the breakable toy pattern, but I believe it is part of it. When building these breakable toys, we use tools and frame works that we sometimes stress to the end of their abilities. Then we find better tools and frameworks or learn to better use and manage the ones we have.

To conclude the breakable toy pattern allows for growth not only skill-wise but also mentally when we exercise self-control. It allows us to practice focus and confront anxiety. To build the skill set of building skill sets.       

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

Thea’s Pantry Quick Breakdown

  • User Stories

I know the costumer ultimately is the organizer using the device, but I could not stop thinking of the people on the other side, who are they, a community member in need, a homeless person, a student in need. This made me think about privacy and sensible ways of presenting quantity constraints in a respectable way. I don’t think a future in UI/UX is for me, but I believe the user should be expanded.

  • Architecture and Technology

What I think is most helpful is the architecture and technology. Mostly architecture, I remember how easy it is to get lost on systems that have many parts with different relations. The UML diagrams are important not only to get it right in the first place but check whether you did get it right or not. I think dependencies are hard to describe concurrently having their layout ahead of work makes everyone’s lives a lot easier.    

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

Quick thoughts on opensource at libreFoodPantry.org

The LibreFoodPantry.org site allows for an easy onboarding, which is something I have been thinking a lot about this close to graduation.  The project is very well defined and spans a good number of educational institutions. I like that is not own by one but multiple responsible parties which to me lends it credibility. It was interesting to see the term FOSS mentioned with emphasis and I wasn’t sure what it was although I probably had used more than a few tools that meet the criteria. Contributing to a free and open source software that has charitable goals is a great way to learn and feel good about it.

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

DinD or DooD but not D&D

While surfing my usual waves at google I came across an article with some peculiar information. It does not directly relate to our current homework, which deals with the backend and API ties, but it is somewhat relevant. The article presents the argument of security in using DinD as a liability exposing the operating system to the container directly. Another important factor was the reliability of DinD and unintended consequences and conflicts with the use of it. I can’t think of possible bugs that docker in docker can cause, but I guess I can see how different operating systems with different file hierarchy and possibly arbitration can be a messy thing to untangle. Regardless, he shows a quite simple and cool way to have an important DinD capability without using DinD.

Why use docker in docker

while scouting for articles I came across this one https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ by Jérôme Petazzoni, it is interesting and tells the story of how DinD  was actually created to help develop docker itself. The use of DinD, as it appears to me, is mostly based on the need to run multiple images within docker to achieve continuous integration. Being able to test the entire system and making sure that integrity is maintained is what makes DinD so useful, or does it?

Why not use docker in docker

The author of the article mentioned tells the many headaches of developing DinD, some of which involves convoluted solutions that worked partially. The more I work and learn from this class, the more I determine that, if something is really complicated and requires too many hacks, it us not worth pursuing. I believe this was the case for early DinD. Some of the problems encountered were different security modules and many others that I am not quite familiar with, and can’t really discuss intelligently about. But DinD moved on, and a lot of improvements were made to improve on a lot of the issues, although I believe issues remain, partially because the article’s author involved with the development of it, asks you to use something else.

Do this instead, DooD docker out of docker

Thankfully, the article’s author gives a solution to the problem, and I didn’t even have to go back to the original google wave I surfed earlier to retrieve it. He mentions DinD works in some kind of quasi object-oriented principle of inheritance, where the containers have a family like hierarchy, this may cause some disturbance in the force. The solution he shows act squashing that inheritance down to a sibling relation, no one depends on anyone, we are all in the same level. The solution works by volume mount, mapping the docker socket. This is the solution for the running DooD in a project that requires continuous integration, “docker run -v /var/run/docker.sock:/var/run/docker.sock  -ti docker”, there are probably advantages as well as disadvantages to doing this but ill leave that for you to decide.

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

API

This week we talked a lot about APIs and to my surprise I thought APIs did much more than they actually do.  Another peculiarity is that the only sort of programmatic process they support are the ones provided by HTTP calls, which again is also something I never had to deal with outside of cluelessly browsing the web.  Nevertheless, they are very important and incredibly intricate in the form of versatility offered to a variety of operations.  This is all very new to me, and this blog may show not only useful things I’ve learned but also crude misconceptions I may have formed by mistake, in the ladder case please disregard or give me a heads up and I’ll make corrections.

HTTP calls are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE and PATCH my knowledge in the subject prevents me from saying that this is all of it or if there are more, use this site to refer to them https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods it has comprehensive descriptions.  From the most recent assignment we had we utilized GET, POST, PUT, and DELETE.  I would like to summarize their function for my own benefit.

  • The GET request is used to retrieve data from the server, and it can only receive it may never change the data in the server
  • The PUT method is used to send and change or create data in the server it is different from post because it is idempotent, (big word) please refer to the URL https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2
  • The POST method is similar to PUT but it is not idempotent, I think the simpler way to put it, oh sorry, post it is that POST creates a new instance every time it is used and PUT would replace it, this article shows good old English we can understand explanation about it https://reqbin.com/Article/HttpPost.
  • The DELETE request will do as it says, it deletes the requested data from the server and unlike GET and HEAD, which we are not mentioning, it may change the state of the server.  A cool thing I get from it is that some servers may reject a DELETE request which makes sense, deleting data should be a restricted action.

Something else I’ve learned from this assignment has to do with the YAML file which I looked up in order to know where it comes from and what it stands for.  There are other things I wanted to talk about related to APIs, but too many to fit here, so I’ll end with YAML.  YAML is a superset of JSON which is a java like way of representing and structuring data.  YAML can do anything JSON does and some more.  JSON is formatted using braces and brackets while YAML uses colon and two space indentation.  In my opinion I think conventions like this such as in python makes for messy nesting which leads to code hard to visualize.  YAML is like JSON, language-independent making it a good tool to use.  https://circleci.com/blog/what-is-yaml-a-beginner-s-guide/   

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

Docker Docs Tutorial Follow-up

Hi everyone, or one, however many, hope all is well. These last few weeks have been hard for all of us, and it is tuff to keep a captain’s log when the sea is turbulent and requires careful navigation. This is the reason I decided to try something new, something I suppose I should have been doing all along. Instead of studying the subject and writing the experience, I will try to combine writing, while, getting acquainted with the subject. Disclaimer, this is a test, it is a discussion from following the tutorial not instructions. Feel free to follow the tutorial –the link is at the end.

The beginning of this tutorial has us creating a folder in cmd and opening that folder, I tried to follow it to the letter.  Windows users tend to get lazy with all the easy click visual aids and underestimate the power of the shell (pun intended).  While playing through a python file, I decided to write the script on the shell and forgot to use “”.  Many lines later I realize the time I wasted with the useless typing effort. Echo “import time” > app.py was all that I needed, sometimes we go through the extra effort without realizing there is no extra reward. The focus of this tutorial is not the python script [ctrl c, ctrl v is my best friend/enemy].

The second part of the tutorial has us setting up a Dockerfile. I wasted some time trying to find the [.extension] for Dockerfile, which shows how sometimes is easy to go around chasing our tails in tutorials. The tutorial has a very good set of explanations on what every line is doing. I really like the RUN pip install -r requirements.txt, which saves space and compartmentalize things, all we must do is write the txt for the requirements in that one file and we never have to touch the Dockerfile for petty things such as these.

Step 3 has us creating a [.yml] file for the compose json like statements. As mentioned in the tutorial this compose file defines a [web] and [redis] services, I assume the version is not linked to anything or it is set at the developer’s discretion giving the condition of some actual project. The [web] service just points to the port that have been exposed from the Dockerfile, I suppose. The other service [redis] is an image to run parallel to the image already running from Dockerfile.

The final step was to just run [docker-compose up] and I must say there is nothing more pleasing than blue text and no errors at the end. It then asks you to use the keyword [volumes] in the [.yml] file to bind the current directory on the host to /code, I must say I got an error for missing a space on [-.:/code] instead of [- .:/code], see the difference.  We’ve done this in class, but any good guitar player could tell you –repetition is the name of the game.

https://docs.docker.com/compose/gettingstarted/

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

Docker/VSCode

This week we will be working with docker, and I must say that before this semester I had not used it.  It can be quite cumbersome to the newly arrived such as I.  As I move through this newly discovered tool, I see the necessity to learn and use such construct.  Working with larger applications that involve more than one developer and maybe a revolving door of developers require continuously tested and proved documentation.  The documentation is only part of what an organic process that you wish will continue with minimal supervision requires. The other important item to achieve the forementioned is requirements and these can vary broadly even in a single project.  

As I see Docker is a repository of images from a variety of Linux base operating systems to which various tools are set to work with. It relies on a lot of shell scripting which I am not very strong with yet and is deserving of colorful language to describe.  When it comes to the shell scripting is like you fell into the matrix, literally, just as cool as the movie cinematics. When the operating system has to share information with a different one on top of the same machine is like matrix meets the Avengers multiverse, and things get out of control unless you have some magic systems admin moves. Well of course I base that on using vscode since I never used docker on any other IDE.

The use of vscode is also something difficult to described. It is a powerful tool; if you know how to use it well it can yield great performance, but if you don’t, it can yield stress, headache and a powerful mess. This is not to discourage the use of it, certainly the more I learn the more I enjoy it. Just recently I discovered that one of the things I dislike the most is easily fixable and I would like to share it here in case it could help someone.

Problem: OS windows 10 does not show “open with vscode” when you right click a folder.

Diagnostic: when installing vscode there are options that need to be selected in order for that to happen.

Easy  solution: reinstall vscode and select the two options

Cool solution: open vscode; go to file then new windows ,close the other windows; go to file then open folder; open the folder /users/yourName; in vscode; open editors; below is yourName file, clique new file; name it something like vsCodeRegistry.reg or whatever.reg; then copy this text to the body of the file.

Windows Registry Editor Version 5.00

; Open files

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]

@=”Edit with VS Code”

“Icon”=”C:\\Program Files\\Microsoft VS Code\\Code.exe,0”

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]

@=”\”C:\\Program Files\\Microsoft VS Code\\Code.exe\” \”%1\””

; This will make it appear when you right click ON a folder

; The “Icon” line can be removed if you don’t want the icon to appear

[HKEY_CLASSES_ROOT\Directory\shell\vscode]

@=”Open Folder as VS Code Project”

“Icon”=”\”C:\\Program Files\\Microsoft VS Code\\Code.exe\”,0″

[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]

@=”\”C:\\Program Files\\Microsoft VS Code\\Code.exe\” \”%1\””

; This will make it appear when you right click INSIDE a folder

; The “Icon” line can be removed if you don’t want the icon to appear

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]

@=”Open Folder as VS Code Project”

“Icon”=”\”C:\\Program Files\\Microsoft VS Code\\Code.exe\”,0″

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]

@=”\”C:\\Program Files\\Microsoft VS Code\\Code.exe\” \”%V\””

Courtesy of a compatriot from Brazil https://dev.to/matheusgomes062/how-to-open-your-files-with-vs-code-from-the-context-menu-on-windows-5fi9; save it go to that file double clique the file and voila, right clique any file and open on vscode.

Now do you understand what this shell script is doing? maybe you do, but I need to look into these things more deeply and as far as I see it appears to be a must to acquire some systems admin moves.

By the way when I tried the first time the shell open and entered an endless loop of empty entries, I had copied something wrong from the file, it is not suppose to do that. The OS will ask you questions if you want to run this, that is supposed to happen.

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

Singleton/Factory

Last week reading took us through one design pattern the singleton pattern and a quasi-design pattern the simple factory technique. I was very impressed by both and took some time to analyze their delivery method –how they presented their arguments. On singleton the author presented the design as a conversation in an almost Zen tone. I was attracted to his way of explaining because I believe that a lot of times when studying we let the stress get the better of us and miss many important points. The step by step really show not just how but why. A lot of times we write a lot of code because we know how but not always know why we write it a certain way, which I believe makes the knowledge untransferable –although why is not always important.

The relaxed Zen mode of explaining is also something I appreciate because I am a strong believer that sometimes, some things should be explained like you would explain a 5-year-old, and I have no shame in listening like a 5-year-old. It is easy to have many years of experience on something and forget some of the things taken for granted are very important to the beginner(me). The Zen approach also reminds me of Buddhist monks drawing complex sand diagrams only to erased them and start over again. It is hard to erase bad habits and acquiring good ones, but by creating the habit of erasing habits the learning cycle can be increased considerably. That’s all I must really say on how the authors carried their message, but the interesting thing was the message itself.

The singleton pattern at first was not impressive if anything I always had a bad view of private or protected variables or methods. I never really understood the need to hide things in code maybe because I never really had to write code of considerable size. Once I started working with the pattern it was like a little light bulb flickered on top of my head and I suddenly started seeing the coolness of obfuscation in this case just preventing object overcrowding. I really thought it was pretty cool and I think that in the way the idea was explained the structure will be in my head for quite some time, and I am a very forgetful person.

The simple factory technique was also well explained in just the right number of words. It was very clear that by consolidating actions or delegating the creation of objects helped to minimize how much one class was doing. Uncle bob always say doing too many things is bad, so I think this applies in this case. I was afraid at first that to implement this was to substitute the singleton pattern that I’ve gotten so fond of, but that was not the case. After implementing it I saw that there were other areas that could be greatly improved by consolidating further. My only fear is to know when to stop –how much is too much consolidation.

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.

UML Diagrams

Diagrams are usually a good way to convey an idea. There is an intrinsic human ability to understand abstract instructions in this form. It is not surprising that in designing software we would look for a way to express it as such. UML diagrams are not only helpful as a [mockup]blue_print in designing but also as format to present the main idea in a more straight-forward way to non-tech assets.

I find it interesting the idea of facilitating the introduction of a concept to a non-tech asset (perhaps because most of the time I just want to understand it better myself). I should really explain what I mean by a non-tech asset, this term could be used somewhere else for a different purpose –if you do so know a better word for my definition, please leave a message. I think of non-tech assets as a broad spectrum of individuals that may be involved directly or indirectly to the end-product. There also may be closer relations amongst different expertise that makes part of a certain project alien to a particular group –also tech aware but not omniscient. This is my philosophical attempt at saying some people need to understand how something works not necessarily why it works –this tie well with obfuscation I believe.

So, by the definition given above and by the readings this week it becomes clearer that there is a choice to be made in UML diagrams –should it be all-expressive or partially-expressive? I believe that most tend to stay at the partially-expressive end, which is best because it uses obfuscation to increase clarity. I know this sounds counter to obfuscation but think, a lot of information about something you don’t understand, or care, does not necessarily make things clear. It does the opposite; it muddies the intention; it hides the meaning by overloading the target. Now that we cover this, let’s move to decision making and end with standardization.     

Throughout the last classes (school class) we have been discussing how to optimize code by looking at UML diagrams. The information on the diagram provided us with the information necessary to see the problems accrued by the code’s configuration. So, it is safe to say that there is a minimum amount of information that needs to be in a diagram in order to be fully helpful. It is also a safe bet to say that a lot of the implementations that don’t affect the relationship amongst the classes (not school classes) is too much information. I think that if we code clean (no pun intended) the implementation speaks for itself and it doesn’t need diagram representation, which should only be necessary when we look at many classes interacting.

At the reading we were presented with a very interesting standardization problem. From what I saw there are a lot of ways to use UML for a variety of subjects. There was a discussion about a public (tech public) uproar from a previous attempt to standardize. I think the complexity lies in how many ways these diagrams are used. Maybe software developers would benefit from such standardization but who am I to say. As far as I know if I had to work with a team, I would like them to produce diagrams that follow a particular set of rules instead of looking at a jungle of too much and too little. Fowler says it best in this quote “… there is no hard-and-fast correspondence between the UML and code, yet there is a similarity. Within a project team, team conventions will lead to a closer correspondence” (Fowler, 2004).

References

Fowler, M., 2004. UML distilled Pearson Education, inc.

From the blog CS@Worcester – technology blog by jeffersonbourguignoncoutinho and used with permission of the author. All other rights reserved by the author.