Wednesday 13 January 2021

What is replacing adobe flash player?

Or, what is going to replace the adobe Flash Player after flash player end of life?

Or, what to do with adobe flash payer dependent contents or sites after adobe flash player end of life?

Or, How to migrate from adobe flash player to other alternatives?

Or, what all are the alternatives of adobe flash player?

 

HTML5 replaced Flash player a long time ago as the deadline from adobe was given a long back, if you are late and now struggling with this, you may now think around how you can transition completely from Adobe flash player dependencies to HTML5.

Other flash player alternatives are WebGL, JS libraries and CSS3 etc..


Her are few recommended KBs you may go through to know more about this (Thanks to);

KB from - Oneline Tech Tips

KB from - zdnet


Please share your ideas if you are doing something really innovative to deal with this situation.


Cheers, please write me back if you have any queries or feedback.


Saturday 9 January 2021

Defaultdict in Python

 

Defaultdict is a subclass of built-in dict class that returns dictionary-like object. It is present in Collections module.

Functionality

Both dict and defaultdict have similar functionalities except that in defaultdict a default value is provided for the key that does not exist.

Note: For more information, please check Python Dictionaries .

 

Creating Defaultdict

Default dict can be created using built-in defalutdict( ) function:

# importing defaultdict from the collections module

from collections import defaultdict

def default_factory( ):
    return "Deafult Value"

defDict = defaultdict( default_factory )
defDict["alpha"] = 0
defDict["beta"] = 1

print(defDict["gamma"])
print(defDict["alpha"])

 


default_factory: An attribute which is a function returning the default value for the dictionary defined. If this argument is absent then the dictionary raises a KeyError.

 If default_factory attribute is absent: KeyError is raised


 

Using int as default_factory

When the int class is used as a default_factory and passed to the defaultdict( ), zero is used as default value for the key that does not exists.


from collections import defaultdict

defDict = defaultdict( int )
defDict["alpha"] = 1
defDict["beta"] = 2
print(defDict["gamma"])
print(defDict["alpha"])