Order Processing Testing – Moq 4 and xUnit

I am reading, experimenting and hopefully learning how to use Moq is a mocking framework for C#/.NET. To learn more about mocking objects read here. For additional documentation on moq4 read here.

After completing the PluralSight course “Mocking with Moq 4 and xUnit” I decided to look for examples of Moq mocking a database. This post is based on my experience and comments on the article Unit Test Through Mocking Using MOQ Framework by Chinmay Dey published Dec 26, 2018. Continue reading “Order Processing Testing – Moq 4 and xUnit”

Notes from the UnsafeCSharp Presentation

At work each month a set of hours are set aside/scheduled for employees to learn something new. I have worked at more than a dozen companies and have never seen a periodic time scheduled in the company calendar for it. Yesterday we had eight hours scheduled for learning. During that time an invite for a one hour presentation UnsafeCSharp showed up. I watched and enjoyed it. In addition most presentations at work are recorded so I am planning on watching it again later today.

As I am writing this post I am not sure if there are things that were presented that are company confidential. For that reason, at this time I am not disclosing the name of the presenter or will dive into specific topics. Continue reading “Notes from the UnsafeCSharp Presentation”

Longest Absolute File Path – C# and Java – Revisited

Hope you had a nice Thanksgiving day with family and friends. My wife and I typically roast a turkey. This year, for the first time, we went with a fresh turkey breast. It was a fraction of the weight of a full turkey and when all was said and done, my wife did not have to deal with cleaning the bones. Today, and probably for the next few days, we will be having different types of turkey sandwiches (Bread, butter on the outside, panini press @ 350F, turkey meat. When brown and crunchy, open sandwich, apply mayonnaise and a touch of mustard. Close and enjoy).

In this post I will revisit solving LeetCode 388. Longest Absolute File Path. The motivation was a message I received a few days back on a solution in O(n). I looked up my solution in Java from February 27, 2017 and it was hard to follow. At the time I used a different plugin and the output was not that great. With time it stopped working so I switched to a different one. Much better but sometimes it mangles the output. Continue reading “Longest Absolute File Path – C# and Java – Revisited”

Flipping Bits

It is Sunday February 02, 2020 (02022020) and today’s date is a palindrome. Lunch yesterday was great. All the food my wife and I cooked turned out quite tasty. Today we will make a salad and sandwiches using a brioche bread loaf that we get at Trader Joe’s. We need to consume simpler and hopefully less food.

I decided to work on HackerRank Flipping bits problem. I decided to use Java 8. The problem has to do with bit manipulations. In my humble opinion, C is a much better suited language than Java. Continue reading “Flipping Bits”

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++”

Porting MD5 Code

Last week my wife and I returned from a one week trip to Portugal. We had not been there in more than a decade. Some things have changed while other not. People continue to be very nice and helpful especially when you attempt to utter a few words in Portuguese.

We arrived in Lisbon and headed to the rental car office. In less than an hour from arrival we were heading south to the Algarve. We have watched a few YouTube videos by Rick Steves and had purchases one of his travel guides for Portugal. In more than one occasion Rick has mentioned that Salema is his favorite beach in the Algarve. By experience we now know why. It is a small town sitting on a relatively small bay with blue and green waters. The population is less than 300 people. My wife took a picture at a restaurant on the beach while the temperature was hitting 96 F and we were enjoying delicious fresh sea food and drinking Sagres beer. From our table we could hear people conversion and different languages. Our waiter was taking care of a few tables and was able to switch to the language spoken by the customers (English, French and German). We only spent two days and headed back to Lisbon. Continue reading “Porting MD5 Code”

C++ Boost Library Visual Studio 2017

Yesterday I spent time attempting to port a C DLL that I wrote some time ago to generate MD5 digests for a storage server. At the time I used as a base code provided by RSA Data Security, Inc. and designed and implemented a set of functions that could be directly called in applications / servers that would require generating MD5 digests for strings and files. When done I package the results into a DLL. The library has been in production for a long time. I used the C programming language for performance and the code was built for 32-bit processors. Continue reading “C++ Boost Library Visual Studio 2017”

Tidbits – Streams in C++

If you have watched Red with Bruce Willis you may recall the opening scene. Frank Moses (Bruce Willis) is a retired CIA operative and he is sleeping in his bed. On the night stand next to him there is a clock. The clock is ticking down to 06:00 AM. Just as the clock reaches 06:00 AM, without the need of an alarm, Frank Moses wakes up and calmly walks down to the kitchen to get breakfast. Obviously Frank Moses is a very disciplined and a morning person. Continue reading “Tidbits – Streams in C++”