Skip to main content

Posts

VSCode: "Go to Symbol in Workspace" and "Go To Definition" only search in currently open tabs (JS)?

This seems to only affect my JS files. My PHP files work fine (with a PHP extension of course). When I do a symbol search (ie. Go to symbol in workspace ) or when I try to Go to Definition (or find usages), it will only look within the currently open tabs. This seems to defeat the purpose of these actions, where I want to search within my entire project. If I open the file containing the symbol/definition I am searching for in one tab, then search for that symbol/definition from a different file in another tab, it works just fine. If I close the tab containing the symbol/definition, it immediately stops working. I've tried disabling all of my extensions. The typescript.workspaceSymbols.scope setting does not affect the problem. I've tried restarting VSCode. I've made sure that the workspace is saved. This is a nearly fresh install of VSCode. Is this just how these features are supposed to work? Do I need to reload some sort of symbol database? Is there some setting or

Fetched data is not updated after changes on next js ssr page

I've got this kind of situation. My application has two pages. The main one is used to show statistics about the user's account. And the user can go to the second one to change these statistics. Both of these pages are server side rendered. So when I go to the first page I see my statistics fetched from the database. I go to the second one and change the data. Then I go back. To go back I use component from "next/link". And here I am on the first page and I see the initial statistics. It seems like the page memoizing fetched data and doesn't update it when I go back. So what do I do to update the data every time the user goes to the statistics page? It's looks like there's no other option except to make it a client component and use useEffect(() => {}, []) hook. What do you think? Here's the statistics page: import Sidebar from "@/components/sidebar/component" import Header from "@/components/header/component" import Statistics

Cannot Change backgound image using javascript though the image change is shown in console?

hello people i am trying to change background images on a interval of 3 seconds using javascript the code seem to be correct because the images can be seen changed in the console but not on the screen i see blank screen after 3 seconds. here is my react code import React, { useEffect, useState } from "react"; function Home() { let i = 0; // Start index from 0 useEffect(() => { const interval = setInterval(backgroundImages, 3000); return () => { clearInterval(interval); // Clean up the interval when the component unmounts }; }, []); function backgroundImages() { const imagearr = [ "rajwada.jpeg", "indore.jpeg", "females.jpeg", "mayor.jpg" ] console.log("Changing background image"); document.getElementById("main").style.backgroundImage = `url(${imagearr[i]})`; i++; if (i === imagearr.length) { i = 0; } } return (

How to implement AES-CCM in Dart

I'm trying to migrate some JavaScript encryption code to a Dart equivalent but I cannot get the same result. The JavaScript code is using Stanford JavaScript Crypto Library and the Dart version is using AesGcm from Dart Cryptography 2.5.0 ( https://pub.dev/packages/cryptography ). The code in JS is result = sjcl.codec.hex.fromBits( sjcl.mode.ccm.encrypt( new sjcl.cipher.aes(sjcl.codec.hex.toBits("6dbe8f8c87d58e61c2ec29321f42e9ff")), // prf sjcl.codec.hex.toBits("00626c742e332e3132397649356b744455415443"), // plaintext sjcl.codec.hex.toBits("101112131415161718191A1B"), // iv sjcl.codec.hex.toBits("6465764944"), // adata 32)); The Dart I try to implement is final encrypted = await AesGcm.with256bits().encrypt( secretKey: SecretKey(utf8.encode("6dbe8f8c87d58e61c2ec29321f42e9ff")), // prf ? utf8.encode("00626c742e332e313239

Why does the web code for the Snapchat Bitmoji Kit lead to a "Something Went Wrong Error"? [closed]

I am trying to implement the Snapchat Bitmoji Kit into a webpage using the Javascript implementation. Here is the code I am following: https://github.com/Bitmoji/BitmojiForDevelopers/blob/main/docs/vanilla-sticker-picker/index.html I am able to get into the login screen successfully. However, when I login I get a "Something Went Wrong Error." I setup the OAuth Keys and connected my Snapchat Developer Account. I am getting a 500 server error. It was also complaining about content security but I added those tags and it didn't fix anything. Is this happening to anyone else? Can someone please edit this code to get the Bitmoji sticker picker to appear? Appreciate all help thanks!! enter image description here I tried adding Content Security Policy tags to my header which was what the Console said to do. I was expecting that there was a browser security issue but I also got a 500 error so it might be a server issue. Via Active questions tagged javascript - Stack Overflow h

How to make transform: scale work with transition and animation on hover?

I am trying to make hover scale work smoothly with animation scale. Hover works with #test but with .rotate I can't get it to work correctly. Also, why the hover scale doesn't work when the animation-fill-mode is forwards instead of none? https://codepen.io/yoholil/pen/qBLbYYm let flag = false; let test = document.querySelector("#test") test.addEventListener("click", function() { console.log(1); flag && test.classList.add("rotate"); !flag && test.classList.remove("rotate"); flag = !flag; }); #test { width: 200px; transition: 0.3s ease; animation: rotateRight 0.3s ease-in-out none; } #test:hover { transform: scale(1.2); } #test.rotate { transform: scaleX(-1); animation: rotateLeft 0.3s ease-in-out none; } @keyframes rotateRight { 0% { transform: scaleX(-1); } 100% { transform: scaleX(1); } } @keyframes rotateLeft { 0% { transform: scaleX(1); } 100% { transform: sc

JavaScript: Key array does not store the value

I expect a list of all keys & values from the arrays to be displayed at the end. But the key array only remembers the key: value from the last for loop operation. let o = 0 let max while (true) { [dir, dirs, files] = dir_content(dir, dirs, files) for (let i = 0; i < files.length; i++) { let blocked_dir = true; for (let b = 0; b < blocked_dirs.length; b++) { if (files[i] == blocked_dirs[b]) { blocked_dir = false } else {} } if (blocked_dir) { tree.dir = files[i]; //Object.assign(tree, {dir: files[i]}); } } console.log(tree) break } Via Active questions tagged javascript - Stack Overflow https://ift.tt/REhruml