• The New Software Engineering Role At Work Caught My Attention

    The New Software Engineering Role At Work Caught My Attention

    I wrote about my plan to become a Site Reliability Engineer (SRE) at Google, but recently I found myself gravitating to the new Software Engineering role I discovered at work. That role is called a Customer & Partner Solutions Engineer. Why does this new role interests me so? And why am I moving away from becoming a SRE? I’ll answer the latter question first.

    My Reasons Moving To The New Software Engineering Role

    I recently had a meeting a SRE manager at Google, and I asked him what I needed to study and/or learn to successfully land that role. He gave me quite the list:

    • Continue to improve my skill-set in a particular programming language. I’m currently doing just that.
    • Learn about System Design. I added that to my list of things to learn.
    • Then learn about System Design involving large infrastructure systems. Okay, that sounds challenging, but I like a good challenge.
    • Develop a good knowledge of Data Structures and Algorithms. That was already on my to-learn list.
    • Learn about handling very large numbers involving data in a large infrastructure system. This one I had to ask for more clarification on, and even then I’m still a little unsure.

    After that the SRE manager told me it took him two months of studying on and off just to prepare for the interview even though he had a plethora of experience. That’s when I got a little iffy about the role. I’m not saying I can’t become a SRE, but I don’t know if I want to invest one to two years of my life preparing for that role. So I thanked the manager for his time, and started thinking about learning the skill-set needed for the new Software Engineering role I recently discovered.

    What Is The New Software Engineering Role I Found?

    The new Software Engineering role I found is called a Customer & Partner Solutions Engineer. This type of engineer develops technical solutions for customers regarding life-cycle events. The team the job role I found handles Google’s first party and third party authentication.

    These engineers also identify technical gaps and other opportunities to reuse solutions or create new code to resolve those issue. In addition, they create technical documentation for the customer’s developers and/or partners.

    Finally, and this isn’t an exhaustive list of duties, Customer & Partner Solutions Engineers create tools and dashboards to track and improve efficiency.

    Why I Think This Role Fits Better For Me

    First, I get to work on problems and find solutions. Thus, I get to perform research and write code to resolve those problems. Next, I also get to work with customers, which I do enjoy doing. I know some people don’t like to work with customers because they can be demanding. Especially if they aren’t sure what they exactly want, but that just means a person like me has to explain what’s doable, and what isn’t. Finally, I have the ability to write technical documentation which I do enjoy too.

    The Qualifications Needed For This Role

    These are the minimum qualifications:

    • Computer Science degree or equivalent practical experience
    • Experience with client-side web technologies like HTML, CSS, JavaScript, and HTTP
    • Experience with one or more programming languages like Java, C/C++, or Python
    • Technical troubleshooting experience, and managing internal and external customers

    So I have all those skills (except the Computer Science degree). However, I do need to work on the following preferred qualifications:

    • Experience in web technologies like XML, databases, SQL queries
    • Knowledge of programming languages like Java, Python, and PHP
    • The ability to implement web and/or mobile operating system authentication and authorization protocols
    • Demonstrate project management and analytical problem solving skills.

    These I can learn in about six months with the learning schedule I follow now. That’s why I rather work toward this role.

  • Where Should I Go Eat: An Introduction

    Where Should I Go Eat: An Introduction

    The last of my technical projects I haven’t talked about yet is Where Should I Go Eat (which you can visit here). In this post I will discuss the following topics about this web application:

    • Why I created it
    • The code running it
    • My future plans for the web application

    Why I Created Where Should I Go Eat

    This story is similar to my story for creating Black History Fact Generator: The year was 2019. I worked at Twitter as a Site Operations Technician at the Atlanta, GA data center. The year prior I taught myself the Python programming language using an Udemy course, and I found myself wanting to create more projects to increase that skill.

    Since I worked at the data center and not an actual Twitter office, the company provided a catered Monday through Thursday. Every Friday we had the opportunity to spend our daily lunch budget ($19 at the time) on our own. We could order lunch via Doordash or go out to eat. Usually, we chose the former because lunchtime traffic in Downtown Atlanta sucks.

    My team always fought about which restaurant to order from. Some people wanted fast food like Chick-fil-A. Others wanted to eat from the newest hip restaurant. We would argue back and forth in the Slack channel dedicated to our lunch order.

    One day I made a joke that I should build an app that chose a restaurant at random for us. That got a few laughs, and one of the Site Reliability Engineers (SREs) on my team told me to do just that. He knew I taught myself Python and that project would get me to flex those skills. So that’s what I did.

    I brainstormed names for my app, decided on Where Should I Go Eat, and bought a domain name from Namecheap.

    The Code Running Where Should I Go Eat

    All the code can be found on the project’s GitHub repo.

    Front-End Code

    I used Bootstrap to build out the Front-End of the website because of the following reasons:

    • Ease to use
    • Rich responsive website design features
    • Offers good performance

    In addition to Bootstrap I use regular (or vanilla) HTML and CSS to build out the Front-End.

    Back-End Code

    I used Python and Flask to build out the Back-end of the website. I chose to use Flask over Django because it requires much less code to spin up a simple application.

    The Python code to randomly choose a restaurant is in the main.py file. I’ll include a snippet of that file below:

    with open("static/files/restaurants.txt", "r") as restaurants:
            restaurant_list: [str] = restaurants.readlines()
    
        # Choose a random restaurant
        random_restaurant: [str] = random.choice(restaurant_list)
    
        # Strip the newline character from the end so the search is successful
        random_restaurant: [str] = random_restaurant.strip()
    
        # Initializing variable
        found_restaurant_url: str = ""
    
        # Search the nested tuples for the correct restaurant URLs matching the chosen random restaurant
        for restaurant in restaurant_urls:
            if random_restaurant in restaurant:
                found_restaurant_url: str = restaurant[1]

    Let’s go through the code line by line:

    1. I have all the restaurants in a text file called restaurants.txt. Using the “with open” command I read all the names into a list called “restaurant_list.”
    2. Then I use the “random.choice” function to choose a random restaurant from the “restaurant_list” list.
    3. After that I strip the newline character from the end of the “random_restaurant” so when I search for it, the exact match appears.
    4. I initialize a variable to hold the “random_restaurant” URL.
    5. Finally, I use a “for” loop to search through the tuple containing the restaurants and their URLs in the “restaurants_urls.py” file, and assign the one matching the “random_restaurant.”

    The main.py file contains all the route (or links) to the home page, which displays the random restaurant and its URL.

    I include the restaurant on the home page template as so:

    <div class="col">
                <button class="button" name="start-over" type="submit" onclick="location.href=location.href">Reset</button>
            </div>
            <p class="restaurant-result">You Should
                Go Eat At {{ restaurant }}</p>
            <p class="restaurant-link">Order Online At {{ restaurant }} <a href="{{ restaurant_link }}"
                                                                           target="_blank">here</a></p>
        </div>
    </div>

    If users wants to generate another random restaurant they click the button on screen, which runs the function again.

    My Future Plans For This Application

    I had some plans to use geolocation to provide restaurants available in that visitor’s location, but I haven’t worked on that feature. I may in the future.

  • Using Google Cloud To Host My Web Applications

    Using Google Cloud To Host My Web Applications

    I’m using Google Cloud to host my web applications although that wasn’t my first choice for web hosting. Allow me to explain how I got to this point.

    August 2022

    I’m on Twitter, like usual, and I see Heroku trending. This interests me because I use the Platform-as-a-Service to host my web apps for free.

    Oh no. Oh…this is not good. There’s a blog post from the CEO called “Heroku’s Next Chapter” and users aren’t happy. I read it and discover the PaaS will remove their free Dynos in November 2022. Oh, I use their free Dynos. What the heck?!

    Why is this happening?

    Heroku’s CEO, Bob Wise, states the following in the aforementioned blog post: “Our product, engineering, and security teams are spending an extraordinary amount of effort to manage fraud and abuse of the Heroku free product plans. In order to focus our resources on delivering mission-critical capabilities for customers, we will be phasing out our free plan for Heroku Dynos, free plan for Heroku Postgres, and free plan for Heroku Key-Value Store, as well as deleting inactive accounts.”

    I go back to Twitter and many people on there think Salesforce forced Heroku into removing the free Dynos so they can make money from their purchase. Salesforce acquired Heroku in 2010. That’s really long ago so I’m not sure if I agree with that theory. Probably the fraud occurring on the free tiers cost the company more money to resolve, which made the free plans too expensive to continue.

    I don’t really care about the reason why this is happening because I’m more concerned about this question: What am I going to do? I checked how much the Paid Dynos cost, and at the time they were $7 a month. Because I have to purchase a Dyno for each of my applications I’ll have to pay $21 per month. And these application don’t make any money.

    I gotta leave Heroku.

    Enter The Search For The Next Provider

    I return to Twitter and look for Heroku replacements. It would be great if I can find a provider offering a free tier.

    I try out different PaaS, but I don’t like them. Some don’t allow me to use a custom domain name with the free tier. Others are too difficult for me to use, especially since I use Python and Flask.

    I give up trying to find a free tier or a free PaaS provider. I decided to pay for a service because I don’t want to end up in the same position later I find myself with Heroku later. Plus, I’m using someone else’s servers, electricity, and staff, so it’s just right to pay for that.

    Who do I want to go with now? DigitalOcean? Nah, they’re too expensive. AWS? If I think DigitalOcean is too expensive, AWS is definitely out of my budget!

    What about Google Cloud? I used them before for testing out virtual machines and other small things. Hmmm. This looks promising.

    Here’s Why I’m Using Google Cloud

    The main reason why I’m using Google Cloud for hosting my web apps because I already have a Google account and tried the service.

    Another reason was their documentation about how to deploy a Python app on their service. It’s well-written and easy for me to follow.

    Next, the monthly cost is low. Really low!

    The company does a great job on giving customers an estimated cost of using one or many of their services. For my web apps I use the App Engine. Because my applications don’t use many resources my monthly bill is about $0.10 per month. Yep, you read that right.

    The final reason I stay with Google Cloud because I’m a Google employee. I might as well use the service that I help maintain.

    That reminds me: Do employees get a discount? I need to check on that.

  • Click-Go-Lotto: An Introduction

    Click-Go-Lotto: An Introduction

    One of my technical projects I updated recently is Click-Go-Lotto (which you can visit here). In this post I will discuss the following topics about this web application:

    • Why I created it
    • The code running it
    • My future plans for the web application

    Why I Created Click-Go-Lotto

    My mom plays the Georgia lottery, both scratch-off tickets and lottery games like Mega Millions, Powerball, and Fantasy Five to name a few.

    Like many lottery players she has her a set of favorite numbers to play for particular games over and over. However, there are times she allows the machine to randomly choose her numbers.

    Instead of allowing the lottery machine to choose numbers for her, I decided to create a web app that could do the same. A benefit of a web app over a lottery machine is that she can generate as many random numbers as she wants without paying for them. My mom could use the app on her phone if she’s on the go, or on her laptop when she’s at home.

    After brainstorming names for my app, I picked Click-Go-Lotto because users would click a button on the website to get the numbers. After coming up with the name I bought the domain name from Namecheap.

    With the domain name in hand, it was time to design the web application. I already knew what tech stack I wanted to use: Bootstrap for the Front-End and Python/Flask for the Back-End.

    The Code Running Click-Go-Lotto

    All the code can be found on the project’s GitHub repo.

    Front-End Code

    I used Bootstrap to build out the Front-End of the website because of the following reasons:

    • Ease to use
    • Rich responsive website design features
    • Offers good performance

    In addition to Bootstrap I use regular (or vanilla) HTML and CSS to build out the Front-End.

    Back-End Code

    I used Python and Flask to build out the Back-end of the website. I chose to use Flask over Django because it requires much less code to spin up a simple application.

    The Python code to generate the random numbers is all in one module: games.py. I’ll include a snippet of that file below:

    def cash3() -> tuple[int, int, int]:
        """This function provides the three numbers for the Cash 3 game.
        The game allows for numbers 0 to 9, and also allows for duplicate numbers.
        :return: Three individual random integers.
        """
        num1: int = random.randint(0, 9)
        num2: int = random.randint(0, 9)
        num3: int = random.randint(0, 9)
        return num1, num2, num3
    
    ...
    
    def mega_millions() -> tuple[int, int, int, int, int, int]:
        """This function provides the six numbers for the Mega Millions game.
        The game allows for numbers 1 to 60, but doesn't allow for duplicate numbers except for the Mega Ball.
        :return: Six individual random integers.
        """
        num1: int = random.randint(1, 13)
        num2: int = random.randint(14, 26)
        num3: int = random.randint(27, 39)
        num4: int = random.randint(40, 52)
        num5: int = random.randint(53, 70)
        mega_ball: int = random.randint(1, 25)
        return num1, num2, num3, num4, num5, mega_ball

    Let’s go through the code line by line:

    1. The function returns a tuple of Integers. The number of Integers range from three to six.
    2. Depending on the game, I either allow duplicate random numbers or use a range of random numbers to prevent duplicates.
    3. Each random number is assigned to a different variable.
    4. If the game has a specific lottery ball (like the Mega Ball in the previous code snippet) I assign a different random number to that variable.
    5. Finally, I return all the Integers from the function.
    6. The main.py file displays the numbers returned from the function:
    @app.route("/games/cash3.html", methods=["GET", "POST"])
    def cash3_game() -> render_template:
        """Displays the cash3.html template.
        :return: Cash 3 page displaying the three random numbers.
        """
        num1, num2, num3 = cash3()
        return render_template("/games/cash3.html", num1=num1, num2=num2, num3=num3)
    
    ...
    
    @app.route("/games/mega-millions.html", methods=["GET", "POST"])
    def mega_millions_game() -> render_template:
        """Displays the mega-millions.html template.
        :return: Mega Millions page displaying the six random numbers.
        """
        num1, num2, num3, num4, num5, mega = mega_millions()
        return render_template("/games/mega-millions.html", num1=num1, num2=num2, num3=num3, num4=num4, num5=num5,
                               mega=mega)

    The main.py file contains all the routes (or links) to the specific game’s page. This is the Flask code hard at work!

    I include the numbers on the game’s page template as so:

    ...
    
    <div class="container game-container">
        <div class="row">
          <div class="col">
            <h1 class="game-title">Cash3</h1>
            <h2 class="lotto-num-short">{{ num1 }} - {{ num2 }} - {{ num3 }}</h2>
            <form action="cash3.html" method="post">
              <button class="btn btn-lg game-btn" name="regenerate" type="submit"
                onclick="{{ num1 }} {{ num2 }} {{ num3 }}">Click-Go-Lotto Again</button>
            </form>
          </div>
        </div>
      </div>
    
    ...

    If users wants to generate a new set of numbers they click the button on screen, which runs the specific function again.

    My Future Plans For This Application

    I don’t have any major plans to modify the code for Click-Go-Lotto. It’s pretty much complete, unless a lottery game changes.

  • Learning Python From Books

    Learning Python From Books

    Recently I switched from using YouTube to improve my Python skills to reading books. Yes, actual books printed on paper. No digital or ebooks (even though there’s nothing wrong with using those, but I prefer reading from physical books). Why did I make this change to learning Python from books? Did I not like learning from video content? Should you use a book to learn a programming language? What are the pros and cons of my decision? I’ll answer those questions in this post.

    Why I’m Learning Python From Books

    I’m learning Python from books because I found myself not actually absorbing the material while watching videos on YouTube. I think this is a problem others run into, but don’t realize. Which is why they have trouble implementing what they learned into a project.

    I didn’t have a problem with focusing on the content, as the presenter was engaging. And I didn’t suffer from distractions, like from my phone, because when it’s study time I make sure to only focus on my study material. However, I found myself just watching the videos play without taking any notes. I became a watcher fully, not inspired to follow along with the presenter as that person typed on the screen.

    I would go back and rewatch the video to try to absorb the material. Sometimes I would even code along with the presenter using my code editor (usually PyCharm). Alas, those actions didn’t help me as much as I wanted. Thus, I turned to books.

    I got the idea to use a programming book from a YouTube video funny enough! As an avid fiction book reader I’m not sure why I didn’t think of this avenue myself. I’ve browsed books in the Technology section at bookstores in the past.

    I used Gemini to ask for Python programming book recommendations. Then I compared those to recommendations I got from YouTube searches. I finally purchased the following books:

    I’m currently reading Python Crash Course and will review it later on my website. So far it’s a great beginner book, and I’ve learned quite a bit from the author.

    Should You Use A Book To Learn Programming?

    While I’m enjoying learning Python from books, you, the reader, may not. Ask yourself these questions:

    • Do you enjoy the act of reading from a physical or digital book?
    • Reading requires time and focus. Do you have the ability to dedicate those?
    • Do you have the money to purchase books, or access to a library?

    If you can answer yes to all three, then I suggest you go ahead and use books. However, if you answer no to one of those questions you can still try to use a book, but I highly suggest checking one out from your local library to save on costs. Or you can try to find a used books at a substantial discount. This way if you don’t like using programming books then you won’t be out much money.

    Another con of using programming books is they can contain outdated information. Thus, it’s important to find a book (or even a book series) that’s updated at least yearly. Or if the book isn’t updated itself, the publisher or author provides online resources (like a PDF file) containing updated information for you to download.