Author Archive


How to Write a MySQL Query to Fetch All WordPress Posts with Category Name

I run this website on wordpress powered by a mysql database. Very often I want to take a look at all the published posts on the site. By quickly looking at the list of post titles I can avoid posting duplicate or similar articles. If you have a wordpress blog with plenty of posts, you […]

How to Run MongoDB Queries on Azure Cosmos DB Using Python

Azure Cosmos DB is a highly scalable and fully managed database service available on the Azure cloud platform. Using MongoDB API support, it is possible to store JSON documents in Azure Cosmos DB. If you are using Cosmos DB with MongoDB API support in your projects, sometimes you need quick Python scripts to analyse data. […]

How to Create a Cosmos DB Database with MongoDB API Using Azure CLI

Azure Cosmos DB supports creation of databases which are compatible with MongoDB API. You can use standard MongoDB query language to access and modify data in such a database. However, please note that there are limitations in MongoDB API support and for aggregations, you will need to explicitly turn on aggregation support when creating the […]

How to Draw a Triangle in Python Turtle

Python has a simple pen drawing library called turtle. Using simple movement commands, we can draw shapes using the python turtle library. When teaching python to children, turtle is a good library to introduce to get children excited about the language and its features. The basic actions used in the following examples are, Draw a […]

How to Calculate SHA256 Hash of a File in Python

SHA256 is a secure hash algorithm which creates a fixed length one way string from any input data. The algorithm is designed in such a way that two different input will practically never lead to the same hash value. This property can be used to verify the integrity of the data. If data and hash […]