Programming Leftovers
-
Recv() Function in C Language
The C language offers several possibilities and the use of different functions for sending and receiving the data over a socket. Each of them provides a different property or constraint. However, the “socket.h” header defines the recv() function which is specifically designed to read the socket files and provides options for receiving the mode, waiting, etc., making it most suitable for use in connections.
In this Linux Hint article, you will learn how to use the recv() function. One of the two functions are used to send and receive the data over a socket in the C language.
We will look at the syntax of this function and its theoretical description of how it works, the input and output arguments, and the data type that is accepted by each of them.
-
Quick Sort in C++
Arranging things in sequence is a task that we perform in daily life, whether it is arranged in ascending order or descending order. The process of arranging things in a proper sequence is called sorting. Ascending is increasing order and descending is decreasing order. In programming, we also perform the sorting using different algorithms. But one algorithm provides the quickest sorting which is “Quick Sort”. This sorting algorithm sorts the array faster than the other algorithms. It works on the divide and conquers rule, first sets a pivot point, and divides the array into two sub-arrays. Then, set a pivot for sub-arrays and the process goes on until we reach the end and the required array is sorted. This article explains an in-depth working of a quick sort in C++ with a practical coding example in ascending order.
-
Initialize struct in C++
In programming, we frequently encounter circumstances where we want to store a collection of data, whether they are of relevant or irrelevant datatypes. In C++, we already know about arrays, which are used to hold collections of information of relevant datatypes in adjacent memory addresses. But in structures, we can store the user-defined datatypes, they can be different datatypes or can be relevant datatypes. Structures carry a group of variables that have different datatypes but under one identifier which is “struct”. The “struct” is the reserved keyword in C++ language and a short form of structures that are used to develop the structures in the program. Let us just examine the syntax of Structures to gain a better understanding of the idea of structures and how we’re going to initialize them inside the C++ programming language.
-
Integer Division in C++
Today, we use one of the datatypes of C++ programming language which is the int datatype, also known as integers. Through this, we will do the division operation in C++ language. As we know, the division is one of the basic methods of mathematics. We do division operations in mathematics so that we can partition a large group into smaller subgroups so that each group can get the same amount of items. In this tutorial, let us just explore more in-depth mathematical technique called division and see how we implement it in C++ programming language.
-
How To Use ASCII in C++
Today, we’ll talk about ASCII and how to utilize it in the C++ language for programming. ASCII stands for “American Standard Code for Information Interchange” and is a standardized information encoding technique that is used for communication between humans and computers electronically. Computers cannot understand the language of humans that is why to work with characters, numbers, punctuation, and other computer-related characters there are already predefined numeric values called ASCII values. Let us just explore how ASCII characters behave and how we may retrieve the value of any computer-related type of character inside the coding language C++ so that we can fully comprehend the notion of ASCII in the field of computer science.
-
How to Pass a Filename as Argument in a Shell Script
The shell programming languages can be used for a variety of tasks like conducting operations and doing repetitive tasks for the automotive industry. We may execute our commands, applications, and shell scripts in a shell environment. You provide input and the program is then executed using that input. A program’s output is shown when it has completed running. How to provide a file name as input to a shell script is addressed in this article. To accomplish this, a script must be created using the “#!/bin/bash” shell. Now, we’ll see how to do this step-by-step.
-
What Is Cat EOF in Bash Script
CAT is a command of Bash in the Linux operating system. CAT is the abbreviation of concentrate. In the Linux operating system, the cat command is used to display the file, read a file, or concentrate the content of the file as the name explains. It takes a file, reads its content or data, and then outputs the content of the files. It also helps us with the creation of files. This command comes with many options that help us to perform the actions with the file according to our needs.
-
How to Write the Bash If-Else Statement in One Line
The open and improved Bourne shell variant that is offered with the Linux and GNU computer systems is called Bash. Identical to the original, Bash also supports the command-line editing as an addition. The if-else statements are essentially statements that are used to make decisions, and they are quite beneficial. If the given condition is true, the provided if statement is printed. If it is false, the else statement is printed. We can utilize an if-else statement in one line in Bash. Before writing the script, we must add the Bash shell on Linux to run the Bash scripts.
-
Data Science Applications in Banking - Data Science Tutorials
Data Science Applications in Banking, Companies require data in order to gain insights and make data-driven decisions.
Data science is a requirement for providing better services to customers and developing strategies for various banking operations.
Furthermore, banks require data in order to expand their operations and attract new customers.
-
Memoirs from the old web: The GateKeeper access control system
It would have been around 2001. The term “AJAX” would not be invented until 2005. Lots of people had their own Geocities page, the typical instance of which was horrific yet in retrospect somehow wonderful. Dynamic web applications were server driven, with any use of JavaScript being only as a minor seasoning on the client side. Previously these applications had often been via Perl and CGI, but now PHP was rising in popularity. Plenty of Perl and PHP-based web forums abounded, forming the centres of little communities run by enterprising individuals. The phrase “dynamic HTML” (DHTML) was used to describe doing interesting and dynamic things by using JavaScript to manipulate HTML live, like making animated menus — a term which has now been long forgotten. Websites such as dynamicdrive.com (2004 archive copy) provided an archive of such scripts uploaded by various people.
At the same time, plenty of people didn't have access to a PHP host and were stuck with static web hosting, which was often free. This kind of free host would usually automatically inject advertising into their user's web pages. From time to time, a user of such a web host would want to create a password protected area of their website. Since doing this securely ordinarily would require some kind of server validation of the password, occasionally you would see people hack it by checking the password in (possibly mildly obfuscated) client side JavaScript. Of course, this was completely insecure.