Geek Logbook

Tech sea log book

Comparative Investment Analysis of Invesco and Blackstone Using Python

Introduction In this post, we’ll explore how to use Python programming to compare the performance of two investment firms, Invesco and Blackstone. Invesco is known for its focus on public asset management, while Blackstone specializes in private equity, actively acquiring and managing companies. We’ll examine some key performance and risk metrics to understand how these

Handling Deletion of Bootcamps in a Node.js API with Mongoose

In this post, I’ll walk through the process of handling the deletion of bootcamps in a Node.js API using Mongoose. Recently, while working on a project, I encountered a TypeError when attempting to delete a bootcamp, and I’ll explain how I resolved it. The Error I had the following function for deleting bootcamps: When attempting

Built-in Functions vs. Object-Oriented Methods

Python strives to be simple and clear, so some operations are implemented as built-in functions, while others are object-specific methods. This distinction arises from the way Python handles different types of objects. Built-in Functions len() is a built-in function that works with many different types, including strings, lists, tuples, dictionaries, and more. This allows for

How to Simplify a Mongoose Schema in Node.js

When working with Mongoose in Node.js, defining a schema for your models can get repetitive and verbose, especially if you’re specifying data types and validation repeatedly. In this post, we’ll look at how to simplify a Mongoose schema and clean up your code without sacrificing functionality. Let’s take a typical Mongoose schema example and explore

Implementing Query Filtering in Express with Mongoose

In modern API development, providing flexible querying mechanisms is essential to allow clients to filter and retrieve data efficiently. In this post, we’ll go over how to implement query filtering using Express.js and Mongoose, focusing on handling MongoDB operators like $gt, $gte, $lt, $lte, and $in. Problem Overview We want to create a route that

Downloading Data from the SEC Website using Python

In this blog post, I’ll show you how to download a JSON file from the U.S. Securities and Exchange Commission (SEC) website using Python. The file contains company tickers, which can be useful for various financial analyses and applications. Steps to Download the File Here’s a complete Python script that handles the download: Run the