Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
MCA Articles
Page 85 of 95
How to Create a Shared Directory for All Users in Linux?
When multiple users need access to the same set of directories or files, we need to create shared folders in Linux. Linux uses users and groups with specific permission levels to enable secure data sharing. Below are the steps to create shared folders where multiple users can read and update files. Step 1: Create the Shared Directory First, create the directory that will be shared. The -p flag creates the directory and ignores errors if it already exists ? sudo mkdir -p /bigproject/sharedFolder Step 2: Create a User Group Create a user group ...
Read MoreHow to Count Word Occurrences in a Text File using Shell Script?
Linux shell scripting provides powerful tools to process text files and analyze their content. One common task is counting word occurrences in a file using pattern matching and counting commands. This article demonstrates several approaches to count specific words in text files. Sample Input File Let's create a sample file to demonstrate our examples ? cat inspire.txt Mastering anything needs practice. It also needs patience. And it needs time and other resources. Using grep and wc The grep command finds patterns in text, and when combined with wc, we can ...
Read MoreHow to Count Number of Files and Subdirectories inside a Given Linux Directory?
When working with Linux systems, it's essential to know how to count files and subdirectories within a given directory. Python provides several ways to accomplish this task, from using the os module to leveraging the pathlib library for more modern approaches. Using os.walk() for Recursive Counting The os.walk() function recursively traverses directories and provides separate counts for files and subdirectories ? import os def count_files_and_dirs(directory): file_count = 0 dir_count = 0 for root, dirs, files in os.walk(directory): ...
Read MoreCreate Shortcuts to Long and Complicated Paths in Linux (Gogo)
Gogo is a tool to bookmark directories with long and complicated paths in the Unix shell. Because the long paths are difficult to remember and cumbersome to type in, gogo provides a simple way to create shortcuts. In this article we'll see how to install gogo and use it. Installing Git We first need to have git installed in our system which will be needed for gogo installation. To install git in an Ubuntu system follow the below command ? $ sudo apt install git Running the above code gives us the following result ...
Read MoreImplicit Threading and Language-based threads
Implicit threading is a programming approach where the creation and management of threads is handled by compilers and run-time libraries rather than application developers. This approach simplifies multithreaded programming by abstracting away low-level thread management details. Syntax #pragma omp parallel { // Parallel code block } OpenMP for Implicit Threading OpenMP is a widely-used implicit threading library for C, C++, and FORTRAN. It provides compiler directives and an API for parallel programming in shared-memory environments. OpenMP identifies parallel regions as blocks of code that can execute in parallel − ...
Read MoreWindows thread API in the C program
Threads are created in the Windows API using the CreateThread() function. Just as in Pthreads, a set of attributes like security information, the size of the stack, and a flag for the thread is passed to this function. In the below program, we use the default values for these attributes. Once the summation thread is created, the parent must wait for it to complete before outputting the value of Sum, as the value is set by the summation thread. Using the WaitForSingleObject() function, we perform the equivalent of pthread_join() in the Windows API, which causes the creating thread to ...
Read MoreMathematical Logical Terms and Definitions
Tautologies A Tautology is a formula which is always true for every value of its propositional variables. Example − Prove [ (A → B) ∧ A ] → B is a tautology The truth table is as follows − A B A → B (A → B) ∧ A [ (A → B) ∧ A ] → B True True True True True True False False False True False True True False True False False True False True As we can see every value ...
Read MoreExamples of E-R model
The ER (Entity-Relationship) model represents real-life scenarios as entities. The properties of these entities are their attributes, and their connections are shown as relationships. ER models help visualize how data is structured in a database system. Hospital ER Model This ER model has three entities − Patient, Doctor, and Tests ? Patient ID (PK), Name Age, Visit_date Doctor ID (PK), Name Specialization Tests ...
Read MoreExtended Entity-Relationship (EE-R) Model
The Extended Entity-Relationship (EE-R) Model is a high-level data model that incorporates extensions to the original ER model to represent complex database requirements. In addition to basic ER concepts, EE-R includes − Subclasses and Super classes Specialization and Generalization Category or Union type Aggregation Subclasses and Super Class A super class contains common attributes shared by all its subtypes. Sub classes are groups of entities with unique attributes that inherit properties from the super class ? Shape ...
Read MoreEntity Relationship Participation in Database
In a relationship, the Participation Constraint specifies the existence of an entity when it is related to another entity. It is also called the minimum cardinality constraint and specifies the number of instances of an entity that can participate in a relationship type. There are two types − Total Participation and Partial Participation. Total Participation In total participation, each entity in the entity set must be involved in at least one relationship instance. No entity can exist without participating in the relationship. This is also known as mandatory participation. Example − Consider two entities Employee and Department related via the ...
Read More