Creating a Script in google apps script to launch a google form

I am trying to create a script where if you change the values in Column D from blank to “Create Something”, it will launch a google form.

I tried this code, but nothing happens. Also edited the trigger button, but nothing happens.

function onEdit(e) {
  var sheet = e.source.getSheetByName('Sheet1'); // Replace 'YourSheetName' with the actual name of your sheet
  var columnDIndex = 15; // Column D is the 4th column (1-indexed)

  if (e.range.getColumn() == columnDIndex && e.value == 'Create Something') {
    openGoogleForm();
  }
}

function openGoogleForm() {
  var formUrl = 'https://docs.google.com/forms/d/yourid'; // Replace 'your-form-id' with the actual ID of your form
  var form = FormApp.openByUrl(formUrl);
  form.createResponse().submit();
}

CouchDB view javascript only supports a subset of JS features?

I am trying to write a few map functions to create views in a CouchDB database. Futon kept telling me that the script I wrote is not a valid function – despise that I used mostly standard JS features. After some debugging, I found that if I use standard string.match(//), string.replace(//,''), array.filter(), array.map() calls, or lambda functions ((x) => x * 2), it will fail to save the document.

This gives me the feeling that couchdb only supports a subset of JS, but could not find a document on what JS features are not supported.

Can someone let me know if such document exist? why couchjs does not support standard JS functions?

my server has couchdb v3.3.2.

How can I change the relevant import path from the command line?

everyone.

When I move a typescript file using a shell script, I would like to change the import path of the related file that imports that file.

At work, I was tasked with organizing a project that had a large number of files.
Since multiple people are working on git for the project, the development pipeline cannot be stopped, and it is required to move files in an instant using a script.

The package manager I’m using is npm.

It was difficult to just move it using the mv command.
If there is a better way, please let me know.

Thank you.

Getting UNDEFINED when using a Map within a Map in React

I use a json file of matches and live score like that:

   [
    {
    "league": {
        "id": 722,
        "name": "Liga Premier Serie A",
        "country": "Mexico",
        "logo": "https://media.api-sports.io/football/leagues/722.png",
        "flag": "https://media.api-sports.io/flags/mx.svg",
        "season": 2023,
        "round": "Group 2 - 19"
    },
    "teams": [
        {
            "home": {
                "id": 17787,
                "name": "Lobos ULMX",
                "logo": "https://media.api-sports.io/football/teams/17787.png",
                "winner": null
            },
            "away": {
                "id": 15932,
                "name": "Irapuato",
                "logo": "https://media.api-sports.io/football/teams/15932.png",
                "winner": null
            }
        },
        {
            "home": {
                "id": 15937,
                "name": "Reboceros La Piedad",
                "logo": "https://media.api-sports.io/football/teams/15937.png",
                "winner": false
            },
            "away": {
                "id": 15936,
                "name": "Pioneros de Cancún",
                "logo": "https://media.api-sports.io/football/teams/15936.png",
                "winner": true
            }
        },
        {
            "home": {
                "id": 19905,
                "name": "CDS Tampico Madero",
                "logo": "https://media.api-sports.io/football/teams/19905.png",
                "winner": true
            },
            "away": {
                "id": 22045,
                "name": "Petroleros de Salamanca",
                "logo": "https://media.api-sports.io/football/teams/22045.png",
                "winner": false
            }
        },
        {
            "home": {
                "id": 17788,
                "name": "Montañeses",
                "logo": "https://media.api-sports.io/football/teams/17788.png",
                "winner": true
            },
            "away": {
                "id": 22043,
                "name": "Aguacateros de Peribán",
                "logo": "https://media.api-sports.io/football/teams/22043.png",
                "winner": false
            }
        },
        {
            "home": {
                "id": 15919,
                "name": "Atlético Saltillo",
                "logo": "https://media.api-sports.io/football/teams/15919.png",
                "winner": null
            },
            "away": {
                "id": 19909,
                "name": "Mexicali FC",
                "logo": "https://media.api-sports.io/football/teams/19909.png",
                "winner": null
            }
        }
    ],
    "goals": [
        {
            "home": 0,
            "away": 0
        },
        {
            "home": 1,
            "away": 2
        },
        {
            "home": 2,
            "away": 1
        },
        {
            "home": 3,
            "away": 2
        },
        {
            "home": 0,
            "away": 0
        }
    ],
    "score": [
        {
            "halftime": {
                "home": 0,
                "away": 0
            },
            "fulltime": {
                "home": 0,
                "away": 0
            },
            "extratime": {
                "home": null,
                "away": null
            },
            "penalty": {
                "home": null,
                "away": null
            }
        },
        {
            "halftime": {
                "home": 1,
                "away": 1
            },
            "fulltime": {
                "home": 1,
                "away": 2
            },
            "extratime": {
                "home": null,
                "away": null
            },
            "penalty": {
                "home": null,
                "away": null
            }
        },
        {
            "halftime": {
                "home": 1,
                "away": 0
            },
            "fulltime": {
                "home": 2,
                "away": 1
            },
            "extratime": {
                "home": null,
                "away": null
            },
            "penalty": {
                "home": null,
                "away": null
            }
        },
        {
            "halftime": {
                "home": 1,
                "away": 1
            },
            "fulltime": {
                "home": 3,
                "away": 2
            },
            "extratime": {
                "home": null,
                "away": null
            },
            "penalty": {
                "home": null,
                "away": null
            }
        },
        {
            "halftime": {
                "home": 0,
                "away": 0
            },
            "fulltime": {
                "home": 0,
                "away": 0
            },
            "extratime": {
                "home": null,
                "away": null
            },
            "penalty": {
                "home": null,
                "away": null
            }
        }
    ],
    "venue": [
        {
            "id": 1072,
            "name": "Estadio Miguel Alemán Valdés",
            "city": "Celaya"
        },
        {
            "id": 11250,
            "name": "Estadio Juan N. López",
            "city": "La Piedad"
        },
        {
            "id": 1086,
            "name": "Estadio Tamaulipas",
            "city": "Tampico y Ciudad Madero"
        },
        {
            "id": null,
            "name": "Estadio de la Sociedad Cuauhtemoc Moctezuma",
            "city": "Orizaba"
        },
        {
            "id": 11237,
            "name": "Estadio Olímpico Francisco I. Madero",
            "city": "Saltillo"
        }
    ]
},
{
    "league": {
        "id": 872,
        "name": "Liga Premier Serie B",
        "country": "Mexico",
        "logo": "https://media.api-sports.io/football/leagues/872.png",
        "flag": "https://media.api-sports.io/flags/mx.svg",
        "season": 2023,
    ....
 ]

I use map within another map to get data:

newData?.map((match, index) => (

.......

 [match]?.map((d, index) => (  // when I use match.teams.map((... I get all element but only under "teams" but other elements as "goals" I get "undefined"

  <h3>{d?.teams?.home?.name}</h3>
  <div>{d?.goals?.home}</div>
 ))
 .....
))

I tried to get data of different elements in json format but I get undefined or cannot read properties.

For example, if I use match.teams.map((d, index) I get all elements under teams but I can’t get data under goals or score.

When I do [match]?.map((d, index) => ( I can get any elements under teams or any other specific fields.

Any Idea?

Slide box up and grayscale behind image on hover and reverse effect on hover loss

When hovering over this image, I would like the gray box to appear at the bottom and then slide up. As it slides up, anything it goes over would become grayscale. Then I would like after I move my mouse of the image for gray box to slide back down and remove grayscale as it passes the image.

I got majority of it to work using css only and the only problem I have is when the mouse exits the image I can’t figure out how to play the animation back.

Here is what I have tried:

.wrapper {
  position: relative;
  
  img {
    width: 600px;
    height: 375px;
  }
  
  .hover {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: 600px;
    height: 100px;
    animation-name: example2;
    animation-duration: 1s;
    display: none;
    
    .gray-image {
      width: 100%;
      height: 100%;
      background-image: url('https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg');
      background-repeat: no-repeat;
      background-size: 600px 375px;
      background-position: bottom 0 left 0;
      
      filter: grayscale(100%);
      -webkit-filter: grayscale(100%);
      //position: absolute;
    }
    
    .text {
      color: #FFF;
      text-align: center;
      width: 100%;
      height: 100px;
      background-color: rgba(89, 89, 89, 0.9);
    }
  }
  
  &:hover {
    
    .hover {
      animation-name: example;
      animation-duration: 1s;
      height: 375px;
      display: block;
    }
  }
}

@keyframes example {
  from {
    height: 100px;
  }
  to {
    height: 375px;
  }
}

@keyframes example2 {
  from {
    height: 375px;
  }
  to {
    height: 100px;
  }
}
<div class="wrapper">
  <img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg" />
  
  <div class="hover">
    <div class="gray-image" />
    <div class="slide-box">
      <div class="text">
          <span>This is the title</span>
      </div>
    </div>
  </div>
</div>

How can I achieve my full effect?

Here is also a jsfiddle for those that prefer it: https://jsfiddle.net/pt15ckeL/2/

How can I add this image to the map stretching over an extent specified in degrees?

I have a codepen at https://codepen.io/ericg_off/pen/gOqmpEE

While I would like to have made this code available as a working snippet, it exceeds those limits. The value of washb64 can be found in the codepen.

washb64 is a base64 encode kmz file. The data within represents a heatmap in Washington, DC. I need to be able to take this data and display it in OpenLayers. While OpenLayers does support kml, it does not support the GroundOverlay. My thought was to use an OpenLayer Image Layer with a custom projection and place the static image in the right spot. However, my code is not working.

The degrees used in the project were pulled from the kml file.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Folder>
    <GroundOverlay>
      <Icon>
        <href>wash-dc.png</href>
      </Icon>
      <LatLonBox>
        <north>38.9098677066083098</north>
        <south>38.8880492619716591</south>
        <east>-77.0492054375858260</east>
        <west>-77.0124290658545902</west>
        <rotation>0</rotation>
      </LatLonBox>
    </GroundOverlay>
  </Folder>
</kml>

The end result should look similar to how the kmz file looks when loaded into Google Earth.

google earth

I am sure there are many things wrong with the code, but I am not sure what or how to fix it.

const washb64 = ''

const north = 38.9098629826801456;
const south = 38.8880073821501711;
const east = -77.0497762322933539;
const west = -77.0120905091252439;

async function loadHeatmapData() {
  const zipFile = new JSZip();

  await zipFile.loadAsync(washb64, { base64: true });

  const imageFile = zipFile.file("wash-dc.png");
  const data = await imageFile.async("arraybuffer");
  const url = URL.createObjectURL(new Blob([data]));

  const projection = new ol.proj.Projection({
    code: "heatmap",
    units: "degrees",
    extent: [west, south, east, north]
  });

  const imageLayer = new ol.layer.Image({
    source: new ol.source.ImageStatic({
      attributions: "wash dc",
      url: url,
      projection: projection,
      imageExtent: [0, 0, 1024, 1024]
    })
  });

  const map = new ol.Map({
    target: "map",
    layers: [
      new ol.layer.Tile({
        source: new ol.source.OSM()
      }),
      imageLayer
    ],
    view: new ol.View({
      projection: "EPSG:4326",
      center: [-77.05, 38.9],
      zoom: 15
    })
  });
}

loadHeatmapData();
#map {
  height: 512px;
  width: 1024px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/7.3.0/ol.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/7.3.0/dist/ol.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>

<div id="map"></div>

Angular 12: Can I handle multiple types of responses from an API using HttpClient?

I have this code below and as you can see, it just checks if my response from API is OK and returns a value or throws an error that I can catch.

fetch(`http://localhost:9000/api/test`, {
   method: "post",
   body: JSON.stringify({ "data": my_payload })
})
.then(response => {
  if (response.ok) {
    return response.json();
  }

  throw response;
})
.then(data => data)
.catch(err => err);

I simply tried to start to use the HTTPClient to send the same request for the API, as you can see in the code below:

this.http.post('http://localhost:9000/api/test',
{ "data": my_payload })
.pipe(
  catchError(err => throwError(() => err))
);

The problem is that the API responds with a JSON when all the process runs fine but when an error occurs, the API throws an error with plain text describing why the error occurred.

So I received this log on my console:

TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.

Even when I tried to add the attribute responseType: "text" the error persists:

this.http.post('http://localhost:9000/api/test',
{ "data": my_payload }, { responseType: "text" })
.pipe(
  catchError(err => throwError(() => err))
);

I really don’t know how to handle this situation. I’ve tried to search for some answers and basically, I found that the error could be in the responseType or the error could be in the version of the RXJS that, by the way, is in the 7.5.0 or even others solutions involving to make an interceptors class but, in my situation, it only change the place where the error occurs.

Do you know what is the problem?
Did it happen to you before?

I can’t believe this is a rocket science, so can you help me to found the solution?

SVGs not being mocked out in jest

I’m trying to mock out calls to render SVG.

Here’s my svgMock.js:

export default "SvgrURL"
export const ReactComponent = "div"

export const BAD_SVG_URL = "/images/BAD_SVG_URL_THAT_WILL_FAIL_TO_LOAD.svg"

Here’s my jest.config.js:

  moduleNameMapper: {
   ...
    '\.svg$': '<rootDir>/tests/mocks/svgMock.js',
  },

And here’s the call in the page:

import { render, screen } from "@testing-library/react"
import { SVGImage } from "../svg-image"

export const AppTest = () => <SVGImage src="./jobs-icon.svg" alt="jobs icon alt" />

test("renders JobsIcon", () => {
  render(<AppTest />)

  console.log(screen.debug())
  
  expect(screen.findAllByText("JobsIcon")).toBeTruthy()
})

Yet it always seems to trigger my msw mock:

  console.warn
    [MSW] Warning: intercepted a request without a matching request handler:
    
      • GET /jobs-icon.svg
    
    If you still wish to intercept this unhandled request, please create a request handler for it.
    Read more: https://mswjs.io/docs/getting-started/mocks

Thoughts?

Could someone please explain how Openai api works?

For example I am getting this error:

raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 – {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}

And this is my code:

from openai import OpenAI
client = OpenAI(api_key="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")

response = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {
      "role": "system",
      "content": "Summarize content you are provided with for a second-grade student."
    },
    {
      "role": "user",
      "content": "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus."
    }
  ],
  temperature=0.7,
  max_tokens=64,
  top_p=1
)

As you can see i am calling gpt-3.5-turbo which is free, also i went online to chatgpt and it is answering my prompts so why is my code showing ‘insufficient_quota’?

Namecheap, Vercel, and Next.js CORS error on custom domain

I have my api opended up to the public for an api. I have a .vercel.app that works fine with no CORS errors. However, with my custom .com domain I am getting CORS errors. The two errors are:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at commercesite.net/api/keys. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 308.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at commercesite.net/api/keys. (Reason: CORS request did not succeed). Status code: (null).

Here is my next.config.js file:

/* eslint-disable */

/** @type {import('next').NextConfig} */
const nextConfig = {
    async headers() {
        return [
            {
                source: "/api/:path*",
                headers: [
                    { key: "Access-Control-Allow-Credentials", value: "true" },
                    { key: "Access-Control-Allow-Origin", value: "*" },
                    {
                        key: "Access-Control-Allow-Methods",
                        value: "GET,DELETE,PATCH,POST,PUT,OPTIONS",
                    },
                    {
                        key: "Access-Control-Allow-Headers",
                        value:
                            "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, Authorization, id, filters, Api-Key",
                    },
                ],
            },
        ];
    },
    webpack: (
        config,
        { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }
    ) => {
        nextRuntime = "nodejs";
        return config;
    },
    eslint: {
        ignoreDuringBuilds: true,
    },
    typescript: {
        ignoreBuildErrors: true,
    },
};
module.exports = nextConfig;

Everything works fine on the Vercel domain but not the custom Namecheap one.

The custom domain is accesible just not through a third party site.

Note: The url actually ends in .com SO is just requiring a .net domain.

Problems while doing real time monitoring tool with plotly, unable to hide a trace

this is a problem I have for 2 weeks now maybe i’m too dumb but I have a web app using flask and plotly

I have some javascript to get data from server and I’m able to see the graph updating in the front end how ever… I noticed that because of my front end is requesting updated to the backend every 5 seconds I cannot use the features of the plotly graph like hide a trace, zoom or pan without being reset after 5 seconds ( i configured this to get the updated data) then, my question is there a better way to do it? I share the code related maybe a good brother or sister can support me

this is the javascript you will notices some console.logs i was trying to get some clue about how to solve this, by the way i dont use cdn for plotly I just downloaded the js and stored in my server, all blessed and thanks in advanced

document.addEventListener('DOMContentLoaded', function() {
    console.log('El evento DOMContentLoaded se ha activado');
    const startButton = document.getElementById('start-monitoring');
    const stopButton = document.getElementById('stop-monitoring');
    const monitorForm = document.getElementById('monitor-form');
    const dropdownCMTS = document.getElementById('dropdown-cmts');
    const dropdownWijk = document.getElementById('dropdown-wijk');
    let continueUpdating = false;
    let updateInterval;
    let graphDiv;

    const traceOpacity = {};
    
    function showMessage(message, isError = false) {
        console.log('Llamando a la función showMessage con el mensaje:', message); // Agregar este registro de prueba
        const messageContainer = document.getElementById('message-container');
        if (messageContainer) {
            messageContainer.innerText = message;
            messageContainer.style.color = isError ? 'red' : 'green';
            messageContainer.style.display = 'block';
        } else {
            console.error('Mensaje no mostrado. El contenedor de mensaje no fue encontrado.');
        }
    }


    if (dropdownCMTS) {
        dropdownCMTS.addEventListener('change', function() {
            $.ajax({
                url: `/upstream_monitor?cmts_name=${dropdownCMTS.value}`,
                type: 'GET',
                success: function(response) {
                    dropdownWijk.innerHTML = '';
                    if (response.wijk_options && Array.isArray(response.wijk_options)) {
                        response.wijk_options.forEach(function(wijk_option) {
                            const option = new Option(wijk_option, wijk_option);
                            dropdownWijk.appendChild(option);
                        });
                    }
                },
                error: function(error) {
                    console.error('Error al obtener opciones de Wijk:', error);
                    showMessage('Error al obtener opciones de Wijk.', true);
                }
            });
        });
    }

    function startMonitoring() {
        const formData = new FormData(monitorForm);
        fetch('/start_monitoring', {
            method: 'POST',
            body: formData
        })
        .then(response => response.json())
        .then(data => {
            if(data.status === 'Monitoring started') {
                continueUpdating = true;
                updateMainGraph();
                updateGaugeGraph();
                showMessage('Monitoreo iniciado con éxito.');
                updateInterval = setInterval(function() {
                    if (continueUpdating) {
                        updateMainGraph();
                        updateGaugeGraph();
                    }
                }, 5000); // Actualizar cada 5 segundos
            } else {
                console.error('Failed to start monitoring:', data);
                showMessage('Error al iniciar el monitoreo.', true);
            }
        })
        .catch(error => {
            console.error('Error:', error);
            showMessage('Error al comunicarse con el servidor.', true);
        });
    }

    function stopMonitoring() {
        fetch('/stop_monitoring', { method: 'POST' })
        .then(response => response.json())
        .then(data => {
            if(data.status === 'Monitoreo detenido') {
                continueUpdating = false;
                clearInterval(updateInterval);
                showMessage('Monitoreo detenido.');
            } else {
                console.error('Failed to stop monitoring:', data);
                showMessage('Error al detener el monitoreo.', true);
            }
        })
        .catch(error => {
            console.error('Error:', error);
            showMessage('Error al comunicarse con el servidor.', true);
        });
    }

    startButton.addEventListener('click', startMonitoring);
    stopButton.addEventListener('click', stopMonitoring);



    function addClickEventToGraph() {
        console.log('La función addClickEventToGraph se está ejecutando.'); // Agregar este registro de prueba
        if (graphDiv) {
            graphDiv.on('plotly_click', function(eventData) {
                const clickedTraceIndex = eventData.points[0].curveNumber;
                const currentData = graphDiv.data;

                // Cambiar la visibilidad de la traza
                currentData[clickedTraceIndex].visible = (currentData[clickedTraceIndex].visible === 'legendonly') ? true : 'legendonly';

                // Cambiar la opacidad de la traza
                if (currentData[clickedTraceIndex].visible === 'legendonly') {
                    traceOpacity[currentData[clickedTraceIndex].name] = 0.5;
                } else {
                    traceOpacity[currentData[clickedTraceIndex].name] = 1.0;
                }

                console.log('Nombre de la traza:', currentData[clickedTraceIndex].name);
                console.log('Visibilidad:', currentData[clickedTraceIndex].visible);
                console.log('Opacidad:', traceOpacity[currentData[clickedTraceIndex].name]);
    

                // Actualizar el gráfico
                Plotly.update(graphDiv, currentData);

                // Persistir el estado de opacidad
                // Puedes almacenar traceOpacity en una base de datos o localStorage si es necesario
            });
        }
    }
    


    function updateMainGraph() {
        console.log('Entrando en la función updateMainGraph');
        fetch('/graph_us_monitor_data')
        .then(response => response.json())
        .then(newData => {
            let graphDiv = document.getElementById('unique-graph-id');
            if (graphDiv && Plotly.Plots.hasPlot(graphDiv)) {
                var currentData = Plotly.Plots.getData(graphDiv);
    
                // Preparar los nuevos datos manteniendo el estado de las trazas
                var updates = {
                    y: [],
                    x: [],
                    visible: [],
                    opacity: []
                };
    
                currentData.forEach((trace, index) => {
                    // Concatenar los nuevos puntos de datos
                    updates.y.push(trace.y.concat(newData[index].y));
                    updates.x.push(trace.x.concat(newData[index].x));

                    // Mantener la visibilidad y opacidad de las trazas existentes
                    updates.visible.push(trace.visible);
                    updates.opacity.push(trace.opacity);
                });

                // Log de los datos de trazas existentes y nuevos datos
                console.log('Datos de trazas existentes:', currentData);
                console.log('Nuevos datos:', newData);
    
                // Actualizar solo los datos de las trazas, no sus estilos o visibilidad
                Plotly.update(graphDiv, updates, {});
            } else {
                // Crear el gráfico si no existe
                var layout = {
                    title: 'Signal Noise Ratio',
                    xaxis: { title: 'Time', type: 'date' },
                    yaxis: { title: 'dB' },
                    legend: {
                        clickmode: 'event+select'
                    }
                };
                Plotly.newPlot('graph-container', newData, layout);
                graphDiv = document.getElementById('graph-container');
                addClickEventToGraph();
            }
        })
        .catch(error => {
            console.error('Error al actualizar el gráfico principal:', error);
            if (document.getElementById('message-container')) {
                showMessage('Error al actualizar el gráfico principal.', true);
            }
        });
    }
    
    
    

    function updateGaugeGraph() {
        fetch('/gauge_graph_data')
        .then(response => response.json())
        .then(data => {
            var gaugeData = [{
                type: "indicator",
                mode: "gauge+number",
                value: data.value,
                gauge: {
                    bar: {'color': "black"},
                    axis: { range: [null, 50] },
                    steps: [
                        { range: [0, 20], color: 'red' },
                        { range: [20, 30], color: 'yellow' },
                        { range: [30, 50], color: 'green' }
                    ]
                }
            }];
            var layout = { title: 'Average dB Value' };
            if (document.getElementById('gauge-graph-container')) {
                Plotly.update('gauge-graph-container', gaugeData, layout);
            } else {
                Plotly.newPlot('gauge-container', gaugeData, layout);
            }
        })
        .catch(error => {
            console.error('Error al actualizar el gráfico gauge:', error);
            showMessage('Error al actualizar el gráfico gauge.', true);
        });
    }
    
});

I would like to be able to hide or isolate traces persistently meanwhile the graph is updating

Why I cannot access a property in an array of objects if not in a loop?

I’m working with Vue 3.
If I write this:

<p v-for="(prs, index) in settings.pressure">{{settings.pressure[0].value}}</p>

I see the value correctly, while if I use this (the one I need):

<p>{{settings.pressure[0].value}}</p>

it throws an error:

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

How could it be defined in the first version and undefined in the second?

Will eclipse no run classes?

I try to run my class and it says the selection cannot be launched, and there are no recent launches.

I tried to run it and I expected it to run but it just pops up with “the selection cannot be launched, and there are no recent launches.”

Injecting javascript into html [closed]

So I’ve been working for some time on a proxy for a game called Shell Shockers using nesting:

<script type="text/javascript" src="Get%20better%20FPS%20in%20shell%20shockers!.user.js">                  </script>
<script type="text/javascript" src="Client.js"></script>
<script type="text/javascript" src="https://github.com/hydroflame521/StateFarmClient.git"></script>
<script type="text/javascript" scr="test.js"></script>

But for some reason it works but doesn’t actually inject anything..
I am however trying to inject a userscript, however i also tagged “test.js” and put console.log("hello world"); in it and it doesn’t work..

403 err c# javascript page [closed]

so my boss asked me to fix this error but honestly i have no clue whats going on, the thing is there is a form that when you click it sends the info and update some table on server. The error comes when you attach a file and submit, the forbidden page shows up, i tried many files so far the only one that works is a txt file. This only happens when user is not connected to the company vpn.

I checked some other files that are using same methods to upload a file and there is no problem.