Jay Shaw
howto · 2025-03-04
How to Connect to PostgreSQL Database Using Python
This article presents a detailed explanation of how PostgreSQL is created, creation of databases using pgAdmin, and using Python to connect to those databases. All the concepts are provided in easy to learn manner, with images and outputs wherever necessary.
howto · 2025-03-04
How to Fit Poisson Distribution to Different Datasets in Python
This article explains three different methods to fit Poisson distribution to Poisson datasets. The first example uses a dummy dataset to fit the Poisson Distribution, whereas in the second example the dataset used is a highly dispersed one, and then it is explained how to fit the Poisson distribution to this highly dispersed data using a negative binomial.
howto · 2024-02-12
How to Throw Exceptions With Message in C++
The article examines C++ methods for throwing informative exceptions, offering developers effective tools to enhance error reporting in their code.
howto · 2024-02-02
How to Plot Confusion Matrix in Python
This article discusses how we can plot a confusion matrix in Python. We use the matplotlib module, Seaborn module, and pretty confusion matrix module in Python.
howto · 2024-02-02
How to Decode Base-64 Data in Python
This article explains the concept of Base64 and decoding, presented step-by-step along with its functional codes and practical examples, including image decoding.
howto · 2024-02-02
How to Create Pipelines in Python
This article mainly focuses on how pipelines in Python are created for sklearn datasets and custom datasets.
howto · 2024-02-02
How to Extract Elements From a Database Using fetchall() in Python
This article explains the implementation of the fetchall() method in Python. The program creates a cursor for the database and handles exceptions for errors. The output derived gives a list of elements from a specific table provided in the query.
howto · 2024-02-02
How to Implement Timeout in Python Requests
Different examples of timeout using modules requests and eventlet is demonstrated in this article. The reader will learn how to implement a timeout, giving read and connect timeouts separately and using a third-party library.
howto · 2024-02-02
How to Convert to SHA256 in C++
This article focuses on the concept of hashing and the SHA256 algorithm. It includes a detailed explanation of the SHA256 algorithm along with code snippets in C++ to make understanding easier. At the end of the article, the whole C++ program is provided.
howto · 2024-02-02
How to Create REST Client in Java
This article explains the utility of a Java Rest client and how it can be created in simple ways using light weight and efficient frameworks.
howto · 2024-02-02
How to Implement Multiple Decorators in Python
This article focuses on the concept of multiple decorators. The reader will learn the basics of decorators, how it is created and implemented, and how to chain it with other decorators on a function.
howto · 2024-02-02
How to Generate Random Values by Dice Roll in C++
This article explains how random numbers can be generated using the time factor method and arbitrary number method that imitate dice roll in C++. Learn how it works and what disadvantages it contains. A C++ program is provided to demonstrate a pseudo number generator.
howto · 2024-02-02
How to Create a Lookup Table in C++
This article focuses on explaining how look up tables are created and its uses in different scenarios. Three code examples are provided to make understanding easier, with code snippets to understand the code in detailed manner.
howto · 2024-02-02
How to Fix ImportError: No Module Named Sklearn in Python
This article presents a working solution to the problem of ImportError with sklearn. Two different methods are explained here to install sklearn - one with pip and another with conda. Along with it, ways to easily install Python is also provided.
howto · 2024-02-02
How to Solve the ValueError: I/O Operation on Closed File in Python
This article provides three major examples of how the I/O Valueerror is caused and what are the various ways through which this error can be solved.
howto · 2024-02-02
How to Solve Error - Python.h: No Such File or Directory in C++
This article explains the steps involved in installing Python through a custom installation, installing Visual Studio, linking the include and libs folder from the Python directory to Visual Studio. Lastly, a program is compiled to display that the error is solved.
howto · 2024-02-02
How to Read Environment Variables From Env File in Python
This article provides two methods to import environment variables into Python codes. The first read variables directly from a local environment file, whereas the other uses a shell script to automate the process.
howto · 2024-02-02
How to Custom Search Engine Using Google API in Python
This article explains how to create a custom search engine and get an API key. Two methods are given to get the API key, one activated and another inactive. Two program examples demonstrate how to implement the CSE and API key in Python.
howto · 2024-02-02
How to Lock a File in Python
This article explains why locking a file in Python is important. This discusses examples of what happens when two processes interact with a shared resource without a lock, why knowing the file state is important before placing a lock, and some widely used lockers.
howto · 2024-02-02
How to Set User Agent Using Requests in Python
This article explains concepts like HTTP headers, getting user agent data, and setting user agent using requests. Every section is provided with an appropriate Python program to aid in understanding the concepts.
howto · 2024-02-02
How to Ignore SSL Security Certificate Check in Python Requests
This article explains issues regarding expired SSL certificates, and how to resolve them. It explains two major ways to disable the security checks, which are either monkey patching the system library requests or using another library package urllib3 to disable them.
howto · 2024-02-02
How to Create Temporary File in Python
This article explains four sub-functions of the tempfile library function: TemporaryFile, NamedTemporaryFile, mkstemp, and TemporaryDirectory. Appropriate programs are provided in each section to ease the understanding of the concepts.
howto · 2024-02-02
How to Read and Write to Parquet Files in Python
The article explains reading and writing parquet files in Python using two interfaces: pyarrow and fastparquet. Relevant coding examples are provided for sub-sections like reading tables and multiple and single columns.
howto · 2024-02-02
How to Run Python in Java Using Jython
This article covers a detailed explanation of how to use Jython to create java programs that support python codes. The article covers all prerequisites like downloading Jython, linking it with an IDE, and writing the java program that can read python codes. Three distinct python codes are prepared that are tested inside Java program and the output is documented.
howto · 2024-02-02
How to Find the Last Day of the Month Using Python
This article uses four distinct libraries, two inbuilt - Calendar and DateTime, and two third-party - Arrow and Pandas to find the last day of a given month. The article provides various examples explaining the same and decoding the logic behind each example.
howto · 2024-02-02
How to Find Value of Polynomial Using Horner's Rule in C++
This article explains how to implement the Horner's rule in C++. The first two examples explain finding the value of a polynomial by using `for` loops, running forward and backward respectively. The third example uses recursion to implement the Horner's Rule.
howto · 2024-02-02
How to Create Python Script to Open a New Terminal and Run Commands in Linux
This article focuses on the various method to open a new terminal and pass Linux command by creating a Python script. The first example uses a variable to save the command that needs to get passed. The second example explains how to add a sleep timer to a new terminal and how to keep it alive. In a subsequent example, a safer method to pass Linux commands to a new terminal using subprocess() is explained.
howto · 2024-02-02
How to Implement the realpath() Function in C++
This article explains how to use the realpath() function in C++. The first example explains the implementation through creating a program inside a text file and compiling it in Linux. The second example demonstrates implementing the realpath() function through a single-line Linux command.
howto · 2024-02-02
How to Validate Numbers Using Luhn Algorithm in Python
This article explains the concept of validation numbers using the luhn algorithm in Python. The article has three examples, the first one is a pure procedural program using lists and slicing operators to implement the luhn algorithm. The second algorithm uses just loops to implement the luhn algorithm. The third example uses a functional program to implement the luhn algorithm in Python.
howto · 2023-12-11
Package Managers for C++
This article explains how to download and install c++ package managers - vcpkg and bpt. This article also covers configuring these packages and compiling C++ codes in them.
howto · 2023-10-18
Collatz Sequence in Python
This article provides four examples to create a Python program that displays the collatz sequence. The first program is a simple demonstration, while the second and third approach improves time complexity of the code. The fourth one calculates number of iterations as well.
howto · 2023-10-12
Arithmetic Operations on Fractions Using Constructor in C++
This article shows the working principles of fractions using constructors in C++. The program explained here uses constructors and few member methods to pass value among each other and provide the final result to the user.
howto · 2023-10-12
Undefined Value in Java
This article focuses on the concept of undefined in Java, and includes elements like its definition, purpose, code, similarity with null, and some real world examples.
howto · 2023-10-12
Linked List Using Templates in C++
This article explains the various steps involved in creating a linked list in C++ using templates. The working program demonstrates a linked list that uses templates to escape the need to declare a datatype whenever a new variable is created.
howto · 2023-10-12
Function Pointer to Member Function in C++
This article provides an explanation on how function pointer to member functions are implemented in C++. Examples are provided to explain which method pointers can be implemented in a program.
howto · 2023-10-12
Rule of Three in C++
This article explains in detail about the law of big three and its significances. The reader will get to know about the two types of copying technique and errors which arise when pointers are copied.
howto · 2023-10-12
C++ Factory Method
This article provides a detailed explanation on factories and their implementation in C++. Three programs have been provided in this article that explains the correct implementation of factories with each program providing a new concept on implementation
howto · 2023-10-12
Dereferencing Pointer to Incomplete Type Error in C
This article explains concepts like referencing and dereferencing of pointers, what are incomplete types, and how they can be completed, solving the error of dereferencing to incomplete types, and understanding different errors that arise with different compilers.
howto · 2023-10-12
using vs typedef in C++
This article provides an explanation on how keywords, using and typedef are implemented in C++. Four examples provided here, which explains all the case scenarios through which using and typedef are used inside a program.
howto · 2023-10-10
Solved: Overflow Encountered in Double_Scalars in Python
This article provides multiple code examples to show how an overflow warning arises and how to go about with it. The article also covers the numpy data types and their ranges. At the end of the article, few other overflow examples are also provided to clear the concept of overflows neatly.
howto · 2023-10-10
Monkey Patching in Python
This article explains what monkey patching is and how it can be implemented in Python. It has two sections; the first demonstrates monkey patching in functions, and the second displays how it can be implemented in unit testing of files.
howto · 2023-10-10
Data Class Inheritance in Python
This article explains concepts like the data class, inheritance, multi-level inheritance, default and non-default attributes. Adequate coding examples are provided to grasp concepts as it unfolds during compilation.
howto · 2023-10-10
Regex Wildcards Using the Re Module in Python
This article explains three concepts - wildcards, implementation of re.sub() function, and using the wildcards with re.sub() function to search patterns and perform operations on regex statements. Wildcards are symbols called quantifiers which are explained in detail and an appropriate program with it to make the concepts clear. In the last section, a Python program searches pattern in regex statement and replaces the entire word.