Tuesday, April 22, 2025

CST338: Week 7/8 (Week 15/16)

 Looking back at HW1, I am still content with my implementation. That said, if the project had additional features or broader scope I might have considered separating the sentence and/or word operations into separate classes/objects. My submission was fine for this project but if the project was larger, I would want to modularize things a bit more. It helps separate concerns and makes the code more maintainable if you don't go overboard. Lastly, we move fast but I want to make it a point to do a better job of commenting my code. I had minimal comments in HW1 and I think adding some would improve understanding.

One victory that comes to mind from this semester was getting reacquainted with Java. It's been a long while and I could once again appreciate how great it is that it is so feature rich as built in types and data structures. Even though it's starting to look like it will be phased out for Android development in favor of Kotlin, I am impressed with the IDE and tool support. JUnit integration, debuggers, emulators, etc  all work well. I gained a lot of knowledge while working on these projects.

I also found the GUI component the Android projects to be a good learning experience. Building the GUI, along with algorithms, and database structure on the backend is something you don't always get to do. Connecting the front and backend has been a good learning experience.

Another victory came from getting more used to open communication. I have been dealing with the fallout from my father's health taking a dramatic turn for the worse. I wasn't sure how to handle it and did not want to drop the class. Normally, I try very hard not to share personal stuff in these settings but this time was different. I let my teammates (and the professor) know what was happening. I said that I may be slower to get things done but that they would get done. Everyone showed incredible grace in giving me the space to complete the work. I owe them a huge debt of gratitude. I learned that communication is critical in any team effort. I owed it to myself and to my team to do everything I could to make a strong contribution.

CST338: Week 6 (Week 14)

This week was very challenging as I am still trying to get caught up. Thankfully, I have been able to make good progress and get a lot done on  that front. My team has been top notch when it comes to patience. I couldn't have hoped for better.

I like some of the exposure to databases since until this class I had never written code that directly initiated database operations. I also like that we are getting exposure to concurrency. In my eyes parallelism, concurrency, caching, and synchronization are some of the most interesting concepts in software development. For example, the way databases operations need to be handled on a separate thread so as not to block the main thread of the program. You see similar approaches in Linux kernel development in the "wait for completion" construct and other places.

I also upgraded the memory in my laptop. It's not a brand new system but the Xeon processor, discrete GPU, and 16GB of memory have been more than enough for my needs. Unfortunately, running the Android Studio emulator along with my web browser and other apps almost consumes all available memory. I upgraded to 32GB and it runs much smoother.

Tuesday, April 15, 2025

CST338: Week 5 (Week 13)

Markov Sentence Generator 

Who did you work with?

I worked with Ethan and Liam.

What was your strategy for solving the Markov assignment?

My strategy for this assignment was to break up the different tasks. (1) Define the member variables and constructor. (2) Add and implement the methods related to building the word dictionary. (3) Add and implement the methods related to building the outputted sentences formed by the algorithm. (4) Address any necessary code cleanup.

I implemented the methods in the order listed in the assignment definition. I implemented each method one at a time but whenever the operation of a method was unclear I would take a step back to see how it fits into the broader program to help clarify things.

Did you start writing code right away? Did you plan it out on paper?

I did not immediately start writing code. I read the assignment and the method specifications that were spelled out. I did not feel the need to map it out on paper.

What was THEIR strategy for solving the Markov assignment?

Ethan started by focusing on the visibility modifiers and attributes and worked on the bigger methods last. Though he describes it as delaying the inevitable I think it is a good way to build up to larger tasks with some small victories. He also used the sample runs to align his code with the expected output.

Liam's approach was to put the lesson he learned from the LDPM assignment into action. Instead of taking a more global look at the assignment and trying to fill in the gaps in a way that he felt made sense, he focused in on each method, one at a time.

How would you change your strategy having worked on the assignment?

Time has been a very very limited resource lately. Ideally, my strategy would be to move more slowly and to add javadoc comments... regardless of whether the assignment specification says that we need them or not.

According to your classmate(s): how well does your code follow the Google Java Style GuideLinks to an external site.?

My code was compliant but my teammates recommended that I use javadoc comments for the method definitions.  I did not see that requirement for this assignment so I left them out. I was also in a hurry. Next time I will include them.

Did you know you can automate applying some of the style guide rulesLinks to an external site.?

Yes. I have Google Java style checking enabled. 

Saturday, April 5, 2025

CST338: Week 4 (Week 12)

 Project 1: LDPM

With whom did you work?

I worked primarily with Ethan but also with Liam  and Keshab to a lesser degree.

What was your strategy for solving the assignments?

I added all of the class variables and created placeholder stubs for all of the methods.

From their I went down the list and implemented the logic for each method using the assignment guide.

Did you start writing code right away? Did you plan it out on paper?

Though I didn't map out the logic on paper, after reading the method descriptions I would take a moment to map things out in my head.

What was THEIR strategy for solving the assignments?

Ethan's strategy for solving the assignment was to carefully read the prompt, including every method and the sample outputs. Then he implemented each method, going down the list.

How would you change your strategy having worked on the assignment?

Time was tight for this project. For a larger project, I would have created more branches and isolated the development of each feature.

According to your classmate(s): how well does your code follow the Google Java Style GuideLinks to an external site.?

One line of my Monster.java is exactly 100 characters long. Which is the prescribed limit. The only comment I received alluded to this. Other than that, my implementation was compliant.

Did you know you can automate applying some of the style guide rulesLinks to an external site.?

I did not. I have been using Google's downloadable style guide.

What was the most challenging part?

The most challenging part was the time constraints that I have been under.

What was the most interesting?

The most interesting part has been when on two occasions in this course when I used intelliJ's debugger to debug a test failure.

What are you the most proud of?

That I have been able to get so much done in spite of an impactful family emergency.

How did you celebrate completing the assignment?

Celebrate? There is no time for such things :-)

If you didn't how will you celebrate? This isn't a joke. It helps our learning to celebrate and acknowledge victories.

Agreed. Once I am caught up, I will treat myself to a local BBQ place that I have been wanting to try.

CST338: Week 3 (Week 11)

 I received the following feedback for my Project 1, Part 1 & 2 code. Note, that at this point I only have function description comments and empty stubs for the Monster class methods. I had a family health related emergency so I am a bit behind on the assignments.

Variable names: are they meaningful and clear?
The variable names are clear, such as defenseMin, attackMax, healthPoints, and fainted. 
Logic that could be more efficient
The logic efficiency is good, and simple getters/setters are efficient. 
Unused imports or warnings.
No unused imports. ArrayList and List are used. 
Clear formatting
The formatting is good, with consistent indentation and brace placement. Methods are logically grouped.
Are there comments?
Class level javadoc to explain the purpose and authorship of the work. With the TODOs explaining what needs to be worked on. For example, setPhrase() call in the constructor. Some are missing, but that is expected as this isn't the final product.
Do all the tests pass
No, they do not pass, which is expected as this is not the final product and simply a work in progress.

These are some bits from this weeks reflective prompt.
What improvements would you make to your code/what was suggested?
At this stage of the implementation there wasn't much room for suggestions.
How would you change the unit tests?
The test cases seem reasonable and are based on the assignment requirements. If we were doing something more like black box testing of an opaque package, maybe they could be more thorough. For example, the setAttackPointsTest() might try passing a negative value to confirm that the operation fails. For our purposes though, the test cases seem fine as they are.
What did you struggle with?
No major struggle at this stage of my implementation. I had a family health emergency so I am not as far along as my teammates are.
What did your teammates struggle with?
One had some minor hurdles getting used to the different output string formatting that Java uses versus C++. Another had some trouble with the inheritance paradigm, i.e., subcalsses and setters/getters. The other had some trouble understanding the logical flow of the program. There wasn't necessarily a trend with the challenges we faced in the implementation process. They were all unique.
What are you most proud of on your submission for Project 1?
At this stage I am glad that it lines up with the prompt and is a good starting point.

CST338: Week 2 (Week 10)

 I like that we are using UML and Junit tests. I would like to get reacquainted with them since they are used widely. Even if I don't end up using them regularly, it's best to at least have some exposure.

This HW01 makes me grateful for having done the Coding Bat exercises. I haven't written code in Java for a very long while and it shows. Those exercises were also a good reintroduction to Java HashMaps which we use in HW01. I didn't have a lot of trouble with structuring my solutions but I needed to do a good amount of reading to get more familiar with Java's built-in data structures, error handling (try/catch), and the String class. I also learned about the very handy for each loop. In the past I have most often used C so I appreciate Java and how easy it is to manipulate Strings and text input.

I am glad that Oracle has thoroughly documented Java's built in classes and interfaces. In endsWithPunctuation() I was able to easily access the last character in a string with the built in String.charAt() function. I traversed Strings character by character using String.toCharArray() and a for each loop. I was able to read about these and other methods in the Java documentation. In C, these operations aren't quite as straight forward.

The most interesting/challenging method to implement was addLine(). I needed to convert the input String to an array of words. I was trying to keep the implementation clean and simple but wasn't sure how to clean up the whitespaces in the input. I used String.split() but the problem was that it left a empty string entries in the resulting array. In the end I added a condition to discard any empty Strings while adding to the ArrayList. Given more time I might be able to come up with a better solution but I am happy with the outcome.

CST363: Week 8 (Week 24)

 The three most important things I learned in this course: 1) What databases are and their advantages over for example, a flat file or sprea...