Producer and Consumer – Part 4

We are quickly approaching the end of another work week. In the Twin Cities of Minneapolis and St. Paul it appears that most businesses are back to normal. The only exception is that many office workers are still working from home and people is required to wear a mask when in public spaces. Most people that want to be vaccinated against COVID-19 have done so. We need to get most (never generalize) people to comply in order to achieve herd immunity.

This is the fourth installment of the sequence of posts related to a producer and consumer connected via TCP/IP. In this post we will not add functionality to the producer or consumer. We will explore some functions and methods that we have at our disposal when encrypting and decrypting files using the Advanced Encryption Standard. Continue reading “Producer and Consumer – Part 4”

Producer and Consumer – Part 3

It is Friday once again. The cleaning crew is at home. I have been listening to the vacuum for a few hours. They should be done shortly.

I have to get a COVID-19 test this afternoon. On Monday I will be having a procedure and the clinic requires a COVID test in the past 72 hours no matter if you have already received the complete doze of a vaccine. I was going to get this procedure done a couple years ago, but with some travelling plans and then COVID did not have an opportunity to get it done.

Today I suggested to my wife if we could have Asian from Trader Joe’s for lunch. She suggested noodles with an Italian sauce we fixed last week. We were able to fill five one-pint containers and put them in the outside freezer. The sauce turned out very good. We made it last Saturday when my wife’s brother and wife had lunch with us. We used a few pounds of chuck and Italian pureed tomatoes. Hopefully the cleaning crew will leave soon so we can have an early lunch. Continue reading “Producer and Consumer – Part 3”

Letter Combinations of a Phone Number

Today is somewhat colder than yesterday in the Twin Cities of Minneapolis and St. Paul. It seems that we weekend will be quite a bit warmer than the rest of the week. This Sunday is Easter. It should be a nice day if you celebrate the holiday.

Earlier my wife went to get her hair done. Last week she got it cut for the first time since the COVID-19 pandemic started. It is amazing how the past year or so have gone by. Continue reading “Letter Combinations of a Phone Number”

Producer and Consumer – Part 2

Yesterday the temperature in the Twin Cities of Minneapolis and St. Paul reached 72F which is quite pleasant for this time of the year. Today we are expecting 42F for a high. That is a drop of 30F! At least the day is forecasted to be sunny.

I also received a message from Gleves48061@hotmail.com regarding my post Revenue Milestones in Java. Not sure what it was all about so I will not comment on it at this time. If I could get an updated comment, I will review and reply as needed. Thanks. Continue reading “Producer and Consumer – Part 2”

Producer and Consumer

Hope you are doing well. I fully understand that not all countries are moving quickly to vaccinate most their population against COVID-19. Hopefully the efforts have already started and will be completed soon. Here in the USA it seems that every state is moving at its own pace. That said, a large amount of people have received at least the first of two jabs. The youngest I know of is of age 21. The world needs to get as much of its population vaccinated as possible to achieve herd immunity. If this is not done the virus will continue to mutate and the threat of COVID-19 might remain for years or decades.

It seems that Israel is leading the vaccination process. As in many other countries, there are some people that do not wish to get vaccinated. The prime minister of Israel has made some clever, and for what I understand legal changes to motivate all their citizens and residents to get a COVID-19 vaccine.

In a nutshell the idea is that the good of the majority needs to prevail. People will not be forced to get a vaccine unless there are medical reasons. Besides that, the population needs to show a vaccine passport to work where there is human contact with others. If the person wishes to attend events and places where they could possibly transmit COVID-19, they need to have a COVID test in the previous 48 hours. The COVID tests used to be free but in the near future people will need to pay for a test. So if a person for without a real medical issue does to get the vaccine but wishes to mix and mingle with others, they will have to pay and get a COVID test every other day. I guess Israel will be one of the countries that will reach heard immunity in the very near future. In my humble opinion, we in the USA need to start thinking about each other and work for a common goal. Continue reading “Producer and Consumer”

Maximum Score of a Good Subarray

Good morning. Hope your day has started on the right note. If you follow this blog you have noticed that I recommend social distancing in order to reduce the chances of COVID-19 to spread in your local community. My wife and I wear a mask when we go shopping. As soon as we return to our vehicle we remove the mask and apply had sanitizer to our hands. We are planning to continue this behavior for the foreseeable future.

My wife has been to the Mall of America a couple times during the pandemic. She and a friend have not been shopping but walking. On each occasion my wife told me that the mall was almost empty with many stores closed. That is a shame. Continue reading “Maximum Score of a Good Subarray”

Merge K Sorted Arrays

Good morning! It is once again Saturday morning during the COVID-19 pandemic. Today is March 13, 2021 and the sun is shining in the Twin Cities of Minneapolis and St. Paul. The forecast calls for the temperature to get up to 58F. For this time of the year it is welcomed. Tomorrow it will be a little cooler and daylight savings time starts at 02:00 AM when the clocks spring forward to 03:00 AM. Tomorrow we lose one hour.

A week or so ago I was talking with an engineer about merging a set of sorted arrays. I also generated the post Merge Sorted Array which probably motivated the exchange. If you take a look at the last post, the idea was to merge two sorted arrays. The obvious next step is to consider multiple sorted arrays of the same or different lengths. In that post we considered two approaches. In the first one we add all the elements from both arrays into a priority queue. We then populate the result array with the elements being removed from the priority queue. Continue reading “Merge K Sorted Arrays”

Clone Graph in Java

It is Friday morning and I am getting on Skype to chat with my best friend. We met when we were attending elementary school. We chat most Fridays but sometimes something comes up and we need to postpone for the following week. All friendships need care and time to maintain. The call occurs at 06:00 AM so hopefully I will have time to get this post done before the call.

The weekend is going to be the warmest of the year so far. We will be around 60F. Most people are going to use their grills or smokers. I believe we will join the group.

I received a message associated with a previous post. I will reply to it later today. The message suggests some improvements to my code. First of all I appreciate the message and suggestion. Please note that in general I want to get a solution up and running and accepted by the web site (e.g., HackerRank, LeetCode). If the solution is too slow, in general I try a second and in some occasions a third approach. I am not going to say that I have the best possible solution. I just want to make sure I describe my approach and you can see my thought process. Continue reading “Clone Graph in Java”

Setting Up C in VSCode IDE

It is another Sunday morning in the Twin Cities of Minneapolis and St. Paul. The weather forecast indicated that we would be receiving about 3 inches of fresh snow. It seems that we will be getting about 0.1 inches of new accumulation. Given that today is February 28, in the next couple months we might still get winter storms bringing 6 or more inches each.

This past week I had a very nice and interesting conversation with a Principal Software Architect at one of the largest software companies in the world. It was very educational. I really enjoyed the conversation. One of the things that initially called my attention was when I asked the kind of things he does on a regular basis. He mentioned that he “provides guardrails” among other things. When he mentioned it I was not sure what he meant so I made a note to ask him later. At some point I had a chance to describe what I do and have done. One of the things I mentioned was sets of DLLs that with time I have created with the purpose to help developers use a set of tools to get some routine work done without having to redesign and test code use as a scaffold and be able to concentrate on the task at hand. Among the libraries that I have developed are some that deals with encryption, linked lists (I refer to them as queues), sockets, trees, etc. I was then clarified what “guardrails” refer to. It is the same concept in order help developers produce faster code with fewer bugs. It seems that we are performing some similar tasks. Continue reading “Setting Up C in VSCode IDE”

Binary Tree Maximum Path

It is a Saturday morning in what has been forecasted so far as the coldest weekend of this winter season in the Twin Cities of Minneapolis and St. Paul. I woke up this morning around 05:00 AM and the temperature was at -8F. It seems like it will go up a few degrees during the day until it starts dropping down in the mid afternoon. On Sunday we should we waking up to a balmy -20F. My wife and I did our grocery shopping for the week yesterday evening. We are not planning on leaving home this weekend.

Earlier today I read Cybersecurity: Is it Worse than We Think? authored by Chris Maurer, Kevin Kim, Dan J Kim, and Leon Allan Kappelman in the latest Communications of the ACM magazine. The article is interesting, but there was a sentence that called my attention the most. The sentence follows:

“While they [organizations] may be saying the right things in public to satisfy investors, underwriters, and customers, there is an apparent lack of urgency in promoting a truly resilient and secure organization”.

You need to read the article to fully understand the meaning. In my opinion addressing cyber threats requires an investment which has no obvious ROI. Given that the word on the street is that it is not if but when a company will be hacked, then by doing as little as possible and carrying insurance to cover the cost of a breach seems the best approach. Of course if you ask a customer whose PID has been published in the dark web, the sentiments might be quite different. Continue reading “Binary Tree Maximum Path”