In this post, I present the concepts of stack and queue which are fundamental in computer science. Furthermore, I demonstrate them with an interactive application below to clearly and visually present what goes on as new elements are added or removed from each and their differences in behavior. The implementation of a stack and queue […]
Tag: education
Creating a Pangram Phrase with Python
Introduction A pangram is a sentence that contains every letter of the alphabet at least once. The most famous example in English is “The quick brown fox jumps over the lazy dog.” Pangrams are not only fun to create but also useful in various applications, such as testing fonts and keyboards. Technically, a pangram doesn’t […]
Identifying double-bookings, scheduling conflicts
You’ve created a week’s schedule for your restaurant staff by day and shift (AM or PM). Next, you want a way fool-proof method to check if anyone is double-booked on any given day, and if so, who. Surely you can manually double-check and triple-check to make sure the schedule is exactly as planned but there […]
Creative and Fun Uses of Hashing (Part 1)
In this post, I’ll demonstrate a fun and creative use of hashing. Before I explain briefly what is hashing for those unfamiliar, let me just give you an overview of my original intent of this exercise. We know that hash functions will give us unique values for a given input (letters, numbers, binaries), so I […]
Creating universal unique IDs
I wanted a way to generate an automatic but unique code or password without it being easily back-traceable and collision-proof. i.e. each time it is executed, it must generate a unique universal ID, aka UUID. Additionally, that code or password must be 8 characters long and must contain a combination of letters and numbers and […]
Saving output from Turtle as an image (Python)
Saving output from the turtle module in Python involves a few unique steps compared to other libraries. The turtle module primarily uses the Tkinter canvas to render graphics, and saving these drawings typically requires converting the canvas to a PostScript file using the postscript() method. This file can then be converted to more common image […]
Given 4 numbers and a resulting number, create the equation to solve
You’re given four numbers and a result. You are supposed to create an equation with those four numbers that yield that given/desired result. Easy enough. Yeah, right! That’s the kind of puzzles some newspapers are running to challenge the readers as in Epoch Times et al. This is commonly referred to as the 4Numbers game. […]
How to calculate streaks in Excel
Streaks refer to trends in the data. These can be linear, exponential, damped, seasonal, irregular/random, stationary, or cyclical. Streaks are important for several reasons: There isn’t any built-in function in Excel for calculating streaks, but there different ways we can make Excel do some of that heavy-lifting by using a combination of functions such as […]
What’s Your Chart Signature? Graphing a name in Excel
Have you ever wondered: how does my name look like if plotted in Excel? Well, wonder no more. In this post, I’ll show you how to enter any name (or any string of characters) and plot it in dynamically to make your unique name come alive as a chart. To make it fully dynamic, I […]
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 […]