RSSAmplifier

Blog

Anthony Calandra

Thoughts on software, and other things.

anthony-calandra.comRSS feed ↗3 posts

Latest posts

Queues in Postgres

# Queues in Postgres Problem: We've got a queue of tasks that workers can consume and work on. The database stores all the tasks, a worker will come along to take the oldest task available, assign itself to it then begin its work. Let's create a simple schema to represent the list of tasks and workers: CREATE TABLE task { id SERIAL PRIMARY KEY , worker_id INTEGER } ; CREATE TABLE worker { id…

const in C++

# const in C++ In this article I'm going to go over all the cases of const in C++ I see regularly. # Why const ? First I want to briefly touch on why we should bother having to qualify as many variables, member functions, etc. whenever we can. The topic of compiler optimizations have been written many times before. Please take a look at this GotW article for when const is effective and also when…

It's okay to suffer a little bit

# It's okay to suffer a little bit Sometimes it's good to suffer for a bit, whether it be a problem you don't know how to solve, a bug you can't figure out, or even trying to find a job. Problem-solving is one of those core life skills we should be developing endlessly. If you always look for others when you get stuck, you become dependent on them. Struggling is when we start thinking outside the…