Typescript: Unknown address type. Byte length is not 36

I am running a script and I see the following error that the address type is unknown. I am new to typescript so if there is any information needed about Address type let me know:

yarn ts-node manage/deploy-sandbox.ts
yarn run v1.22.19
$ /Users/apple/proj/tonstart/node_modules/.bin/ts-node manage/deploy-sandbox.ts
/Users/apple/proj/tonstart/node_modules/ton/dist/address/Address.js:17
    throw new Error('Unknown address type: byte length is not equal to 36');
          ^
Error: Unknown address type: byte length is not equal to 36
    at parseFriendlyAddress    (/Users/apple/proj/tonstart/node_modules/ton/dist/address/Address.js:17:15)

deploy-sandbox.ts:

import { Cell, contractAddress, StateInit, toNano, beginCell, Address } from  'ton';
import { readFileSync } from 'fs';
import qs from 'qs';
import qrcode from 'qrcode-terminal';

// Create a data cell similar to the initial contract state
const dataCell = beginCell()
.storeUint(0, 32)                        // counter
.storeAddress(Address.parse('/* YOUR ADDRESS */'))
.endCell();

// Load code from build
const codeCell = Cell.fromBoc(readFileSync('./build/hello-world.boc'))[0];

// Calculate address from code & data
const address = contractAddress({
    workchain: 0,
    initialCode: codeCell,
    initialData: dataCell
});

// Prepare init message
const initCell = new Cell();
new StateInit({
code: codeCell,
data: dataCell,
}).writeTo(initCell);

// Encode link to deploy contract
let link = 'https://test.tonhub.com/transfer/' + address.toFriendly({ testOnly: true }) + '?' + qs.stringify({
text: 'Deploy contract',
amount: toNano(1).toString(10),
init: initCell.toBoc({ idx: false }).toString('base64')
});
console.log('Address: ' + address.toFriendly({ testOnly: true }));
qrcode.generate(link, { small: true }, (code) => {
 console.log(code)
});

I was expecting the script to execute. I just tried running it that’s all.

How to decode the request from frontend?

I get the following payload (part of payload I had pasted below):

images%5B2bbe51ff-27ee-4a71-bfeb-97ceaf8a6698.png%5D=iVBORw0KGgoAAAANSUhEUgAAAhIAAAISCAIAAAAWX7HoAAEAAElEQVR4nOz9Wa%2BuWZIehkWs8Z2%2Bec97nzHnyszqGrq7eh5oUSJpWRDJC8uSDBge4QvCEATYhATD8IUHyIZgygQow5RlUxQsAYRINt0DWxTJ6upmdVVX1pBz5pnP2fP%2B5ndeQ4Qv8qSB%2BgG%2Bq7jZt%2FvBelc8EU88sT6An8XP4mfxs%2FhZ%2FCx%2BFj%2BLn8XP4mfxs%2Fj%2FR%2BAXf%2F7m%2F%2B5%2F7OdLlYUdPeU8TQ0ioBQQZV4UnEj2LB2Zm%2Fa0vG

There should be the base64 encoded images. How I can decode it?
Fast API Form(…) or File(…) give me 422 Unprocessable Entity

getting SetTimeout is not a Function Error in javascript

Here is my JS Code:

buttonColours = ["red", "blue", "green", "yellow"];
gamePattern = [];
userClickedPattern = [];


$(".btn").click(function(){
  var userChosenColour = $(this).attr("id");
  userClickedPattern.push(userChosenColour);
  animatePress(userChosenColour);
  playSound(userChosenColour);
})



function nextSequence(){
    randomNumber = Math.floor( (Math.random() * 4) );
    randomChosenColour = buttonColours[randomNumber];

    gamePattern.push(randomChosenColour);
    console.log(gamePattern);
    playSound(randomChosenColour);

}



function playSound(name){
  $("#" + name).click(function(){
      let buttonAudio = new Audio("sounds/" + name + ".mp3");
      buttonAudio.play();
  });

}

function animatePress(currentColour){
  $("." + currentColour).setInterval(() => {
    $(this).addClass("pressed");
  }, 100);
}

nextSequence();

HTML Code:

 <h1 id="level-title">Press A Key to Start</h1>
  <div class="container">
    <div lass="row">

      <div type="button" id="green" class="btn green">

      </div>

      <div type="button" id="red" class="btn red">

      </div>
    </div>

    <div class="row">

      <div type="button" id="yellow" class="btn yellow">

      </div>
      <div type="button" id="blue" class="btn blue">

      </div>

    </div>

  </div>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
  <script src="./game.js"></script>

CSS Class(which I am adding):-

.pressed {
  box-shadow: 0 0 20px white;
  background-color: grey;
}

Error:-

game.js:36 Uncaught TypeError: $(...).setInterval is not a function
    at animatePress (game.js:36:26)
    at HTMLDivElement.<anonymous> (game.js:9:3)
    at HTMLDivElement.dispatch (jquery.min.js:2:43064)
    at y.handle (jquery.min.js:2:41048)

Don’t Know why I am facing this error. I tried to solve but not able to. I am learning Javascript and this is a part of my project and I want to know the reason of this error. Please Help.

I searched on various platforms to know the possible cause of this error but I didn’t find my answer.

How do i make this fluid player auto pause after its done playing

I will like to make the fluid player auto pause after each video is done playing

Stack over flow it won’t be difficult if u just make the form be a

`<script src=”https://cdn.fluidplayer.com/v3/current/fluidplayer.min.js”></script>

<video id=”video-id”><source src=”video.mp4″ type=”video/mp4″ />

<script>

var myFP = fluidPlayer(

    'video-id', {

"layoutControls": {

    "controlBar": {

        "autoHideTimeout": 3,

        "animated": true,

        "autoHide": true

    },

    "htmlOnPauseBlock": {

        "html": null,

        "height": null,

        "width": null

    },

    "autoPlay": true,

“mute”: true,

    "allowTheatre": true,

    "playPauseAnimation": true,

    "playbackRateEnabled": true,

    "allowDownload": false,

            "loop": true,

    "playButtonShowing": true,

    "fillToContainer": true,

    "posterImage": ""

},

"vastOptions": {

    "adList": [

        {

            "roll": "preRoll",

            "vastTag": "https://www.videosprofitnetwork.com/watch.xml?key=ddbbe516ba5a32d04f608af9bb011c1a",

            "adText": ""

        }

    ],

    "adCTAText": false,

    "adCTATextPosition": ""

}

});

</script></source></video>`u

How to center a text generated from an API in JS?

I’m learning how to generate content with API’s, but when I print in screen the generated text does not alignt with the rest of the container.

<body class="container bg">
    <div class="card row border-primary text-center" style="width: 40rem;">
        <img src="../img/meme.jpg" class="card-img-top mx" alt="...">
        <div class="card-body">
          <h5 class="card-title">Best dad jokes!</h5>
          <div class="col-6 joke text-center"></div> 
          <button class="col-6 btn btn-primary" onclick="pulsarBoton()">Pulsa para un nuevo chiste</button>
      </div>
    </div>
    
    <script src="api.js"></script>
</body>

Also I attach the API code too:

const jokeText = document.querySelector(".joke");

  async function buscarChiste() {
    const response = await fetch("https://icanhazdadjoke.com", {
      headers: {
        Accept: 'application/json',
      },
    });

    const joke = response.json();
    return joke;
  }

  async function pulsarBoton() {
    const { joke } = await buscarChiste();
    jokeText.innerText = joke;
  }

The issue is that I need the card to be centered in the screen with all text centered but the generated text only is shown at the left of the card.

Thanks in advance!

Centering the API generated text

How To Send A Data Object With Fetch API

I want to send a data object with fetch api with keepalive to the current page and get the data through php. how can I do it.

Data To Send

{
  name: 'blabla',
  age: 432,
  type: 'pig'
}

I want to recieve as a post variable

$_POST['name'];

I’ve tried this but it is not working

fetch('', {

            method: 'POST',

            body: {name: 'blabla'},

            keepalive: true

        });

Sorry for no code

How to submit a HTML checklist form and get the checked data in a json file upon form submission without reloading the page in python flask?

I am building an application that uses Python Flask. There is an HTML form that looks like this:

<form method="POST" action="/route_name">
<p>No Annotation<input type="checkbox" value="No annotation" name="mycheckbox" ></p>
<p>Connector<input type="checkbox" value="connector" name="mycheckbox"></p>
<p>Enclosure<input type="checkbox" value="enclosure" name="mycheckbox"></p>
<p>Text<input type="checkbox" value="text" name="mycheckbox"></p>
<input type="submit" value="Submit">

How do I get the checked data in a json file upon the form submission without reloading the page?

How To implement CarQuery API In React Native

Am new in react Native, a need to implement a simple form with car query data using CarQuery API, have tried to find tutorials online but have not found any in react native, please anyone who can implement a simple form with car query data a will a appreciates so much

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘backend’)

I am experiencing the following error in my code: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘backend’). This error is occurring when I am trying to access the ‘backend’ property of an object, but it is returning as undefined. I have checked my code multiple times and cannot figure out why this is happening.

Here is the error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'backend')
    at Engine.moveData (engine.ts:426:1)
    at DataStorage.get (backend.ts:55:1)
    at MathBackendCPU.incRef (backend_cpu.ts:106:1)
    at Object.reshape [as kernelFunc] (Reshape.ts:40:1)
    at kernelFunc (engine.ts:646:1)
    at engine.ts:712:1
    at Engine.scopedRun (engine.ts:480:1)
    at Engine.runKernelFunc (engine.ts:708:1)
    at Engine.runKernel (engine.ts:553:1)
    at reshape_ (reshape.ts:60:1)

Dependencies:

 "@tensorflow/tfjs": "^4.1.0",
 "@tensorflow/tfjs-converter": "^4.1.0",
 "@tensorflow/tfjs-core": "^4.1.0",
 "@tensorflow/tfjs-node": "^1.7.4",

If anyone has experienced this error or has any suggestions on how to fix it, please let me know.

CSS Grid System adding extra gap

I am trying to understand the basics of the CSS grid system. I have an image I want to place in the upper left corner. When I place it in the top left corner, for some reason it adds extra space at the top and the left. As well, when I adjust the gap in the CSS, nothing changes, unless I change it to something extremely large (like 300px).

Here is the code I have so far. I tried adjusting the gap, removing the gap, etc.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="gridgallerycss.css">
</head>

<body>

    <div class="gallery">
        <figure class="gallery__item gallery__item--1">
            <img src="Emma_Allerd_Images/emmapic1.jpg" class="gallery__img" alt="Image 1">
        </figure>
    </div>


</body>

</html>

CSS

.gallery{
    display: grid;;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 5vw);
    gap: 15px;
}

.gallery__img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery__item--1{
    grid-column-start: 1;
    grid-column-end: 4;
    grid-row-start: 1;
    grid-row-end: 6;
}

Selenium Python – Passing URL to website’s inputbox removes all forward slashes and reverses URL words

Passing URL to the website’s inputbox removes forward slashes and reverses the words in URL.
However, passing same URL to other inputboxes (like website’s login page) doesn’t cause issue.

message="https://www.example.com/post/abc-def-ghi-jkl"
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@class='...']"))).send_keys(message)

Getting below output:

abc-def-ghi-jklpostwww.example.comhttps

Tried using JS via execute_script,

webEle = driver.find_element(By.XPATH, "//div[@class='...']")
driver.execute_script("arguments[0].value=arguments[1]", webELe, message)

but it doesn’t print any value to inputbox.

About object reference

let ob = {
    head:{next:0}, 
    tail:2
}

let first = ob.head; //{next:0}
ob.tail = ob.head; // {next:0}
let second = ob.head.next // 0
first.next =2

console.log(ob.tail === first). //true
console.log(first.next === second) //false
console.log("first= " + JSON.stringify(first)) //first= {"next":2}
console.log("second= " + JSON.stringify(second)) //second= 0
console.log("ob.tail= " + JSON.stringify(ob.tail)) //ob.tail= {"next":2}
console.log("ob.head= " + JSON.stringify(ob.head)) //ob.head= {"next":2}
console.log(ob)

In these codes, I am so confused that why when the first.next = 2 doesn’t change the variable second?
Can anyone help to explain it? I appricate it.

How to disable horizontal scrolling on a website for iOS (CSS)

I can’t seem to be able to disable horizontal scrolling in CSS for iOS. I need the extra width on the side to make room for my navbar so it is essential for me to disable it.

I’ve tried

  overflow: hidden;
  overflow-x: hidden;
  max-width: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body::-webkit-scrollbar {
  display: none;
}```
But I can still scroll horizontally on my iPhone

Do not redraw marker cluster if it is already in the map

How to not redraw a marker-cluster on the map if it is already displayed on the map. I tried

markerCluster.setMap(null);

but it clears the markers as well but I want to clear just the marker-cluster without clearing the markers from the map. Can anybody tell? Thanks

I have a filter-button which will update markers, if an info window is open it should remain open when filter-button is clicked but when markers are redrawn the info window gets closed. This is my code:

let markerCluster = null;
const addMarkers = (stores) => {
    // marker and info window event
    const markers = stores.map((store) => {
        const markerLatLng = new google.maps.LatLng(store.latitude, store.longitude);
        const latLng = {
            lat: Number(store.latitude),
            lng: Number(store.latitude)
        }
        let marker = null;
        if (!map.getBounds().contains(latLng)) {
            marker = new google.maps.Marker({
                map: map,
                position: markerLatLng
            });

            marker.addListener("click", () => {
                infoWindow.open({
                    anchor: marker,
                    map: map,
                });
            });

        }
        return marker;
    });

    if (markerCluster) {
        markerCluster.setMap(null);
    }
    markerCluster = new markerClusterer.MarkerClusterer({ map, markers });
}