MD5 Hash Encoding Using Python

Samual Sam
Updated on 30-Jun-2020 09:23:44

5K+ Views

One of the major concern of all IT companies in the security of there data. Multiple hashing techniques are there to project and check our data.What is HashHash is a function which takes variable length sequence of bytes as input and converts it to a fixed length sequence. However, to get your original data(input bytes) back is not easy. For example, x is your input and f is the f is the hashing function, then calculating f(x) is quick and easy but trying to obtain x again is a very time-consuming job.The return value from a hash function is called ... Read More

Generating Random IDs in Python

Samual Sam
Updated on 30-Jun-2020 09:19:37

2K+ Views

We use to generate a random number in our project for a sample data, which later can be used for testing, filled empty columns or for many other purposes, the key thing is we need to generate random data. In python, there are numerous ways to generate random data and we're going to explore some of them here in this article −Python random() moduleOne of the important library, what comes with python is random and we are going to use it throughout in our code.To use this module in your code, you just need to import it, that’s it and ... Read More

Add Multiple Intervals to DATE_ADD in MySQL

karthikeya Boyini
Updated on 30-Jun-2020 09:16:47

492 Views

The current date and time is as follows −mysql> select now();OutputThis will produce the following output −+---------------------+ | now()               | +---------------------+ | 2019-06-15 12:24:06 | +---------------------+ 1 row in set (0.00 sec)Let us first create a table −mysql> create table DemoTable    ->(    -> ArrivalDate datetime    -> ); Query OK, 0 rows affected (1.15 sec)Insert some records in the table using insert command. Here, we are adding multiple intervals to the DATE_ADD() method −mysql> insert into DemoTable values(DATE_ADD(DATE_ADD(NOW(), INTERVAL 6 MONTH), INTERVAL 1 YEAR)); Query OK, 1 row affected (0.13 sec) ... Read More

Pattern Matching in Python with Regex

karthikeya Boyini
Updated on 30-Jun-2020 09:16:45

7K+ Views

What is Regular Expression?In the real world, string parsing in most programming languages is handled by regular expression. Regular expression in a python programming language is a method used for matching text pattern.The “re” module which comes with every python installation provides regular expression support.In python, a regular expression search is typically written as:match = re.search(pattern, string)The re.search() method takes two arguments, a regular expression pattern and a string and searches for that pattern within the string. If the pattern is found within the string, search() returns a match object or None otherwise. So in a regular expression, given a ... Read More

Defining Clean-Up Actions in Python

Samual Sam
Updated on 30-Jun-2020 09:14:31

1K+ Views

There are numerous situation occurs when we want our program to do this specific task, irrespective of whether it runs perfectly or thrown some error. Mostly to catch at any errors or exceptions, we use to try and except block.The “try” statement provides very useful optional clause which is meant for defining ‘clean-up actions’ that must be executed under any circumstances. For example −>>> try:    raise SyntaxError finally:    print("Learning Python!") Learning Python! Traceback (most recent call last):    File "", line 2, in       raise SyntaxError    File "", line None SyntaxError: The final clause ... Read More

Perform Google Search Using Python Code

karthikeya Boyini
Updated on 30-Jun-2020 09:13:14

1K+ Views

In this article, we will try to do google search using python code, this comes handy in case you are working on a python project and you need to access some data from the web and the search result(from the web) is going to be used inside your project.Prerequisite –You must have python installed on your system.Install google module. You can use pip to install google module like below −C:\Users\rajesh>python -m pip install google Collecting google Downloading https://files.pythonhosted.org/packages/c8/b1/887e715b39ea7d413a06565713c5ea0e3132156bd6fc2d8b165cee3e559c/google-2.0.1.tar.gz Requirement already satisfied: beautifulsoup4 in c:\python\python361\lib\site-packages (from google) (4.6.0) Installing collected packages: google Running setup.py install for google ... done Successfully installed ... Read More

Python Object Serialization

Samual Sam
Updated on 30-Jun-2020 09:11:53

690 Views

Serialization is a process in which an object is transformed into a format that can be stored/save (in a file or memory buffer), so we are able to deserialize it later and recover the original content/object from the serialized format. We are going to use a python pickle module to do all these operations.What is pickling?Python pickle module is used for serializing and de-serializing python object structures. The process to converts any kind of python objects (list, dict, etc.) into byte streams (0s and 1s) is called pickling or serialization or flattening or marshaling. We can convert the byte stream ... Read More

Plotting Google Map Using gmplot Package in Python

karthikeya Boyini
Updated on 30-Jun-2020 09:05:26

4K+ Views

There are numerous ways you can draw geographical coordinates on Google Maps. However, in case you want to save it in a local file, one better way to accomplish is through a python module called gmplot.Python library gmplot allows us to plot data on google maps. gmplot has a matplotlib-like interface to generate the HTML and javascript to deliver all the additional data on top of Google Maps.InstallationIt is easy to install gmplot using pip incase gmplot is not already installed −pip install gmplotOn running above command, you may see output something like −From above, we can see the latest ... Read More

Create a Link Button with Borders Using CSS

vanithasree
Updated on 30-Jun-2020 08:53:44

3K+ Views

To create a link button with borders, you can try to run the following code −ExampleLive Demo                    a:link, a:visited {             background-color: white;             color: black;             border: 1px solid blue;             padding: 30px 30px;             text-align: center;             text-decoration: none;             display: inline-block;          }          a:hover, a:active {             background-color: red;             color: white;          }                     Demo Link    

Change HTML Content in JavaScript

vineeth.mariserla
Updated on 30-Jun-2020 08:52:32

2K+ Views

Yes, it is possible to change the content of the HTML in javascript. Usually HTML content will be in HTML tags such as , , etc. In javascript, we have DOM methods that have an ability to access the HTML tags. Those methods, such as document.getElementById(), document.getElementByTagName(), etc., make use of tags to change the HTML content.Example-1In the following example, the content in the span tag is changed using a javascript DOM method document.getElementById(). Live Demo    Is javaScript is java.     Once the above code is executed, we will get the following on the screen If we click ... Read More

Advertisements