highlight the word at content

  // highlitingall but getting error at ist plural

// highlightContent(content, keywords) {
// console.log(content);
// const regexPattern = keywords
// .map(keyword => {
// const escapedKeyword = keyword.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
// return `\\b${escapedKeyword}(?:(?:'s|s\\b|'\\bs)\\b(?!\\s*[a-z]))?`;
// })
// .join('|');
// const regex = new RegExp(regexPattern, 'gi');
// const highlightedContent = content.replace(regex, match => `<span class="highlight">${match}</span>`);
// console.log(highlightedContent);
// return highlightedContent;
// },
// return `\\b${escapedKeyword}\\b`;
highlightContent(content, keywords) {
const regexPattern = keywords
.map(keyword => {
const escapedKeyword = keyword.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&');
return `\\b${escapedKeyword}(?:(?:'s|'\\bs)\\b(?!\\s*[a-z]))?`;
})
.join('|');
const regex = new RegExp(regexPattern, 'gi');
const highlightedContent = content.replace(regex, match => `<span class="highlight">${match}</span>`);
return highlightedContent;
},

interview questions

 difference between api route and web route


what is the use of config

what ithe use of composer


improve database query speed how to improve


test cases in laravel


what use of trait

hoisting in javascript


how many way to create a object


 return content.replace(

        new RegExp(keywords.join("|"), "gi"),

        (match) => {

          return '<span class="highlightText">' + match + "</span>";

        }

      );

install vue

  2015 node -v

2016 cd ~
2017 curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh
2018 nano /tmp/nodesource_setup.sh
2019 sudo bash /tmp/nodesource_setup.sh
2020 sudo apt install nodejs
2021 node -v
2022 nvm install v14.10.0
2023 node -v
2024 cd www
2025 cd ma-dash-ui/
2026 history


npm -v
node -v
sudo apt-get remove nodejs
sudo apt update
sudo apt install nodejs
nvm install v14.10.0
npm install vue@2.6.10
vue --version
vue create ma-dash-ui
pick a project version 2
npm run serve



# npm version
npm -v

### node version
node -v

### To upgrade node js version to some other version
sudo apt-get remove nodejs

### update
sudo apt update

### install node js
sudo apt install nodejs

### install required version
nvm install v14.10.0

### install vuejs
npm install vue@2.6.10

### vue version
vue --version

### create vue template
vue create ma-dash-ui
pick a project version 2

### run the vue
npm run serve



ERROR: for web Cannot start service web: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/pc/www/ma-dash-ui/nginx/default.conf" to rootfs at "/etc/nginx/conf.d/default.conf": mount /home/pc/www/ma-dash-ui/nginx/default.conf:/etc/nginx/conf.d/default.conf (via /proc/self/fd/6), fl Starting node ... error



  • The file /home/pc/www/ma-dash-ui/nginx/default.conf does not exist.

remove write protected nginx



chmod +w nginx.conf




ERROR: for node Cannot start service node: driver failed programming external connectivity on endpoint node (895cbd89a968bb1e7a5c0 Starting web ... done ERROR: for node Cannot start service node: driver failed programming external connectivity on endpoint node (895cbd89a968bb1e7a5c01621b816eeca00d7489440e281c432f4fd33cc6fd4f): Error starting userland proxy: listen tcp4 0.0.0.0:8080: bind: address already in use ERROR: Encountered errors while bringing up the project.



netstat -an | grep 8080

sudo lsof -i:80





docker-compose up -d ./dock node npm run serve

s

 

Vue.js / Frontend Developer - Bhumika

Description

 | Must Have - 
 
 Professional experience in software development in the frontend development area [min. 3-5 years] 
 
 Good knowledge of multi-tier and cloud-based architectures (Microsoft Azure, Azure DevOps, AWS) 
 
 Extensive experience frontend development: VueJS, Java based Frontend Frameworks (Apache Struts, Java Server Faces), Typescript, HTML5, CSS, JS  
 
 Good Understanding of Rest based development and backend development, experience, and willingness to work in Backend Development (Java) is an advantage 
 
 Understanding in databases (SQL/ NoSQL) 
 
 Knowledge of common software development tools (Sonar, Git, Confluence, JIRA/Azure Devops) 
 
 Experience in writing Unit test cases(eg. Jest framework/ react) 
 
 Methodical knowledge of agile software development (Scrum, Kanban, DevOps) 
 
 Excellent ability to work in a team, independently organized work 
 
 Willingness to work in shifts 
 
 Willingness to work On-Call Duty 
 
 Good to have domain knowledge -how in the automotive area 
 
 Strong micro-service architecture knowledge 
 
 DevOps-Toolchain (Git, Jenkins, Nexus…) 
 
 Understands high-level architectural design and patterns 
 
 Aid in planning product development and timelines 
 
 Provide feedback to marketing or sales teams 
 
 Leading the team in translating user stories and other requirements into clear and focused implementation plans 
 
  Work closely with other project team members (engineers, designers and project managers) 
 
 Deliver high-quality outputs at all stages of development, from documentation to code 
 
 Communicate clearly with both clients and colleagues 

duplicate values from table in sql

 SELECT column_name, COUNT(column_name) AS count

FROM table_name GROUP BY column_name HAVING COUNT(column_name) > 1;

composer json file laravel

 composer have the pacakages requied to run our application

packages has special features which it give special things to our appication


composer install


it will install all the pacakges and dependencies

composer update

it will update the depenencies by locking the version in package


it has autoloader-> 

based on the apckages install-. it generates some autoload files

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"barryvdh/laravel-cors": "^0.11.3",
"barryvdh/laravel-dompdf": "^0.8.5",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.8.*",
"laravel/passport": "^7.3",
"laravel/tinker": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0",
"maatwebsite/excel": "^3.1",
"phpoffice/phpspreadsheet": "^1.10",
"spatie/laravel-permission": "^2.37"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Cmp\\": "process/cmp",
"Moderation\\": "process/moderation",
"ProfileModeration\\":"process/profile-moderation",
"Escalation\\":"process/escalation",
"CommentModeration\\":"process/comment-moderation",
"AdvertisementModeration\\":"process/advertisement-moderation",
"ImageModeration\\":"process/image-moderation",
"TextModeration\\": "process/text-moderation",
"MediaAnalysis\\": "process/media-analysis",
"Crawler\\": "process/crawler",
"PrintImports\\": "process/print-imports",
"ReviewClipping\\": "process/review-clipping"

},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}

how to create trait and whats the benefits and use

 create folder trait

Trait nameoftrait{

}


class MyClass {

    use MyTrait;

    

    // Class methods and properties

}




multiple inheritance
use controller -> single inheritance
traits multiple inheritance
reusable of code
duplication of code removes


Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...