Found 34489 Articles for Programming

Display all the Sundays of a given year using Pandas in Python

Naveen Singh
Updated on 31-Jul-2023 11:21:22

222 Views

Pandas is a powerful Python library for data manipulation and analysis. One of the key features of Pandas is its ability to handle date and time data effectively. In this article, we will show you how to use Pandas to display all the Sundays of a given year. In this article, we will explore how to use Pandas, a popular data manipulation library in Python, to display all the Sundays of a given year. We will go through the step-by-step process to extract the Sundays of a year and display them in a readable format. Prerequisites Before we start, make ... Read More

Display all the dates for a particular month using NumPy

Naveen Singh
Updated on 31-Jul-2023 11:16:46

62 Views

NumPy is a powerful library in Python for scientific computing, particularly for dealing with arrays and matrices. One of the lesser-known features of NumPy is its ability to generate arrays of dates. In this article, we will explore how to use NumPy to display all the dates for a particular month. Installation Before we start, let's make sure that NumPy is installed on our system. You can install it using pip by running the following command in your terminal or command prompt − pip install numpy Now that we have NumPy installed, let's start by importing it − import ... Read More

Article on Dispatch Decorator in Python

Naveen Singh
Updated on 31-Jul-2023 11:14:52

939 Views

In Python, the @dispatch decorator is used to overload functions with different signatures. This is a common pattern in object-oriented programming where multiple methods can have the same name, but different parameters or argument types. The @dispatch decorator allows you to write a single function with multiple implementations that will be chosen at runtime based on the arguments passed to the function. In Python, decorators are a powerful and widely used feature of the language. They allow you to modify or enhance the behaviour of functions, classes, or modules without changing their source code. One such decorator is the Dispatch ... Read More

How to Log Errors and Warnings into a File in PHP

Naveen Singh
Updated on 28-Jul-2023 21:43:02

259 Views

PHP (Hypertext Preprocessor) is a widely-used open-source scripting language primarily designed for web development. It is embedded within HTML code and executed on the server-side, enabling the creation of dynamic web pages and applications. PHP provides developers with a range of features and functionalities, including database connectivity, file handling, form processing, session management, and more. Its simplicity, versatility, and broad support make it a popular choice for developing websites and web applications. PHP code is typically written within tags, allowing seamless integration with HTML and other scripting languages. With its extensive documentation, large community, and numerous frameworks ... Read More

How to Pass PHP Variables by Reference

Naveen Singh
Updated on 28-Jul-2023 21:52:02

576 Views

In PHP, you can pass variables by reference instead of by value using the ampersand (&) symbol. This allows you to modify the original variable within a function or method. There are primarily two ways to pass PHP variables by reference: Using the ampersand in the function/method declaration Using the ampersand when passing the variable to a function/method Using the Ampersand in the Function/Method Declaration In PHP, you can pass variables by reference using the ampersand symbol (&) in the ... Read More

How to put String in Array, Split by New Line in PHP

Naveen Singh
Updated on 31-Jul-2023 11:25:29

731 Views

What is PHP? PHP, which stands for Hypertext Preprocessor, is a popular server-side scripting language used for web development. It is designed to create dynamic and interactive web pages. PHP is embedded within HTML code and executed on the server, generating HTML output that is sent to the client's browser. With its simple and easy-to-learn syntax, PHP allows developers to build dynamic websites, handle form data, interact with databases, and perform various server-side tasks. It has a vast ecosystem of libraries and frameworks that enhance its functionality and enable developers to create robust and scalable web applications. PHP is widely ... Read More

How to get the Last n Characters of a PHP String

Naveen Singh
Updated on 31-Jul-2023 11:07:45

6K+ Views

What is PHP? PHP (Hypertext Preprocessor) is a widely used server-side scripting language for web development. It allows developers to embed code within HTML files, enabling the creation of dynamic web pages and interactions with databases. PHP is known for its simplicity, versatility, and extensive integration capabilities with popular databases. It offers a broad range of extensions and has a large community of developers, ensuring ample resources and support. PHP is commonly employed in content management systems and e-commerce platforms, providing essential tools for handling data, processing user input, and generating dynamic website content. How to get the ... Read More

How To Get Multiple Selected Values Of Select Box In PHP

Naveen Singh
Updated on 28-Jul-2023 21:40:56

5K+ Views

What Is PHP ? PHP is a popular server-side scripting language primarily used for web development. It stands for Hypertext Preprocessor, and it is known for its simplicity, versatility, and wide community support. PHP allows developers to embed code within HTML files, enabling dynamic content generation and interaction with databases. With its extensive set of built-in functions and libraries, PHP offers a range of capabilities, such as handling forms, managing sessions, processing files, and interacting with various protocols. It is compatible with multiple operating systems and web servers, making it a versatile choice for creating dynamic and interactive websites ... Read More

Check if there exists a permutation of given string which does not contain any monotonous substring

Naveen Singh
Updated on 31-Jul-2023 14:56:56

133 Views

A monotonous substring is a contiguous substring of given string containing characters whose values are all strictly increasing or strictly decreasing. A monotonous substring is a string sequence that either strictly increases or strictly decreases in value. Method Dynamic Programming Backtracking Method 1: Dynamic Programming One technique is to apply dynamic programming to construct table of sub problems, here each item (i, j) in table denotes whether there exists a permutation of the substring S[i...j] that does not contain any monotonous substring. When i=j, the substring comprises only one character and is hence trivially monotonous. ... Read More

Split a binary string into K subsets minimizing sum of products of occurrences of 0 and 1

Naveen Singh
Updated on 31-Jul-2023 14:04:28

88 Views

A binary string is made up of a succession of binary numbers, also known as bits, that are either 0 or 1. It is a method of encoding data that uses only two numbers for computer applications where data is stored and processed using electronic circuits that can only recognise two states. In computer programming, binary strings are frequently used to represent data in way that is simple for electronic circuits to handle, such as numbers, text, and images. Method Method 1. Dynamic Programming Method 2. Greedy Approach Method 1: Dynamic Programming To tackle this difficulty, we can employ ... Read More

Advertisements