In an earlier post, I demonstrated a fun and creative use of hashing to create unique visual signatures based on any input. In this post, I’ll create add another twist to it. Specifically, I’ll show another creative use of hashing where we can input any city name and get it’s real-time weather information, and based […]
Tag: python
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 […]
How To Pick Rows Or Columns, And Combine Them With Other Functions For Powerful Uses. Part 2
In this post, I’ll share an Excel function that enables us to easily pick specific number of rows and/or columns from a range of data. Additionally, I’ll share examples of how it can be combined with other functions to do some powerful tasks. The function I am discussing here is: DROP(). In another blog, I discuss […]
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 […]
Customizing Windows desktop wallpaper automatically, on schedule (Python)
With a little programming know-how, you can write your own dynamic Windows wallpaper app that can change its color to whatever color you want, to a random color that your app chose for you for the day, or set to your photos, images on a rotating basis or randomly picked from a list from your […]
How to convert a standard date format <-> Excel date serial number
You may already know that all date type values in Excel are converted to a serial number in Excel. This is an effective way to store date because not only do the digits take less space, it can be calculated upon for all sorts of date maths such as finding difference in days, months, years, […]
Division, Floor Division (Python)
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 […]
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 […]