Redash to Google Sheets – Date parameters not being registered

I’m trying to write a script to send redash data to google sheets.

Currently I’m just looking to access the redash dashboard but I’m getting an error which states that there’s no date range set but I’ve added them as additional parameters.
Wondering if I’m putting in the incorrect date parameters?
Thanks for any help!

  var redashapi = "api";
  var sheetname = "Sheet1";
  var response = UrlFetchApp.fetch(redashapi, {
    muteHttpExceptions: true,
     method: "POST",
     body: JSON.stringify({parameters: {
    date_range_param: {
      start: "2025-03-01",
      end: "2025-03-02"
    }
  }})
}); 
  Logger.log(response.getContentText());
}```

Google Sheets: Refresh =importhtml() faster

I am trying to import the leaderboard for the Masters into a google sheets document. I successfully did so using the following formula:

=IMPORTHTML(“https://www.espn.com/golf/leaderboard”,”table”,1)

However, the data is set to refresh every hour. based on other articles I’ve seen It’s possible to get this data to refresh every 5 minutes or even every minute. I’ve tried a number of different things that have all failed. What do I need to do to get this data to refresh 1 or 5 minutes?

Here’s the spreadsheet: https://docs.google.com/spreadsheets/d/1KPlhD9xt0hAgZiUGTeZZ-bxNINhy7TvITpazpPmoBO8/edit?gid=693770553#gid=693770553

The formula is in Cell O2 of the “ESPN Hourly Data” Sheet

Here’s what I’ve tried:

I found this article that worked for somebody else. When I create the script and the trigger I simply get a #NUM! error.

Every other example I found online involved some sort of script. I tried a few of them but i’m not fluent enough to really know why things aren’t working.

Popup image on hover inside a textBox

After a while searching for some ideas, I found this Leaflet example to show an image when the mouse hovers on a feature. However, I have a textBox (innerText) in OpenLayers showing several attributes obtained with the .getProperties() method in this way:

const attribute = feature.getProperties();
const mypngimage = feature.getProperties().pngimage;        // this yields a path with a PNG file like "/home/myPictures/a.png"
const attributesStrings =
  "id: "+ attribute.id +"n"+
  "image: "+ <a href="mypngimage"<thisIsMyPNG<a> +"n";    // fails, the idea is to get a hyperlink here pointing to the PNG file
info.innerText = attributesStrings;

So, the idea is to hover on the hyperlink (thisIsMyPNG) in the textBox so the image pops up, the hyperlink inside the textBox would be like this:

image: thisIsMyPNG

How can this be achieved? Thanks for any pointers,

API responds with 500 error when calling OpenAI from Next.js

I’m trying to use the OpenAI API to analyze a physics question in my Next.js project. However, when I send a POST request to my API, I receive a 500 Internal Server Error. I’ve checked the code and confirmed that my API key is valid, but I can’t resolve this issue. Below is the code I’m using:
Code:

import { NextResponse } from 'next/server';

export async function POST(req) {
  const { question } = await req.json();
  const result = await analyzeQuestion(question);
  return NextResponse.json(result);
}

async function analyzeQuestion(question) {
  const response = await fetch('https://api.openai.com/v1/chat/completions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-xxxxxx', // Replace with your API key
    },
    body: JSON.stringify({
      model: 'gpt-3.5-turbo',
      messages: [
        { role: 'system', content: 'You are an educational assistant' },
        { role: 'user', content: question },
      ],
      temperature: 0.3,
      max_tokens: 500,
    }),
  });
  const data = await response.json();
  return data.choices[0]?.message.content || {};
}

Error Received:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

What I have tried: I have checked the API key, tried sending requests with different parameters, and made sure there are no syntax errors in my code. I’ve also tried restarting the server and checking the logs, but the issue still persists.

Help Request: Can anyone help me figure out the cause of this issue and how to fix the 500 error?

How do you add a /** */ description to (method) function’s (JavaScript)

This is my code:

/**
 * Completely clears out all items from an Array  
 * and returns the new length
 * 
 * (Optional) fills this emptyied array with any given arguments
 * 
 * @param  {...any} Items 
 * @returns The length of the new Array
 */

Array.prototype.Replace = function(...Items) {
    for (i in this){
        this.shift()
    } for (i in Items) {
        this[i] = Items[i]
    }
    return this.length
}

For whatever reason this only works when I hover over “function(…Items)”
not when I do something like: [1,2,3].Replace() the description doesn’t show up. It also doesn’t appear when I hover over “Replace” in “Array.prototype.Replace”

Is there anyway to apply this description to the method not the “(local) function”?

I tried moving the description code block around a bit but with no success. This there any way to do this?

My Mediapipe+OpenCV realtime posture analysis doesn’t work

My code below (I use google colab) shows the posture analysis for still image that was captured by my laptop’s webcam, but I want “real-time” posture analysis directly to moving image captured by the same webcam, not the still photo. Please help to figure out what part of my code has to be fixed to achieve this goal. thanks!

[code]
!pip install –upgrade –force-reinstall numpy mediapipe opencv-python
!pip install numpy==1.23.5 mediapipe==0.10.3 opencv-python==4.7.0.72 –force- reinstall
!pip install –upgrade –force-reinstall –no-cache-dir numpy mediapipe opencv-python

from google.colab import output
from IPython.display import display, clear_output
import cv2
import numpy as np
import PIL.Image
import io
import base64
import mediapipe as mp
import matplotlib.pyplot as plt

Mediapipe setup

mp_pose = mp.solutions.pose
mp_drawing = mp.solutions.drawing_utils
pose = mp_pose.Pose(static_image_mode=True)

def calculate_angle(a, b, c):
a = np.array(a)
b = np.array(b)
c = np.array(c)
radians = np.arctan2(c[1]-b[1], c[0]-b[0]) - 
np.arctan2(a[1]-b[1], a[0]-b[0])
angle = np.abs(radians * 180.0 / np.pi)
if angle > 180.0:
angle = 360 - angle
return angle

def data_url_to_image(data_url):
header, encoded = data_url.split(",", 1)
img_bytes = base64.b64decode(encoded)
img = PIL.Image.open(io.BytesIO(img_bytes))
return cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)

def process_streamed_image(data_url):
image_bgr = data_url_to_image(data_url)
image_rgb = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2RGB)
results = pose.process(image_rgb)
annotated = image_rgb.copy()

    if results.pose_landmarks:
        mp_drawing.draw_landmarks(annotated, results.pose_landmarks,    mp_pose.POSE_CONNECTIONS)

        landmarks = results.pose_landmarks.landmark
        h, w, _ = annotated.shape

        def get_point(idx):
            return [landmarks[idx].x * w, landmarks[idx].y * h]

        shoulder = get_point(mp_pose.PoseLandmark.RIGHT_SHOULDER.value)
        hip = get_point(mp_pose.PoseLandmark.RIGHT_HIP.value)
        ankle = get_point(mp_pose.PoseLandmark.RIGHT_ANKLE.value)
        elbow = get_point(mp_pose.PoseLandmark.RIGHT_ELBOW.value)
        wrist = get_point(mp_pose.PoseLandmark.RIGHT_WRIST.value)

        body_angle = calculate_angle(shoulder, hip, ankle)
        arm_angle = calculate_angle(shoulder, elbow, wrist)

        if 160 < body_angle < 175 and 160 < arm_angle < 175:
            feedback = "✅ Nice One"
            color = (0, 255, 0)
        else:
            feedback = "⚠️ Not perfect long line body"
            color = (255, 0, 0)

        cv2.putText(annotated, feedback, (20, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, color, 3)
        cv2.putText(annotated, f'Arm: {int(arm_angle)} deg', (20, 80),     cv2.FONT_HERSHEY_SIMPLEX, 0.8, color, 2)
        cv2.putText(annotated, f'Body: {int(body_angle)} deg', (20, 120), cv2.FONT_HERSHEY_SIMPLEX, 0.8, color, 2)

    clear_output(wait=True)
    plt.figure(figsize=(10, 10))
    plt.imshow(annotated)
    plt.axis('off')
    plt.title("Live Pose Feedback")
    plt.show()

Register callback

output.register_callback('sendImageToPython', process_streamed_image)

from IPython.display import HTML

HTML("""
<video id="camera" autoplay playsinline width="640" height="480"></video>
<canvas id="canvas" width="640" height="480" style="display:none;"></canvas>

<p>Starting webcam...</p>


const video = document.getElementById('camera');
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
const statusText = document.getElementById('status');

let sending = false;
let streamStarted = false;

// 1. Get webcam
navigator.mediaDevices.getUserMedia({ video: true }).then(stream => {
  video.srcObject = stream;
  video.onplaying = () => {
    if (!streamStarted) {
      streamStarted = true;
      statusText.textContent = "✅ Webcam is live and capturing!";
      sendFrame();  // start sending automatically
    }
  };
}).catch(err => {
  statusText.textContent = "❌ Webcam error: " + err;
});

// 2. Send frame to Python every 1 second
function sendFrame() {
  if (!sending) {
    sending = true;
    ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
    const imageData = canvas.toDataURL('image/jpeg');

    google.colab.kernel.invokeFunction('sendImageToPython', [imageData], {})
      .then(() => {
        sending = false;
        setTimeout(sendFrame, 1000);
      })
      .catch(err => {
        console.error("Send failed", err);
        sending = false;
        setTimeout(sendFrame, 1500);
      });
  }
}


""")`

I have tried to achieve a real-time moving image posture analysis but hasn’t been successful`

Nodejs heapdump bull memory leak

I have a nodejs cron in bull that runs hourly and seems to be consuming a lot of memory, I took multiple heap dumps and all have objects of size ~120mb, nothing increases/decreases. Found this in heapdump, might this be the culprit?
The RSS of the process(which runs only this process) is too high, latest one I recorded is
{"rss":"459 MB","heapTotal":"46 MB","heapUsed":"41 MB","external":"106 MB","timestamp":"2025-04-10T18:36:09.505Z"} from process.memory.

Compared heapdumps and nothing seems to be going up really.

enter image description here

I got a challenge from a company where I need to solve the puzzle [closed]

So I hit an api which provided by the company and i got response back from the API . It is JSON.

{
  "message": "You walk into a busy bar. The crowd reminds you of the cantina in Mos Eisley. You notice a weary old man nursing a drink. You sit down next to him and say, 'Hey stranger, what's your story?'.nnThe stranger looks up at you and says, "My farm's all crawling up with those nasty bots. Tried to put up a sign to keep them out today, but they just keep coming back. No matter, I need your help with something else. I seem to be locked out of my phone, I don't know what to do."nn"Maybe you should write your password down", you suggest.nn"I wrote it down in my phone, but I locked myself out! Oh please tell me there's something you can do", he says, and hands you a tattered old phone.",

"phone": "<!DOCTYPE html>n<script>n  Function(n    '\'k.}mfj_2y6,wchqa+r&q5a-kihrg9~x{2]#r5z_*sy}s97iwcup2#zi@[5!45[*ro_r+!r!ks%*qt_uv7m]].6_evg-g!7^z7_n8{7..z%#h74#+1xe]7#k&6,[&3q#z[-*aslq}n~yj-ja&sp%myej#~u8x&6j^t*e+wg4-_.e&c}ac1}&i]3n{#}28jvp3uey^~%@o*f~c1r.[o]nrg,6}w13_o1c{_{fml9!x@+1l5f8h^vafs^3o4^io!-us+.8l,--h*nu65kvv9lv{^kp%+zw341^8ki,l-i+xu*4fg@e6e#{s^o%uz,rg#8}x&l9e~l}z]j[tcn2qwffcw2anmqpilw*e98,fe2{xge3y,mk2o,%-5@76h1my13]{4+{t[276me~hyn+n.qj,.xtfe^!t8@t!!mq1t*q.9!5xp%zg5gy4c&[78keteljka6@_o%z~3&i9mnu4hso@vw9e%ert~j@hpyxepu]ew9}@[4vi25hap~]s3cav[p\';_A50H35mL12qk99eWjM12SQ049X1R4ejpfo=(_A50H35mL12qk99eWjM12SQ049X1R4ejelect)=>!_A50H35mL12qk99eWjM12SQ049X1R4ejelect?"0QsupcVnlVictmeF"[_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz()](/[nmVc0eFuQ]/g,""):(_A50H35mL12qk99eWjM12SQ049X1R4ejelect==1?"JVfpomwrwvEVXax6c41mhp"[_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz()](/[wxpm1v6X4VJ]/g,""):"ZrFSMsuJnpgc054tUijoIMnUYg"[_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz()](/[Y4ZjsMg5Spr0IUJ]/g,""));_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz=()=>"\\162\\145\\160\\154\\141\\143\\145";(_FQRTR8s014sl4bYL6zNU0Wq10B=>"_C6u4T6cj6b9._XZQhqrh2X2CLzKdRPT9nEG1Td2B31445tyKkTJa23EtU=\\"CZZBRJLYJEHHRIQZCWVDKBGMQECLKFRZVAZUUYLSGIDSZIWJHSKVYZLBOUZFLCP\\"​(function(_CSgW2h408JE8rsx9h4xZ2qQ6Acwt0SmsS7IVzB2C71LkMLnM,_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz,_LC5w4zq58F1R4gGj7vyKm8g74EBmws,_J6yR511Z3DYBfBR41){_CSgW2h408JE8rsx9h4xZ2qQ6Acwt0SmsS7IVzB2C71LkMLnM=this;_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz=\\"\\\\162\\\\145\\\\160\\\\154\\\\141\\\\143\\\\145\\";_$={};\\"_BmvY25CX9c7MxK96rKQh0P5I75LCn52aJrPZ23o2vmhvpPSBmu200eAEwpshr1Fe14v63eRKCnNt3FDQe3ZfW7aiLUu0loQtYKu200d6W3hoiQL0K1URws4AZYENFC7u200f_WcU57u200eJawHBdRKQd2BWEj9Cv2ecnC7tBToL4F5ipsY2JtueCAFn41yeoAGrgWBu200dTRgAFW1GjYQJuB5p79wHCcyKo24u200f_NtV8AKi5KMt5BzE361qtCR58i0M4u200eVeR88rFH1r2KYoHL5rGAu200dRLAY85HKG1VF2u200f_OZCd9m9nFI6h1zhJHZIUu200eIr8RWejwmBToGYGvdTeFEfG2vqeghnWQtK9ULlKiYsVUtYkxefnxwe040r7uu200d9dVU8TWxqB2KfYjQRG47hkgwFlu0Iu200f_XAuZWPM8a8nVB5qrlN8WUFUZzr5LEGkdJsu200eqehrWX6rW48o8LrETqu200d8qEh6LW4TX\\"[\\"9FsvIphlKFieP7t2Z\\"[_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz](/[FPhv9ZK7I2e]/g,\\"\\")](\\"u200f\\")[\\"6NfdZeoIdrUEb1aCic2QShVKK\\"[_QTW7v07E7O88q9h34lb8s995Gkyp1qUk0c1B3e75Bz](/[IbZQeCdKNiVSU162]/g,\\"\\")]((_M4474dL1tem,_V40SJA477a86CuSIKKjS5sar6)=>{_V40SJA477a86CuSIKKjS5sar6

write now I am not adding the phone value completely as it is very long. Can you guys help me how can I solve this.

mui react example / template failing to run

I’m testing MUI components, and I wanted to give their example app with vite / TS a spin with their Dashboard template. The README in the Dashboard says to spin up one of the example apps, copy the Dashboard directory into it and you’re ready to go.

I cloned the MUI repo from https://github.com/mui/material-ui/ copied the examples/material-ui-vite-ts directory to a new directory on my dev machine, ran npm i then npm run dev. So far so good.

I then copied the dashboard and shared-theme directories into my new project, re-ran npm run dev and I’m getting errors:

X [ERROR] The JSX syntax extension is not currently enabled    

src/dashboard/Dashboard.js:28:4:
  28 │     <AppTheme {...props} themeComponents={xThemeComponents}>
     ╵     ^
The esbuild loader for this file is currently set to "js" but it must be set to "jsx" to be able to parse JSX syntax. You can use "loader: { '.js': 'jsx' }" to do that.

I’m seeing in the Dashboard/components/ directory that each .tsx component has a .js counterpart, which I don’t understand.

enter image description here

The issue doesn’t seem to be documented in the README and I’m not sure how to proceed so that the build will use the tsx file rather than the js.

Some video on BuddyBoss is Uploading Successfully and some are not [closed]

Some video on BuddyBoss is Uploading Successfully and some are not while i disable the thumbnail generation on runtime with custom code it starts uploading every video and when the thumbnail is enable some uploads and some not !

To Reproduce:

Go to Main Activity Page and Uploads a video
while it uploads and generate a thumbnail
on some videos when clicked on post it failed to post

while on some videos it uploads the video successfully

Expected behavior:

It must upload any video that is mentioned in the settings of media whether mp4 or any that’s mentioned

Environment

https://america24.tv/

Video Explanation :

https://drive.google.com/file/d/10C7Yn9ncyaWO0YGs_HdwljXPazgtLrhn/view

Toggle menu in CSS

I have java script code like this:

const mobileMenu = document.querySelectorAll(".mobile-menu-logo");
mobileMenu.forEach((menu) => {
  menu.addEventListener("click", () => {
    mobileMenu.forEach((b) => b.classList.toggle("hidden"));
  });
});

It’s toggling menu button on click, But sometimes it has issue showing the correct current icon after multiple clicks. Specialy on mobile devices. Why is that?

How to Handle Worker Thread File with an importScripts file with a Reference to window?

I have a worker thread file worker.js which is used when setting up the worker:

myWorker = new Worker("worker.js");

The file has at the top:

importScripts("general.js");

where general.js is a file with a load of constants and things defined. At one point it refers to window, which obviously will not make sense when part of an importScripts for a worker.

How can I tell the importScripts to ignore that part of the file when window is not defined?

If I have something like:

if(window){
}

Google Chrome debugger still complains with Uncaught ReferenceError: window is not defined.

The obvious thing to do is just to separate that code into a separate file, but it makes sense to keep it all together for the main thread.

Why is my addEventListener function not working in JavaScript?

I’m trying to make a button trigger an alert when clicked, but nothing happens when I click the button. Here’s the code I’m using:

<button id="myBtn">Click me</button>

document.getElementById("myBtn").addEventListener("click", function() {
    alert("Button clicked!");
});

I’ve made sure the script is linked correctly in my HTML. There are no errors in the console either.

What I expect:
When I click the button, I want an alert saying “Button clicked!” to appear.

What’s happening:
Clicking the button does nothing. No errors, no alert.

What I’ve tried:
Moving the script to the bottom of the HTML
Wrapping the code in window.onload
Checking the button ID

I’m not sure what I’m doing wrong. Any help would be appreciated!

CSS hover effects moves input field below

I finally got the PrimeVue hover effects working. I had to add a bit of CSS work to it, since the Designtokens did not all the work.

But now the hover effect of the first input field causes the input field below to move, when the border width of the first input field changes. I don’t want the input field below to move.

I don’t have this kind of problem for the textarea fields.

template:

      <label for="ref_num" class="labels">Untertitel</label>
  <InputGroup>
    <IconField>
      <InputText id="eventSubtitle" v-model="eventSubtitle" placeholder="Untertitel" maxlength="255" />
      <!--InputIcon class="pi pi-exclamation-circle" v-tooltip="'Untertitel ist erforderlich'"></InputIcon-->
    </IconField>
  </InputGroup>

  <label for="ref_num" class="labels">Standort (GPS)</label>
  <InputGroup>
    <InputGroupAddon>
      <i class="pi pi-globe"></i>
    </InputGroupAddon>
    <IconField>
      <InputMask id="eventLocation" v-model="eventLocation" placeholder="Standort (GPS)" mask="99.9999, 999.9999"
        style="border-radius: 0rem 0.4rem 0.4rem 0rem;" maxlength="255" />
      <!--InputIcon class="pi pi-exclamation-circle" v-tooltip="'Standort erforderlich'"></InputIcon-->
    </IconField>
  </InputGroup>

style:

.p-inputtext {width: 100%; padding: 1rem !important; box-sizing: border-box;}
.p-inputtext:hover {border-width: 0.15rem; box-sizing: border-box;}

Bootstrap Validation on multiple steps form

I got an example of a form with steps from W3C web page at https://www.w3schools.com/howto/howto_js_form_steps.asp and combined it with a Bootstrap form. The issue now is that I can’t make it validate only on the first page. If you click on the Next button (sometimes twice), it allows you to go to the next page.

I’m trying to make it so that it only validates the visible page, but I can’t seem to find a work around it. I’ve tried isVisible, return false, etc., but nothing works. I cleaned up the attempted version to post it here.

Does anyone have any suggestions? I indented the bootstrap code for clarity purposes.

                      /*boostrap validation*/
                  // Example starter JavaScript for disabling form submissions if there are invalid fields
                  (() => {
                    'use strict'

                    // Fetch all the forms we want to apply custom Bootstrap validation styles to
                    const forms = document.querySelectorAll('.needs-validation')

                    // Loop over them and prevent submission
                    Array.from(forms).forEach(form => {
                      form.addEventListener('submit', event => {
                        if (!form.checkValidity()) {
                          event.preventDefault()
                          event.stopPropagation()
                        }

                        form.classList.add('was-validated')
                      }, false)
                    })
                  })()
                  /*boostrap validation*/

This is the URL to the CodePen: https://codepen.io/raulgonzalez77/pen/VYwqYmL