Custom pop up timer not working correctly

When socket messages come, I pop up divs in my page which disposes after 3 seconds themselves

<!-- I'm using vuejs -->

<div v-for='item in messageList'>
  <!-- message body ,  -->
</div>
// used to pause timer when mouseEnter and resume when mouseLeave
const mesTimerMap = new Map()

const messageList = ref([])
socket.on('message',function(mesBody){
  messageList.value.push(mesBody)
  let timer = setTimeout(()=>{
    handleRemove(mesBody) // in which I splice messageList
  },3000)
  mesTimerMap.set(mesBody.id,timer)
})

But I found that if I switch to other tabs and here comes a message, when I change back to my page, the pop up is still there even 3 seconds already passed. And I can not replicate this every time. Why is that?

How can I convert a cubemap stripe to a ‘little planet’ projection

I have some images in cubemap format which I’m using with photo-sphere-viewer (see my repo). I’ve made a simple Apple Shortcut that converts six separate cubemap angles to one stripe. For example:

example cubemap

I want to convert the cubemap to a ‘little planet’ style image such as the one below as a download option for my image. I don’t want to have to download any software, I only want to use JS, but I’m not familiar with THREE.JS.

example little planet image

Thanks!

How do I make a frame update and a time update?

I am making a game (HTML/JS/CSS) where you have things that update every second, but also other things (e.g. keypresses) that need to be updated every frame. So far I have a setTimeout() in a requestAnimationFrame() loop for the former, but I need to know how to add a frame update alongside it.

Accessing values from Angular object defined with TypeScript index signature using bracket notation

I am having trouble accessing my environment variables in Angular. What am trying to achieve is merging configuration values coming from the backend/server with the configuration of the frontend. Here are the code snippets:

STEP 1: EnvironmentConfiguration

    @Injectable({
      providedIn: "root"
    })
    export class EnvironmentConfiguration {
      public production = false;
      [key: string]: unknown;
    }

STEP 2: environment.ts

export const environmentConfiguration: EnvironmentConfiguration = {
  production: false,
// Adding extra key-value pairs to the config
  enableAuthentication: true,
  enableSSO: false
}

STEP 3: EnvironmentConfigurationService

This service init function is called during application startup to add extra info from the server to the environment object

@Injectable({
  providedIn: 'root'
})
export class EnvironmentConfigurationService {
 private informationService = inject(InformationService);
 private environment: EnvironmentConfiguration = new EnvironmentConfiguration();

  get Environment(): EnvironmentConfiguration {
    return this.environment;
  }

public initializeEnvironment(angularConfig: EnvironmentConfiguration): Promise<void> {
this.environment = angularConfig;
this.informationService.getInformation().pipe(finalize(() => resolve())).subscribe({
        next: result => {
          // Here am adding extra info from the server to the environment object
          this.environment['shelf'] = result.shelf?.id;
          this.environment['table'] = result.table?.id;
          this.environment['carpet'] = result.carpet?.id;
         },
        error: err => 
          this.logger.error('Problem loading application info', err);
          
        complete: () => this.logger.debug('Merging info with Angular environment config')
      });
  }
}

STEP 4: App initialization function.

This method is called during Angular application startup (is called from the app.config.ts). The “environmentConfig” parameter will be the const variable “environmentConfiguration” defined in step 2 (from the environment.ts file) so that extra data from the server can be added to it.

export function provideEnvironmentConfig(environmentConfig: EnvironmentConfig): EnvironmentProviders {
  return makeEnvironmentProviders([
    provideAppInitializer(() => {
      const environmentConfigurationService = inject(EnvironmentConfigurationService);
      return environmentConfigService.initEnvironment(environmentConfig)
    })
  ]);
}

STEP 5

I inject the EnvironmentConfigurationService in the menu service to have access to the environment object so that I can access the config info added from the backend/server

@Injectable({
  providedIn: 'root'
})
export class MenuService {
 private environmentConfigurationService = inject(EnvironmentConfigurationService);

// In this method I want to have access to the values added to the environment object from the server. When I log the whole object I see that values from the server are present but when I try to extract a specific value using the bracket notation I get undefined, very weird behavior I don't understand.
  processMenu() {
   const config = this.environmentConfigurationService.EnvironmentConfig;
   console.log(config) // displays the whole object including values from the server
   const shelf = config['shelf'];
   console.log(shelf) // displays undefined
  }
}

What am I doing wrong?

Problem Accessing Values From Angular Object Defined With Typescript Index Signature Using Bracket Notation

I am having trouble accessing my environment variables in Angular. What am trying to achieve is merging configuration values coming from the backend/server with the configuration of the frontend. Here are the code snippets:

//— STEP 1: EnvironmentConfiguration

    @Injectable({
      providedIn: "root"
    })
    export class EnvironmentConfiguration {
      public production = false;
      public myapplications?: { [key: string]: string } = {};
      [key: string]: unknown;
    }

//— STEP 2: environment.ts

export const environmentConfiguration: EnvironmentConfiguration = {
  production: false,
  myapplications: {
    book: 'https://www.book.com',
    pen: 'https://www.pen.com'
  },
// Adding extra key-value pairs to the config
  enableAuthentication: true,
  enableSSO: false
}

// — STEP 3: EnvironmentConfigurationService
This service init function is called during application startup to add extra info from the server to the environment object

@Injectable({
  providedIn: 'root'
})
export class EnvironmentConfigurationService {
 private informationService = inject(InformationService);
 private environment: EnvironmentConfiguration = new EnvironmentConfiguration();

  get Environment(): EnvironmentConfiguration {
    return this.environment;
  }

public initializeEnvironment(angularConfig: EnvironmentConfiguration): Promise<void> {
this.environment = angularConfig;
this.informationService.getInformation().pipe(finalize(() => resolve())).subscribe({
        next: result => {
          // Here am adding extra info from the server to the environment object
          this.environment['shelf'] = result.shelf?.id;
          this.environment['table'] = result.table?.id;
          this.environment['carpet'] = result.carpet?.id;
         },
        error: err => 
          this.logger.error('Problem loading application info', err);
          
        complete: () => this.logger.debug('Merging info with Angular environment config')
      });
  }
}

// — STEP 4: App initialization function. This method is called during Angular application startup (is called from the app.config.ts). The “environmentConfig” parameter will be the const variable “environmentConfiguration” defined in step 2 (from the environment.ts file) so that extra data from the server can be added to it.

export function provideEnvironmentConfig(environmentConfig: EnvironmentConfig): EnvironmentProviders {
  return makeEnvironmentProviders([
    provideAppInitializer(() => {
      const environmentConfigurationService = inject(EnvironmentConfigurationService);
      return environmentConfigService.initEnvironment(environmentConfig)
    })
  ]);
}

//– STEP 5: I inject the EnvironmentConfigurationService in the menu service to have access to the environment object so that i can access the config info added from the backend/server

@Injectable({
  providedIn: 'root'
})
export class MenuService {
 private environmentConfigurationService = inject(EnvironmentConfigurationService);

// In this method i want to have access to the values added to the environment object from the server. When i log the whole object i see that values from the server are present but when i try to extract a specific value using the bracket notation i get undefined, very weird behavior i don't understand.
  processMenu() {
   const config = this.environmentConfigurationService.EnvironmentConfig;
   console.log(config) // displays the whole object including values from the server
   const shelf = config['shelf'];
   console.log(shelf) // displays undefined
  }
}

I have no idea what am doing wrong. Am i accessing the data in a wrong way? Any pointer to a blog or tutorial to fix it will be much appreciated.

How to conditionally change pointColor from Nivo Line Chart

I would like to conditionally change the pointColor of the Line Chart.

Depending of the data value from X Scale, the point should have a different color.

Example:
enter image description here

I’ve tried to use the prop pointColor as a function but it does not return the values for me to change the color dinamically.

Here is what I have so far:
https://codesandbox.io/p/sandbox/nivo-line-responsive-chart-forked-49tymy?file=%2Fsrc%2Findex.js%3A103%2C1

Nuxt 3: Prevent useFetch or useAsyncData requests from appearing in browser Network tab after client navigation

I’m working on a Nuxt 3 project and trying to make all API calls happen only on the server so that API URLs never appear in the browser’s Network tab under fetch or xhr.

When I use useFetch or useAsyncData with server: true, the request runs on the server during the initial load, which is fine. However, when I navigate to another route and then return, the data is fetched again from the client side, and I can see the request URL in the Network tab.

I’ve tried { server: true }, server APIs, and forcing SSR mode, but none of them fully prevent client-side re-fetching.

How can I ensure useFetch or useAsyncData always execute only on the server — even after route navigation — while keeping all Nuxt features like reactivity and loading states, and without creating extra server API endpoints?

Post request body empty – XMLHttpRequest to PHP

Always getting empty post data null in php end

var data = new FormData();
data.append('ip', 'val');
data.append('ua', 'val2');
data.append('country', 'val3');

var xhr = new XMLHttpRequest();
xhr.open('POST', 'visitor.php?type=visitorControl', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);

PHP END

if ($_GET['type'] == 'visitorControl') {
    
    $file = 'visitors.json';
    $visitors = json_decode(file_get_contents($file), true);
    $userid = substr(str_shuffle('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0,6);;
    $newEntry = [
        'userip' => $_POST['ip'],
        'useragent' => $_POST['ua'],
        'country' => $_POST['country'],
        'status' => 'Pending',
        'timestamp' => 'NA'
    ];

    $visitors[$userid][] = $newEntry;
    file_put_contents($file, json_encode($visitors));
    // setcookie("valid_userid", $userid, time()+86400);
    $_SESSION['valid_userid'] = $userid;
    echo json_encode(array(
        'userid' => $userid,
        'status' => 'ok'
    ));
}
[{"userip":null,"useragent":null,"country":null,"status":"Pending","timestamp":"NA"}],"LInUxe":[{"userip":null,"useragent":null,"country":null,"status":"Pending","timestamp":"NA"}],"MweWyG":[{"userip":null,"useragent":null,"country":null,"status":"Pending","timestamp":"NA"}],"qfAFcG"]

Even i tried stringify data to json and change request header but always getting empty

Can anyone help

How to avoid slow Post-Redirect-Get (PRG) flow when updating data?

I have two pages in my Next.js app:

  1. /entry-detail — user edits a single entry and clicks Save

  2. /entry-list — shows a list of all entries

When the user saves from /entry-detail I want to do both of these atomically in one HTTP request:

  1. Update the entry object in the database

  2. Navigate to /entry-list and display the updated list of entries

In a plain React + Express app I would do this:

  1. PUT /api/entry (server updates DB) — server returns the full, updated list of entries

  2. Put that list into a client-side entry store (Context / Redux / Zustand)

  3. router.push('/entry-list')

  4. /entry-list renders entries from the store (no extra HTTP request)

This achieves the behavior I want in a single HTTP request (one round-trip), avoiding a second request from /entry-list and improving TTFB/UX.

Question
What is the idiomatic way to accomplish the same with Next.js? Is there a recommended pattern (API route, App Router server action, etc.) to:

  1. Update the entry, return the updated list in the same response, and

  2. Navigate to /entry-list and render from the returned list — without making a second HTTP request?

Should I start a requestAnimationFrame loop with an initial call to requestAnimationFrame(callback)?

Here’s my requestAnimationFrame() callback:

function callback(){
    render();
    requestAnimationFrame(callback);
}

When starting an animation loop with this callback, should I start the loop like this:

requestAnimationFrame(callback);

or by simply calling the callback:

callback();

I get the feeling that if I start it by just calling callback(), then the callback will actually run twice in that initial frame (resulting in a wasted call to render()), because it was called outside the requestAnimationFrame API. Is my assumption correct?

In other words, if I just call callback() by itself, then there’s a chance it would execute at the beginning of a frame. And since callback() internally schedules itself to run again before the next frame using requestAnimationFrame(callback), then the callback would just run again in the same frame.

No Data or Errors from Server Sent Events

I’m new to server sent events and I’m trying the MSDN laid-out method of going about server sent events; with no luck.

No errors and no data seem to be received by my small HTML file’s embedded segment of Javascript. I don’t know if the problem is that my PHP script isn’t functioning properly either.

I uploaded the following HTML and PHP scripts to my friend’s server and viewed the HTML file in my Chrome browser.

These two files are hosted on my friend’s server in the same directory. I successfully navigated to and viewed the HTML file (test.html)

test.html

<!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script>
        const evtSource = new EventSource("event.php");
        evtSource.addEventListener("ping", (event) => {
            document.body.innerHTML+=event.data+"<br /><br />";
        });
        evtSource.onerror = (err) =>
        {
            document.body.innerHTML+=err;
        }
    </script>
    </head>

    <body>
        &nbsp;
    </body>
</html>

event.php

<?php
    header("X-Accel-Buffering: no");
    header("Content-Type: text/event-stream");
    header("Cache-Control: no-cache");

    while (true)
    {
        echo "event: pingn";
        echo 'data: Hello World!';
        echo "nn";

        if (ob_get_contents()) {
            ob_end_flush();
        }
        flush();

        if (connection_aborted()) break;

        sleep(1);   
    }

React Native “Text strings must be rendered within a component” Error with No Stack Trace – Need Help Finding Source

type here

Problem Description: I’m getting the dreaded “Text strings must be rendered within a <Text> component” error in my React Native/Expo app, but the error stack trace is completely unhelpful – it only shows: ERROR Warning: Error: Text strings must be rendered within a <Text> component. This error is located at: Call Stack App (<anonymous>) withDevTools(App) (<anonymous>)

I am desperate because I have been searching for over a week now. The IOS version is fine but when i run it on Android it crashes. I don’t know if its looked down upon on here but i even turned to AI. PM or DM and I can share more if you think you can help

✅ Tested all components individually – Created a component tester that renders each component in isolation. None of the individual components cause the error.

✅ Checked all obvious text rendering patterns:

No unwrapped strings like {someVariable}

No conditional rendering like {condition && “text”}

All text is properly wrapped in <Text> components

Fixed HTML entities like ← → ←

✅ Cleaned and rebuilt everything:

Cleared node_modules, .expo, android builds

Ran npx expo prebuild –platform android –clear

Fresh npm install

✅ Added debugging:

Console.log statements throughout render cycles

Error boundaries to catch the issue

Individual component isolation testing

Does JavaScript object destructuring allocate a new object?

In the following JavaScript, does the object destructuring that follows the creation of target create a new (temporary) object that has to be garbage collected? In other words, are there two objects being created here or just one? I know that from my perspective, a and b are just variables (not objects), but I’m interested in whether JavaScript has to create a throwaway object every time I destructure.

const target = {
    a: 123,
    b: 456
};

const { a, b } = target;

To be super duper sure that no extra object is created, I could do this:

const a = target.a;
const b = target.b;

But I’m wondering if object destructuring gets optimized to that.

Split pane resizable Vertical, How do I set up two vertical split panes so that dragging each will affect the other

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
</body>
</html>

when i move threegutter, top twogutter doesn’t keep moving to topI want to keep moving twogutter, when i move threegutter

Bug Recorder hide Sensitive data in session recording? [closed]

Hello I am using bugrecorder.com and I want to hide some Sensitive data in html, I woul d like to know if I need to add a tag or what

<script>(async function(w,d,b,r){w[b]=w[b]||{q:[],c_id:"68c1894d2fc87783783780e",recordingEnabled:true,formEnabled:true,domain:"atsresumebuilderai.com",custom_data:{}};w[b].set=w[b].add=async function(k,v){w[b].custom_data[k]=v;(w[b].q=w[b].q||[]).push([this===w[b].set?"set":"add",k,v])};const t=d.createElement(r);t.async=1;t.src="https://bugrecorder.com/script.js?domain=atsresumebuilderai.com&c_id=68c1894d2fc87783783780e&t="+Date.now();const y=d.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y)})(window,document,"bugRecorder","script");</script>

I am using tag above

I tried to set recordingEnabled to false but then it disbaled the session recording completly but I want just to hide some data to not be recorder for privacy