Emma’s Supercomputer or Two Pluses

I started the Emma’s Supercomputer HackerRank problem last week. This problem is also known as Two Pluses. Last week I got quite busy so I did not have time until this morning to complete the solution for the problem. Last Wednesday I was able to get my code to pass 20 of 23 test cases. I figured out what I could do to pass the last three, but until this morning I had no time.

The problem is ranked Medium difficulty, but I spent time like it was more difficult than that. Read the description in the HackerRank web site. The description is straight forward. I understood what the idea was with the plus signs, but from there to implement a solution that is a different story.

Continue reading “Emma’s Supercomputer or Two Pluses”

Stacks to Reverse Order

UPDATE – Added a couple classes and implemented reverse method to reverse the linked list in segments. I will leave this post and move on to a different subject on the next one.

It is a cold Sunday in the Twin Cities of Minneapolis and St. Paul. The forecast called for a winter storm starting last Friday around noon ending Saturday afternoon. The forecast called for 6 to 9 inches of fresh snow and wind blowing up to 45 mph. Due to the forecast, people visiting the area last week or people with plans for the weekend decided to move their schedules and leave the Twin Cities earlier. Airports were crowded and flights were overbooked. When all was said and done, the Twin Cities received about 6 inches of fresh snow. Some places further out received considerable higher amounts (e.g., Hovland, MN 16.5 inches).

Continue reading “Stacks to Reverse Order”

Promise and Async in C++

In the past couple days I have been trying to get up at 06:00 AM instead of 05:00 AM. It is not working yet. Today I woke up around 04:30 AM, checked the time in my phone and decided to get up. Read a few articles of which two called my attention the most.

In Israel, Intel’s Mobileye has been testing an autonomous car that makes use of 12 cameras. Their software has ability to connect to RADAR and LIDAR but they have been driving the car in the city of Jerusalem. The video shown at CES show in Las Vegas looks pretty good. I agree with Elon Musk’s idea that an autonomous car should not require LIDAR. That said how many cameras and their position would be critical for success. I believe most humans only use their two eyes (one stereo camera) to drive vehicles. Of course humans have a very powerful computer which at this time we know little about how it works. Given time, I believe autonomous cars will use a limited set of cameras and newer and more powerful algorithms to allow them drive in most traffic and road conditions. Continue reading “Promise and Async in C++”

Threads and Templates C++

It is Saturday morning. Last week my wife was going to have over two of his brothers and spouses but she was not feeling well so lunch was postponed for today. After breakfast I made the dough for the spinach scacciata. It is resting in a bowl. After my second and last 2-hour block I will check out the dough.

We are missing fresh mushrooms for the chicken Marsala. My wife and I will be heading out to Trader Joe’s to pick up some last minute items we need for lunch and the upcoming week. Continue reading “Threads and Templates C++”

Creating Threads in C++

This week seems to be flying by. It is already Wednesday.

On my last post I mentioned that I get up around 05:00 AM every day of the week. I prepare and have breakfast, shower and get dressed, and go down to work around 06:00 AM. By the time I go to sleep around 07:30 PM, I am pretty tiered.

So what happens if something comes up around 05:00 PM CST at work? The company I work for is in California. That implies that it is relatively early in the afternoon at 03:00 PM PST. If urgent I will take a look and then address it on the next day. This is because at 05:00 PM CST I am fried. Since I wake up at 05:00 AM CDT, which is considerably early on the west coast (03:00 AM PST), I have plenty of time (about 5 hours) to get things done before people starts arriving around 09:00 AM PST. Continue reading “Creating Threads in C++”

Almost Sorted

In the past few days there have been several announcements by both car and device manufacturers that self driving cars are almost a reality and to make that possible new and cheaper devices are being introduced to help.

It seems that newer LIDAR devices are improving in range and precision while their prices are coming down. This should help. On the other hand researchers are working on algorithms to check that sensors are getting more reliable. I read an article today that LIDAR systems can be tricked to not detect something or to detect something that is not there. Continue reading “Almost Sorted”

3D Surface Area

Good morning. It is Monday January 06, 2020. Last year’s holiday season was rather long. Christmas fell on Wednesday so most companies gave Tuesday as a holiday. On the following week, most companies do not give New Years Eve day as a holiday but most people take it as a personal holiday or vacation day. I work every day (included weekends and holidays). Granted that on weekends and holidays I only sit in front of my computer for only two 2-hour blocks. Continue reading “3D Surface Area”

The Grid Search

It is Saturday morning and I am in my second block of the day. I typically do a couple 2-hour blocks on weekend days. As usual I got up at 05:00 AM and got breakfast ready. During breakfast my wife mentioned that she was not feeling well. Apparently she caught a cold or flu.

We had invited for lunch a couple of her brothers and spouses. One of her brother’s birthday was yesterday.  We decided to change the menu and postpone lunch with family for next Saturday. We had planned a couple of Italian dishes and I was already savoring them. We both enjoy cooking but decided on a single simpler course for lunch. Continue reading “The Grid Search”

To Trie or not to Trie

I am always interested in learning new and refreshing on known algorithms. I looked at a problem in HackerRank which at this time is not relevant. The problem involves looking for sub strings in a string. There are many algorithms that could be used, but as the saying goes, there are many ways to skin a cat, but I always say that one and only one is the best.

I am not going to discuss the some possible approaches to solve the problem in this post. I will take a look at Tries which might be close. Will build a node for the trie, a trie and then will attempt to figure out if by modifying the node and possibly the trie, I can solve the problem. If we are not able to solve the challenge (I do not expect to solve it with a base Trie), will cover a better approach in the next post. Continue reading “To Trie or not to Trie”

Bigger is Greater

I was going to have a different introduction (the regular chit chat) to this post, but based on the article “Malevolent Machine Learning” by Chris Edwards on Communications of the ACM 12/2019 Volume 62 Number 12 I changed my mind. Allow me to explain.

A couple years ago I took a few courses from Coursera. The general topic was big data and machine learning. The course of interest is “Neural Networks and Deep Learning” by Andrew Ng deeplearning.ai. It was very interesting class and I highly recommend it.

I tried locating my notes on those courses, but not sure what I did with them. Found my notes. I hoped to have stored the transcriptions to verify what I recall about a specific class. I do not have the transcriptions Continue reading “Bigger is Greater”