How to convert this “PROMPT” code to take input from an “IFRAME/POPUP” instead?

How to convert this “PROMPT” code to take input from an “IFRAME/POPUP” instead?
SEMrush

This is the js code:


u= prompt(" Enter a http:// image path ");
if( u.substring(0,3)=="htt" ){
text= "(image)" + u.trim() + "(/image)";
}
//update main webpage here using "text"

Code (markup):

Instead of asking user to type a URL of image, I was thinking of showing them a webpage, either in iframe or in popup, where they can select an image from a dropbox.
That will be much easier than typing URL…
I’ll make the webpage, no problem there.

Problem is how to hault the javascript code until the iframe or popup returns the selected image?
Until an “ok” button is pressed in the iframe or popup window, the “if” block in above code is not executed.

In above code, the javascript execution is stopped automatically till “ok” button is clicked in the “prompt” box.

 

HDMI to USB converter. Connect HDMI laptop output to USB (type C) input portable monitor

I have a portable monitor (Lenovo ThinkVision M14) which only accept USB Type C as input. My laptop is Asus Zenbook 14 and does not any USB which support display. The laptop have one HDMI output. Is there any chance I can connect the monitor to my laptop for extending screen?

Thanks in advance.

Submitting to SP List, Input string was not in correct format error JavaScript

I am getting the error, “Input list was not in correct format error”

My sharepoint list has single text fields so i cannot see the problem

function savingsdatick(varid) {
//Get Current Tabs before submission
var allTicksForSave = {};
$(“.thischeck”).each(function () {
allTicksForSave($(this).attr(“id”)) = $(this).is(“:Checked”)
});
console.log(“So…”)
console.log(allTicksForSave)

var Tickbox1 = “Tickbox1”;
var Tickbox2 = “Tickbox2”;
var Tickbox3 = “Tickbox3”;
var Tickbox4 = “Tickbox4”;
var Tickbox5 = “Tickbox5”;
var Tickbox6 = “Tickbox6”;
var Tickbox7 = “Tickbox7”;
var Tickbox8 = “Tickbox8”;
var Tickbox9 = “Tickbox9”;
var Tickbox10 = “Tickbox10”
var Tickbox11 = “Tickbox11”;
var Tickbox12 = “Tickbox12”;
var Tickbox13 = “Tickbox13”;
var Tickbox14 = “Tickbox14”;
var Tickbox15 = “Tickbox15”;
var Tickbox16 = “Tickbox16”;
var Tickbox17 = “Tickbox17”;
var Tickbox18 = “Tickbox18”;
var Tickbox19 = “Tickbox19”;
var Tickbox20 = “Tickbox20”;
var Tickbox21 = “Tickbox21”;
var Tickbox22 = “Tickbox22”;
var Tickbox23 = “Tickbox23”;
var Tickbox24 = “Tickbox24”;
var Tickbox25 = “Tickbox25”;
var Tickbox26 = “Tickbox26”;
var Tickbox27 = “Tickbox27”;
var Tickbox28 = “Tickbox28”;
var Tickbox29 = “Tickbox29”;
var Tickbox30 = “Tickbox30”;

  var varid = localStorage.getItem("projectnewTitle");
  var currentStorm = document.getElementById("dale3").innerHTML;
  var siteUrl = _spPageContextInfo.webServerRelativeUrl;
  var clientContext =  SP.ClientContext.get_current();
  var oList = clientContext.get_web().get_lists().getByTitle('SecurityDesignAssuranceLeft');
  this.oListItem = oList.getItemById(currentStorm)
    if(allTicksForSave.SDALEFTBOX0) oListItem.set_item('Tickbox1', 'True');
    if(allTicksForSave.SDALEFTBOX1) oListItem.set_item('Tickbox2', 'True');
    // if(allTicksForSave.SDALEFTBOX2) oListItem.set_item(Tickbox3, "True")
    // if(allTicksForSave.SDALEFTBOX3) oListItem.set_item(Tickbox4, "True")
    // if(allTicksForSave.SDALEFTBOX4) oListItem.set_item(Tickbox5, "True")
    // if(allTicksForSave.SDALEFTBOX5) oListItem.set_item(Tickbox6, "True")
    // if(allTicksForSave.SDALEFTBOX6) oListItem.set_item(Tickbox7, "True")
    // if(allTicksForSave.SDALEFTBOX7) oListItem.set_item(Tickbox8, "True")
    // if(allTicksForSave.SDALEFTBOX8) oListItem.set_item(Tickbox9, "True")
    // if(allTicksForSave.SDALEFTBOX9) oListItem.set_item(Tickbox10, "True")
    // if(allTicksForSave.SDALEFTBOX10) oListItem.set_item(Tickbox11, "True")
    oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded4), Function.createDelegate(this, this.onQueryFailed4));
function onQuerySucceeded4() {
alert("Hi")

}

function onQueryFailed4(sender, args) {
alert(“Failed” + args.get_message())
}
}

google sheets – Using REGEXMATCH with list input

I’m trying to see if a COL A contains anything from a specified list.

I’m currently doing it this slow, insane way. Is there a better way?

=if(REGEXMATCH(I20,"SOUTHERN"),1,0) + if(REGEXMATCH(I20,"GLASS"),1,0) + if(REGEXMATCH(I20,"HOME"),1,0) + if(REGEXMATCH(I20,"JOHN"),1,0) + if(REGEXMATCH(I20,"ENTERPRISE"),1,0) + if(REGEXMATCH(I20,"BRITISH A"),1,0) + if(REGEXMATCH(I20,"WSELECTRICAL"),1,0) + if(REGEXMATCH(I20,"VIKING"),1,0) + if(REGEXMATCH(I20,"TASCHEN"),1,0) + if(REGEXMATCH(I20,"FRANCY"),1,0) + if(REGEXMATCH(I20,"MODELSHOP"),1,0) + if(REGEXMATCH(I20,"APPLE"),1,0) + if(REGEXMATCH(I20,"CURRYS"),1,0) + if(REGEXMATCH(I20,"WATFORD"),1,0) + if(REGEXMATCH(I20,"WICKES"),1,0) + if(REGEXMATCH(I20,"LEYLAND"),1,0) + if(REGEXMATCH(I20,"IKEA"),1,0)

enter image description here

Godot: How to get mouse button input for a Tilemap for Cellular Automata

Conway’s Game of Life

I have been working with a tilemap for the implementation of a cellular automata game. My current method for getting mouse button input is using an Area2D as a child of the Tilemap and detecting mouse button input like that.

I have done this and have since been wondering if there is something built in that I can use for this. I have looked into it and cannot find anything better.

Is there something built-in to Node2Ds or Canvas Items that I can use.

H4N connected to MacBook always results in input of 48 kHz

When my H4N is connected to MacBook pro it always results in input of 48 kHz, whereas on the device is 41hz I have to manually set it in the Midi each time to 41.

h

any way to stop this?

javascript – Do I have to declare placeholder on my reusable input in React with typescript?

I’m creating a React components library with Typescript and have a question. Do I have to declare every single input properties in type/interface when creating a reusable component?

I have an input field created with styled components like this:

import React from 'react';

import { StyledInput } from './styles';

interface Props {
  type?: 'text' | 'password' | 'number' | 'tel' | 'time';
  name: string;
}

const Input: React.FC<Props> = ({ type = 'text', name, ...rest }) => {
  return <StyledInput type={type} name={name} {...rest} />;
};

export default Input;

I’m trying to use this with placeholder, for example. Typescript throws this error:

Type '{ name: string; placeholder: string; }' is not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'.
Property 'placeholder' does not exist on type 'IntrinsicAttributes & Props & { children?: ReactNode; }'.ts(2322)

As placeholder is intrinsic Input property, I thought it was resolved when I spread props {...rest}. Input doesn’t already knows that placeholder is a string prop? Or onChange is a function, or onFocus?

Let me know if this question doesn’t make any sense.

Cheers!

turing machines – A reduction from $HP$ to ${(langle M rangle, langle k rangle) : text{M visits in at list $k$ states for any input}}$

I tried to define the next reduction from $HP$ to ${(langle M rangle, langle k rangle) : text{M visits in at list $k$ states for any input}}$.

Given a couple $(langle Mrangle , langle xrangle)$ we define $M_x$ such that for any input $y$, $M_x$ simulates $M$ on the input $x$. We denote $Q_M +c$ the number of states needed for the simulation of $M$ on $x$, and define more special states for $M_x$ $q_1′,q_2′,…,q_{Q_M + c+ 1}’$ when $q’_{Q_M +c+1}$ is defined as the only final state of $M_x$. Now, in case $M_x$ simulation of $M$ on $x$ halts (i.e $M$ reach one of its finite state) $M_x$ move to $q_1’$ and then continue to walk through all the special states till it reaches $q_{Q_M + c + 1}$.

We define the reduction $(langle M rangle , langle x rangle) longrightarrow (langle M_x rangle , langle Q_M +c+1 rangle)$

In case $((langle M rangle , langle x rangle) in HP$ then for any input $y$ , $M_x$ walks through all the special states and thus visits in at least $Q_m + c+ 1$ steps. Otherwise, $M$ doesn’t stop on $x$ so $M_x$ doesn’t visit any special state, thus visits at most $Q_M +c$ states (the states needed for the simulation).

Is it correct? If you have other ideas or suggestions please let me know.

laravel – Keeping the input request as JSON

My application need to post data to external endpoint and getting the response. But that external endpoint disable cross origin so I can’t make the request directly from front-end JS but have to make it from the back-end laravel.

My question is if I post the JSON body data from my JS front-end to my back-end laravel, How to keep it as JSON? So the laravel can POST that JSON data to external endpoint with Guzzle.

mobile – What element to focus after user input on a chatbot?

This is similar to What element should have the focus after a search?, but not the same case.

I’m building a chatbot with Flutter (mobile). This is the flow:

  1. Bot asks a question.
  2. User is presented with several fixed options (like radio buttons)
  3. User chooses one of them
  4. String equivalent answer is added to the chat log
  5. Options disappear, since they made sense only for question in point 1
  6. Bot asks new question
  7. User is presented with new options.

I want to make this accessible. I’ve taken a look at role log and it fits great. I’m using a similar equivalent in Flutter and it handles new messages perfectly. The problem is that, since options disappear with each answer, focus disappears too: when the user “tabs” to the next element, focus goes back to the top of the app, and she’d need to scroll back all the list of messages (or find her way with an equivalent but also suboptimal manner) to get to the end, every time.

I can force the focus moving to the last message, but that would clash with the message reading, since that won’t be “polite” (ARIA sense).

For now, I’m not using the aria-live feature (so the app doesn’t read new messages) and I’m moving the focus manually, only after the user submits the info and only to the first unread message. It works, but I find that solution kind of hacky.

What should be the best way to handle this?