In Python, the single forward slash ‘/’ performs a floating-point division unless you’re using Python 2.x,in which case it performs an integer division with integer operands. The double forward slash //, on the other hand, forces a floor division operator which performs an integer division and returnsthe largest integer less than or equal to the […]
Tag: programming
How to parse json data from a restaurant
In this blog post, I’ll show you a real-life example of a restaurant menu encoded as a JSON file and how you can parse in your app, and subsequently display it in your custom UI as desired. Suppose you have a menu of items with details encoded in JSON format that looks like this: This […]
Sorting, grouping, defragging…a visual working demo
Watching a sorting, grouping, or just a defragmentation process graphically is both educational and curiously satisfying. So, I created a Python script that sorts a set of randomly placed, randomly colored, ungrouped tiles on a board by colors so that all like-colored tiles are placed consecutively, adjacently. Think of it like the good old Windows […]
Data cleansing challenge: non-ASCII characters
Non-ASCII characters can pose challenges in data cleansing for several reasons: Therefore, it’s a good practice to standardize or normalize text data to ASCII when possible, or ensure correct handling of non-ASCII characters. This helps to maintain data integrity and simplifies subsequent data processing tasks. Superscripts, subscripts, or “special” characters often look like ascii characters […]
How to export a Youtube playlist for free
In this post, I’ll explain the steps to export your playlist on Youtube or one that’s shared with you for free. No, not the actual content like music tracks or videos, as for that, you’ll need a premium account, but the list of names such as artist or author names, tracks or video titles, and […]
Music Playback from a CSV (Python)
In my earlier blog post An Interactive Musical Keyboard Player (Python), I shared the full code on how to write an interactive musical keyboard that can also save what you play into memory and optionally to a file. In this post, I’ll share a related component as a separate code module that can read a […]
Reshaping data for Excel via Python
In this post, I demonstrate an effective way to reshape a CSV or XLSX file that originally has multiple rows repeating for each column. For example, many raw data exports will include a country’s metrics (GDP for example) for the year in each row and it repeats for different years as rows. Cntry Year GDP […]
An interactive musical keyboard player (Python)
In this post, I am sharing my Python code for creating a simple musical keyboard player that can be played using a standard computer keyboard. The app will generate specific musical notes as you press keys A-Z on your keyboard. You can increase a note by half-step or full-step by each press. So, increasing by […]
Find Superscripts, Subscripts, and Unicode in a text file (Python)
Occasionally, it becomes necessary to search for special characters like superscripts, subscripts, symbols, emojis, or any Unicode characters within a text document. This is crucial when working with data files that should not contain any such characters, unless they are explicitly required and managed. Most editors, including Word, lack a ‘Find’ feature that reveals all […]
Windows 11 Boot MicroAnimation and Wise Monkey using just text
Recently, an ex-colleague of mine brought to our attention the Microsoft font possibly used in creating the spinning dots in Windows 11 boot screen. The font is called “Segoe Boot Semilight” and is a true type font. So, I had to verify that this is true, and I wanted to try to create the animation […]