karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 85 of 143

Scraping and Finding Ordered Word in a Dictionary in Python

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 732 Views

For solving this problem we need requests module.For installing requests module, we need this command to get executed at command line.pip install requestsScrapingImport requests module.Then we need to fetch data from URL.Using UTF-8 decode the text.Then convert string into a list of words.Ordered FindingTraverse the list of words using loop.Then compare the ASCII value of adjacent character of each word.If the comparison is true then print ordered word otherwise store the unordered word.Example codeimport requests    def Words_find():       my_url = ""#put thisurl of .txt files in any website       my_fetchData = requests.get(my_url)       ...

Read More

Page Rank Algorithm and Implementation using Python

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 6K+ Views

The PageRank algorithm is applicable in web pages. Web page is a directed graph, we know that the two components of Directed graphsare -nodes and connections. The pages are nodes and hyperlinks are the connections, the connection between two nodes.We can find out the importance of each page by the PageRank and it is accurate. The value of the PageRank is the probability will be between 0 and 1.The PageRank value of individual node in a graph depends on the PageRank value of all the nodes which connect to it and those nodes are cyclically connected to the nodes whose ...

Read More

Creating child process using fork() in Python

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 2K+ Views

Our task is to create a child process and display process id of both parent and child process using fork() function in Python.When we use fork(), it creates a copy of itself, it is a very important aspect of LINUX, UNIX. fork() is mainly applicable for multithreading environment that means the execution of the thread is duplicated created a child thread from a parent thread. When there is an error, the method will return a negative value and for the child process, it returns 0, Otherwise, it returns positive value that means we are in the parent process.The fork() module ...

Read More

Adding a column that doesn't exist in a query?

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 1K+ Views

Add a column that does not exist in a query, with the help of AS keyword. The syntax is as follows −SELECT yourColumnName1, yourColumnName2, ....N, yourValue AS yourColumnName, ....N' FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table ColumnDoesNotExists     -> (     -> UserId int,     -> UserName varchar(20)     -> ); Query OK, 0 rows affected (0.67 sec)ExampleInsert some records in the table using insert command. The query is as follows −mysql> insert into ColumnDoesNotExists(UserId, UserName) values(100, 'Larry'); Query OK, ...

Read More

Check if a table is empty or not in MySQL using EXISTS

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 4K+ Views

The following is the syntax to check whether a table is empty or not using MySQL EXISTS −SELECT EXISTS(SELECT 1 FROM yourTableName);ExampleFirst, let us create a table. The query to create a table is as follows −mysql> create table ReturnDemo    -> (    -> Id int,    -> Name varchar(10)    -> ); Query OK, 0 rows affected (0.79 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into ReturnDemo values(100, 'Larry'); Query OK, 1 row affected (0.18 sec) mysql> insert into ReturnDemo values(101, 'Bob'); Query OK, 1 row affected (0.28 sec) ...

Read More

Python program to check if a string is palindrome or not

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 4K+ Views

Given a string, our task is to check weather this string is palindrome or not.AlgorithmStep1: Enter string as an input. Step2: Using string slicing we reverse the string and compare it back to the original string. Step3: Then display the result.Example codemy_string=input("Enter string:") if(my_string==my_string[::-1]):    print("The string is a palindrome") else:    print("The string isn't a palindrome")OutputEnter string:madam The string is a palindrome Enter string:python The string isn't a palindrome

Read More

Play a video in reverse mode using Python OpenCv

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 791 Views

The full form of OpenCv is Open Source Computer Vision, using this library we can perform different operations on images, videos.Application areas of OpenCVFacial recognition systemMotion trackingArtificial neural networkDeep neural networkVideo streaming etc.For installing on Windows we can use this command linepip install opencv-pythonFor Linux −sudo apt-get install python-opencvTo complete our task we have to follow some steps −Step 1: We import OpenCv library named cv2. Step 2: Take a video as input data. Step 3: First we break the video into a number of frames and store all these frames in a list. Step 4: When we are getting ...

Read More

Python Program to calculate the Round Trip Time (RTT)

karthikeya Boyini
karthikeya Boyini
Updated on 26-Jun-2020 2K+ Views

Here we will see how Python can be used to get the Round Trip Time (RTT). The RTT is the time which is taken by the entire trip of a signal. It means the time between the starting time when a signal is sent and the receiving time of the acknowledge signal.The RTT results varies on different parameters like.The data transfer rate of the sender’s side.The nature of the transmission media.The actual distance between the sender and receiver.The number of nodes between sender and receiver.The amount of traffic on LAN.Number of requests handled by intermediate points.Example Codeimport time import requests ...

Read More

Prefix sum array in python using accumulate function

karthikeya Boyini
karthikeya Boyini
Updated on 25-Jun-2020 586 Views

Given an array and we have to do the prefix sum array using accumulate function.itertools.accumulate(iterable[, func]) module functions all construct and return iterators. So they should only be accessed by functions or loops that truncate the stream. Make an iterator that returns accumulated sums. Elements may be any addable type including Decimal or Fraction. If the optional function argument is supplied, it should be a function of two arguments and it will be used instead of addition.ExampleInput Data = [1, 0, 2, 3, 5] >>> list(accumulate(data)) # running summation Output [1, 1, 3, 6, 11]AlgorithmStep 1: Create list. Step 2: ...

Read More

Render ASP.NET TextBox as HTML5 Input type "Number

karthikeya Boyini
karthikeya Boyini
Updated on 25-Jun-2020 1K+ Views

To render ASP.NET TextBox as HTML5 input type “Number”, set type="number" directly on the textbox.Let us see an example of ASP.NET TextBox −You can also use the following dynamically created the control −TextBox tb = new TextBox(); tb.Attributes.Add("Type", "number");

Read More
Showing 841–850 of 1,421 articles
« Prev 1 83 84 85 86 87 143 Next »
Advertisements