Absolute Permutation

UPDATE:  The technical issue that prevented me from posting a solution was promptly resolved by HackerRank. I received a message indicating all was well to proceed.

It is Sunday and a sunny day in the Twin Cities of Minneapolis and St. Paul. I tried solving the Absolute Permutation challenge from Hacker Rank but ran into an issue. Will comment on it and show my solution which at this time has not been accepted.

Today is Mothers Day. If you are a mom hope you enjoy the day with your family. My wife and I have two sons. One lives in Indiana, and the other in Minnesota. The one in Minnesota stopped by yesterday afternoon with flowers and his two kids. Earlier this morning our son and wife called to wish my wife a nice day. Continue reading “Absolute Permutation”

Beautiful Triplets

It seems that today is going to be another nice day in the Twin Cities of Minneapolis and St. Paul. For some reason I woke up a few minutes shorter than 04:00 AM. I decided to give a try to the HackerRank challenge that I received via email.

If interested take a look at the requirements on how to determine what makes a triplet beautiful. Continue reading “Beautiful Triplets”

JUnit 4 – Parameterized

The winter storm in the Twin Cities of Minneapolis and St. Paul is over. Currently there is light snow falling but the temperature is above freezing. Hopefully all the snow will melt somewhat slowly in order to avoid flooding.

In this post we will revisit JUnit 4 from the parameterized angle. I have covered other aspects of JUnit in this post. Continue reading “JUnit 4 – Parameterized”

Singleton Threads

My wife and I enjoy cooking and of course eating the food we prepare. Yesterday we decided to making from scratch empanadas. Different cultures around the world have come up with similar implementations. I am not a historian so I am not sure if all foods covered in some type of dough and then baked or deep fried, are derived from a single version or instance (the Computer Science shows up).

In the US we refer to a similar object with the name turnover. My wife’s family comes from Spain. According to this article the name empanada was mentioned in a book published in Catalan as early as 1520. It seems that one should be able to find the best recipes for empanadas in and around Barcelona. Next time we are in that area will make sure to have some empanadas.

My parents came from Italy. As a matter of fact I am first generation not born in Genoa.  In Italy there are similar foods named calzone and Stromboli both of which we had on my parents table quite often while growing up.

While searching the web with Chrome, I found this site which lists some foods related to empanadas. Empanadas enclose some type of food in dough while a food that is quite common in the US, presents the food in an open face version. That is what pizzas are all about. You can read more about pizza here. The modern pizza was created in Napoli, Italy, and yes my wife and I have been to the restaurant that claims to have created the Neapolitan pizza.

So back to yesterday, my wife made about seven pounds of empanada stuffing (beef, onions, eggs, garlic, and many other spices). I made a batch of dough (flour, yeast, olive oil, and a few more ingredients) which was enough to make about 18 empanadas. While we were preparing the food, one of my wife’s nice stopped by. Apparently she was interested in joining us for lunch. While we were chatting, my son calls. One thing and the other and he (plus wife and two sons) requested some empanadas for Sunday. We where forgetting that two of my in-laws and spouses were stopping by around 02:00 PM for lunch.

Panic mode set in. We had plenty of stuffing, but not enough dough. I made a second batch. As the empanadas were taking shape, I made a third batch. Of course the dough did not have enough time to rise, but it had to be done. When all was set and done, we ended with around six dozen empanadas. We were baking them in batches so things were moving along.

Our formal guests arrived so we all had empanadas with lime, beer, and wine. On Friday, my wife had prepared a couple gypsy arms stuffed with “dulce de leche”. We forgot to serve the salad but I had more than enough to eat and drink. We did not have a chance to walk outside yesterday. That said; I checked my fitbit before going to bed. I had about 10,500 steps. I was pleasantly surprised with the final tally.

Today we are going out for Chinese food. We do not wish to cook. Continue reading “Singleton Threads”

Can You Access?

Today is going to be the warmest day of the year so far. Forecasts are calling for a high in the mid to upper 60’s. Hopefully the warmer weather will help the remaining snow melt. I would guess that most people in this part of the country had enough snow for the year.

This morning I took a look at the Can You Access? HackerRank problem. The requirements are quite simple. You need to call a method with a parameter in a class that is two levels deep. Continue reading “Can You Access?”

Java Priority Queue

Yesterday was sunny and all the snow on our deck has melted away, so my wife and I decided to grill for the first time this season. I believe the temperature went up to 58 F. The day was not as warm as I would have liked, but on occasions I went out just wearing a t-shirt. We grilled homemade hamburgers, potatoes, and corn. We fixed on the stovetop mushrooms with onions and garlic. All was very good and as usual we made too much food. That is fine because we will just warm up leftover today. Continue reading “Java Priority Queue”

Java SHA-256

There was a full moon this morning providing some light before the sun came up. That was nice.

This week I have been taking care of some items that I could not during the past two. My wife and I were able to renew our TSA Pre Checked status for another five years. Was not sure why we had to answer the same questions we did five years ago, and get fingerprinted again. As far as I understand, fingerprints do not change over time. If they would, they would be totally useless. I do not recall if last time we had to present our passports or not. We did have to get our pictures taken. I do agree that the look of people may change in five years. The renewal will kick in before our current one expires. Continue reading “Java SHA-256”

Java Dequeue

It is a relatively warm day in the Twin Cities of Minneapolis and St. Paul. My son tweeted an hour or so ago that the temperature by his place was 46F. Not a day to wear swim trunks and T-shirts but a very welcomed change.

I was going to clean up the code for this post but I have a Docker webinar to watch soon.

The subject for this post is the Java Dequeue (https://www.hackerrank.com/challenges/java-dequeue/problem) challenge from HackerRank. It is a mix of double ended (doubly linked) queue and hash map. Continue reading “Java Dequeue”

Java Interfaces

Beautiful sunny day in the Twin Cities of Minneapolis and St. Paul, not that matters because I am working indoors in my home office, and it does not have an outside window.

Last week I was talking with a software engineers and the topic of interfaces came up. An interface is a contract stating that we define a list of methods in the interface and any class that uses the interface must define and implement the methods listed in the interface definition at a minimum. Additional methods may be included if necessary. Continue reading “Java Interfaces”

RabbitMQ – Work Queues

In this post we will experiment with a work queue using the RabbitMQ middleware software on a Windows 10 machine. After we cover the basics, we will integrate RabbitMQ with Docker and a group of microservices. It is extremely important to read and experiment until all the concepts are clearly understood.

With that said, let’s talk about work queues. In this example we will create a Work Queue that will be used to distribute time-consuming tasks among multiple workers. I have been experimenting with one, two and three worker threads. Continue reading “RabbitMQ – Work Queues”