UUID


Universally Unique Identifier (UUID) is a 128-bit label used for information in computer systems. This has standards for generating the identifier for uniqueness and independent code generation. Its existence since year 1980 with Appollo computer used in Network Computer System and later adapted by Open Software Foundation in Distributed Computing Environment.

There are other standards organizations has registered and make the identifier specification such as RFC, ITU and IETF.

UUID stands for Universal Unique Identifier defined by RFC 4122

Format:

FieldNDR Data TypeOctet #Note
time_lowunsigned long0-3The low field of the timestamp.
time_midunsigned short4-5The middle field of the timestamp.
time_hi_and_versionunsigned short6-7The high field of the timestamp multiplexed with the version number.
clock_seq_hi_and_reservedunsigned small8The high field of the clock sequence multiplexed with the variant.
clock_seq_lowunsigned small9The low field of the clock sequence.
nodecharacter10-15The spatially unique node identifier.

how to use?

we can generate UUID in any standard programming language or general-purpose application software.

we are going to look into the following:

Database system:

Database – function – data type

  • Oracle – sys_guid() – RAW(16)
  • SQL Server – NEWID() – uniqueidentifier
  • PostgreSQL – gen_random_uuid() – UUID
  • MySQL – UUID() – BINARY(16)

Programming language:

Python:

The uuid module provides immutable UUID objects (the UUID class) and the following functions 

uuid1()uuid3()uuid4()uuid5() 

are for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122.

note: version 1 may have the privacy issue. please use these functions with full understanding.

acronyms:

  • RFC – Request for Comment
  • ITU – International Telecommunication Union
  • IETF – Internet Engineering Task Force

Ref:

Universally unique identifier – Wikipedia

stackoverflow.com – uuid-in-python

Python – Data types – Day 3


Data Types

We come across various types of day in the real world. Basically, we invented it to describe any unit of datum.

in the same way, programming languages are designed for various purposes and have different data types to process the users input.

For example, FORTRAN (Formula Translation) is a computer programming language that is used for scientific data processing.

COBOL (Common Business Oriented Language) – Programming language for business data processing.

these two notable legendary programming languages that have rich data types to handle various application data.

Likewise, Python is capable of handling different type of data for today’s modern applications.

  1. numeric – integer, float, complex
  2. boolean – values are True, False
  3. set – {}, it is an unordered, unindexed and deduplicated data collection in a single variable.
  4. mapping – {“key”:”value”}, Dictionary data store with key-value pair.
  5. sequence – string, list is the collection storage of similar data type. tuple contains different types of data.

data types are grouped into mutable and immutable. mutable allows the program to update the value in the existing memory and immutable does not allow the program to update the value instead it created new memory and old memory will be given away then freed by garbage collection.

examples:

interger

a = 1

floating point

b = 1.5

complex number

c = complex(a + b)

boolean

f = True

set

A = {1,2,3,4,True, False, 4,3,2,1}

dictionary

d = {“name”:”dog”,”job”:”guard”}

sequence – can retrieve value using the index [1…n]

string

e = “elephant”

list

f = [‘f’,’u’,’n’]

tuple

g = (1,3,5,’odd’,’natural’, True)

you can view the output of the variables using print() function

Python interactive shell

Python – Introduction – Day 1


This name has a power to transform this world. it can be taught to a young people to senior citizens. Since, the nature of this language is simple to read and write. You can write a program to print “hello, world!” or send a rocket to the moon.

Python is an interpreted language. It is a high level, Object-oriented programming language.

There are some basic to learn a programming language. It is vital to understand the following and it is same for all languages.

  1. Language Syntax – to construct the program structure.
  2. Variables – a name use to store a value.
  3. Data Type – Type of the value to be stored in a variable or as a literal for computation.
  4. Operators – symbols that represent operations to be performed.
  5. Control Structure – Control structures are used to perform different actions in a program. such as, conditional flow, repetitive code block and catch exceptions.
  6. Module – is a collection of subroutines that are essential or readily available for developer’s use instead of creating. for instance, print() is a standard function for output.

We will get to learn each item as given above. Learning the basic of a programming language basics gives you confidence to do more. Therefore, more you do will make you an expert.

There is a concept called 10K hours rule. If you practice a complex skill dedicatedly for 10K hours, you will become master in it.

Same goes for mastering a programming language.

Start your first day and wish you to reach the 10K hour.

Ref: https://www.python.org/

Numerizer – Text to number – Python


Numerizer is a python package that is used to convert natural language numeric text to actual numeric value.

So, Just trying to experiment with few examples in this blog

how to install?

pip install numerizer

how to import into python program?

from numerizer import numerize

Examples:-

from numerizer import numerize
print (numerize(‘Airlines companies are adding five million shares’))

output : Airlines companies are adding 5000000 shares

 

from numerizer import numerize
print (numerize(‘dollar Five Thousand Four Hundred And Sixty Seven And Cents Forty Five Only’))

output: dollar 5467 And Cents 45 Only

We can use this library for other purposes like translation application, speech to text, ATM machine and etc.

References:

https://pypi.org/project/numerizer/

https://freechequewriter.com/number-to-words