Java Functional Programming – 2 of n

Today I woke up a little earlier than usual. I have my alarm set for 06:00 AM, but I was up around 04:45 AM. Read for a while, prepared breakfast and woke up my wife. After breakfast showered and was in my home office by 06:00 AM. I typically work in 2-hour blocks. Break for about 15 minutes and then repeat. For lunch I break for about an hour depending if I need to help my wife with lunch. Typically I help grilling on the deck, but the temperature has dropped and there is snow so I think there will be no more outdoor cooking until next spring.

I have a lot of things planned for the workday. Hopefully I will be able to get most of them done by 06:00 PM. Continue reading “Java Functional Programming – 2 of n”

Java Functional Programming – 1 of n

It is not a nice day in the Twin Cities of Minneapolis and St. Paul. It has been raining and snowing on and off all day. I assume the roads are somewhat slippery. The good thing is that we do not have to go anywhere this evening.

One of my goals is to continue learning and experimenting with Java. Experience has taught me that at work one tends to use a limited feature set of the programming language(s) you use. This is why on my own time I like to learn different programming languages and different features so when I design and develop software, I can be quite productive.

We all know that not all languages have the same syntax or features, but with time, most object oriented languages tend to add similar features (not to say the same) with a different name and syntax. That is why I also like to solve problems that require algorithms. Once you have the idea, it does not take too much to implement the algorithm in a different language. This seems to be the trend while developing microservices. The idea is to use the best language for a task. Continue reading “Java Functional Programming – 1 of n”

Java Streams and LocalDate

It is Monday November 09, 2020 and it has been a week since the Election Day and the tally of votes is still being adjusted. What a disaster for the USA and friends.

I am not sure why we are not using a voter ID card and limiting voting in person at the polls on Election Day. No exceptions! I am not implying the obvious, but the changes made to the electoral system this year was an open invitation for fraud. Not sure which part of our government is responsible for making sure elections are legal and trustworthy.

If you disagree with the voter ID card and a secure electronic vote at polling sites I would like to provide you with some facts (not opinions) which seem to be all over the news and social media. When you get a credit card via USPS, for your protection, you are asked to call a toll free number and answer a few questions which would allow the credit company to enable the card so you can start charging on it. Credit card companies / banks do not trust the USPS with money. Continue reading “Java Streams and LocalDate”

Dates in Java

Today I woke up around 05:00 AM. Later this morning my wife has a lab appointment at 08:15 AM. I decided to get up, cancel my 06:00 AM alarm, and set a new alarm for 07:15 AM. That should give us ample time to get ready and drive to the appointment. Will have breakfast when we get back because she needs to fast for the blood test.

Not sure what is going on with the Presidential Election 2020 results. As I have mentioned in a previous post, the entire process is open to fraud. Do not understand how in the USA we do not use a voter ID card. In addition we should have a secure system in which voters go to their designated polling sites and vote electronically. A paper receipt can be used by voters to make sure the ballot is counted and has not been tampered with. Election Day should be the only day one can vote. If you miss it because it is not important to you, so you can wait four years and plan accordingly. Continue reading “Dates in Java”

Concurrent Skip List Map

Before we start I would like to thanks all of you that have subscribed to my blog. We have reached 2,000 subscribers!!! As a matter of fact, we currently have 2,150 subscribers. Thanks a lot!!!

It is so hard to find real news not politically opinionated. For example, I ran into an article that discussed the AztraZeneca vaccine trial in the UK. Apparently there have been two cases in which people that received the vaccine got severely ill. In both cases the trial stopped until further investigation. In both cases it was determined that the issue was not associated with the vaccine. The trials continued in the UK. Continue reading “Concurrent Skip List Map”

Student Attendance Record I

Woke up today at 04:20 AM. It was raining. Spent some time reading and on this blog and at 06:00 time to make the donuts (actually breakfast).

Since I had not much time I did a search on LeetCode problems using the string “recursion”. Problem 551. Student Attendance Record I came up. I did not see the need to use recursion and the problem does not specify to use it either. Continue reading “Student Attendance Record I”

Get Returned Type – Java

In general when you are developing software you need to have a good idea of the different classes that are needed and for each class the members and methods. Under some special circumstances you might run into classes that are not documented and you need to get some information as to the returned values. Please bear with me attempting to provide a good example. In practice most of the time (do not generalize) you will have such information displayed in your IDE or in documentation provided by the vendor. Continue reading “Get Returned Type – Java”

Sum Two

This weekend my wife and I spent it in Madison, Wisconsin visiting our son and family. We left Friday after work and returned Sunday afternoon. The drive is between 3.5 and 4.0 hours depending on traffic. Given that we are in the middle of the COVID-19 pandemic, we were amazed at how much traffic we encountered.

Last Friday morning I took a look into a couple problems but did not have time to write the associated posts. I will do if I have some time in the near future. Note that I have already addressed a similar problem in my post Sum of Two earlier this year.

In this post I will cover a problem I searched for on the web. This problem comes in different flavors. I found the one on LeetCode so I decided to take a stab at it. Continue reading “Sum Two”

Combinations

Hello gals and guys! It seems that during the COVID-19 pandemic time goes faster. It is Saturday and the work week went by in the blink of an eye.

This post was motivated by a HackerRank problem which I am getting ready to tackle. I decided to experiment with combinations and factorials to make sure that a brute approach to the actual problem would be futile. In my next post will tackle the basis for a better approach.

As usual let’s start with some chitchat. Continue reading “Combinations”

Tree Preorder Traversal

Good morning! It is a sunny and warm Sunday morning in the Twin Cities of Minneapolis and St. Paul. Yesterday due to high temperature and humidity concerns, my wife and I decided to start lunch earlier than usual. We finished our mid morning cup of triple espresso around 11:00 AM.

My wife made some nachos. She used small tortilla chips, and a block of Colby-Jack cheese which she shredded in the Ninja blender. For the salsa she used one or two avocados, some jalapenos from a jar and some Pace picante medium strength sauce. The plain tortillas with the cheese were placed in a 350 F oven for about 20 minutes. That melted the cheese. Continue reading “Tree Preorder Traversal”