Sum of an array using pthreads

Divya Sahni
Updated on 28-Sep-2023 15:20:41


Pthreads is an execution model that helps use multiple processors to work at the same time for solving a problem. It is independent of the programming language. Problem Statement Given an array of integers. Find the sum of all the elements of the array using pthreads. Need for Multithreading for Calculating sum The problem is to add the elements in an array. Although it is a simple problem where a linear traversal of the array can do the work very easily with a time complexity of O(n) where n is the number of elements in the array. But if we ... Read More

How to Concatenate Column Values in a Pandas DataFrame?

Mukul Latiyan
Updated on 28-Sep-2023 14:50:47


Pandas is a powerful library for data manipulation and analysis in Python. It provides a variety of functions and tools for handling and transforming data, including the ability to concatenate column values in a Pandas DataFrame. In a Pandas DataFrame, columns represent variables or features of the data. Concatenating column values involves combining the values of two or more columns into a single column. This can be useful for creating new variables, merging data from different sources, or formatting data for analysis. To concatenate column values in a Pandas DataFrame, you can use the method. This method concatenates two ... Read More

How to Collapse Multiple Columns in Python Pandas?

Mukul Latiyan
Updated on 28-Sep-2023 14:46:52


Pandas is a popular data manipulation library in Python that is widely used for working with structured data. One of the common tasks when working with data is to clean and transform it in order to prepare it for analysis. Sometimes, the data might contain multiple columns that have similar information or are related to each other. In such cases, it might be useful to collapse these columns into a single column for easier analysis or visualization. Pandas provides several methods to collapse multiple columns into a single column. In this tutorial, we will explore these methods in detail and ... Read More

Circle of Squares using Python Turtle

Mukul Latiyan
Updated on 28-Sep-2023 14:40:32


The Circle of Squares is a fascinating geometric pattern that can be created using Python's turtle graphics library. This pattern consists of a circle of squares that are evenly spaced around its circumference, with each square rotated at an angle relative to the previous square. This creates a mesmerizing visual effect that can be customized to suit any color scheme or size. In this tutorial, we will explore how to create the Circle of Squares pattern using Python's turtle library, step by step. We will also discuss different customization options that can be applied to create unique variations of the ... Read More

Print numbers in the range 1 to n having bits in an alternate pattern

Divya Sahni
Updated on 28-Sep-2023 14:26:29


Alternate bit pattern implies the positioning of 0’s and 1’s in a number at an alternate position i.e. no two 0s or 1’s are together. For example, 10 in binary representation is (1010)2 which has an alternate bit pattern as 0’s and 1’s are separated by each other. Problem Statement Given an integer, N. Find all the integers in the range 1 to N where the bit pattern of the integer is alternating. Example 1 Input: 10 Output: 1, 2, 5, 10 Explanation $\mathrm{(1)_{10} = (1)_2, (2)_{10} = (10)_2, (5)_{10} = (101)_2, (10)_{10} = (1010)_2}$ Example 2 Input: ... Read More

Threema Alternatives

Shirjeel Yunus
Updated on 28-Sep-2023 14:19:39


What is Threema? Threema is a messenger and it also has the ability to secure your data from hackers. Governments, and corporations. It is an open-source app which can be used to make video and voice calls with end-to-end encryption. Web and desktop interfaces of the platform are available. You can also make arrangements for polls and have private chats Price Plans of Threema There are three price plans that Threema offers to its users. The price of each plan can be found in the table below − Plan Cost Essential $2 Professional ... Read More

Jacobsthal and Jacobsthal-Lucas Numbers

Divya Sahni
Updated on 28-Sep-2023 14:19:17


Jacobsthal Numbers Lucas sequence 𝑈𝑛(𝑃, 𝑄) where P = 1 and Q = -2 are called Jacobsthal numbers. The recurrence relation for Jacobsthal numbers is, $$\mathrm{𝐽_𝑛 = 0\: 𝑓𝑜𝑟 \: 𝑛 = 0}$$ $$\mathrm{𝐽_𝑛 = 1\: 𝑓𝑜𝑟 \: 𝑛 = 1}$$ $$\mathrm{𝐽_𝑛 = 𝐽_𝑛−1 + 2𝐽_{𝑛−2}\: 𝑓𝑜𝑟 \: 𝑛 > 1}$$ Following are the Jacobsthal numbers − 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, …. Jacobsthal-Lucas Numbers Complementary Lucas sequence $\mathrm{𝑉_𝑛(𝑃, 𝑄)}$ where P = 1 and Q = -2 are called JacobsthalLucas numbers. The recurrence relation for Jacobsthal-Lucas numbers is, $\mathrm{𝐽_𝑛}$ = ... Read More

Simkl Alternatives

Shirjeel Yunus
Updated on 28-Sep-2023 14:18:21


What is Simkl? Simkl is a mobile app which can be used to track the videos, and anime that you have watched and keep its history stored in a central location. The app has the ability to track everything automatically. The app can suggest new movies and shows on the basis of the content that you have already watched. The platform is available on the web browsers and also as a computer application and mobile app. It can also be used as a Chrome extension. The app also lets you know about the number of episodes left for the show ... Read More

phpMyAdmin Alternatives

Shirjeel Yunus
Updated on 28-Sep-2023 14:17:46


What is phpMyAdmin? phpMyAdmin is a software application which can be used to administer MySQL on the internet. The platform can be used to do a lot of things in MariaDB and MySQL. The operations include the management of databases and their parts like tables, columns, indexes, relations, permissions, users, and many more. The app can also be used to execute any SQL statement. A wide variety of documentation is also available and users are also allowed to update the wiki pages of the app. Why phpMyAdmin Alternatives? It supports only MariaDB and MySQL It is not ... Read More

Openverse Alternatives

Shirjeel Yunus
Updated on 28-Sep-2023 14:16:59


What is Openverse? Openverse is a platform that includes more than 600 million images and audio files. This is an open-source search engine which has the ability to index and reuse all licenses and public-domain media. Creative Commons released licenses which were used as a substitute for all rights reserved. These licenses gave an opportunity to the image creators to share their work on the basis of flexible terms and nothing would happen to their copyrights. Now the company has licenses for more than 2 billion works that consist of different media like audio, images videos, etc. Price Plans of ... Read More

1 2 3 4 5 ... 11332 Next