Funny String

It is Sunday in the Twin Cities of Minneapolis and St. Paul and it is starting to snow. The forecast calls for snow turning into rain. Later this morning my wife and I are going to the Mall of America (MOA) for a walk. It beats getting on exercise equipment at home and watching TV.

I selected the Funny String practice from HackerRank. Given a string one has to reverse the characters and place them in a second string. Then traverse both comparing the absolute differences among consecutive characters. If the differences match then the function should return the string “Funny”; otherwise it should return “Not Funny”. Continue reading “Funny String”

HackerRank in a String

Good morning. It is a cold morning in the Twin Cities of Minneapolis and St. Paul. When I got up around 04:00 AM the temperature was around -1F. I believe it will rise during the day.

My wife left with our neighbor shopping. They should be back around noon. We are planning on making some ravioli from scratch. On workdays my wife cooks, but on weekends we both do. Have some red wine from last week which we did not finish. It should be a nice and cozy lunch. Continue reading “HackerRank in a String”

Strong Password

Earlier this morning I took a look at the Strong Password challenge in HackerRank. I just want to exercise my skills processing text / strings with Java.

The idea is to check if a password entered by a user follows the requirements stipulated in the challenged for a strong password. If it does not, one needs to return the number (not types) of characters missing to make current password specified by the user strong. Continue reading “Strong Password”

Python Basics with Numpy

In a previous post I commented on waking up exactly at 05:00 AM. This morning I woke up around 04:10 AM. I guess there is some variation every day on how much sleep you get based on several factors (i.e., physical exhaustion, mental exhaustion, noise, temperature, food intake, among others). Continue reading “Python Basics with Numpy”

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

Broadcasting in Numpy

Broadcasting is a feature of Python and Numpy. When one is performing array operations, in some cases the shapes of the arguments do not match. The good and bad thing is that Python assumes what you want to happen and does it. In most cases the results are fine, but on occasions Python might do something that you are not expecting. This post discusses to some degree what is broadcasting. The idea is that we will be using it in a future post when doing some regressions for image recognition. Continue reading “Broadcasting in Numpy”

Numpy Vector Notes for Machine Learning

When learning and working with Python on machine learning it is important to make sure that Numpy arrays have the proper dimensions. Using improper dimensions may cause issues / bugs that are hard to track yet it is simple to prevent and we will see in this post. Continue reading “Numpy Vector Notes for Machine Learning”

Numpy Vectorization – Revisited

It is the last Sunday in January 2019 and is relatively cold in the Twin Cities of Minneapolis and St. Paul. The computerized mercury scale indicates -12F not taking into account wind. As usual, get up before 05:00 AM and get in my first 2 hour block of Deep Work. I am in the process of reviewing the last course I took on neural networks and deep learning. Continue reading “Numpy Vectorization – Revisited”

BST Diameter

Earlier this morning I read a post “Binary Tree: The Diameter” by David Pynes. The post showed up on Medium but was initially written for Towards Data Science. After quickly reading the post I decided to spend time reading the article in my computer, thinking about it and writing a solution in Java. The original article used C++. Continue reading “BST Diameter”