October 22, 2024
Chicago 12, Melborne City, USA
javascript

How can I fix GLSS Shading on THREE.js so it shows an accurate day-night cycle on an earth?

I’m working on a 3D Model of the earth for a project, and I am having a problem. Originally, I was using no shading, and added both materials to a group, with THREE.AdditiveBlending. This led to what is seen in the image below, where the lights that show up on the night texture show up

Read More
javascript

How to dyanamically get the data on sql using d3.js with recursive functions?

I built a tree with d3.js. The Head and children as shown in the image attached: https://www.awesomescreenshot.com/image/51112170?key=ef216990b59101f1fa063f72df525fb4 If it is ordinary HTML and Javascript, it will show children: https://www.awesomescreenshot.com/image/51114459?key=1c64ecfe53c7a0f818aa5dfad4a76d90 Now the goal is pull out the children like E, F, G as dynamic users from the SQL In the first level, children is working just

Read More
javascript

Switch component is not working after switching from Checkbox

I was using Ant Design Checkbox earlier to check and publish the comments and it was working fine with no errors. <Checkbox key={record.id} checked={Publish[record?.id]?.["ispublish"] == 'true' ? true : false} onChange={(e) => Update(e.target.checked, record)} /> I want to use Switch instead. <Switch key={record.id} checked={Publish[record?.id]?.["ispublish"] == 'true' ? true : false} onChange={(e) => Update(e.target.checked, record)} />

Read More
javascript

How can I find the default rules for phone numbers in the google-libphonenumber NPM package?

I’m using the google-libphonenumber NPM package to format and parse phone numbers, specifically for New Zealand. I want to understand which default rules are applied when parsing and formatting phone numbers. Is there a way to access or view the rules used by the library for a specific region, like New Zealand? Example: When parsing,

Read More
javascript

prevent from consuming touch and scroll event on VictoryChart in React

when using this code in web browser and web app, cannot scroll on VictoryChart component it consumes all event and so scroll not working plz check the code below import { useContext, useEffect, useRef, useState } from 'react'; import "../styles/global-style.css"; import colors from "../assets/values/Colors"; import TextWithSubNoun from '../component/TextWithSubNoun'; import { VictoryChart } from 'victory-chart'; import

Read More
javascript

Typescript – Is it possible to extract a list of types from a constant object?

I’m trying to read from a data file where everything is stored in arrays, and transfer that to the equivalent Javascript object. What I want to be able to do with typescript is create a system that automatically reads the arrays, and stores them in corresponding object, but also is able to verify that the

Read More
javascript

How do I refund a wrong transaction on PhonePe?

To refund money from Phone Pe for a wrong transaction, you should immediately contact Phone Pe’s customer support:08O99-130-508 and (available 24/7) report .." To refund money from Phone Pe for a wrong transaction, you should immediately contact Phone Pe’s customer support:08O99-130-508 and (available 24/7) report .." You need to sign in to view this answers

Read More
javascript

Unpredictable variable context in Typescript classes

I am trying to create a class in Typescript (React Native) that manages modals in a stack as to not have the modals consume too much memory (use case might not be super important). I am declaring an instance of the class and then pushing and popping from the class. However, when I call the

Read More
javascript

When using @tomjs/vite-plugin-vscode, blank page is shown, but only in dev mode

I’m using @tomjs/vite-plugin-vscode to build a VS Code extension with Vue. I started from a WebView Provider, partially following its minimal example. vite.config.mts: import pluginVscode from '@tomjs/vite-plugin-vscode'; import pluginVue from '@vitejs/plugin-vue'; import { defineConfig } from 'vite'; export default defineConfig({ plugins: [ pluginVscode({ recommended: true, }), pluginVue({ template: { compilerOptions: { isCustomElement: tag => tag.startsWith('vscode-'),

Read More
javascript

Fetch is only working when my chrome dev-tool is open why?

I’m encountering an issue where a fetch API call works perfectly when the Chrome DevTools are open, but fails when the DevTools are closed. I’m using React with the useEffect hook to fetch restaurant data from an API, and the problem only occurs when running the application without the DevTools. I’ve tried wrapping my fetch

Read More