Sziaszok, szeretnék segítséget kérni html és css-el és javascripttel kapcsolatban, hogyan tudok [closed]

Nem tudok fethcelni javascripttel. sgeíííts 🙁

Szeretnék segítséget kapni

Még sok sok sok betűt le kell írjak mert nincs elég szó a kérdés feltételéhez el kell érjem a 220 karaktert, szóval gyors iderakom a palacsinta recepjét:
Hozzávalók
3 db tojás
2 ek cukor
1 csomag vaníliás cukor
240 g finomliszt
2.5 dl tej
2.5 dl szódavíz
0.5 dl napraforgó olaj

powerscript to create subfolders in folders

Am getting errors when executing powershell script.I got folders on the name of date DD MMM example 01 May,02 May go on to 31 May.I want to get the name of the folder 01 May covert it to 01 May 2025 to check if the date is monday then add subfolders of different name in it.But I got stuck with this part of code guving me errors when run

if([datetime]::TryParseExact(“$folderName $currentYear”, “dd MMM yyyy”, $null, [System.Globalization.DateTimeStyles]::None, [ref]$dateParsed)

how to proxy an iframe

I want to use an iframe to show some kind of chart with xmind-embed-viewer. inside this package there is iframe that send request to xmind.app and fetch some data and show it.
recently this website block our region so I need to use a proxy inside that iframe.
how can I do it ?

TypeError: 0, _reduxSaga.default is not a function (it is undefined), js engine: hermes

I’ve been working on a mobile app with Expo React-Native for a while. Everything worked fine with Expo 52.0.37 and React-Native 0.76.7. However, since updating to Expo 53.0.9 and React-Native 0.79.2, my app has been crashing with the following error when I call createSagaMiddleware():

TypeError: 0, _reduxSaga.default is not a function (it is undefined), JS engine: Hermes

The Redux-Saga version is 1.2.3. I encountered the same issue after updating it.

import AsyncStorage from '@react-native-async-storage/async-storage';
import {legacy_createStore as createStore, applyMiddleware} from 'redux';
import {persistStore, persistReducer} from 'redux-persist';
import createSagaMiddleware from 'redux-saga';
import logger from 'redux-logger';
import rootReducer from '@reducers';
import rootSagas from '@sagas';

/**
 * Redux Setting
 */
const persistConfig = {
  key: 'root',
  storage: AsyncStorage,
  blacklist: ['home', 'wishlist', 'list', 'messenger', 'notification'],
  timeout: 100000,
};
const sagaMiddleware = createSagaMiddleware();

let middleware = [sagaMiddleware];
if (process.env.NODE_ENV === `development`) {
  middleware.push(logger);
}

const persistedReducer = persistReducer(persistConfig, rootReducer);
const store = createStore(persistedReducer, applyMiddleware(...middleware));
sagaMiddleware.run(rootSagas);
const persistor = persistStore(store);

export {store, persistor};

I’m trying to add redux-saga middleware.

Is there a JavaScript reference library specific to HTML5 Canvas in Adobe Animate?

I have returned to Adobe Animate after a hiatus of man years thanks to Apple killing Flash off. Now swfs and AS2 are dead, I am using it to create projects using JavaScript and Canvas.

Is there a JavaScript reference library specific to HTML5 Canvas in Adobe Animate? Either online or a book.

There does not seem to be much reference out there other than the odd YouTube video. The videos needs to be watched, which takes time, and they may not necessarily have the answer I am looking for.

jQuery document ready function not run at all in another .js file

We include jQuery and document ready code at the bottom of the page here:

<script src="https://songer.datasn.com/themes/stage2/_public/js/jquery-2.1.3.min.js"></script>
<script src="https://songer.datasn.com/themes/stage2/_public/js/main.js"></script>
<script src="/outsource/main-site-js/main-2.js"></script>

Which loads jQuery first and then 2 separate .js files that use $(document).ready(function() { .... }) to do stuff.

We have this in main.js:

$( document ).ready(function() {
    console.log('Document ready function in main.js --- Run!');
});

And these in main-2.js:

console.log('Hello from main-2.js');

if (window.jQuery) {
    console.log('jQuery is loaded!');
} else {
    console.log('jQuery is not loaded.');
}

console.log($);
console.log(jQuery);
console.log($( document ));

$( document ).ready(function() {
    
    console.log('Document ready function in main-2.js --- But not run, why?');
    
});

console.log('End of js file');

The weird issue is that the closure function for ready() is run in main.js but NOT main-2.js. Why?

See console log screenshot:

enter image description here

Why doesn’t the ready() closure run in main-2.js? The jQuery is apparently loaded and there are no obvious errors.

Vue Js placing a dynamic variable within a data set. error: Unquoted attribute value cannot contain

How do you place dynamic values within a database on a vue template. I am trying to add an id number to my delete button.

I keep getting this error:

Unquoted attribute value cannot contain U+0022 ("), U+0027 (')

This works:

<button
 type="button"
 @click.prevent="heart"
 :data-id=1"
 >
Delete
</button>

However when I try adding a dynamic variable to the data-id, it crashes the page:

<button
type="button"
@click.prevent="heart"
 :data-id="{{member.member_id}}"
>
Delete
</button>

i tried json encoding the value:

:data-id={{json_encode(member.member_id)}}"

it gave this error: Unquoted attribute value cannot contain U+0022 (“), U+0027

Does Upstash’s context.call method support ReadableStream.?

I am using upstash context.call method to call my langgraph server. My langgraph server has an agent that autocompletes the notetext. when I do console.log on my body of context.call i can see the responses but I only see the workflowrunId when i call the route through frontend. Pls help what’s the issue here?


import { serve } from '@upstash/workflow/nextjs';
//import { TextDecoder, TextEncoder } from 'util';

export const { POST } = serve<{ noteText: string }>(
  async (context) => {
    const { noteText } = context.requestPayload;

    const { status, headers, body } = await context.call<ReadableStream>('langgraph-request', {
      url: `${process.env.LANGGRAPH_RUN_URL}/runs/stream`,
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${process.env.LANGSMITH_API_KEY}`,
      },
      body: {
        assistant_id: 'autocomplete_agent',
        input: { note_text: noteText },
        stream_mode: ['updates'],
      },
    });
    console.log('body:', body);

    return body;
  },
  {
    failureFunction: ({ failStatus, failResponse, failHeaders }) => {
      console.error('Autocomplete workflow failed:', {
        status: failStatus,
        response: failResponse,
        headers: failHeaders,
      });
    },
  }
);

My frontend code:

const getSuggestion = debounce(async (noteText: string, cb: (suggestion: string) => void) => {
      try {
        const response = await fetch('/api/workflow/autocomplete/', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({ noteText }),
        });

        if (!response.ok || !response.body) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        console.log('response body frontend:', response.body.readStreamableValue);

        const reader = response.body.getReader();
        const decoder = new TextDecoder();

        let suggestion = '';

        while (true) {
          const { done, value } = await reader.read();
          if (done) break;
          
          // Directly append the decoded text
          suggestion += decoder.decode(value);
          console.log('suggestion:', suggestion);
          cb(suggestion); // Update UI progressively
        }
        
        cb(suggestion); // Final update
      } catch (err) {
        console.error('Autocomplete failed:', err);
        cb('');
      }
    }, 300);
        
My console.log from route:body: event: metadata
data: {
data:   "run_id": "2d6cf720-42e0-43b1-8650-6196b93db2c5",
data:   "attempt": 1
data: }

event: updates
data: {
data:   "autocompleteNote": {
data:     "note_text": "A ",
data:     "suggested_completion": "<cusor-position> patient presents with persistent symptoms of fatigue and malaise. Vital signs are stable, and a thorough physical examination reveals no acute distress. Laboratory tests, including complete blood count and metabolic panel, are pending. The patient has been advised to maintain hydration and rest while awaiting results. Follow-up appointment scheduled for next week to review test outcomes and adjust management plan as necessary."
data:   }
data: }
but from fronted fetch, this is not being returned. I am simply getting workflowRunId. Please help what could be the issue


React: “Element type is invalid” when trying to render a modal component

I’m working on a React project and encountering this error when trying to open a modal:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Here’s my file structure:

src/
├── Components/
│   ├── Modals/
│   │   ├── MainModal.jsx
│   │   └── CategoryModal.jsx
└── Screens/
    └── Dashboard/
        └── Admin/
            └── Categories.jsx

CategoryModal.jsx

import React from "react";
import MainModal from "./MainModal";

function CategoryModal({ modalOpen, setModalOpen }) {
  return (
    <MainModal modalOpen={modalOpen} setModalOpen={setModalOpen}>
      <div className="inline-block sm:w-4/5 border border-border md:w-3/5 lg:w-2/5 w-full align-middle p-10 overflow-y-auto bg-main text-white rounded-2xl">
        <h2 className="text-3xl font-bold">Create</h2>
      </div>
    </MainModal>
  );
}

export default CategoryModal;

Categories.jsx

import React, { useState } from "react";
import SideBar from "../SideBar";
import { CategoriesData } from "../../../Data/CateporiesData";
import { HiPlus } from "react-icons/hi";
import Table2 from "../../../Components/Table2";
// Make sure this path is correct - verify the actual location of your CategoryModal component
import CategoryModal from "../../../Components/Modals/CategoryModal";

function Categories() {
  const [modalOpen, setModalOpen] = useState(false);

  const openModal = () => {
    setModalOpen(true);
  };

  return (
    <SideBar>
      {/* Modal component */}
      <CategoryModal modalOpen={modalOpen} setModalOpen={setModalOpen} />
      <div className="flex flex-col gap-6">
        <div className="flex items-center justify-between gap-2">
          <h2 className="text-xl font-bold">Categories</h2>
          <button
            onClick={openModal}
            className="bg-main flex cursor-pointer items-center gap-2 font-medium transition hover:bg-subMain border border-red-500 text-white py-2 px-4 rounded"
          >
            <HiPlus /> Create
          </button>
        </div>

        <Table2 data={CategoriesData} users={false} />
      </div>
    </SideBar>
  );
}

export default Categories;

MainModal.jsx

import { Dialog, Transition } from "@headlessui/react";
import React, { Fragment, useRef } from "react";
import { IoClose } from "react-icons/io5";

function MainModal({ modalOpen, setModalOpen, children }) {
  const cancelButtonRef = useRef();
  return (
    <>
      <Transition show={modalOpen} as={Fragment} appear>
        <Dialog
          as="div"
          className="fixed inset-0 z-30 overflow-y-auto text-center"
          initialFocus={cancelButtonRef}
          onClose={() => setModalOpen(false)}
        >
          <div className="min-h-screen px-4">
            <Transition.Child
              as={Fragment}
              enter="ease-out duration-300"
              enterFrom="opacity-0"
              enterTo="opacity-100"
              leave="ease-in duration-200"
              leaveFrom="opacity-100 scale-100"
              leaveTo="opacity-0"
            >
              <Dialog.Overlay className="fixed inset-0 bg-black opacity-60" />
            </Transition.Child>
            
            {/* This element is to trick the browser into centering the modal contents. */}
            <span
              className="inline-block h-screen align-middle"
              aria-hidden="true"
            >
              &#8203;
            </span>
            
            <Transition.Child
              as={Fragment}
              enter="ease-out duration-300"
              enterFrom="opacity-0 scale-95"
              enterTo="opacity-100 scale-100"
              leave="ease-in duration-200"
              leaveFrom="opacity-100 scale-100"
              leaveTo="opacity-0 scale-95"
            >
              {children}
            </Transition.Child>
            
            <div className="absolute right-5 top-5">
              <button
                onClick={() => setModalOpen(false)}
                type="button"
                className="inline-flex transition justify-center px-4 py-2 text-base font-medium text-white bg-subMain rounded-full hover:bg-white hover:text-red-500"
              >
                <IoClose />
              </button>
            </div>
          </div>
        </Dialog>
      </Transition>
    </>
  );
}

export default MainModal;

I’ve confirmed:

The component is exported with export default

The import path is correct (triple-checked)

I restarted the dev server

But the error persists.

Any ideas why this might be happening?

Scriptable iPad app: OpenAI call returns “No question generated” and Dictation always fails with “Recognizing the audio failed”

I’m building a daily reminiscence app for my grandfather on iPad using Scriptable. It:

  1. Loads a simple JSON profile
  2. Calls the OpenAI Chat API to generate a gentle question
  3. Presents it via Alert + Speech
  4. Uses Dictation.start() to capture his spoken answer
  5. Writes both Q&A into a local JSON log

Most of the code is working, but I keep hitting two errors in my Console log:


Console log
2025-05-10 17:17:15: Reminiscence app starting: 5:17:15 PM
2025-05-10 17:17:15: Generating question…
2025-05-10 17:17:16: OpenAI API Error: Error: No question generated
2025-05-10 17:17:16: Presenting question: Margaret, do you remember any special songs you enjoyed when you were younger?
2025-05-10 17:17:19: Starting dictation…
2025-05-10 17:17:25: Dictation error: Error: Recognizing the audio failed. Please try again.
2025-05-10 17:17:25: Saved conversation entry
2025-05-10 17:17:25: Presenting thanks for response: [No response recorded]


What I’ve tried so far

  • OpenAI “no question generated”
    • Verified OPENAI_API_KEY is set and valid
    • Logged out the raw response from https://api.openai.com/v1/chat/completions
    • Fallback to hard-coded questions works if I disable useOpenAI
  • Dictation error
    • Confirmed Scriptable has microphone permission
    • Tried both FileManager.local() and FileManager.iCloud() (for writing)
    • Wrapped await Dictation.start() in try/catch

My two big questions are

  1. OpenAI: Why does my call sometimes throw “No question generated”? Is my request payload malformed, or is Scriptable handling the JSON response incorrectly?
  2. Dictation: What steps are required to get reliable speech-to-text in Scriptable? The prompt appears, but Dictation.start() always fails with “Recognizing the audio failed.”

Any pointers on how to debug these two errors (or better patterns for calling OpenAI + Dictation in Scriptable) would be hugely appreciated. Thank you!

Fetch API Accumulative Memory Spike When Refreshing

I’m having an issue where I am fetching from a website in my Vue project, and the memory usage grows every refresh – when I first run the project in development mode and check the memory usage in my browser, the page sits at around 40 MB ram usage. However after refreshing somewhat frequently it goes over 1 GB ram usage, after which it does tend to reset. I am not sure if this is intended garbage collection but I would like to prevent the memory usage from peaking so high if possible. Any help would be appreciated!

Here is my API code which fetches the information:

export async function api(subDirectory) {
  try {
    const res = await fetch(
      `https://wheelcollectors.com/collections/${subDirectory}/products.json?limit=1`
    )

    const data = await res.json()

    const availableProducts = data.products.filter(
      (product) => product.variants[0].available === true
    )

    return availableProducts
  } catch (error) {
    console.error("Error fetching data:", error)
    return [] // Important to avoid undefined returns
  }
}

And here is where that API function is called on my home page.

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import { api } from '../api.js'

let products = ref([])

onMounted(async () => {
    let data = await api("hot-wheels-premium-collection")
    //console.log(data)

    products.value = data.map((item) => {
        let name = item.title.split("*")[0]
        let brand = item.title.split("*")[2]
        let link = `https://wheelcollectors.com/products/${item.handle}`
        
        return {
            brand: brand,
            name: name,
            price: parseFloat(item.variants[0].price),
            link: link
        }
    })
})
</script>

<template>
    <div class="container">
        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>Brand</th>
                    <th>Name</th>
                    <th>Price</th>
                    <th>Link</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(product, index) in products" :key="index">
                    <td>{{ product.brand }}</td>
                    <td>{{ product.name }}</td>
                    <td>${{ product.price.toFixed(2) }}</td>
                    <td><a :href="product.link" target="_blank">View Product</a></td>
                </tr>
            </tbody>          
        </table>
    </div>
</template>