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.

MySQL extension causes the active connection to be displayed at the top of my web page

4 February 2026 @ 11:29 pm

I am using the mySQL database client extension. Suddenly today, the active database connection is displayed at the top of my web page. This only happens in my development environment, not in the test and live environments. I've disabled and even uninstalled the extension but the problem still occurs. What could be causing this?

Is @WebMvcTest annotation missing from spring-boot-starter-test:4.0.2 and require explicit spring-boot-starter-webmvc-test:4.0.2 dependency?

4 February 2026 @ 11:13 pm

My initial assumption is that since Spring Boot @WebMvcTest annotation is so common, it should automatically get pulled in via org.springframework.boot:spring-boot-starter-test dependency. However, it does not appear to be the case? I had to explicitly add org.springframework.boot:spring-boot-starter-webmvc-test to build.gradle file. dependencies { // Does not appear to include @WebMvcTest? 🤔 testImplementation 'org.springframework.boot:spring-boot-starter-test' // Needed to resolve resolve @WebMvcTest testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test' } Want to ask here before raising an issue at https://github.com/spring-projects/spring-boot/issues

Handling audio interruptions that begin, but do not end

4 February 2026 @ 11:10 pm

In Apple's Audio Session Programming Guide, there's a section, Observing Audio Interruptions [archive], that says: Note: There is no guarantee that a begin interruption will have a corresponding end interruption. Your app needs to be aware of a switch to a foreground running state or the user pressing a Play button. In either case, determine whether your app should reactivate its audio session. I

How to find children of each node using git log

4 February 2026 @ 11:04 pm

I am currently working on GitGarden, a CLI tool that draws your repos as plants. I want the branching/forking of Github repos to be mimicked in my program, like how trees branch off in real life. To do that, I need to identify whether each node is a split (branching off) or a merge (coming back to the main trunk). I have successfully flagged merges in my tested repos, but not splits. How can I do this? Here is my code to help. This is my first post here and I can always add more code if there is not enough context. Here I get the git commits for the repo using git log: def get_git_commits(limit=None): cmd = [ "git", "log", "--all", "--date=iso", "--pretty=format:%H%x1f%an%x1f%ad%x1f%s%x1f%b%x1f%P%x1e" ] if limit: cmd.insert(2, f"-{limit}") result = subprocess.

Need to display plaintext passwords to teacher for 2nd grader accounts

4 February 2026 @ 10:16 pm

I'm working on an amplify website which has 2 cognito account types, a teacher and students created by this teacher. These are 2nd graders who often forget passwords/have to have teacher look them up and importantly wont have a phone number or email address or the ability to do the usual password reset stuff. It has been requested that the teacher dashboard be able to display the username and password for students so they can login after creation. This is a bit of a security nightmare with plaintext passwords so I am hoping to find some guidance about how I can provide the student cognito passwords to the teacher dashboard frontend as safely as possible(and clean up after). I can capture the student password during student account creation, but I don't want them at rest in dynamo in plain text, and I need to also get them to the teacher dashboard frontend safely as well. Access to the backend is provided via a cognito authorizer gated REST api g

What's the fastest and most reliable way to aggregate ipv4 addresses into CIDRs in Go?

4 February 2026 @ 9:38 pm

I have an array of ipv4 addresses (over 750k addresses).These IPs have so long been stored in hash:ip ipset of Linux through the Go application. I want to reduce this to shortest (if that's a good idea) array of non overlapping CIDRs that would be optimal for storing in hash:net ipset. How can I do this in Go as fast as possible? Also will this lead to faster lookups since hash:net would be more efficient at storing this?

[Oracle][SQL] Optimisation [closed]

4 February 2026 @ 7:40 pm

I'm working on Oracle 19 and I need to sort a 70GB table. I have unlimited parallelism. What would be the optimal values to optimize this sort? in terms of parallelism in terms of database configuration (pga_aggregate_taget...) other? This is a table generated by an automatic tools and there is no index. The query is something like: select /*+parallel(X)*/ID, min(col1), avg(col2), max(col3)... from byTable group by id; The only thing I can improve is parallelism and database parameters.

Splitting a string into tokens with several possible separators, using `std::ranges`

4 February 2026 @ 5:10 pm

My goal is to split a std::string into tokens delimited by a list of possible delimiters/separators. For instance std::string line{"\tSplit \t\t this sequence\t of tokens "}; must be split into Split,this,sequence,of,tokens. It's a well-known problem and many implementation can be found: with std::isstream with std::regex with std::strtok with find or find_first_of As far as I know, the first two are requiring to allocate intermediate substrings and regex is particularly slow. std::strtok is not thread-safe, as it maintains an internal state in the form of static variable(s). Using find is quite straightforward and happens to be fast (see benchmarks below) but the code is quite verbose (I know, it's subjective). I want to test

Feedback on ERD normalization for school project for a service to match users based their preferences, and how to model verification status in ERD?

4 February 2026 @ 1:30 pm

What is feedback on the normalisation of my ER diagram which I designed for my school project for a service to match users based on their preferences? The ERD is supposed to show no transitive dependencies. I have modelled preferences in a separate table and they reference user_profile. Another example is having a separate table to for visibility of attributes in user_profile, rather than having these columns directly in user_profile. To model the verification status of a user, we have tables such as AuthSession and AuthStatus, and tables for SMS and email verification; however, four tables to model verification may be overkill as some have said that it is fine to have a boolean flag next to the user's login table. ERD

What are the mechanics of custom CMake install()-command scripts?

4 February 2026 @ 9:20 am

(Kind of a follow-up to this question.) CMake can run a custom script for you, when installing, i.e. when you invoke it with cmake --install and the install() commands get run. This is how you tell it to do so: install([[SCRIPT <file>] [CODE <code>]] [COMPONENT <component>] [...]) The SCRIPT form will invoke the given CMake script files during installation. If the script file name is a relative path it will be interpreted with respect to the current source directory. (and I care about the SCRIPT case, not so much the CODE case.) So, this tells me how CMake finds the script. Ok, but: What is the