StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

React useEffect firing twice on mount even with empty dependency array in StrictMode

21 January 2026 @ 3:07 am

I'm sending an analytics event when a component mounts, but in development with StrictMode it fires twice. I know this is expected behavior, but I'm unsure of the best practice here. Should I debounce the call, use a ref to track if it already fired, or just ignore it since it won't happen in production?

OnScreen keyboard open for Pos system on focus

21 January 2026 @ 2:58 am

I am using electron react app and for pos system i am making it open i have used the code but doesnot close once the keyboard is open const exec = require('child_process').exec; exec('start /d "C:\\Program Files\\Common Files\\microsoft shared\\ink" TabTip.exe', (error, stdout, stderr) => { if (error) { console.error(error); return; } }); }``` please provide approprate solition for this

How to Ctrl+P files in git submodule in vscode?

21 January 2026 @ 2:57 am

In vscode, when I use Ctrl+P (which is also known as Quick Open) to find files in git submodule, it can't find the file, so how can I do this? For example, I have this directory structure: robot (git repo) - robot_ui (git submodule) - ui.cpp - robot_other - other.cpp When I use Ctrl+P to find other.cpp, I can find it, but when I try to find ui.cpp i can't find it. I ensure that I have ui.cpp in robot_ui directory. I have tried the following setting in vscode, but it not work: "search.exclude": { "**/robot_ui": false },

Where is there a Word add-in tutorial that actually works?

21 January 2026 @ 2:54 am

I am trying to create an Office Add-In for Word. I have followed the tutorial at Microsoft Tutorial: Create a Word task pane add-in. I am using Windows 11 Professional, and I have a personal Microsoft 365 subscription. I am a local admin on my machine. I also have a Windows server on my LAN, where I am a domain admin. Here's what happened (all on my local machine): I installed node.js using the website linked to in the tutorial. I installed the yo generator as described in the tutorial. I created a folder: E:\WordAddIns, opened an elevated command window, changed to that folder, and entered "yo office" as instructed in the tutorial. I Chose "Excel, PowerPoint, and/or Word Task Pane with unified manifest for Microsoft 365 (preview)" and specified Word as the relevant application.

How to exclude non-source content from the Project View in CLion?

21 January 2026 @ 2:39 am

"In CLion, when I move the CMake build directory to a path outside of the project folder, the project tree becomes cluttered with numerous 'autogen' directories the next time I launch the IDE. I want to hide these folders, but I've already tried adjusting the 'File Types' (ignored files) and 'Scopes' settings without success. How can I properly exclude them from the project view?" enter image description here

How to connect to Azure Monitor Log Analytics from VS Code

21 January 2026 @ 2:28 am

Currently in Azure Data Studio we have the connection type as Azure Monitor Logs to run KQL.There isn’t an official “Azure Monitor Logs” extension in Visual Studio Code exactly like the one in Azure Data Studio (ADS). The Azure Monitor Logs extension that lets you connect directly to a Log Analytics workspace exists for Azure Data Studio and ADS is being retired soon, with Microsoft recommending VS Code + MSSQL support for some workloads — but not specifically for Monitor Logs the same way ADS does and Kusto how can the same functionality be done in VS Code enter image description here. How to workaround

Self-Contained Alt Text Generation For Use In Other Software

21 January 2026 @ 2:25 am

I am currently working on a tool that takes in every webpage of a site, adds alt text to images missing it, and outputs the webpage as a PDF for archival purposes. For the generation of alt text, is there a pre-existing machine learning (if that's the right word) tool that I can use? Trying to google and scouring github yields either a software that's meant to be used in a GUI or something that calls out to an external api. I would love something that I can just call from the command line or use programmatically otherwise. Software that calls out to an online api to perform alt text generation does not work for my purposes. Online api's are brittle with relying on a company, potentially changing interfaces, and expensive. Furthermore, I have access to multiple beefy computers (3060s, 16 gigs of ram) that I can use to run any tool locally. Thank you in advance

Today's Foreign Exchange Rate Function/Formula in Microsoft Excel Spreadsheet application

21 January 2026 @ 2:23 am

Is there a today's foreign exchange rate function or formula in Microsoft Excel Spreadsheet? If not could it be useful to add in Office 365 Microsoft Suite? The function should take two currencies as input and fetch a real time foreign exchange rate value.

Best practice for querying and displaying large datasets (1M+ rows) with multiple joins and LIKE filters

21 January 2026 @ 2:17 am

I have a database table with more than 1 million rows. This table is joined with around 10 other tables, and the data needs to be filtered using LIKE queries based on user input. This query will be used to display data in an application, and I expect more than 1,000 user requests per day. My questions are: What is the best practice for handling queries like this efficiently? How should I design the query and indexes to avoid performance issues? I am looking for general architectural and database-level recommendations to handle this kind of workload efficiently.

I am getting "generate_placeholder_thoughts" reasoning in thoughts reasoning when include_thoughts=True

21 January 2026 @ 2:16 am

I am using ChatGoogleGenerativeAI from langchain_google_genai and declared my wrapper instance as below. agent_llm = ChatGoogleGenerativeAI( model="gemini-3-flash-preview", google_api_key=GOOGLE_API_KEY, temperature=0, top_p=0.8, top_k=40, include_thoughts=True, thinking_level="low", convert_system_message_to_human=False ) When I debug my agent workflow with LangSmith, I get proper reasoning content in my AIMessage which shows CoT processes and declare which tools to call next as a conclusion. But as turns increase, I get absolutely different reasoning content which only tells that generate_placeholder_thoughts tool should be called. And there is nothing about my tools and approporiate reasoning process for my prompt. Examples are below. **Crafting a Placeholder Tool Invocation** Okay, so I need to get this process moving. The task