software development

Simple query refactor - 100x faster

TL;DR - Recently set out to speed up a slow query behind a multi-column cursor paginated endpoint. A simple switch to represent the where filters as a tuple makes a huge difference in performance on the exact same data with the same indices. Eg - change where ( a > c or (a = c and b > d )) to where (a, b) > (c, d). In the “tuple” case postgres can use the index more efficiently and get more of the needed rows using the index condition, versus walking it, reading rows in and filtering.
Read more

Working on a Fisheries Data Platform

TL;DR: A side project I’m working on is a web interface for the photos collected by a smart scale. The scale and its attached camera is deployed in remote areas and as the fish are caught they are weighed on the scale and their picture is taken. There is a mobile app that coordinates all of that and when the user is back in an area with service / wifi, the photos are sent up to a bucket.
Read more

Highlight Text From Multiple User Selections in React

TL;DR - This is a simple React component that allows you to make multiple highlights in a text from user selections. Why? Working on a side project I wanted a way for users (and me as the current only user) to save words that they don’t know from a text. I found this great example blog that demonstrated one way to do this in React, but it didn’t allow for multiple highlights.
Read more

Smart Pointer Pointers

TL;DR - Switch raw heap pointers to unique_ptrs when possible. If your heap allocated resource needs multiple owners, use a shared_ptr instead. I find myself reviewing C++ smart pointer types over and over again. I guess for me, it’s just been one of those things that doesn’t stick, or perhaps I’ve only needed to use them infrequently enough to forget about them. So, here’s a note to myself, and anyone else dying to read about smart pointers in C++.
Read more

¿Qué Hace Mi Empresa?

Aviso: eso ha sido un trozo de texto que escribí para practicar mí español, no tiene nada que ver con FarSounder oficialmente. Introducción En mi empresa, se llama FarSounder, hacemos un sistema de Sónar para los buques y los yates. El objetivo principal de este sistema es buscar cosas que sean peligrosas delante de la nave y bajo el agua. Hay un sensor que se pone en la proa, que está dirigido hacia delante, por supuesto.
Read more

Triplet Counting Algorithmic Puzzle

We’ve all got a little more time on our hands lately due to social distancing and COVID-19 (unless you have young children). I’ve been partly entertaining myself by learning new programming languages and frameworks, and also with some programming puzzles on sites like HackerRank. I found one problem I ran into recently particularly interesting, and I enjoyed figuring it out (read: drove me crazy for a bit). This post is a write up of the problem and the solution that I ended up with.
Read more

Switching to the Python Pathlib Module

It’s been about a year or so since we officially upgraded all of our tooling at my job at FarSounder from Python 2.7 to Python 3 (3.6 at the moment). Aside from the syntactic changes, there have been a handful of updates in Python 3 that I’ve found to really increase the readability of our scripts. One of those updates (from back in Python 3.4) has been the introduction of the pathlib module.
Read more