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.

Spotify Web API returns 403 Forbidden for /v1/playlists/{id}/tracks but /v1/playlists/{id} works (Flask + Spotipy)

22 February 2026 @ 6:15 pm

I’m building a small Flask app using Spotipy to fetch a user’s playlists and then display the tracks inside a selected playlist. Authentication works correctly. I can: Log in via OAuth Fetch current_user_playlists() Fetch playlist metadata using sp.playlist(playlist_id) However, calling: sp.playlist_items(playlist_id) returns: spotipy.exceptions.SpotifyException: http status: 403, code: -1 https://api.spotify.com/v1/playlists/{playlist_id}/tracks?limit=100&offset=0&additional_types=track%2Cepisode: Forbidden I'm using these scopes: playlist-read-private playlist-read-collaborative user-library-read playlist-modify-private For all the playlists: It’s public I am the owner

Looking for a new text editor or activate my editor

22 February 2026 @ 6:12 pm

I was using RichTextEditor in an ASP.NET Core project. I recently noticed that the menus of this editor are disabled, and I can't even write anything in it. What could be the reason? What free editor can I use as a replacement? Footnote: I am from Iran. Is it related to sanctions and filtering?

Is the ability to transmit 802.11 deauthentication frames alone considered a vulnerability?

22 February 2026 @ 6:06 pm

During an authorized wireless security assessment, I was able to transmit 802.11 deauthentication frames toward a target client and observed that the frames were acknowledged at the 802.11 layer (ACK received). However, no persistent client disconnection was observed during testing. The network configuration appears to be: WPA2-Enterprise (CCMP/AES) 2.4 GHz and 5 GHz enabled 802.11w (Protected Management Frames) status not yet confirmed My question is about correct technical classification: Since 802.11 management frames are historically unprotected, is the ability to transmit deauthentication frames at RF level simply expected behavior? If PMF (802.11w) is not enforced, is this considered a design characteristic rather than a vulnerability? If client disconnection is not reproducibly observed, can this scenario reasonably be classified as a security vulnerability? Should this be treated as a configuration hardeni

BGTaskScheduler.shared.submit(request) is called but the Task is canceling after killing App

22 February 2026 @ 5:53 pm

The function BGTaskScheduler.shared.submit(request) is working fine, but the pending Task is gone after killing the App and recreates the background Task after launch the App again. But this is not how it should be. I'm testing on real device. 1. I activated Background Modes in Signing & Capabilities with Background fetch & processing I add my identifier to Info.plist Permitted background task scheduler identifiers 2. First i'm using BGTaskScheduler.shared.register to execute self.handleTask(task: task) when background task is called. 3. Im calling schedule() to submit a task if currently no task is pending. This works fine. If I start the App for the first time, the task will be scheduled. If I would call schedule() again it would not submit again because a task is pending. If I let my App in background and won't kill

How to capture rapid Esc typings in ncurses

22 February 2026 @ 5:46 pm

ch = getch(); if (ch == 27){ int ch2 = getch(); if (ch2 == ERR){ printw("Esc key pressed."); refresh(); } else { ungetch(ch2); printw("Alt key captured."); refresh(); } } with this method I can determine if a key is esc with waiting for a while but I wanna capture rapid esc presses with no or small waiting time how can I do that

Instantiating an object with a function pointer, with its arguments filtered by type

22 February 2026 @ 5:39 pm

Given ViewPath is a class which takes a void function pointer and a varying number of std::variant<std::string, int> as arguments in its constructor. Given the arguments of said function pointer will be however many ints were passed into the ViewPath constructor. For function void testFunction(int arg1), the corresponding object instantiation can be ViewPath view_path(testFunction, "This will not be passed into testFunction", 73). The part I am stuck on is using a template called Filter , which filters out everything but the ints. It is used in the constructor: ViewPath(void(*view)(Filter<TypeList<Types...>, IsIntegral>), Types ...args) : view(std::move(view)), view_args(std::make_tuple(std::move(args)...)) { } When attempting to instantiate the object through helper function addPattern

I use vscode in Mac, Why it gives random-not real errors while it same code works in my Windows vscode [closed]

22 February 2026 @ 4:45 pm

So in my MacBook computer, I use Visual Studio Code, but whenever I run a code, it gives random errors, warnings but it runs successfully in my Windows-another pc For example that code: #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t; if(!(cin>>t)) return 0; const int L=31623; vector<int> p; vector<char> isp(L+1,1); for(int i=2;i<=L;i++) if(isp[i]){ p.push_back(i); if((long long)i*i<=L) for(int j=i*i;j<=L;j+=i) isp[j]=0; } while(t--){ int n; cin>>n; vector<long long>a(n); for(int i=0;i<n;i++) cin>>a[i]; unordered_map<long long,int> mp; mp.reserve(n*2); int ans=0; vector<pair<long long,int>> pf; vector<long long> divs; function<void(int,long long)> gen = [&](int i,long long cur){

How to render transparent custom bitmap text in VGA Mode 13h (x86 16-bit Real Mode) without BIOS interrupts?

22 February 2026 @ 4:39 pm

I am developing a monolithic 16-bit OS in x86 Real Mode using NASM. I have successfully set up a basic GUI using VGA Mode 13h (320x200, 256 colors) by writing directly to the video memory segment at 0xA000. Currently, to draw text over my GUI (like inside a drawn window or a grid), I rely on the BIOS teletype interrupt (int 10h, ah=0x0E). However, this approach creates two major roadblocks for a custom UI: Background Overwriting: The BIOS draws a solid background behind the characters (often a black bounding box), which completely overwrites and ruins my custom drawn UI elements beneath it. Rigid Positioning: The text is snapped to a fixed 40x25 character grid, making pixel-perfect positioning (e.g., placing text at exactly X=45, Y=12) impossible. My Goal: I want to write a custom text rendering routine that reads a standard 8x8 bitmap font array and draws only the foreground pixels to ES:DI (where ES=0xA000),

General aptitude question which got me confused

22 February 2026 @ 4:27 pm

Passage : President can remake some laws by his/her approval only. Sometimes remaking a law require parliament approval in such cases voting is done in parliament. Statement inferred from above passage: "Remaking some law requires voting in parliament" Options: Statement is true, false. (Note: assume this question is in aptitude and english section of the paper) My answer is false, because I interpret it as remaking any law requires voting which is false according to passage. I know it may be because I overthinked it. But please clarify. Confusion is if we should consider, 'some' as existential quantifier or simply english sense as I thought should be considered.

Why can't I use Iterable as a type for overloading a singledispatchmethod?

22 February 2026 @ 3:55 pm

Why can't I use the typing.Iterable class to overload a singledispatch method? It works for other generi classes such as numbers.Number. For instance the following minimal code will raise a TypeError (I'm using python 3.12) from functools import singledispatchmethod from typing import Iterable from numbers import Number @singledispatchmethod def handle(x): print("Fallback") @handle.register(Iterable) # Will break here def _(x): print("I'm an iterable") @handle.register(Number) # This works fine def _(x): print("I'm a number") What really fascinates me is that the following code works : my_list = [1, 2, 3] print(isinstance(my_list, Iterable)) # outputs True just like it would do for a Number. Is it a bug ? Or is there something i'm missing or misunderstanding ?