Posts

The magic of a storing more information in a single number

Image
Introduction Have you ever imagined how can we store a group of information in a single digit? There is a way to do it. Thie technique is commonly used in the old days when memories are limited. But still its widely used for in Embedded and IOT based application programming. Here I am trying to explain it using an example. Example For this, I am taking an example of “How to store all roles of a user in a single integer value.” When developing application software, a programmer should write a module for handling Roles and Permissions for the users. Suppose we have the following roles: Role Anonymous Admin SuperAdmin General Manager Senior Manager Data Entry View Only ReportsOnly The programmer will usually assign an integer ID to each role like the following: Id Role ...