Solidity Operators and ‘Delete’ Keyword

Throughout this article, we’ll take a dive into the topics of operators, specifically the ternary operator, compound and increment/decrement operators, and the delete keyword. We’ll conclude the article with a table overviewing the operators in Solidity. It’s part of our long-standing tradition to make this (and other) articles a faithful companion or a supplement to … Read more

Solidity Iterable Mapping Type (Howto + Video)

In this article, we’ll continue our story on the mapping data structure, but this time, we’ll go through the data structure upgrade and reach a new functionality: the iterative mapping data structure. This way, by upgrading the readily available data structure, we’ll get a broader perspective and better understanding of how it works and how … Read more

Solidity Mapping Type Made Easy [+Video]

In this article, you’ll dive into detail on the Solidity mapping type and learn about mapping type specifics. It’s part of our long-standing tradition to make this (and other) articles a faithful companion, or a supplement to the official Solidity documentation, starting with docs for this article’s topic. Mapping Type We have seen mapping type … Read more

Python | Split String after Character

Problem Formulation πŸ“œ Problem: Given a string. How will you split the string after a specific character? Note that there can be different scenarios that can come up when you are trying to split a string after a certain character/sub-string. So, let’s understand the given problem with the help of numerous examples. 🏷️Scenario 1: Splitting … Read more

The Fasting Cure [Book Summary + Free Download]

Fasting has many scientifically proven benefits for your body and overall health: Intermittent fasting improved blood pressure and resting heart rates as well as other heart-related measurements. Physical performance. Young men who fasted for 16 hours showed fat loss while maintaining muscle mass. Mice who were fed on alternate days showed better endurance in running. … Read more

How to Add Elements to a Python Set

Problem Formulation and Solution Overview This article will show you how to add elements to a Python set. ℹ️ Info: A Python set is a collection of unique item(s) saved in no particular order (unordered). A set cannot be changed. However, elements can be added and removed. Sets can also perform calculations like union, intersection, … Read more

How to Remove ‘\x’ From a Hex String in Python?

Problem Formulation + Examples πŸ’¬ Question: Given a string of hexadecimal encoded string such as ‘\x00\xff\xf2’. How to remove the ‘\x’ prefixes or characters from the hex string? Here are a few examples of what you want to accomplish: Hex String Desired Output ‘\x00\xff\xf2′ ’00fff2’ ‘\x41\x42\x43’ ‘414243’ ‘\x53′ ’53’ ‘\xff\xff\xff\xff\xff’ ‘ffffffffff’ ‘\x00\x6a\x6f’ ‘006a6f’ Strawman Solutions … Read more

Python Create JSON File

Problem Formulation and Solution Overview This article focuses on working with a JSON file. JSON is an acronym for JavaScript Object Notation. This is a flat-text file formatted based on JavaScript (JS) Syntax. This file is most commonly noted for its ability to transmit data to/from web applications, such as sending/receiving data from a Server/Client … Read more

Python Hex to Float Conversion

Problem Formulation πŸ’¬ Question: Given a hexadecimal string. How to convert it to a float? Examples Here are a few example conversions where each hex string represents four bytes, i.e., two hex characters per byte. Hex String Float ‘0f0f0f0f’ 7.053344520075142e-30 ‘4282cbf1’ 65.39832305908203 ‘43322ffb’ 178.1874237060547 ‘534f11ab’ 889354649600.0 Solution – Convert Hex to Float The expression struct.unpack(‘!f’, … Read more