A Byte of Coding Issue 389

A Byte of Coding Issue 389

A Byte of Coding

Hey-yo,

Hope you had a nice weekend. I work a lot with CSVs and JSONs for my data-driven websites, so I shared two short command line scripts I use to quickly convert between the two. The json2csv version isn’t perfect, so if you have a better solution, let me know!

Also I’m hiring two full stack devs as contractors to help with building out the aforementioned websites, so if you have experience with svelte + postgres + typescript / javascript and are interested in data and owning the work you do (or know someone who might be interested), please reach out to me. Experience with elder.js and / or design is a big plus! Front-end leaning or back-end leaning are both fine, but you should be comfortable with basic ETL and then using that data to build a compelling webpage (we have a designer who can code, but you’d have to set up an outline of the page with all of the information plumbed in).

Anyway, here’s the issue.

Made possible through generous sponsorship by:

Published: 22 April 2024

Tags: postgres, database

Ryan Booz dives into recursive CTEs in postgres, which can be used to generate hierarchical queries. These can be very powerful and I used them extensively on https://findenergy.com/ to map the relationships between parent and subsidiary companies.

Some highlights:

  • explains how to implement a recursive CTE

  • includes examples of recursive CTEs

  • it’s pretty easy to accidentally get into an infinite loop with these, so I’d recommend adding a counter column with some upper limit and setting a WHERE clause in the recursive query to check its value (ie counter < 20) 

Published: 21 April 2024

Tags: c, api design

Jussi Pakkanen explains why C apis are still going to be important for a while and some best practices for designing them.

Some highlights:

  • most programming languages have native apis for using C dependencies

  • advice given using a pdf generation library written in C as an example

  • “design functions that are as high level as possible and try to ignore all implementation details you can, almost as if the C API was a slightly cumbersome DSL”

Published: 28 June 2021

Tags: sponsored, auth, web

WorkOS has published an extensive guide on how one-time passwords work, their benefits, and implementation details.

Some highlights:

  • “OTPs come in three different forms, and each form works differently: time-synchronized OTPs, lockstep synchronized OTPs, or transmission-based OTPs”

  • OTPs are more secure than static passwords, but can create a frustrating user experience due to potential delays

  • Pros and cons for OTPs

Published: 20 February 2024

Tags: ai, optimization, scaling, machine learning

Gergely Orosz discusses the scaling challenges OpenAI faced with Evan Morikawa, who led the Applied engineering team as ChatGPT launched and scaled.

Some highlights:

  • includes info on how chatgpt4 works and the importance of gpus

  • scaling challenges covered are kv cache and gpu ram, batch size, metrics to measure, getting gpus, and inability to auto-scale

  • section on lessons learned at the end

Thanks for your Support!

Big thanks to all of the Patreon supports and company sponsors. If you want to support the newsletter you can checkout the Patreon page. It's not necessary, but it lets me know that I'm doing a good job and that you're finding value in the content.