Determine a Pangram String in JavaScript

AmitDiwan
Updated on 24-Feb-2021 16:11:26

3K+ Views

Pangram strings:A pangram is a string that contains every letter of the English alphabet.We are required to write a JavaScript function that takes in a string as the first and the only argument and determines whether that string is a pangram or not. For the purpose of this problem, we will take only lowercase alphabets into consideration.ExampleThe code for this will be − Live Democonst str = 'We promptly judged antique ivory buckles for the next prize'; const isPangram = (str = '') => {    str = str.toLowerCase();    const { length } = str;    const alphabets = 'abcdefghijklmnopqrstuvwxyz'; ... Read More

Calculate Weight of a String in JavaScript

AmitDiwan
Updated on 24-Feb-2021 16:09:53

854 Views

Weight of a character (alphabet):The weight of an English alphabet is nothing just its 1-based index.For example, the weight of 'c' is 3, 'k' is 11 and so on.We are required to write a JavaScript function that takes in a lowercase string and calculates and returns the weight of that string.ExampleThe code for this will be − Live Democonst str = 'this is a string'; const calculateWeight = (str = '') => {    str = str.toLowerCase();    const legend = 'abcdefghijklmnopqrstuvwxyz';    let weight = 0;    const { length: l } = str;    for(let i = 0; i ... Read More

Finding Minimum Deletions in String in JavaScript

AmitDiwan
Updated on 24-Feb-2021 16:06:56

184 Views

Suppose we have a binary string like this −const str = '001001';We are required to write a JavaScript function that takes in one such string as the first and the only argument.The function should then compute and return the number of minimum deletions required in the input so that no two adjacent numbers are the same.For example, for the above string, the output should be −const output = 2;because if we delete '0' at index 0 and 3, the new string will be '0101' which is the longest desired string.ExampleThe code for this will be − Live Democonst str = '001001'; ... Read More

2-Key Keyboard Problem in JavaScript

AmitDiwan
Updated on 24-Feb-2021 14:30:56

223 Views

Suppose the following situation −Initially on a notepad only one character 'A' is present. We can perform two operations on this notepad for each step −Copy All − We can copy all the characters present on the notepad (partial copy is not allowed).Paste − We can paste the characters which were copied last time.We are required to write a JavaScript function that takes in a number, let's call it num as the only argument. Our function is required to compute and return the minimum number of steps (copy all or paste) required to print 'A' num times.For example −If the input ... Read More

New Features in MySQL 8.0

AmitDiwan
Updated on 24-Feb-2021 13:41:41

861 Views

MySQL is a very powerful program in its own right. It handles a large subset of the functionality of the most expensive and powerful database packages. It uses a standard form of the well-known SQL data language. MySQL 8.0 released on 19 April 2018 and the current version is 8.0.23.The new features in MySQL 8.0 have been briefly listed below:Atomic DDLAn atomic data definition language (DDL) statement to combine updates made to data dictionary, storage engine operations and so on.Encryption DefaultsThe encryption defaults have been defined and implemented globally for table encryption.  The ‘default_table_encryption’ variable is used to define an ... Read More

Features Added in MySQL 8.0

AmitDiwan
Updated on 24-Feb-2021 12:43:40

281 Views

Let us understand the features that were added to MySQL 8.0Security Levels EnhancedThe security levels have been improved, and DBA (Database administrator) has been given greater flexibility for account management.Resource GroupsResource groups can be created and managed, and the server has the ability to assign threads to resources of specific groups, that are running within the server. Group attributes can be used to control the resources, restrict or provide permission to the threads to consume the resource, and so on.Transactional Data DictionaryA transactional data dictionary is used to store information about objects, which was previously a non-transactional table.Upgrade ProcedureThe upgrade ... Read More

Deprecated Features in MySQL 8.0

AmitDiwan
Updated on 24-Feb-2021 12:32:57

2K+ Views

Some of the features that have been deprecated may be removed in the upcoming versions of MySQL. If applications use the features that have been deprecated in that specific version, that feature should be revised and alternatives should be used wherever possible.Let us understand in brief, the features that have been deprecated in MySQL 8.0:The ‘utf8mb3’ character set is deprecated, use ‘utf8mb4’ instead.The ‘sha256_password’ password authentication is deprecated, may be removed in future updates. Use ‘caching_sha2_password’ instead.Some implementation changes have been made to ‘validate_password’ plugin, may be removed in future versions. Use this plugin by ensuring that component infrastructure is ... Read More

Features Removed in MySQL 8.0

AmitDiwan
Updated on 24-Feb-2021 12:17:35

690 Views

Some of the features have become obsolete and have been removed from MySQL 8.0. When alternatives to these removed items are shown, they need to be used to avoid further complications.The ‘innodb_locks_unsafe_for_binlog’ system variable has been removed.The ‘READ COMMITTED’ isolation level can be used since it behaves in a similar way.After upgrading the system to MySQL version 8.0.3 or later, scripts that reference previous InnoDB INFORMATION_SCHEMA view names have to be upgraded.Some of the account management attributes have been removed. A few have been listed below:Instead of using ‘GRANT’ to create users, use ‘CREATE USER’.The query cache has been removed.The deprecated ... Read More

Options and Variables Introduced in MySQL 8.0

AmitDiwan
Updated on 24-Feb-2021 12:10:15

214 Views

Some of the options and variables newly introduced in MySQL 8.0 have been listed below:Com_clone: It refers to the number of CLONE statements. It was added in MySQL 8.0.2.Com_create_role: It refers to the number of CREATE ROLE statements that are used. It was added in MySQL 8.0.0.Com_drop_role: It refers to the number of DROP ROLE statements that were used. It was added in MySQL 8.0.0.Com_restart: It refers to the number of RESTART statements that were used. It was added in MySQL 8.0.4.Firewall_access_denied: It refers to the number of statements that were rejected by MySQL Enterprise Firewall. It was added in ... Read More

Options and Variables Deprecated in MySQL 8.0

AmitDiwan
Updated on 24-Feb-2021 12:03:54

397 Views

Some of the options and variables that have been deprecated in MySQL 8.0 have been listed below:Compression: It tells whether the client connection uses compression in client/server protocol or not. It was deprecated since MySQL 8.0.18.expire_logs_days: It purges the binary logs after specific number of days. It was deprecated since MySQL 8.0.3.log_syslog: It determines whether to write error log to syslog. It was deprecated since MySQL 8.0.2.master-info-file: It helps determine the location and name of file that remembers the source and where the I/O replication thread is, in source's binary log. It was deprecated since MySQL 8.0.18.master_info_repository: It determines whether ... Read More

Advertisements