My name is Dan. I am a data scientist at bit.io, which offers the fastest way to get a cloud PostgreSQL database. In my role, I use bit.io databases to manage the data in various data science research projects. I've analyzed data and written about topics such as methane emissions, Bayesian statistics, labor turnover, the size of the House of Representatives, and much more. Read more…
(2023-05-21) Writing on AI and Postgres
Since this start of this year, I've been working on and writing about AI tools for working with Postgres databases. Most of this work has involved finding different ways to integrate ChatGPT (and previously Codex) with other tools and workflows. I wanted to collect and share some of that writing here, as it's related to a lot of the other things I write about on my personal blog.
(2023-03-10) Using the ChatGPT API with Julia Part 2: Defining a Chat Struct
One of the things that makes working with the ChatGPT API a little different
from working with, e.g., the
davinci-text-003 model api is the need to maintain
the history of a given chat session. A Julia
Struct containing the chat
history, coupled with a function that acts on that Struct, provides a good way
to work with the ChatGPT API.
For the basics of working with the ChatGPT API, check out part 1.
(2023-03-04) Using the ChatGPT API with Julia Part 1: the HTTP.jl Library
This brief post shows the basics of using the Julia
HTTP library to interact
with the OpenAI ChatGPT API, which was made public a few days ago. This post
will only include the minimum necessary detail for getting started with the
API. Future posts will go into a little more detail on how to send message
histories and engage more interactively with the API.
(2022-12-22) Using Quarto Files with Denote
The latest release of Denote (by the inimitable Protesilaos Stavrou) introduced support for custom file types in addition to the defaults, Org, Markdown+YAML, Markdown+TOML, and plain text. This post shows how to add Quarto files (.qmd). Quarto, the successor to R Markdown, is "an open-source scientific and technical publishing system" with support for Python, R, Julia, and Observable. The setup detailed here will allow one to choose the .qmd filetype when creating a new Denote file.
(2022-09-18) Processing a JSON API Response with jq
There are countless ways of processing JSON data and converting it to different
formats. Historically, I've used Python and loaded the data into a Pandas
Dataframe for processing. This isn't really necessary for simple tasks,
though. Sometimes, a lightweight command line tool does the job just fine. Enter
jq. jq is "like
sed for JSON data." This post walks through an example of