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
Articles by Alex Onsman
Page 3 of 15
What is the difference between height and line-height?
The height property defines the vertical measurement of an element's content area, while line-height controls the spacing between lines of text within that element. The height property sets the overall vertical size of a container, such as a div or paragraph. When content exceeds this height, it may overflow or be clipped depending on the overflow settings. The line-height property specifies the minimum height of line boxes within the element. It determines the vertical space between lines of text, affecting readability and visual spacing. Line-height can be specified in pixels, percentages, or as a unitless number (multiplier of ...
Read MoreOpen Source Databases
Open source databases have publicly available source code that anyone can view, study, or modify. They can be relational (SQL) or non-relational (NoSQL), and they significantly reduce database costs compared to proprietary solutions. Why Use Open Source Databases? Database licensing is a major software expense for companies. Open source databases offer a cost-effective alternative − free to use, with community support, and no vendor lock-in. Many also offer commercial support tiers for enterprise needs. Popular Open Source Databases Database Type Key Feature MySQL Relational (SQL) Most widely used open source DB; community ...
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 MoreUnique Key in RDBMS
A Unique Key is a constraint in RDBMS that ensures all values in a column (or set of columns) are distinct. Many users confuse Primary Key with Unique Key since both enforce uniqueness, but they differ in NULL handling, volume, and modifiability. The unique key constraint is essential for maintaining data integrity by preventing duplicate entries while providing more flexibility than primary keys. It's commonly used for columns like email addresses, phone numbers, or social security numbers where uniqueness is required but the field may not serve as the primary identifier. Primary Key vs Unique Key Feature ...
Read MoreEntity Integrity Rule in RDBMS
The Entity Integrity Rule in RDBMS states that every table must have a primary key, and the primary key column(s) cannot contain NULL values. This ensures that every row in a table is uniquely identifiable. Example 1: Student Table Consider the following Student table ? Student_ID (PK) Student_Name Student_Awards S001 Alice Gold Medal S002 Bob NULL S003 Charlie Silver Medal Here Student_ID is the primary key. We cannot use Student_Awards as the primary key since not every student would have received an award (it can be ...
Read MoreHow to disable right click using jQuery?
To disable right click on a page, use the jQuery bind() method. This prevents users from accessing the context menu that typically appears when right-clicking on web elements. Example You can try to run the following code to learn how to disable right click − $(document).ready(function(){ $(document).bind("contextmenu", function(e){ return false; ...
Read MoreHow to bind events on dynamically created elements using jQuery?
When working with dynamically created elements in jQuery, regular event binding methods like click() or on() directly on elements won't work because these elements don't exist in the DOM when the page loads. To solve this, you need to use event delegation by binding events to a parent element that exists at page load. The key is to use $(document).on(event, selector, handler) or bind to a specific parent container. This way, the event is attached to an existing element and will trigger when the specified selector matches any current or future child elements. Example Here's a complete ...
Read MoreHow to bind jQuery events within dynamic content returned via Ajax?
To bind jQuery events within dynamic content, use event delegation. Event delegation allows you to attach events to elements that don't exist yet in the DOM, which is essential when working with content loaded dynamically via Ajax. The key is to bind events to a parent element that already exists (like document) and specify the target selector as the second parameter. This way, when new elements are added dynamically, they will automatically respond to the events. Event Delegation Syntax Use the following syntax for event delegation − $(document).on('event', 'selector', function() { ...
Read MoreHow to handle when checkbox 'checked state' changed event in jQuery?
To handle the checkbox checked state, use the change event. It will check whether the checkbox is checked or not. The change event is triggered whenever the state of a checkbox changes from checked to unchecked or vice versa. You can use different jQuery methods to detect the checked state: .prop("checked") − Returns true/false (recommended method) .is(":checked") − Returns true/false .attr("checked") − Returns the attribute value Example You can try to run the following code to learn how to handle when checkbox checked state changed ...
Read MoreCan I wrap a JavaScript event in a jQuery event?
Yes, you can wrap a JavaScript event in a jQuery event. For wrapping, use the jQuery event object and the $.Event() constructor. This allows you to create a jQuery event wrapper around a native JavaScript event, giving you access to jQuery's event handling methods and properties. Example You can try to run the following code to wrap a JavaScript event in a jQuery event − $(document).ready(function(){ ...
Read More