Construct Binary Search Tree from Pre Order Traversal

It is Thanksgiving Week 2020 and we do not have a winner in the 2020 Presidential Elections yet. The amount of fraud in this year’s elections has been unprecedented. My comment has nothing to do with politics. It is just based on common sense for individuals 12 years of age and older. I have friends and relatives living in different parts of the world. Their confidence and respect in the USA is almost (never generalize) gone.

On multiple occasions and referring to different topics, I have mentioned in this blog a technique used when people want to understand the positions of each other. First both argue on behalf of their own positions. Then, and this is the key of the technique, they switch positions and argue in favor of the opposite position. It is amazing what you can learn about different ideas when you use this technique. The reason for this tends to be based on facts and logic. Continue reading “Construct Binary Search Tree from Pre Order Traversal”

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”

Path with Minimum Effort – Java

I have been busy with work, reading and experimenting. So far it has been an interesting and rewarding workweek. That said, I am glad that tomorrow is Friday. Due to the COVID-19 pandemic my wife and I do not have big plans for the weekend with the exception of going out for groceries. I assume that you might be in a similar situation.

I decided to tackle LeetCode problem 1631 Path With Minimum Effort. Sometimes I go for the best approach I can came up with. In this case I kind of stopped before implementing it. My first approach timed out as expected. We will discuss the details. My second approach was accepted with a reasonable time. I still want to get one more pass on it but I just do not have time to get that done now. Continue reading “Path with Minimum Effort – Java”

REST API

It is another average fall day in the Twin Cities of Minneapolis and St. Paul. It is sunny and cold. Two more days for the weekend; not that it matters because we are still in the COVID-19 pandemic. That said things appear to be getting better. Hopefully a vaccine will be available soon and we will all get into a new normal.

I am still reading the book Hacker’s Delight by Henry Warren. I have a couple more chapters that I would like to finish before putting it down and starting Get Programming with Node.js by Jonathan Wexler. As I mentioned a few months ago, I will be working on a storage project for my blog. I will start with the APIs and database interface. I decided to use MongoDB for the metadata and the file system for the data. The server part code will be implemented using Node.js in JavaScript. After we have the base functionality we will split the software to work on multiple servers. Once that is done we will move to place the modules in Docker containers and will manage them with Kubernetes. Once all is well, I will see if we can move it to the Azure cloud. After that we will create and integrate additional features. Continue reading “REST API”

Longest Univalue Path

I have a childhood best friend which we both attended K-12 in the same sequence of schools. We used to hang out on weekends and in some occasions would go out with the family. After high school we both went in different directions. We lost track of each other while attending college. A few years went by and we reconnected. Since then we have visited in person and our spouses appear to have connected well.

Through the years we kept in touch about once a month via Skype. Since the COVID-19 pandemic started, we talk once a week, typically on Friday. We are both morning people so we set the call time between 06:00 AM and 07:00 AM. This morning around 05:00 AM I received a message via Gmail that he had some work appointments early morning. We skipped the call but will reconnect next week. Continue reading “Longest Univalue Path”

Styling React Components and Elements

I continue pushing forward with the React course by Maximilian Schwarzmuller by O’Reilly via my subscription with ACM Learning.

Today is a nice summer day in the Twin Cities of Minneapolis and St. Paul. The private streets in the neighborhood where I live are being redone. Part of the work is on gutter drainage, some on replacing some of the curbs and finally a fresh double coat of asphalt. Today’s work started shortly after garbage and recycling trucks picked up their corresponding items. After the trucks left, noise and dust were all over the neighborhood. Right now all is quite. Not sure if they are done for the day. The final asphalt will be deposited on Wednesday. Continue reading “Styling React Components and Elements”

Using with in Python

It is Wednesday in the Twin Cities of Minneapolis and St. Paul. My wife and I spent most of the morning dealing with health insurance. Hopefully all will be done in the next few days. I am in the process of changing health insurance companies. Due to the COVID-19 pandemic everyone is using some type of video application to communicate. The proposed application was Zoom, but due to the security issues, we prefer using Jitsi. It did not take more than a minute to switch applications. It is interesting that video on Jitsi was working great but one of the participants decided to use our cell phones for voice because he did not have a camera or microphone on his computer. The cellular signals were not that great, but we managed. Continue reading “Using with in Python”

Working with Files – Python

A couple weeks ago one of my wife’s nice told her that there is a Costco store in Minneapolis that seems to sell different items and in larger packages than others. The Costco Minneapolis Business Center Warehouse is located at 3311 Broadway St NE, Minneapolis, MN 55413-4553. We have not visited the store yet.

A couple days ago there was an article by CBS News titled Groceries could see meat shortages by end of week amid plant closings. I read it and twitted it. In addition I sent a message with the link to my two sons. Apparently they both decided to resupply on meats yesterday. One of my sons lives in Madison, WI so he just went to the Costco store near him. The other lives in MN. The one in WI periodically orders a side of beef and a side of pork. I believe he should be fine for a while.

My son who lives in MN decided to visit the Costco store on Broadway Street. He was impressed by the size of the packages of meat. The prices were very appealing. The only drawback for some might be that you need to buy a large and uncut piece (e.g., full rib eye) and when you get home you need to cut in servings, put them in plastic bags, and then store them in a freezer. If you do not do so and just put it in a freezer, you will have to consume it all in a few days after thawing it. You should never refreeze meats. My sons and we at home are used to this process. We get most of our protein at restaurant suppliers. Continue reading “Working with Files – Python”