Category Archives: cs-wsu

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.

Blog Discovery

Why do we use Docker?

I decided to choose this article because it goes in-depth on the way we use docker in real life and how efficient it can be when it comes to “virtualization” in a sense, which allows it to run smoother. Plus, BMC blogs are filled with potential reads about software development, implementation, methods, etc. filled with blogs about other project they have accomplished to supply on  how we are already learning the basics on docker and command lines, this information on how docker works will be used in my class for future projects will give not just give me insights but other students that have a need to gather an understanding on how to operate docker and its components and valuable resources.

What is Docker exactly?

Docker is an open-sourced platform that is Linux based towards virtualization but using containers to build, run, test and packages applications with pure efficiency without losing its integrity because it doesn’t rely on the computer’s hardware but on the OS (Docker Engine). Docker is broken down into different elements that helps it run a bit smoother than virtualization, which are containers, images, registries, docker file, and Docker engine. Docker image are set instructions that make up the containers and processes on how to run the application. To run the images, we have the docker engine that helps maintain the virtualization said container on the host machine. If docker is installed it can be applied the same when it comes to container since they run the same. For example, when we want to build a website and add in a web server along with a database such as MySQL, we can simply make an image for the MySQL and give it instruction to the specific port you wish. then package the web server in a container to run the images you already preconfigured and its dependencies, so if you need more servers to be added, easily deployable and easy to migrate said containers to new server. 

I have no prior experience with docker but have a great understanding on how it can be useful in software development and how it can used efficiently especially when compared to cost and using VMs. I could have used this practice in combine with my database class of when I built a MySQL sever and could’ve practice my database with a docker container and saw first handedly how to implement and observe the inner workings of composing it into a container to save the hassle if I wanted to build a web server or application entirely on the docker services. 

Blog resource link: https://www.bmc.com/blogs/docker-101-introduction/

From the blog cs@worcester – Dahwal Dev by Dahwal Charles 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.

A little bit about myself.

Hello everyone! My name is Andrew Sychtysz. I am currently a senior at Worcester State University in the process of receiving my BS in Computer Science. With a concentration in Software Development. I am a Polish American that was born in Ware Massachusetts. I speak both English and Polish.

I have a great appreciation for Computer Programming Languages. I found a passion for technology at a very young age. When I first started coding, I realized that this was something I wanted to pursue for the rest of my life. The first language I began working with was Java. Once I found myself getting comfortable with Java, I became more fascinated. As I learned about Data Structures in Java and pursued the C programming language, my world began to change.

My aspirations are to work in the Software Development field and better myself as a coder everyday. Writing Software is such a beautiful concept to me. There is always something new to learn and different ways to improve. I plan to continue growing as a coder throughout the rest of my life.

CS@Worcester, CS-343

From the blog CS-WSU – Andrew Sychtysz Software Developer by Andrew Sychtysz and used with permission of the author. All other rights reserved by the author.

Introduction

Hi hope all are doing well, this has been a challenging couple of months but we made through it. I can’t wait to be in person again and hopefully soon this pandemic can be behind us. This semester seems promising to me and hopefully it will be to all of us.

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

About me…

Hi! I am Murtaza. I am a tech nerd. I love to learn and read about new technologies. This is my blog where I hope to share my take on tech today. Thank you!

From the blog CS-WSU – Towards Tech by murtazan and used with permission of the author. All other rights reserved by the author.

Learning for a lifetime

Virtue of Learning

Students have been ingrained from their childhood to get good grades and to excel in every course. They work hard through their K-12 years before they start earning their higher education degrees. This is where, now, they should sit back and prioritize their goals. What is their goal in life? What do they really want to do in life? The learning they achieve in the higher education courses should align with these goals. It is not about passing and getting good grades in the courses any longer. It is no longer about cramming the concepts. It is about actually understanding and comprehending the concepts. If the concepts are not well-understood, the students will not be able to apply these concepts in their next phase of life, viz., actual job scenarios. On the other hand, if the concepts are well-understood, good grades will follow. At the higher education level, it is no longer about cramming the concepts, it is about application of concepts across courses, across disciplines, and finally later in life. After all, earning a degree in a particular area is not just a roll of paper. It is much greater than that. Earning a degree in higher education is the harbinger of earning bread and butter for the rest of one’s life.

Observations of a Professor with four eyes!!

Emoji credit: https://pixabay.com/illustrations/emoticon-emoji-cartoon-emotions-1628080/

With the vast expanse of information available and required to be learned for a particular course, it is definitely not possible to cram it. It is more beneficial if other methods, viz., visual aids, practical applications, etc. are used to experientially learn it. There are tools, like SafeAssign, and Turnitin, available now-a-days to aid the professors to catch plagiarism. There are online browsers like Respondus Lockdown to prevent online cheating. Students may even try to out-smart these tools, but what may not be out-smarted is the experience in teaching gathered over the years by an eccentric professor. A professor with four eyes!!

Remember that working as a software professional, a person always has access to software manuals to look-up the correct syntax as well as the Internet to get help. But there is a difference between getting help through manuals and internet versus copying the entire solution. Also, as they say it, even copying requires brains!!

I would like to share some interesting anecdotes.

Scenario 1 – Grades without Brains!!!

It is true that in the software profession, it is not required to memorize the commands, as manuals are always available at hand. But it is important to learn the concepts and techniques of programming. It is important to learn where and how these concepts can be applied in a programming language and can analogously be applied to another programming language. Therefore, you will find that home quizzes are given and many times the use of IDE is allowed in tests to try out the commands. After all, it is not about memorizing the commands, but about learning how to apply them. Before I go ahead about the point that is being made here, I would like you to go through following article/response on Internet that set me thinking:

https://www.quora.com/Recruiters-have-you-ever-had-to-deal-with-a-candidate-that-turned-out-to-be-completely-unqualified-What-happened

There are cases when quizzes and tests have problems which require students to complete the missing part. It is one thing to look for solutions on the internet, but it is another to copy without understanding. This will only lead to “grades without brains” and to the situation as illustrated above. This has been observed in submissions wherein solutions look so neat but when executed they run into errors. There are also problems when the method signature has been provided, but since the student’s submission has been taken from the internet, there is a mismatch between the provided method signature and the submitted method, resulting in errors. Again, a case of copying without understanding.

I have encountered cases of students innocently asking if they could be helped with their error in an online quiz or even a test (even remote online test!) where the method signature of calling method was already provided, but they are getting an error. The reason… you guessed it!! The required method was copied from the internet, resulting in a mismatch between the method signature of the method call and the actual method. There is a mismatch in the data types of parameters or return type, or simply a one-to-one correspondence does not exist between the argument passed in the original method call and the parameters of the new method written. Ah well!!

Scenario 2 – Which Tire?

Well! Everyone has heard this one! The truly passionate and devoted Prof. James Bonk whose Chemistry classes were actually termed as “Bonkistry”, and one of his rather notorious flat tire story. If not, then please go through the following reference:

https://today.duke.edu/2013/03/bonkobit

But I am providing a twist here. I am not talking about a flat tire excuse here and am not interested in asking student(s) about which tire was flat.

Here is my suggested solution if the students are suspected to have copied the solution from somewhere else.

Ask the suspected students (privately!!) to just answer one question, give the name(s) of the other student(s) that you collaborated with on the project.

It is just not possible to have projects not only match and have a similar storyline (if everyone had to work on and submit their own project), with similar statements that match line-by-line having only variable names changed… and sometimes across sections!!

Remember, a professor with four eyes is at work here, who does not require plagiarism software aids. Well! So to say, with experience added over the years, every professor has those four eyes (both figuratively and literally!!). That maybe one of the reasons for us being called “Eccentric”!!

Reflection

My advice to the students is that learning is a virtue. Always aim for a better learning; a learning that will stay for a lifetime, and good grades will follow. You have selected this career path for a reason and that reason should not be belittled. It should not happen that lack of practice and preparedness causes your dreams to crash during the very first few job months, lest in the interview. If a professor is strict on grades, it is for a reason. If a professor is firm with the due dates, then you are getting trained for the real-world deadlines. If you need to multi-task between a number of assignments in different courses, you are being trained and prepared as a multitasker for real-world scenarios. If you need to remember and apply the concepts learned in one course to another course, you are being trained to remember the skills for a longer period of time, so that you may eventually apply them at your workplace.

From the blog CS@Worcester – Professor's Tales by Dr. Shruti Nagpal and used with permission of the author. All other rights reserved by the author.

Read Constantly

An algorithm is a set of rules to be followed in order to solve mathematical problems in numerous steps that usually involve repetition of an operation. Sometimes algorithm problems do not show up at the beginning of a project. As Steven S. Skiena states, different programmers find them out as subproblems, which appear to be … Continue reading Read Constantly

From the blog cs-wsu – Kristi Pina's Blog by kpina23 and used with permission of the author. All other rights reserved by the author.

Dig Deeper

We live in a world where different complex software projects have different deadlines and they use a variety of tools to finish the projects. Most of the time employers cannot afford to hire too many specialists to fill every role. You learn only enough about any tool to get today’s job done. You select some … Continue reading Dig Deeper

From the blog cs-wsu – Kristi Pina's Blog by kpina23 and used with permission of the author. All other rights reserved by the author.