Most active questions

Filter by
Sorted by
Tagged with
21 votes
21 answers
25k views

When embedding YouTube videos using the IFrame API or direct embed URLs, the player occasionally displays the message “Error 153: Video Player Configuration Error” instead of loading the video. This ...
user2783430's user avatar
34 votes
5 answers
14k views

I've been successfully using TestContainers with Docker for quite a while now. All of a sudden today, I started getting this error: UnixSocketClientProviderStrategy: failed with exception ...
Stewart's user avatar
  • 18.8k
25 votes
6 answers
20k views

I'm trying to get started with the Google Antigravity platform (the new Gemini 3 agentic IDE), and I'm hitting a wall right at the very beginning—the account setup phase. The Issue I'm Seeing: I ...
Niloy Chowhury's user avatar
24 votes
2 answers
2k views

In JavaScript, when you do something like this, function connect() { var ws = new WebSocket(url); ws.onmessage = function(e) { window.alert(e.data); }; } it will work. But why ...
Maestro's user avatar
  • 9,846
6 votes
4 answers
5k views

I’m working on a Next.js + TypeScript project with a MySQL database using Prisma. I set up my configuration in prisma.config.ts like this: import { defineConfig, env } from "prisma/config"; ...
Amrita Pathak's user avatar
12 votes
4 answers
3k views

I’m trying to install the Entity Framework Core CLI tools globally using the .NET CLI command: dotnet tool install --global dotnet-ef However, the installation fails with the following error message: ...
tutte2k's user avatar
  • 301
23 votes
1 answer
3k views

I have found a piece of code that defines register access permissions for a chip. Using arm-none-eabi-gcc it compiles correctly. Here is the code: static const uint8_t defaultRegisterAccess[...
2A-66-42's user avatar
  • 890
20 votes
4 answers
2k views

I made a small C program that should print an emoji: #include <stdio.h> #include <windows.h> int main(void) { SetConsoleOutputCP(CP_UTF8); printf("\U0001F625\n"); // 😥 ...
Tim's user avatar
  • 325
17 votes
3 answers
874 views

I have a function template f, defining in its body a local class A with another nested class B. Both classes are not templates. Must I name the inner class as typename A::B or shorter variant A::B is ...
Fedor's user avatar
  • 24.7k
Advice
1 vote
21 replies
261 views

I just wanted to ask if it's possible to read to a specific file format, say if I wanted to read from a file that has a format of something "info.uc" or "main.uc", how would I go ...
ShizamDaGeek's user avatar
Best practices
4 votes
14 replies
266 views

I'm looking for some advice. System: Ubuntu 20.04, g++ 9.4.0 (c++17) Traditionally in C, we'd use #define along with #ifdef, for example: #define FOO true #ifdef FOO //Do something #else //Do ...
Mike's user avatar
  • 629
10 votes
4 answers
1k views

The program test tag dispatching pattern, where the function process_data(tag, a, b) can accept 2 tags int_tag, float_tag. There are 3 case: int_tag and a, b are int -> print a + b float_tag and a,...
Huy Le's user avatar
  • 1,979
8 votes
6 answers
852 views

If it's possible, I would like to define a macro that would take number of arguments in function template ARGS_COUNT and make a template with all argument types being enumerated and output being ...
kusok_kvarka's user avatar
3 votes
5 answers
627 views

I'm talking from a language point of view in C or C++, where the compiler sees: return condition ? a : b; vs: if (condition) return a; else return b; I've tried in my code, and both of them ...
Zebrafish's user avatar
  • 16.3k
Advice
4 votes
14 replies
237 views

I currently have a block of code looking like this: if (StateA) { DoSomething(); } else if (StateB) { DoSomething(); DoSomethingElse(); } I was thinking there must be an elegant way ...
lenny's user avatar
  • 793
16 votes
2 answers
701 views

I have a program that reads the coordinates of some points from a text file using std::istringstream, and then it verifies the correctness of parsing by calling stream's operator bool(). In general it ...
Fedor's user avatar
  • 24.7k
Advice
1 vote
22 replies
304 views

From the man pages, I found that size_t has the range of 0 to SIZE_MAX, and ssize_t has the range of -1 to SSIZE_MAX. So, after printing those values on a 64bit system, I have the following results: ...
sat0sh1c's user avatar
Advice
2 votes
4 replies
246 views

Any C++ class can be first forward declared, and defined only later in the program. Are function-local classes an exception from this rule? Please consider a simplified program: auto f() { struct ...
Fedor's user avatar
  • 24.7k
Best practices
3 votes
7 replies
275 views

In Python, it is common to import all libraries required by a certain file, in the beginning of the file. But this has a disadvantage: if my file contains several different functions, and only one of ...
Erel Segal-Halevi's user avatar
7 votes
5 answers
835 views

I have an object with nested properties. I want to update those nested properties by using an array of elements that reflect the nested sequence of the object. Also if a property does not exist, then ...
a6e b0a's user avatar
  • 91
14 votes
4 answers
991 views

C89 and C99 do not provide an alignof macro as part of the standard library (nor an alignof keyword as part of the language as done by C23). C programmers found out they can define their own version ...
Random Citizen's user avatar
11 votes
7 answers
1k views

I want to use circular queue with different types and lengths in a project which mainly consists of C code. I'm thinking about implementing the circular queue as a C++ template struct. How to expose ...
Jackoo's user avatar
  • 503
Advice
1 vote
9 replies
200 views

unsigned int n = 1; char* s = "X" + 1; s[-n]; Is that third statement undefined in C23? It seems it is, as by the standard in 6.5.2.1.2: ... The definition of the subscript operator [] is ...
Kyle's user avatar
  • 1,116
9 votes
2 answers
680 views

C++, using <chrono>, I would like to get a value formatted as <seconds>.<milliseconds>. I am using system_clock and get the current seconds as: auto secs = duration_cast<seconds&...
Ender's user avatar
  • 1,914
5 votes
6 answers
233 views

Let's say I have the following code: #include <array> #include <string> #include <variant> using namespace std::literals; using known_types_t = std::variant<int, double, char>...
Miguel Horta's user avatar
Advice
0 votes
13 replies
163 views

I am trying to replace Joda datetime and interval methods with Java.time and also trying to specify explicitly timezone as Duser.timezone=America/Chicago. This my code fragment public void ...
madhu's user avatar
  • 139
13 votes
1 answer
2k views

When I run pip-compile I get an error telling me that AttributeError: 'InstallRequirement' object has no attribute 'use_pep517' I am using Python 3.11.6 pip v25.3 pip-compile v7.5.1 From other ...
user3535147's user avatar
3 votes
7 answers
214 views

Starting with the example dat0 below, let's say I want to randomly extract 3 pairs of ìd`s. Initial data (5 id pairs) dat0 <- structure(list(id = c("A", "A", "B", &...
denis's user avatar
  • 962
2 votes
3 answers
313 views

I need to make a linked list implementation without using STL. push_front function has two overloads: one with const T&, the other with T&&, but the implementation is the same. The only ...
Paul-dev's user avatar
Advice
0 votes
11 replies
196 views

The following code is accepted by GCC and the resulting binary prints the expected results. But is it standard conform and would always work on different systems using different compilers? Minimal ...
Martin Fehrs's user avatar
  • 1,165
12 votes
2 answers
615 views

I am trying to recreate this graph I saw in this book, but instead make it as a histogram. This is my code so far, but it is not looking as good: set.seed(123) library(dplyr) library(ggplot2) # ...
Victor Hartman's user avatar
Advice
1 vote
11 replies
221 views

I have a big Python list containing integers. Below is the definition of my event. Look at each element of the list and check if that element is greater than a specified number, say S. If before that ...
Brian Smith's user avatar
  • 1,679
Advice
1 vote
14 replies
239 views

I need help regarding a code I want to write in c++. I want to develop a program that receives and visualizes CAN messages on a GUI. The messages in question are about 100 distinct ID's, so we're not ...
Simone Sesana's user avatar
10 votes
2 answers
6k views

After the last Chrome update message "Look for and connect to any device on your local network" prevents me from running testcafe tests in Chrome. The browser setting that affects this is ...
Oleksii Lukashyn's user avatar
5 votes
4 answers
302 views

Consider the code fragment below: using List=std::vector<Data>; List generate(); List a = generate(); List b = generate(); a += generate(); // append generate() output to a a += b; //...
Victor Tsang's user avatar
Advice
0 votes
9 replies
199 views

I'm writing an Api in ASP.NET. There is a lot of boilerplate when doing validation checks. If there was a returnif (condition) <return value>. Then Api code could look way cleaner. Instead of ...
Bamsen's user avatar
  • 52
Advice
4 votes
2 replies
4k views

Can I express a function that consumes an object? Meaning that its destructor is not run on the moved-from object? Like the proposed library function trivially_locate_at itself? template <class T&...
user2394284's user avatar
  • 6,164
2 votes
6 answers
332 views

My goal is to get a certain number of values between 1 and 50, a certain amount of times. It has to be randomly selected in [1-50] interval. I wrote this script but it runs awefully slow. I removed a ...
Freaka's user avatar
  • 97
12 votes
1 answer
704 views

I'm trying to register a Thread-Local Storage (TLS) callback in a Windows application without using the C runtime (CRT). Compiler: MSVC 14.44.35207 (Visual Studio 2022) Target: x64 OS: Windows 11 I ...
felix's user avatar
  • 131
6 votes
3 answers
384 views

I've got a list P of 2-dimensional points, 100 ≤ |P| ≤ 100000, and a list C of circle centers, 100 ≤ |C| ≤ 100000. All coordinates (x,y) ∈ P or (x,y) ∈ C are integral, 0 ≤ x,y ≤ 4095. P and C may ...
hidefromkgb's user avatar
  • 6,002
3 votes
2 answers
150 views

In the below code I'm trying to print an unsigned char variable using std::cout and std::println. Using std::cout prints the character while std::println prints the ascii value. Can somebody explain ...
Harry's user avatar
  • 4,132
3 votes
6 answers
174 views

in a bash script I call an external script that gives me the status of a program, like ~/bin/status which returns something like program is running or program is halted Now I want to use only the ...
jokey's user avatar
  • 53
Advice
6 votes
7 replies
347 views

Our current codebase exists as a monolithic .NET application. The many years of legacy has made it difficult for our engineers to make changes and we're looking to Strangler Fig our way out of a Big ...
Jaidiac's user avatar
  • 101
14 votes
1 answer
858 views

Rust programs typically panic when you index into a slice with an out-of-bounds usize index. Is that panic actually guaranteed to happen? Can I rely on the panic when reasoning about the soundness of (...
Aljoscha Meyer's user avatar
7 votes
2 answers
705 views

Assuming two overloads: void X::f(int, float); void X::f(long, double); is it possible, in C++17 or higher, to infer int/long (or whatever it is) from float/double for the second argument? To be used ...
Gleb Belov's user avatar
Advice
2 votes
10 replies
380 views

I'm a small-scale C programmer at the moment, and I'm bugged by the question: is Visual Studio worth the annoyance that it is? I've been programming in C and C++ in Visual Studio Code for a while, and ...
Gaspar Liboreiro's user avatar
7 votes
2 answers
366 views

I’m using an official SDK that provides an api.h header file. When I try to compile, I get the following error, with wriggles on cmd: type containing an unknown-size array is not allowed Here are the ...
Luigi's user avatar
  • 411
8 votes
1 answer
848 views

With C++26 reflection, we can simply iterate all data members of an object: #include <iostream> #include <meta> struct Foo { int x; int y; }; void PrintFoo(const Foo& foo) { ...
Timothy Liu's user avatar
10 votes
1 answer
496 views

The signature of std::thread::Scope::spawn looks like this: pub fn spawn<F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T> where F: FnOnce() -> T + Send + 'scope, ...
jacobsa's user avatar
  • 7,817
1 vote
6 answers
223 views

I've been studying Java for some time now to better understand what goes on inside some of the code parts. While studying Enum, which I am used to using exclusively for listing various fixed values (...
Ice K's user avatar
  • 37

15 30 50 per page
1
2 3 4 5
140