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 ( challenge from HackerRank. It is a mix of double ended (doubly linked) queue and hash map. Continue reading “Java Dequeue”

Java Stack

It is Tuesday morning and woke up a few seconds before my alarm went off. Did some reading and decided to give Java Stack from HackerRank a try. I am quite sure I have solved this same challenge with a different name in this or a different platform. I am working on some medium level stuff and when tired will jump up to the next level. Continue reading “Java Stack”

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”

Java BigDecimal

It is Monday. It is a beautiful sunny day in the Twin Cities Area. All is well so far.

I picked up the next Java challenge Java BigDecimal from HackerRank.

The challenge requires for one to sort in descending order a specified set of numbers provided as strings. You can read the entire description at the HackerRank web site. Continue reading “Java BigDecimal”

Climbing the Leaderboard

I was going to say “What a week” but today is Sunday and in some calendars, the week starts today so technically last week is over.

Last Monday and Tuesday I had to deal with a water leakage issue generated by a new water meter installed by the city a couple weeks ago.

On Wednesday, our SUV popped the two right side tires in a set of potholes covered with water as I was entering Cedar Avenue also known as 77, on my way home from having an oil service at the dealership. Continue reading “Climbing the Leaderboard”

Sieve of Eratosthenes

It seems like my wife has a new doctor’s appointment towards the end of the day today. It has been a very hectic week. Hopefully we will be done with putting out fires soon. I enjoy waking up early morning and spending my time learning and working in two-hour blocks. Typically I get in 5 blocks on workdays and 2 to 3 on weekend days.

A few days ago I was solved a HackerRank challenge which dealt with prime numbers. I wrote a post but did not go into too many details. The approach I used was based on the Sieve of Eratosthenes. Continue reading “Sieve of Eratosthenes”

Docker Webinar #1

It has been a week from hell and it is only Thursday afternoon. Allow me to elaborate. On a previous post, I mentioned the events regarding a water leak in my office. That occurred last Monday and Tuesday. At this point I only have to call to return a fan and ask for reimbursement on four books that got damaged by water.

On Wednesday I stopped by the car dealer to get an oil service for my vehicle. It has a lithe over 4,000 miles. I do not drive too much since I work from home. On my way back on 494 E I exited on the ramp to get to 77S (Cedar Avenue). As I merged into Cedar I started accelerating and moving to the center lane (Cedar at that point has three lanes plus a fourth one to enter and exit). As I was reaching the bridge for Old Shakopee Road, my two right tires popped as I hit a set of potholes covered in water. It was raining and quite foggy. After stopping on the bridge over the Minnesota River, I decided drive to a nearby gas station to see if I could put some air in my tires. Lucky I have run flat tires, otherwise I would have had to call a tow. When I tried putting air, I noticed that both tires had openings of about 5 to 6 inches. The only solution was to get them replaced. After talking with my son, he suggested the closest shop which would offer a rental while they replaced the tires. Shortly before 05:00 PM I received a call that the vehicle was ready and headed out to pick it up. Continue reading “Docker Webinar #1”

Prime Checker

I mentioned in a previous post that I experienced some water problems in my home office after the water meter was replaced at home. The contractor who did the update stopped by yesterday afternoon with a powerful fan to help the small amount of water that had leaked into my office dry up. This morning the humidity from the carpet was gone. He also mentioned that they will replace the four books that got damaged by water. I will call this afternoon to return the fan and inform them of the four books.

I randomly selected the Prime Checker challenge at HackerRank. Read the requirements and spent time working on a solution. When I was ready to give it a try, noticed that it would not allow me to enter my solution. In addition, it seems that the scaffolding code has an issue and a message indicates that you need to address it. Not sure what is going on. Have to skip it because I am not able to enter my code. Continue reading “Prime Checker”

Java 1D Array (Part 2)

It has been one of those days. Yesterday morning I was working in my home office when some noise coming from the utilities room called my attention. A week or so ago, a contractor on behalf of the City of Apple Valley stopped by to replace the water meter. Apparently the new meters are able to send data for billing purposes. Two people came in. One was a trainee and the other was supervising the operation. They cut off the water supply inside the house, installed the new meter in the line, and  turned back on the water supply. All seemed well. I checked that evening and no leaks. All seemed well at the time.

Yesterday the sounds coming from the utility room seem to indicate something was dripping. I went and check and tater was coming from the connection that they made. We immediately called the City of Apple Valley. I took some pictures.  Two hours later a representative of the contractor and a Public Works Supervisor from the city showed up.

The issue was simple to fix. They shut off the water and inserted a plastic / rubber ring that was missing. They did find one or two rings in the area around the meter. Apparently it fell twice and the people that made the installation only noticed the ring falling out of place once. Continue reading “Java 1D Array (Part 2)”

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”