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.

Loading outside data (CES) into R

13 April 2026 @ 4:48 pm

I need to install an outside dataset into R, I want it to be ces25_common.tab by Harvard Dataverse but I cannot figure it out. Some list out the code to do so, like the full libraries, and packages needed. I have already tried this: install.packages("dataverse") library (dataverse) library(dplyr) data(ces)

Azure notification hubs service endpoint - ENOTFOUND on NestJS backend

13 April 2026 @ 4:47 pm

I am trying to send notifications from our NestJS backend through Azure notification hubs and I'm running into a specific problem. I've created the namespace, I've created the hub, and I am given the specific connection string from the access policies (of the hub, not the namespace) as DefaultFullSharedAccessSignature. However, any time I try using the client like so: this.client = new NotificationHubsClient( 'Endpoint=sb://myhubname.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=myaccesskey=', 'myhubname', ); I know it should be an .env, I'm just typing it like so for display purposes. However, no matter what I try, I keep receiving an error of not finding the service endpoint, despite the status showing up 'active' on Azure's control panel. I also tried doing a DNS lookup of my service endpoint, but that also returned:

Why does the postfix operator ! say it's not needed when compiling in Release Mode in Rider

13 April 2026 @ 4:45 pm

Here is a very simple MRE. I'm using System.Diagnostics: using System.Diagnostics; class Program { static void Main() { int? myVariable = 42; Debug.Assert(myVariable.HasValue); Console.WriteLine(myVariable!.Value); } } My understanding is that Rider should flag the postfix operator ! as redundant when compiling in debug mode (and it does! It says "The nullable warning suppression expression is redundant") and shouldn't when compiling in release mode since the Debug.Assert will not be run when optimisations are enabled. However, even in release mode, I get the warning The nullable warning suppression expression is redundant Why is that? What ensures the compiler/static analyser that it is redundant? Proof:

Expo-widgets pod error during development build

13 April 2026 @ 4:37 pm

I've tried to create an expo widget by following the documentation here: https://docs.expo.dev/versions/latest/sdk/widgets/ However I am getting an error while trying to create a development build. [!] Invalid `Podfile` file: private method `resolve' called for.... # from /Users/expo/workingdir/build/ios/Podfile:70 # ------------------------------------------- # target "ExpoWidgetsTarget" do > use_expo_modules_widgets! # # ------------------------------------------- pod install exited with non-zero code: 1 Environment: System: OS: Windows 11 10.0.26200 Binaries: Node: 22.19.0 - C:\Program Files\nodejs\node.EXE npm: 10.9.3 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: AI-252.27397.103.2522.14617522 npmPackages: expo: ~54.0.33 => 54.0.33 react: 1

How do I delete a slice element

13 April 2026 @ 4:20 pm

I'm in the process of learning Golang, and I'm currently trying to create a Todo project. My knowledge is limited to the GO base. Please take a look at my code and tell me how I can delete a task. The user writes in the console: add Eat add Sleep add Study Then they write: list to check the tasks For example, if they want to delete the second task (Sleep), and I write del 1, it will delete the first element of the slice, which is 0. And every time I write del 2, it will still delete the first element. And now I need to make it so that I can delete: a) By the title b) By the number of the task location Thank you all!!! I'm stuck at the "Creating a task deletion command" stage. package main import ( "bufio" "fmt" "os" "strings"

Is it "expensive" to check if a user exists in Firebase, every call?

13 April 2026 @ 4:19 pm

I have a Laravel backend that I'm using for my Flutter app on android and iOS. I'm using Firebase for auth, and the token lives for about an hour. The problem I have right now is that you need to be able to delete your account in the app AND on the web. So if you delete the account via the web while being logged in the app, the app can still talk to the backend since the token is valid. So my middleware does this: public function handle(Request $request, Closure $next): mixed { $token = $request->bearerToken(); if (!$token) { return response()->json(['error_message' => 'Unauthorized'], 401); } try { $verifiedToken = $this->firebaseAuth->verifyIdToken($token); $uid = $verifiedToken->claims()->get('sub'); $claims = $verifiedToken->claims()->all(); $lastSignInProvider = $claims['firebase']['sign_in_provider'] ?? null;

Error in running MongoDB cluster connection

13 April 2026 @ 4:16 pm

Earlier my backend project was running on using the command npm run dev but now it is not working. It shows issues like this: > [email protected] dev > npx nodemon server.js [nodemon] 3.1.11 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,cjs,json [nodemon] starting `node server.js` ā—‡ injected env (2) from .env // tip: ⌘ enable debugging { debug: true } Server is running on port 3000 Error: querySrv ECONNREFUSED _mongodb._tcp.interview-ai-cluster.sjx4gvt.mongodb.net at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:294:17) { errno: undefined, code: 'ECONNREFUSED', syscall: 'querySrv', hostname: '_mongodb._tcp.interview-ai-cluster.sjx4gvt.mongodb.net' } How to fix this?

Weird artifacts when rendering textured triangles

13 April 2026 @ 3:40 pm

I am writing my own driver for the Intel ARC A750 GPU for my own operating system. I am currently working on supporting the render engine. When I am rendering textured triangles: Vertex shader: #version 450 layout(location = 0) in vec4 pos; layout(location = 1) in vec2 uv; layout(location = 0) out vec2 uvOut; void main() { gl_Position = pos; uvOut = uv; } Fragment shader: #version 450 layout(binding = 1) uniform sampler2D texSampler; layout(location = 0) in vec2 fragUV; layout(location = 0) out vec4 outColor; layout(binding = 0) uniform UniformBufferObject { vec4 colorBias; } ubo; void main() { vec4 c = texture(texSampler, fragUV) + ubo.colorBias; outColor = c; } ...I get weird artifacts of pixels from lower triangles "bleeding" through higher triangles:

Bash: printing lines of file until SPECIAL_LINE (not included)

13 April 2026 @ 3:18 pm

I came up with this: awk '{print}/SPECIAL_LINE/{exit}' file.txt | head -n -1 Any other suggestions? Maybe it could be more elegant.

How to create a dynamic todo list app using flask, sql, css, JavaScript, HTML, in pycharm

13 April 2026 @ 1:12 pm

Good day Everyone, Please I am new to programming and I’m trying to create a specific todo list that has the google keep kind of thick boxes, but I want to create it with flask so I can store it with the current price of the written list in the database, please I really need help on this