Design a System like Yelp

Last week I was talking with a software manager about the design of a feature for Yelp. For starters I am not a Yelp user. If you are like me, you can find more about Yelp in this Wikipedia link.

It seems that Yelp is a business directory and uses a crowd-source review forum to collect information and ratings about different businesses (i.e., barber shops, cinemas, coffee shops, restaurants). It happens that I use OpenTable for restaurant-reservations. Apparently on both platforms one can get nearby restaurants of desired types in a specified distance so you can decide where to go for dinner (or for that matter for any meal at any time) tonight. A side fact, both companies happen to be headquartered in the San Francisco, California area. Continue reading “Design a System like Yelp”

Larry’s Array

Over the weekend my wife and I tried baking baba (Italian yeast cake) using a large mold. Typically baba is baked in individual small molds but it takes a while to grease and fill them. We tried for the first time using a large mold. All was going well until we put the mixer bowl covered with plastic in the oven with the lights on for it to ferment and double in size. After a couple hours the dough had pushed its way out of the bowl and spilled over the oven floor. We had to clean the mess before baking. We also moved the contents of the bowl into the large baking mold. Continue reading “Larry’s Array”

A* Search Algorithm

As I mentioned in my last post, I read the article “A* search: what’s in a name?” by James W. Davis and Jeff Hachtel. If interested, you may find the article in Communications of the ACM, December 2019, Vol. 63 No. 1, Pages 36-37. The article deals with the name of a search algorithm that was originally published in 1968 by Peter Hart, Nils Nilsson and Bertram Raphael of Stanford Research Institute.

My interest was not much about the name but to be able to experiment and understand the algorithm. There are so many algorithms in Computer Science that adding one more to my list is always welcomed. I do not plan on memorizing the algorithm but if the time comes when I might need to search a graph, I will have one more choice in my toolkit. Continue reading “A* Search Algorithm”

Priority Queue

Time flies when you are having fun; at least that is how the saying goes. Today is Saturday and I am on my second and last block of the day. After breakfast I prepared the pizza dough and put it in a bowl covered with plastic film for it to rise. During the break between blocks my wife and I checked the dough. It is touching the plastic. It has tripled its size.

For lunch we are going to make and bake a few small and thin pizzas. We are going to mix and match toppings and are expecting to have a few leftover pizzas. Tomorrow we are going to make “baba” (an Italian yeast cake). Will have a few and the rest with the pizzas will be delivered to my oldest son. Continue reading “Priority Queue”

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”