All Questions
Ask Question
Loading questions...
72
votes
8
answers
PostgreSQL JSONB vs normalized tables for multi-tenant event metadata
We're designing an events table for a multi-tenant SaaS app. Each tenant has different metadata schemas for their events. Option A is a JSONB column w...
29
votes
5
answers
React context re-renders entire tree - how to optimize with useMemo and selectors?
I'm using React Context to share auth state across my app. Every time the token refreshes, every component that consumes the context re-renders even i...
34
votes
5
answers
Kubernetes pod stuck in CrashLoopBackOff after scaling beyond 20 replicas
Our deployment works fine at 15 replicas but when the HPA scales to 20+ we get CrashLoopBackOff. The pods fail with OOMKilled despite having 512Mi mem...
18
votes
3
answers
Why does my TypeScript mapped type lose optionality when using keyof?
I'm trying to create a mapped type that transforms all properties of an interface but preserves whether each property is optional. When I use [K in ke...
55
votes
7
answers
PostgreSQL query planner choosing sequential scan despite btree index on large table
I have a table with ~50M rows and a btree index on (tenant_id, created_at). When I run SELECT * FROM events WHERE tenant_id = 42 AND created_at > '202...
38
votes
3
answers
Kubernetes HPA not scaling pods based on custom Prometheus metrics
I've configured a HorizontalPodAutoscaler to scale based on a custom metric exposed via the Prometheus adapter. The metric shows up correctly in 'kube...
22
votes
6
answers
React useReducer vs useState for complex form state with validation
I'm building a multi-step registration form with cross-field validation. Currently using multiple useState hooks but the validation logic is getting t...
47
votes
5
answers
How to properly chain asyncio.gather with error handling in Python 3.12?
I have multiple async coroutines that each call an external API. I want to run them concurrently with asyncio.gather but need fine-grained error handl...
41
votes
4
answers
Python asyncio.TaskGroup vs gather: when to use which in production?
Python 3.11 introduced TaskGroup as a structured concurrency primitive. I'm refactoring a microservice that heavily uses asyncio.gather. The TaskGroup...
20
votes
5
answers
Legacy CSS conflicts with Bootstrap - how to resolve?
I'm implementing Bootstrap on a site that has been around for quite a while and evolved over the years. As soon as I add the bootstrap CSS and js to m...
8
votes
2
answers
Android prevent restoring the activity
I have a viewpager holding many fragments. When the activity is sent to background and when resources are needed, the OS will kill the app or at least...
13
votes
4
answers
How to get title from WP_Post Object
i was trying to see the list of child pages name with some description to display ..i use below code $my_wp_query = new WP_Query(); $all_wp_pages = $m...
12
votes
3
answers
finding _collections in python source
I wanted to have a look at the python deque class. When I checked the source code , I found the following at line 10 from _collections import deque, d...
13
votes
1
answers
Extract single line contours from Canny edges
I'd like to extract the contours of an image, expressed as a sequence of point coordinates. With Canny I'm able to produce a binary image that contain...
8
votes
2
answers
Duplicate push notifications on iOS
This question is probably the same as Duplicate Apple APNS push notifications? , but since that one didn't get an answer, and I have some more informa...
12
votes
4
answers
How to get a phone's azimuth with compass readings and gyroscope readings?
I wish to get my phone's current orientation by the following method: Get the initial orientation (azimuth) first via the getRotationMatrix() and getO...
14
votes
2
answers
AngularJS design patterns: Should I use factories to create constructor functions?
This is something I've been mulling over while creating an AngularJS app. When I first learned about AngularJS factories, I thought one clever usage o...
33
votes
2
answers
Bootstrap 3: Missing gutters
Just started playing around with bootstrap 3 and I can't get gutters between columns to work. I created the most basic code to test with: <!DOCTYPE ht...
18
votes
1
answers
How to search a character backwards from the end of line in Vim
for the example text below, the curser is in the first space: This is the sentence. is it awesome that I can use command like fe to jump to the last e...
15
votes
4
answers
Division by zero error while using modulus
Modulus operator is supposed to show the remainder. Like for echo(34%100) outputs 34 . But why do i get a " Division by zero " error for this code ech...
12
votes
4
answers
Detecting and printing timestamps of periods of silence using SoX
I am trying to output the begin-timestamps of periods of silence (since there is background noise, by silence I mean a threshold) in a given audio fil...
21
votes
4
answers
Fastest way of finding differences between two files in unix?
I want to find the difference between two files and then put only the differences in a third file. I saw different approaches using awk, diff and comm...
12
votes
3
answers
Generating Alphanumeric random string in Java
I am using String Builder from another answer, but I can't use anything but alpha/numeric, no whitespace, punctuation, etc. Can you explain how to lim...
10
votes
1
answers
Bind List to DataGrid
I have a problem binding a List to a DataGrid in WPF. Let me explain what I have tried. public struct SomeInfo { public string Name; public string Des...
20
votes
3
answers
Host static web site in Amazon S3 without using Amazon route 53
I tried to publish a static website in Amazon S3 and after following all the steps I managed to do it, but after a few minutes it didn't work anymore....
8
votes
5
answers
when does a function have to return a reference in c++
In c++, under what scenarios do we have to return a reference from a function? I understand using references as function inputs, but for function outp...
8
votes
1
answers
Django with mod_wsgi on apache - 500 error: Authtype not set?
Trying to deploy my first django site on Dreamhost...I had this working and then I'm not sure what I did to make it stop working. This is the error me...
26
votes
3
answers
C++: Multiple exit conditions in for loop (multiple variables): AND -ed or OR -ed?
For loops and multiple variables and conditions. I am using a for loop to set source and destination indexes to copy items in an array. for(int src = ...
10
votes
1
answers
How can I simultaneously apply multiple rotate transforms by toggling classes?
I'm trying to apply various transforms to a given element or set of elements by clicking buttons to toggle classes on and off. This works for most thi...
10
votes
3
answers
error: expected unqualified-id before ‘.’ token //(struct)
I need to make a program that gets a fraction from the user and then simplifies it. I know how to do it and have done most of the code but I keep gett...
