James Guthrie's Avatar

James Guthrie

@jamesguthrie.bsky.social

computers, coding, networking, rust software engineer in AI at Timescale πŸ‡ΏπŸ‡¦ in πŸ‡¨πŸ‡­

57 Followers  |  365 Following  |  20 Posts  |  Joined: 22.10.2024  |  1.5852

Latest posts by jamesguthrie.bsky.social on Bluesky

Async python is such a footgun. Just don't.

26.02.2025 14:00 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Another day, another bug caused by the lack of type safety in a snaky duck-typed language.

Why do we do this to ourselves?

Why am I doing this to myself?

Meanwhile, in the distance I hear the the gentle laughter of the crabs, frolicking in their blissfully-typed world πŸ¦€

#python #rust

28.01.2025 16:51 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Nice, looking forward to this!

25.12.2024 16:24 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Do it!

22.12.2024 17:01 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

If it were up to me I’d replace the phrase β€œproving a program correct” with β€œconvincing another human the program is correct”

I think the latter phrase promotes better intuitions for how to approach formal methods

10.12.2024 22:34 β€” πŸ‘ 24    πŸ” 2    πŸ’¬ 4    πŸ“Œ 1

I know the operator soup is somewhat reminiscent of line noise, but the power!

10.12.2024 07:40 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Combine that magic into:

UPDATE <table>
SET <jsonb_column> = <jsonb_column> #- '{"path", "to", "delete"}'
WHERE <jsonb_column> @? '$.path.to.delete';

🀯

10.12.2024 07:40 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

`@?` returns if a jsonpath is in an object:

> SELECT '{"foo": {"bar": "baz"}}'::jsonb @? '$.foo.bar' as "@?";
@?
----
t

10.12.2024 07:37 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

`#-` deletes a field specified by a path:

> SELECT '{"foo": {"bar": "baz"}}'::jsonb #- '{"foo", "bar"}' as "#-";

#-
-------------
{"foo": {}}

10.12.2024 07:37 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Postgres is awesome. I wanted to remove a key from a jsonb column. The `#-` and `@?` operators come to the rescue!

`#-` deletes a field specified by a path, and `@?` returns if a jsonpath is in an object.

10.12.2024 07:35 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Hey, I do Rust stuff!

13.11.2024 00:08 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Does anybody in my (small) network know of anybody who is _not_ using the default 8k page size in Postgres? And why?

Please repost for reach.

11.11.2024 19:57 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Seems like you found it? Maybe the real question is how to reproduce it?

Did it help that you were writing for a specific person (as opposed to a broader audience)?

10.11.2024 20:25 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Campaign Security with [REDACTED] With the 2024 United States Presidential Election right around the corner, we talk to an unnamed guest who has worked on cybersecurity for political campaign...

This was a pretty eye-opening podcast episode, going into the computer security around political campaigning in the US. securitycryptographywhatever.com/2024/10/13/c...

10.11.2024 13:09 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
unsafe_op_in_unsafe_fn warning - The Rust Edition Guide

This change in the 2024 edition is great! β€œHidden” unsafe ops in unsafe fns are a great way to overlook the safety constraints that the caller must uphold. And I’ve seen the bugs to prove its value. I wonder how many codebases that really need it will turn it off. doc.rust-lang.org/nightly/edit...

09.11.2024 22:01 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Multi-Tailnet: Unlocking Access to Multiple Tailscale Networks

A few weeks ago I figured out how to access devices on two tailscale networks (tailnets) simultaneously (no more dreaded "switch tailnet") and wrote up my findings here: jamesguthrie.ch/blog/multi-t...

If you're interested in networking you might like it.

08.11.2024 22:42 β€” πŸ‘ 7    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Just in time for the weekend: I finally got to the bottom of the cause for undefined behaviour in a Postgres extension written in Rust. Blog post incoming.

08.11.2024 21:38 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Prompt Engineering Guide | Prompt Engineering Guide A Comprehensive Overview of Prompt Engineering

A useful guide on prompt engineering techniques: www.promptingguide.ai

06.11.2024 12:47 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I am reminded of that old joke about the optimist and the pessimist: the pessimist says "Everything’s terrible, itΒ can’tΒ get any worse." and the optimist says "Oh, yes it can!"

06.11.2024 11:27 β€” πŸ‘ 7    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0

Wow, I had forgotten how slow cargo's old git-based fetch was. Just switched to 1.60 to debug something, and was surprised by this fellow:

Updating crates.io index
Fetch [===============> ] 64.08%, (149529/291979) resolving deltas

04.11.2024 11:04 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

The great thing about daylight savings time ending: an extra hour to sleep in.

The bad thing: kids don’t care about wall clock time.

27.10.2024 04:38 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
A raspberry pi pico w with headers pre soldered, a pico inky display, and a raspberry pi pico debug probe

A raspberry pi pico w with headers pre soldered, a pico inky display, and a raspberry pi pico debug probe

Welcome to my 🧡 where I post my progress and steps on a short embedded project in Rust πŸ¦€ on the Raspberry Pi Pico!

I hope to finish it today, but may end up being tomorrow.

25.10.2024 17:59 β€” πŸ‘ 22    πŸ” 5    πŸ’¬ 3    πŸ“Œ 1
Embroidery Trouble Shooting Page Embroidery Trouble Shooting Answers to all your questions about Embroidery problems

does everybody know about my favorite website, the embroidery tips page that forgot to close its <h3> tags

25.10.2024 15:39 β€” πŸ‘ 8090    πŸ” 3502    πŸ’¬ 349    πŸ“Œ 428

Today at work I discovered that the front end components (react) don’t know anything about the types of the data coming out of the store (mobx), despite us using typescript.

I’m surprised that anything worked.

Fixed the typing: one gajillion type errors. 😱

24.10.2024 22:22 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@jamesguthrie is following 19 prominent accounts