Mukul Latiyan

Mukul Latiyan

363 Articles Published

Articles by Mukul Latiyan

363 articles

JavaScript Algorithms: Sorting, Searching, and Graph Traversal

Mukul Latiyan
Mukul Latiyan
Updated on 26-Dec-2024 797 Views

JavaScript is a versatile programming language widely used for web development. While it is known for its ability to enhance the interactivity of web pages, JavaScript also provides powerful algorithms for sorting, searching, and graph traversal. These algorithms are essential in solving complex problems efficiently. In this article, we will explore advanced JavaScript algorithms, including sorting algorithms like quicksort and mergesort, searching algorithms like binary search, and graph traversal algorithms like breadth-first search and depth-first search. Sorting Algorithms Sorting algorithms play a crucial role in organizing data in a specific order. JavaScript offers several efficient sorting algorithms, two of which ...

Read More

JavaScript Robotics: Controlling Hardware with Johnny-Five and Arduino

Mukul Latiyan
Mukul Latiyan
Updated on 09-Dec-2024 565 Views

JavaScript is no longer limited to web development; it has expanded into controlling hardware devices, thanks to frameworks like Johnny-Five. Johnny-Five is a powerful and user-friendly JavaScript robotics library that allows developers to interact with hardware components like LEDs, motors, sensors, and more using microcontrollers such as Arduino. What is Johnny-Five? Johnny-Five is a JavaScript robotics and IoT (Internet of Things) platform that allows you to control hardware devices using JavaScript. It provides a simple and intuitive API that abstracts the complexities of working with electronics, making it easier for developers to prototype and experiment with physical computing projects. Johnny-Five ...

Read More

How to check if a file exists in Golang?

Mukul Latiyan
Mukul Latiyan
Updated on 01-Nov-2023 43K+ Views

In order to check if a particular file exists inside a given directory in Golang, we can use the Stat() and the isNotExists() function that the os package of Go's standard library provides us with.The Stat() function is used to return the file info structure describing the file. Let's first use the Stat() function only and see whether it will be enough to detect the presence of a file in Go.Example 1Consider the code shown below.package main import(    "fmt"    "os" ) func main() {    if _, err := os.Stat("sample.txt"); err == nil {       fmt.Printf("File ...

Read More

How to create a symbolic link to a directory in Ubuntu?

Mukul Latiyan
Mukul Latiyan
Updated on 21-Oct-2023 35K+ Views

Linux provides us a way with which we can create symbolic links or symlinks, that issimply pointing to another file or folder on your machine. Now let's understand what symbolic links actually mean and how to make use of it. Symbolic links in simple terms mean advanced shortcuts. A symbolic link that you create will appear to be the same as the original file or folder which it is pointing to, even though it’s simply a link. For example, let’s say that you have a program that needs to store its files at /home/user/Downloads/.program. But you actually want to store ...

Read More

How to Concatenate Column Values in a Pandas DataFrame?

Mukul Latiyan
Mukul Latiyan
Updated on 28-Sep-2023 8K+ Views

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 pd.Series.str.cat() method. This method concatenates two ...

Read More

How to Collapse Multiple Columns in Python Pandas?

Mukul Latiyan
Mukul Latiyan
Updated on 28-Sep-2023 2K+ Views

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
Mukul Latiyan
Updated on 28-Sep-2023 3K+ Views

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

string.sub() function in Lua

Mukul Latiyan
Mukul Latiyan
Updated on 08-Sep-2023 81K+ Views

Another important function of the Lua’s string library is the string.sub() function. The string.sub() function is used to extract a piece of the string.The string.sub() function takes three arguments in general, the first argument being the name of the string from which we want to extract a piece, the second argument is the i-th index or say, the starting index of the string piece that we want, and the third and the last argument is the j-th index of the last index of the string piece we want.It should be noted that both the starting index and the ending index, ...

Read More

Classical NOT Logic Gates with Quantum Circuit using Qiskit in Python

Mukul Latiyan
Mukul Latiyan
Updated on 01-Sep-2023 579 Views

Quantum computing is an emerging field that utilizes the principles of quantum mechanics to perform computations more efficiently than classical computers. Qiskit, a powerful open-source framework, provides a user-friendly platform to develop and execute quantum programs in Python. In this tutorial, we will explore the concept of classical NOT logic gates implemented with quantum circuits using Qiskit. Classical NOT Logic Gate The classical NOT gate, also known as an inverter, is a fundamental logic gate that takes a single input and produces the logical complement of that input. In other words, if the input is 0, the output is 1, ...

Read More

Class Based vs Function Based Views in Django

Mukul Latiyan
Mukul Latiyan
Updated on 01-Sep-2023 2K+ Views

Django is a popular web framework for building complex and scalable web applications in Python. One of the key design principles of Django is the use of views to handle HTTP requests and generate responses. In Django, views can be implemented using either class-based views or function-based views. Both types of views offer their own set of advantages and disadvantages, and choosing the appropriate type of view for your application depends on your specific requirements and development style. Function-based views are the traditional way of implementing views in Django. These views are implemented as simple Python functions that take ...

Read More
Showing 1–10 of 363 articles
« Prev 1 2 3 4 5 37 Next »
Advertisements