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 Let's write a video game from scratch like it's 1987
7yo me could not understand how people could possibly make software but I knew I wanted to be part of it. I loved my CPC 6128.
aidos··on How to get the most out of Postgres memory settings
Ah nice. Thanks for the extra info. I’m weirdly fascinated by the inner workings of Postgres.
aidos··on How to get the most out of Postgres memory settings
I don’t think the visibility map suffers from bloat. It’s a bitmap with 1 bit per page.

You might have more pages due to the extra size of each tuple, but it’s not likely to be a big difference.

aidos··on Why Triplebyte Failed
What are you trying to achieve here? Are you looking to remove a bunch of competent developers by asking weird trick questions?
aidos··on You'll regret using natural keys
Little bit hazy because it was 15 years ago.

I’d used an external int id that was syncing down into our system. There were then a bunch of other tables referencing it as a foreign key.

Overnight it turned into a sting. Clearly I was going to have some reconciliation work to do in any case and it may be that I maintained the old id as the primary key at that point (can’t recall).

It was just a good lesson in mitigating the blast radius - especially wrt things that are out of your control.

As an analogy, imagine that you’re dealing with dates in the same system (we were), you wouldn’t let their date format bleed into your other tables.

You draw a line at the boundary between the systems. In a way, natural keys break that rule.

aidos··on You'll regret using natural keys
Yeesh. I once made the mistake of using an external ID as a primary key. What a day it was when they were changed on me.
aidos··on Working with Excel Files in Python
For those that don’t know - xlsx files are just zips. Change the extension and open them to see all the xml lurking within.

For what it’s worth we use xlsxwriter and are happy with it.

aidos··on Clever code is probably the worst code you could write (2023)
Let me see if I can sway you.

The nice thing about both the ternary and the list compression is that they become statements of the form derived_thing = some_computation. The code flows better when you’re skimming it at a high level and thinking “then we get this”, “then pluck this”. You can think more about your reformed data and less about how it was reformed.

The alternative is that the branching obscures what you’re trying to create at each step.

Sometimes I’ll even use 2 list comprehensions instead of a loop (even though it’s slower) because it’s clearer to read something like:

    odds = […]
    evens = […]
That’s my experience, anyway.
aidos··on Clever code is probably the worst code you could write (2023)
With a slight difference that junior dev tends be proud of the code they’re added while a senior will be proud of the code they’ve removed…
aidos··on Ask HN: Why do you all think that Htmx is such a recent development?
I don’t have experience with htmx, but I was there in the 2000s and before.

From what I’ve seen of htmx, we did have something in the same vein back in those days, albeit in a more adhoc manner.

For our part we built a lot of sites that were quite content heavy with a sprinkling of interactivity. Think blogs with comment sections. By the time I stopped doing that, the pattern we had settled on was loading the comments with the page (server rendered html). When someone posted a new comment (json) we returned the rendered comment as html and injected it in place. It worked well because we could share the same template fragment for a single comment and use it in the initial render loop.

As I say, don’t have experience with htmx so maybe my understanding is off.

aidos··on Simplifying Join Syntax
I struggled to find the actual language at the link you posted - is there an obvious example somewhere?

Given that graphql is often shortened to gql is feel this is going to get confusing!

aidos··on Making a Postgres query 1k times faster
Thanks. Too late though, I already read it.

The article felt like it was fumbling around when the initial explain pointed right at the issue. I didn’t know this specific trick, so I did learn something I guess.

aidos··on Branded types for TypeScript
Respectfully disagree on the elegance. This looks pretty neat to me:

    type Hash = Branded<string, "Hash">;
aidos··on Branded types for TypeScript
By “trace” I think GP meant that the required wrapper is still there at runtime but was only in service of the type system.
aidos··on NPM package is-even has over 140k weekly downloads
Ha! Good catch. You’d think that with a math degree including algebraic number systems I would have spotted that.
aidos··on NPM package is-even has over 140k weekly downloads
Ahhh, I see my confusion here. Got mixed up with the abstractions (isEven != isEmtpy) and thought there was something crazy going on with lists of numbers implementing isEmpty.

On the whole I do agree with you about all this mess. The JS stdlib has a lot to answer for.

aidos··on NPM package is-even has over 140k weekly downloads
Hmmm, that's not what I'm seeing when all this is put together.

isOdd coerces to a number using Math.abs, so the string checks in isNumber don't apply.

    function isOdd(value) {
      const n = Math.abs(value);
      if (!isNumber(n)) {
        throw new TypeError('expected a number');
      }
      if (!Number.isInteger(n)) {
        throw new Error('expected an integer');
      }
      if (!Number.isSafeInteger(n)) {
        throw new Error('value exceeds maximum safe integer');
      }
      return (n % 2) === 1;
    }


    function isNumber(num) {
      if (typeof num === 'number') {
        return num - num === 0;
      }
      if (typeof num === 'string' && num.trim() !== '') {
        return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
      }
      return false;
    }
aidos··on NPM package is-even has over 140k weekly downloads
I'd say there's a reasonable middle ground here where you can define isOdd where you need it:

    isOdd = x => x % 2 === 1
    ...
It's one of those things that doesn't pop up all that often and never changes. I've looked through my whole codebase and there are 3 occurrences.

Aside: I don't use Dart, but does that mean that you have to rely on each different type of iterable to implement these functions?

aidos··on Avoiding the soft delete anti-pattern
How do you store it as a row in your case? JSON offers a very reasonable trade off; it works forever over all tables in spite of schema changes.
aidos··on Homoiconic Python
I guess I’m confused about what running code even means after the exception. The process has crashed. Is it waiting to be reaped by a parent process?
aidos··on Homoiconic Python
I don’t quite understand what sort of state the system is in at this stage. So the process has errored but not exited?

I know that during the exception you can pry into the variables from the stack. When do they get cleaned up?

https://stackoverflow.com/a/5328139/171450

aidos··on Ask HN: Who is hiring? (May 2024)
Countfire | Senior Fullstack Developers | Remote (but must based in UK) | www.countfire.com

Countfire makes software for the construction industry. Our software is well loved because we try to design solutions that are a magnitude more efficient than existing tools.

We use all sorts of tech, but mostly MobX, React, Typescript, Python, Hasura, Postgres, Terraform, and AWS.

We have a great loyal customer base and lots of exciting ideas that need bringing to life.

Previously based in London, now seeking remote devs across the UK.

More info here https://www.countfire.com/careers/

Feel free to contact me directly aidan@countfire.com

Note, applicants must be resident in the UK. No recruiters.

aidos··on Mini ponds are 'tiny universes' of biodiversity for gardens and windowsills
South east England.
aidos··on Mini ponds are 'tiny universes' of biodiversity for gardens and windowsills
We inherited a couple of ponds when we bought our place 4 years back. One has fish in.

To our surprise, every winter the pond freezes over and the fish are fine come spring. In fact they’re thriving and we don’t touch the pond at all - it doesn’t even have a pump.

The other pond could definitely do with cleaning out, but again it’s teaming with wildlife. There’s not a huge window between when the newts leave for the summer and when it freezes in winter. By the time it thaws and we think to do something about it the newts are back again.

aidos··on Angle-grinder: Slice and dice logs on the command line
Before anyone gets any ideas, I’m sure it is possible, but angle grinders are most definitely not designed for cutting wood. They’re dangerous enough as it is when you’re using them correctly!
aidos··on Hardest problem in computer science: centering things
It’s also to prevent moisture issues. If you plaster right down to the floor then the plaster slowly soaks up moisture over time. Instead an unsightly gap is left to prevent this bridging. Skirting / baseboard covers the gap.

So much of what happens in house construction is about water management and without understanding it, it’s common for people to create issues. Regularly see patios that cover airbricks, causing suspended timber floors to rot.

aidos··on Pylyzer – A fast static code analyzer and language server for Python
I’ve been keeping an eye on this but haven’t had the chance to try it out. Anyone have first hand experience of how it compares to pyright in reality?

Now that I have ruff giving me a bunch of instant feedback, pyright has become a bit of a distraction due to the lag.

aidos··on Keeping your data from Apple is harder than expected
I’m confused by the diagram. A and B appear to be early in the process but looking more carefully they’re actually pointing to steps 11 and 12. Seems a little misleading at first glance.
aidos··on Launch HN: Creo (YC W24) – Build internal tools with NextJS and AI
So your environment has access to my db?
aidos··on Developing a Modern Full-Stack Application: Choosing the Right Tech Stack
There’s numpy in the middle, so bits are outside python. The vast majority of the code is Python though and the performance gains come from being strategic about the architecture.

My point is that for most usecases you can go a lot further by looking at the code that’s running rather than the language that’s running it.

← PreviousPage 6 of 34Next →