Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

How to Use add-remove CSS classes in jQuery?

So in this blog, we’re going to learn that Use add-remove CSS classes in jQuery?

So let’s go ahead and do that for first in index.html, with help of style.css & main.js and define-

Additional CSS classes can be added to an element via addClass() For instance, add the class .fancy-link to all anchor tags. Note that you *do not* add a dot in front of the class name here.

$(“a”).addClass(“fancy-link”);

You can also add multiple classes at once.

  $(“p:first”).addClass(“large emphasize”);

To attach a class based on the index of the element in your selected set of elements, you can use a callback function.

$(“li li”).addClass(function(index) {
// This adds classes .item-0, .item-1, … to the list’s sub-items.
$(this).addClass(“item-” + index);
});

You can even use two parameters for the callback function, the index and the current class of the element.

$(“div”).addClass(function(index, currentClasses) {
console.log(currentClasses); // String containing all classes

// Add .red-box if the current classes contain "dummy"
if (currentClasses.indexOf("dummy") !== -1) {
  return "red-box";
}

});

CSS classes in jQuery without js
 CSS classes in jQuery with js
Tagged : / / / / /

How do classes work in JavaScript?

Class

JavaScript classes, introduced in ECMAScript 2015 or ES 6, Classes are in fact “special functions”.
There are two ways to define a class in JavaScript using class keyword:-

  • Class Declaration
  • Class Expression

Class Declaration

Constructor

The constructor method is a special method for creating and initializing an object created within a class. There can be only one special method with the name “constructor” in a class.

Default Constructor

If you do not specify a constructor method a default constructor is used.

Parameterized Constructor

Class Expression

Class expressions can be named or unnamed.

Class Hoisting

Class Declarations and Class Expression are not hoisted. You first need to declare your class and then access it.

Inheritance

Class Inheritance

The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
The extended keyword can be used to subclass custom classes as well as built-in objects.

Class Inheritance

  • Inherit Built-in Object

– Date
– String
– Array

class myDate extends Date {
}

Super

Super ( ) is used to initialize parent class constructor. If there is a constructor present in a subclass,
it needs to first call super() before using “this”. A constructor can use the super keyword to call the
constructor of a parent class.

Method Overriding

Same function name with different implementation.

Parent ———————> show ( ) {return “Super Class”; }
Child ———————–> show ( ) {return “Sub Class”; } show ( ) {return “Super Class”; }

Static Method

The static keyword is used to define a static method for a class. Static methods are called without creating object and cannot be called through a class instance (object). Static methods are often used to create utility functions for an
application.

Tagged : / / / /

Potential SCM Problem Classes | SCM Potential considerations in an organization

potential-scm-problem-classes

When planning for SCM in your product development organization, you must first understand the classes of potential problems that can exist. Once the classes are understood, the inherent problems that are causing configuration management issues may be easily identified.
Potential SCM Problem Classes

  1. Multiple developer syndrome—When you have a project that requires more than one developer, there is the problem with multiple people working on one product base. This could be a test plan, requirements specification, or code. Effort is wasted when two or more people work on the same file and then save it. Without SCM control, the last person to save the file has those changes saved. All the other changes are lost. The simplistic method of locking a file while one person reads it prevents others from simultaneously working on the file.
  2. Multiple releases—Enhancements to the base product should result in additional releases of the product containing the latest changes. Once the second release is available, some users are on an earlier release. Having an SCM makes managing those releases possible. When bugs are reported, changes must be made across all impacted releases. As new features become available in the product, they must be made available to all current users, no matter what the release date.
  3. Product family—As products are built that offer the same capabilities across a heterogeneous set of hardware platforms, both the common and the platform-specific software bases must be managed. If a product operates on four versions of Windows, three versions of Unix, Red Hat Linux, and FreeBSD the user manual may be significantly the same. But there is a different installation process for all nine platforms. Without SCM, nine individual manuals must be written and maintained. With SCM, one documentation configuration item with nine versions will suffice, with the differences being only the installation procedure.
  4. Requirements change—The first law of systems engineering is that no matter where we are in the system life cycle, the system/software will change, and the desire to change it will persist throughout the life cycle. Dealing with this change represents a major management challenge. Having an SCM in place will ease the management of these changes to the requirements of the products that will occur. An SCM allows the easy identification of feature sets that group the requirements satisfied by a release or version of the product. These feature sets are tracked through development to delivery.
  5. Schedule change—As requirements change, so must the schedule. Mapping the feature sets for release to the schedule allows project managers to more accurately estimate the effort required for generating that next release. Having the SCM in place allows the project manager to look at historic effort levels in getting out releases. This is an enormous aid in estimating the “what if” scenarios that result from taking on new product users or providing customized solutions to other clients.
  6. Software changes—No product developer has the luxury to write code once and forget about it. Along with requirements and schedules, the software being developed changes in response to those other changes. Software is not static. That is its inherent power. It can be changed, so it will be changed. SCM systems track those changes so that, if the wrong change is made, a previous working version is available. This capability alone has saved enormous amounts of time as developers have tried out specific solutions that did not work in the product environment and were able to rapidly back up to a working version.
  7. Staff changes—In the best of organizations, people get promoted, take other jobs, and leave. When that happens in the midst of a development project, not just the technology knowledge goes out the door. The long-learned knowledge of how things are done is also gone. So when a replacement person is brought on board, they may know the technology, but without a documented SCM process, they will have no real idea how to do product development. SCM provides the framework and knowledge base of what has gone on before in the project. A new staff member has one place to go to understand the “how” of the organization’s development process and the “what” of the project to date.
  8. System/user documentation change—No product developer has the luxury to produce in a technology or tool vacuum. All product developers use hardware microcode, operating systems, tools, and documentation that are not under their control. When a major operating system change occurs (e.g., the next “best” release of Windows), an SCM will allow tracing all the CIs, components, and subcomponents that are impacted by that change. The change is isolated, and the amount of effort required to respond to the change can be estimated. This provides a responsible schedule for an upgrade based on situations beyond the organization’s control.

A template that may be used in the creation of a software configuration management plan (SCMP) appears in Appendix F, “Project Artifact Templates.” It includes management issues (organization, responsibility, etc.), SCM activities (configuration item identification, change control, status accounting, audit, and reviews), tools, techniques and methods, supplier control, and standards collection and retention.

SCM Staffing
On any given project, a few engineers or developers specialize in and become your SCM experts. While they are the gurus, everyone on your project will be a user of the product that they select, develop, and maintain. It is better to have a few highly experienced people than a large number of inexperienced people. These experienced few must be able to see congruence between software products and perceive what is missing from a software product.
We can group the characteristics and abilities needed by the four SCM functions: identification, control, auditing, and status accounting.

Identification

  1. Ability to see partitions
  2. Ability to see relationships
  3. Some technical ability
  4. System engineering orientation
  5. Programming

Control

  1. Ability to evaluate benefits versus cost
  2. System viewpoint (balance of technical/managerial, user/buyer/seller)
  3. An appreciation of what is involved in engineering a software change

Auditing

  1. Extreme attention to detail
  2. Ability to see congruence
  3. Ability to perceive what is missing
  4. Extensive experience with technical aspects of system engineering or software engineering

Status Accounting

  1. Ability to take notes and record data
  2. Ability to organize data
  3. Some technical familiarity
  4. System engineering orientation
  5. Programming

Once the staffing of the SCM function is complete and the overall organization’s SCM policy is established, the configuration control board (CCB) is identified. The CCB is the heart of the control function. It infuses sustained visibility into the process of change throughout the system life cycle and traceability into the process of change. The membership in the CCB is not limited to the developers or product line management. All stakeholders in the product must be represented. This includes the end-user usually represented by marketing, subcontractors used in the product development, product development funders, and the product developers. The CCB is the final decision maker as to what bug fixes, enhancements, and feature sets get included in the next product release.
The CCB has periodic meetings, with the results documented. These meetings can be done in a rapid fashion, and doing them online or via email is an adequate way to gain consensus and come to a decision. Important to status accounting is the documentation of CCB meeting minutes. The basic purpose of the minutes is to provide the CCB decision makers with the information needed to make intelligent, informed decisions. The amount of detail varies with the meeting frequency and technical content.

Tagged : / / / / / / / / / / / / / / / / / / /

What are the potential SCM problem Classes in the process?

scm-potential-problem-classes

When planning for SCM in your product development organization, you must first understand the classes of potential problems that can exist. Once the classes are understood, the inherent problems that are causing configuration management issues may be easily identified.
Potential SCM Problem Classes

  1. Multiple developer syndrome—When you have a project that requires more than one developer, there is the problem with multiple people working on one product base. This could be a test plan, requirements specification, or code. Effort is wasted when two or more people work on the same file and then save it. Without SCM control, the last person to save the file has those changes saved. All the other changes are lost. The simplistic method of locking a file while one person reads it prevents others from simultaneously working on the file.
  2. Multiple releases—Enhancements to the base product should result in additional releases of the product containing the latest changes. Once the second release is available, some users are on an earlier release. Having an SCM makes managing those releases possible. When bugs are reported, changes must be made across all impacted releases. As new features become available in the product, they must be made available to all current users, no matter what the release date.
  3. Product family—As products are built that offer the same capabilities across a heterogeneous set of hardware platforms, both the common and the platform-specific software bases must be managed. If a product operates on four versions of Windows, three versions of Unix, Red Hat Linux, and FreeBSD the user manual may be significantly the same. But there is a different installation process for all nine platforms. Without SCM, nine individual manuals must be written and maintained. With SCM, one documentation configuration item with nine versions will suffice, with the differences being only the installation procedure.
  4. Requirements change—The first law of systems engineering is that no matter where we are in the system life cycle, the system/software will change, and the desire to change it will persist throughout the life cycle. Dealing with this change represents a major management challenge. Having an SCM in place will ease the management of these changes to the requirements of the products that will occur. An SCM allows the easy identification of feature sets that group the requirements satisfied by a release or version of the product. These feature sets are tracked through development to delivery.
  5. Schedule change—As requirements change, so must the schedule. Mapping the feature sets for release to the schedule allows project managers to more accurately estimate the effort required for generating that next release. Having the SCM in place allows the project manager to look at historic effort levels in getting out releases. This is an enormous aid in estimating the “what if” scenarios that result from taking on new product users or providing customized solutions to other clients.
  6. Software changes—No product developer has the luxury to write code once and forget about it. Along with requirements and schedules, the software being developed changes in response to those other changes. Software is not static. That is its inherent power. It can be changed, so it will be changed. SCM systems track those changes so that, if the wrong change is made, a previous working version is available. This capability alone has saved enormous amounts of time as developers have tried out specific solutions that did not work in the product environment and were able to rapidly back up to a working version.
  7. Staff changes—In the best of organizations, people get promoted, take other jobs, and leave. When that happens in the midst of a development project, not just the technology knowledge goes out the door. The long-learned knowledge of how things are done is also gone. So when a replacement person is brought on board, they may know the technology, but without a documented SCM process, they will have no real idea how to do product development. SCM provides the framework and knowledge base of what has gone on before in the project. A new staff member has one place to go to understand the “how” of the organization’s development process and the “what” of the project to date.
  8. System/user documentation change—No product developer has the luxury to produce in a technology or tool vacuum. All product developers use hardware microcode, operating systems, tools, and documentation that are not under their control. When a major operating system change occurs (e.g., the next “best” release of Windows), an SCM will allow tracing all the CIs, components, and subcomponents that are impacted by that change. The change is isolated, and the amount of effort required to respond to the change can be estimated. This provides a responsible schedule for an upgrade based on situations beyond the organization’s control.

A template that may be used in the creation of a software configuration management plan (SCMP) appears in Appendix F, “Project Artifact Templates.” It includes management issues (organization, responsibility, etc.), SCM activities (configuration item identification, change control, status accounting, audit, and reviews), tools, techniques and methods, supplier control, and standards collection and retention.
SCM Staffing
On any given project, a few engineers or developers specialize in and become your SCM experts. While they are the gurus, everyone on your project will be a user of the product that they select, develop, and maintain. It is better to have a few highly experienced people than a large number of inexperienced people. These experienced few must be able to see congruence between software products and perceive what is missing from a software product.
We can group the characteristics and abilities needed by the four SCM functions: identification, control, auditing, and status accounting.

Identification

  1. Ability to see partitions
  2. Ability to see relationships
  3. Some technical ability
  4. System engineering orientation
  5. Programming

Control

  1. Ability to evaluate benefits versus cost
  2. System viewpoint (balance of technical/managerial, user/buyer/seller)
  3. An appreciation of what is involved in engineering a software change

Auditing

  1. Extreme attention to detail
  2. Ability to see congruence
  3. Ability to perceive what is missing
  4. Extensive experience with technical aspects of system engineering or software engineering

Status Accounting

  1. Ability to take notes and record data
  2. Ability to organize data
  3. Some technical familiarity
  4. System engineering orientation
  5. Programming

Once the staffing of the SCM function is complete and the overall organization’s SCM policy is established, the configuration control board (CCB) is identified. The CCB is the heart of the control function. It infuses sustained visibility into the process of change throughout the system life cycle and traceability into the process of change. The membership in the CCB is not limited to the developers or product line management. All stakeholders in the product must be represented. This includes the end-user usually represented by marketing, subcontractors used in the product development, product development funders, and the product developers. The CCB is the final decision maker as to what bug fixes, enhancements, and feature sets get included in the next product release.
The CCB has periodic meetings, with the results documented. These meetings can be done in a rapid fashion, and doing them online or via email is an adequate way to gain consensus and come to a decision. Important to status accounting is the documentation of CCB meeting minutes. The basic purpose of the minutes is to provide the CCB decision makers with the information needed to make intelligent, informed decisions. The amount of detail varies with the meeting frequency and technical content.

Tagged : / / / / / / / / / / / / / / / / / /