Alex Rivera | Logout

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...
asked 2026-05-03T11:45:00Z by Alex Rivera
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...
asked 2026-04-11T15:20:00Z by Natalie Kim
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...
asked 2026-03-20T07:55:00Z by Alex Rivera
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...
asked 2026-02-14T10:30:00Z by Natalie Kim
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...
asked 2026-01-09T08:15:00Z by Alex Rivera
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...
asked 2025-11-18T11:10:00Z by Alex Rivera
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...
asked 2025-09-05T16:42:00Z by Natalie Kim
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...
asked 2025-08-14T09:22:00Z by Alex Rivera
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...
asked 2025-07-22T13:08:00Z by Alex Rivera
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...
asked 2013-08-06T23:39:16.523
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...
asked 2013-08-06T22:39:49.913
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...
asked 2013-08-06T10:14:10.830
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...
asked 2013-08-06T08:31:48.013
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...
asked 2013-08-06T08:00:07.330
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...
asked 2013-08-06T07:51:39.623
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...
asked 2013-08-06T07:04:21.340
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...
asked 2013-08-06T05:54:47.493
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...
asked 2013-08-06T02:49:38.637
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...
vim
asked 2013-08-06T02:47:04.987
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...
php
asked 2013-08-06T00:09:57.380
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...
asked 2013-08-06T00:05:03.560
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...
asked 2013-08-05T23:46:57.277
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...
asked 2013-08-05T23:26:12.257
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...
asked 2013-08-05T21:51:46.090
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....
asked 2013-08-05T20:43:00.200
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...
c++
asked 2013-08-05T17:45:10.880
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...
asked 2013-08-05T17:28:03.577
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 = ...
asked 2013-08-05T16:56:21.450
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...
css
asked 2013-08-05T16:13:33.043
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...
asked 2013-08-05T16:02:01.410