Is there any key shortcut for fast forward in video.js hotkeys plugin?

I want to set fast forward shortcut for my player. I found this shortcuts in hotkeys plugin
Space bar toggles play/pause.
Right and Left Arrow keys seek the video forwards and back.
Up and Down Arrow keys increase and decrease the volume.
M key toggles mute/unmute.
F key toggles fullscreen off and on. (Does not work in Internet Explorer, it seems to be a limitation where scripts cannot request fullscreen without a mouse click)
Double-clicking with the mouse toggles fullscreen off and on.
Number keys from 0-9 skip to a percentage of the video. 0 is 0% and 9 is 90%.

Is there any key for fast-forwarding?

channel.send is not a function – Discord.js issue

I’m trying to send a message to a specific channel on discord, however it tells me that channel.send is not a function. I’ve entered the correct channel id though, what could be the issue ? Here’s my function code and a snapshot :

function discordsend(usern)
{ 
    usern="someusername#1234"
    string = "somethingsomething"+usern;
    const channel = 
client.channels.cache.get('946932969359179786')||client.channels.fetch('946932969359179786');
    channel.send(string);
}

enter image description here

Openstreetmap API: Latitude/Longitude

In the end, I need Latitude/Longitude coordinates. On a webpage, I need a zoomable map, preferably with a cross in the center, and an OK button. The user moves and zooms the map, and then clicks the OK button, which gives the page (JavaScript) the lat-long coordinates of the current center of the map.

Also, a type-in field on the map would be nice, so the user can get to the area more easily.

Could someone please point me to the right direction? I’m completely new to this field.

Openstreetmap is preferred, but Google Maps can be arranged, if necessary.

Thank you in advance.

Extend RegExp to CSS4 Color

I’m working on updating the TinyColor RegExp and I recently added angles and percent based alpha into the mix to be able to compute CSS4 Module color strings.

Please have a look at the following sample snippet:

const ANGLES = 'deg|rad|grad|turn';
const CSS_INTEGER = '[-\+]?\d+%?';
const CSS_NUMBER = '[-\+]?\d*\.\d+%?';
const CSS_ANGLES = `[-\+]?\d*\.?\d+(?:${ANGLES})?`;

const CSS_UNIT = `(?:${CSS_NUMBER})|(?:${CSS_INTEGER})`;
const CSS_UNIT2 = `${CSS_UNIT}|(?:${CSS_ANGLES})`;

const PERMISSIVE_MATCH3 = `[\s|\(]+(${CSS_UNIT2})[,|\s]+(${CSS_UNIT})[,|\s]+(${CSS_UNIT})\s*\)?`;
const PERMISSIVE_MATCH4 = `[\s|\(]+(${CSS_UNIT2})[,|\s]+(${CSS_UNIT})[,|\s]+(${CSS_UNIT})[,|\s|\/]+(${CSS_UNIT})\s*\)?`;

const matchers = {
  hsl: new RegExp(`[hsl|hsla]+(?:${PERMISSIVE_MATCH4})`),
  hsl2: new RegExp(`[hsl|hsla]+(?:${PERMISSIVE_MATCH4})|(?:${PERMISSIVE_MATCH3})`),
  hsl3: new RegExp(`[hsl|hsla]+(?:${PERMISSIVE_MATCH3})|(?:${PERMISSIVE_MATCH4})`),
};

console.log('hsl - null', matchers.hsl.exec('hsl(120, 100%, 50%)'));
console.log('hsl - correct', matchers.hsl.exec('hsla(120, 100%, 50%, 0.5)'));
console.log('hsl - null', matchers.hsl.exec('hsl(120deg 100% 50%)'));
console.log('hsl - correct', matchers.hsl.exec('hsl(120deg 100% 50% 50%)'));

console.log('hsl2 - wrong indexes', matchers.hsl2.exec('hsl(120, 100%, 50%)'));
console.log('hsl2 - correct', matchers.hsl2.exec('hsla(120, 100%, 50%, 0.5)'));
console.log('hsl2 - wrong indexes', matchers.hsl2.exec('hsl(120deg 100% 50%)'));
console.log('hsl2 - correct', matchers.hsl2.exec('hsl(120deg 100% 50% 50%)')); // returns correct

console.log('hsl3 - correct', matchers.hsl3.exec('hsl(120, 100%, 50%)'));
console.log('hsl3 - incomplete', matchers.hsl3.exec('hsla(120, 100%, 50%, 0.5)'));
console.log('hsl3 - correct', matchers.hsl3.exec('hsl(120deg 100% 50%)'));
console.log('hsl3 - incomplete', matchers.hsl3.exec('hsl(120deg 100% 50% 50%)'));

I need to change PERMISSIVE_MATCH4 to work will matchers.hsl in all variations and return the matches in the same order and format:

output = [
'hsl(120deg 100% 50% 50%)', // the input capture
'120deg', // HUE first value
'100%', // SATURATION second value
'50%', // LIGHTNESS third value
'50%', // ALPHA last and OPTIONAL value
 // ... other matches results
]

I’m open to suggestions and I thank you for any reply.

set arrow with tooltip of matTooltip angular material

in angular material it provide matTooltip attribute to show tooltip . i want to show arrow with tooltip pointing towards overflow text. but tooltip position is dynamic based on target element position in corners , top or bottom based on that appending arrow in tooltip design as per tooltip position is difficult , i applied bellow solution but works only if i open tooltip at specified position top, bottom , left or right

.mat-tooltip::before {
      content     : '';
      display     : block;
      position    : absolute;
      bottom      : 100%;
      border-style: solid;
      border-color: transparent transparent #3E464E transparent;
      border-width: 12px;
      left        : calc(50% - 12px);
}  


<div class="title-ellips"
   matTooltipClass="custom-tooltip"
   matTooltip="{{exam | examColumnValue: column}}"
  *ngIf="((exam[column]) && ((exam | examColumnValue: column).toString().length>=30))"
   placement="top" data-container="body" tooltipClass="customTableTooltip">
  {{exam | examColumnValue: column}}
</div>

How can I use modify and use ‘$and’ in a search query when some items are null?

I need help tweaking the code for this:

const posts = await PostMessage.find({ $or: [ { title }, { tags: { $in: tags.split(',') } } ]});

At the moment, you can filter for posts using a search form which has title and posts. You can leave one empty when you search. It works fine except when you use both. For example searching “hiking” and tagging “Europe” would show posts for both hiking titles AND Europe tags (when I would want the search narrowed down to only show posts with the title hiking and tagged Europe). I know that I can use $and in place of $or but that only returns posts if the user enters both title and tags when I want to give the user the option to leave one blank. Can someone help me write out the code for that?

From what I’ve seen I was wondering if I could do something like this:

Or: {
(And: title not null, tags not null )
(Or title null, tags not null)
(Or title not null, tags null)
)

Is this possible to do? I can’t find a similar example. Thanks for the help!

Node.js installation was successful but, while running a test file it is showing a error . please help to fix this

This is the error while I’m running from Node.js Command prompt

This is the error while I’m running from power shell or CMD

This is the code file

Code:

var http = require('https');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World!');
}).listen(8080);

Error:

asd.js : The term 'asd.js' is not recognized as the name of a cmdlet, function, script file, 
or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and 
try again.
At line:1 char:1
+ asd.js
+ ~~~~~~
+ Category Info          : ObjectNotFound: (asd.js:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

WebSpeechAPI to run on browser

i’m working as a software developer trainee in an organisation and
i’m trying to achieve a webspeechApi code which can access browser..
suppose if i say ‘open facebook’ the browser should open facebook.
i’ve tried using annyang but i dont wanna add any external libraries because of
security reasons

                                <script>
                                    var message = document.querySelector('#message');

                                    var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;
                                    var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList;

                                    var grammar = '#JSGF V1.0;'

                                    var recognition = new SpeechRecognition();
                                    var speechRecognitionList = new SpeechGrammarList();
                                    speechRecognitionList.addFromString(grammar, 1);
                                    recognition.grammars = speechRecognitionList;
                                    recognition.lang = 'en-US';
                                    recognition.interimResults = false;

                                    recognition.onresult = function(event) {
                                        var last = event.results.length - 1;
                                    
                                    
                                        
                                    var commands = {

                                            'open facebook' : open,
                                            
                                            }
                                            
                                            function openfacebook(){
                                            alert('opening facebook')
                                            console.log('open facebook');
                                            location.href = 'https://www.facebook.com/';
                                            
                                            }
                                    
                                    };

                                    recognition.onspeechend = function() {
                                        recognition.stop();
                                    };

                                    recognition.onerror = function(event) {
                                        message.textContent = 'Error occurred in recognition: ' + event.error;
                                    }        

                                    document.querySelector('#btnGiveCommand').addEventListener('click', function(){
                                        recognition.start();

                                    });


                                </script>

laravel-mix production build failed

I have an issue with the production build of my app, the dev build is working fine, but when I run the production build it fails with the following error

cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js

CssSyntaxError: /css/app.css:39524:3: Unknown word
    at Input.error (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/input.js:128:16)
    at Parser.unknownWord (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/parser.js:561:22)
    at Parser.decl (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/parser.js:233:16)
    at Parser.other (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/parser.js:164:12)
    at Parser.parse (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/parser.js:75:16)
    at parse (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/parse.js:17:12)
    at new LazyResult (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/lazy-result.js:64:16)
    at Processor.<anonymous> (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/processor.js:142:12)
    at Processor.process (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/processor.js:121:23)
    at Function.creator.process (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/postcss/lib/postcss.js:148:43)
    at OptimizeCssAssetsWebpackPlugin.processCss (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/optimize-css-assets-webpack-plugin/src/index.js:73:21)
    at Object.processor (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/optimize-css-assets-webpack-plugin/src/index.js:13:18)
    at /Users/vladimirgatev/Sites/localhost/SP6/node_modules/last-call-webpack-plugin/src/index.js:150:10
    at arrayEach (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/lodash/_arrayEach.js:15:9)
    at forEach (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/lodash/forEach.js:38:10)
    at OptimizeCssAssetsWebpackPlugin.process (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/last-call-webpack-plugin/src/index.js:147:5)
    at /Users/vladimirgatev/Sites/localhost/SP6/node_modules/last-call-webpack-plugin/src/index.js:178:28
    at _next0 (eval at create (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:17)
    at eval (eval at create (/Users/vladimirgatev/Sites/localhost/SP6/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

I noticed that there is a javascript at the end of the app.css

/* (ignored) *//* (ignored) *//* (ignored) *//* (ignored) *//* (ignored) *//* (ignored) */var map = {
    "./Products": [
        "./frontend/src/views/apps/orders/orders-add/templates/Products.vue",
        2,
        9,
        17
    ],
    "./Products.vue": [
        "./frontend/src/views/apps/orders/orders-add/templates/Products.vue",
        2,
        9,
        17
    ],
    "./Shops": [
        "./frontend/src/views/apps/orders/orders-add/templates/Shops.vue",
        7
    ],
    "./Shops.vue": [
        "./frontend/src/views/apps/orders/orders-add/templates/Shops.vue",
        7
    ],
    "./Stage": [
        "./frontend/src/views/apps/orders/orders-add/templates/Stage.vue",
        2,
        4,
        3,
        5,
        10,
        16
    ],
    "./Stage.vue": [
        "./frontend/src/views/apps/orders/orders-add/templates/Stage.vue",
        2,
        4,
        3,
        5,
        10,
        16
    ]
};
function webpackAsyncContext(req) {
    if(!__webpack_require__.o(map, req)) {
        return Promise.resolve().then(function() {
            var e = new Error("Cannot find module '" + req + "'");
            e.code = 'MODULE_NOT_FOUND';
            throw e;
        });
    }

    var ids = map[req], id = ids[0];
    return Promise.all(ids.slice(1).map(__webpack_require__.e)).then(function() {
        return __webpack_require__(id);
    });
}
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
    return Object.keys(map);
};
webpackAsyncContext.id = "./frontend/src/views/apps/orders/orders-add/templates lazy recursive ^\.\/.*$";
module.exports = webpackAsyncContext;

I think it is something related to dynamic imports of modules, but I do not know how to fix that.

laravel-mix version 5.0.1
webpack version: 4.46.0

Having an Issue with Typescript in VueJS with setProperty

Still trying to get my head around typescript so please forgive me but my searches have yielded me no answers. All my other types have worked well but I just can’t figure out how to get the value in style.setProperty(propertyName, value) to accept the number.

    function setRotation(vari: HTMLElement , rotationRatio: number) {
      vari.style.setProperty('--rotation', rotationRatio * 360);
    }

TypeScript Error–Argument of type ‘number’ is not assignable to parameter of type ‘string | null’

Is it possible to upload a file to IPFS without first storing it locally using AJAX

I have JS and PHP scripts that uploads a file to Pinata (IPFS) and it all works fine but I first need to upload the file to my web server then it can be uploaded to IPFS. This is not a good solution for large files because I need to wait for 2 uploads to happen before I get the returned CID.

Is it possible to upload directly to Pinata without first uploading to my server? Ultimately im going to setup my own Arweave node in the future but am currently using a paid account on Pinata.

i am trying to get the style of an element from html and trying to print on console

i am trying to get the style of an element from html and trying to print on console. I cant see style option while typing the style property in visual code. its keep showing the error
Uncaught TypeError: Cannot read properties of null (reading ‘style’)
in javascript var element; element = document.querySelector(“#header”).style.backgroudColor; console.log(element);

<!DOCTYPE html>
<html>

  <head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>Page Title</title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <link rel='stylesheet' type='text/css' media='screen' href='all.css'>
    <script src="javascript_code.js"></script>
  </head>

  <body>
    <div id="header" class="heading" style="background-color: red;">
      <h1>this is header</h1>
      <h1>this is header2</h1>
    </div>
    <script src="javascript_code.js"></script>
  </body>

  </html>

How to render a string which has both HTML and Latex in it in React Js?

This is the string “<table border=”1″ cellpadding=”1″ cellspacing=”1″ style=”width:400px;”>rntrnttrnttt<td rowspan=”3″>An algebraic expression with rntttonly one termrntttMonomialrnttrnttrnttttwo unlike termsrntttBinomialrnttrnttrntttthree unlike termsrntttTrinomialrnttrntrnrnrn

An expression <span class=”mathImg mathquill-rendered-math”>4x^2+4 has  <select name=”first” required=”required”><option value=””>Select<option value=”3″>1<option selected=”selected” value=”2″>2<option value=”4″>3 terms.  So, it is a  <select name=”second” required=”required”><option value=””>Select<option value=”1″>Monomial<option selected=”selected” value=”Binomial”>Binomial<option value=”2″>Trinomial expression.

rnrn

An expression <span class=”mathImg mathquill-rendered-math”>-frac{7}{9}a^2-4b+3 has <select name=”fourth” required=”required”><option value=””>Select<option value=”1″>1<option value=”2″>2<option selected=”selected” value=”3″>3 terms.  So it is a  <select name=”third” required=”required”><option value=””>Select<option value=”1″>Monomial<option value=”2″>Binomial<option selected=”selected” value=”Trinomial”>Trinomial expression.

rn” which I need to render in ReactJs.The expression frac{7}{9}a^2-4b+3 in the above string needs to be rendered as Latex.

Converting json response to Array Variable [duplicate]

i am trying to show data from events.json file to my website. my code is showing data in console.log but how can i store it in variable to resue it, on the website.

events.json file data:

[
{
      "id": "d8jai72s",
      "name": "Vacations",
      "description": "TEST",
       "date": "March/16/2022",
      "type": "vacation"
     
    }
]

Code to show response in console:

$(document).ready(function() {
fetch("events.json")
.then(response => {
   return response.json();
})
.then(jsondata => console.log(jsondata));

enter image description here

i want to use this response here in same .js file:

    $("#demoEvoCalendar").evoCalendar({
        format: "MM dd, yyyy",
        titleFormat: "MM",

        calendarEvents: [{
          

> // i want place response data in calendarEvents here with other events.

      id: "d8jai72s",
      name: "Vacations",
      description: "Winter Vacation Starts (All Classes)",
       date: ["January/01/2022", "January/13/2022"],
      type: "vacation",
      everyYear: 0
    }
]
});