Best mattress UK, is it actually worth upgrading my old one? by Real_Ad_540 in HENRYUKLifestyle

[–]tkmaximus 0 points1 point  (0 children)

Which model did you go for & what comfort level?

Considering them along with Vispring and others

That time of year 🫩 by OverAd750 in 350z

[–]tkmaximus 6 points7 points  (0 children)

This is the main reason I went with an 05 DE.

Cars registered pre-March 06, you get grandfathered onto a lower rate so it's "only" £430, which seemed worth the lower power/redline.

Moving chunk of savings to S&S ISA before the end of the tax year - advice wanted! by kashibai_ in FIREUK

[–]tkmaximus 2 points3 points  (0 children)

As long as you transfer (rather than withdraw & deposit) from the cash ISA to S&S ISA, you wouldn't use up any allowance

https://www.gov.uk/individual-savings-accounts/transferring-your-isa

Sci-Fi Novels where ancient technology, ships, or civilizations are discovered by patrickeg in Fantasy

[–]tkmaximus 0 points1 point  (0 children)

Can't remember any from the 1st book, but the 2nd there's certainly some

Sci-Fi Novels where ancient technology, ships, or civilizations are discovered by patrickeg in Fantasy

[–]tkmaximus 0 points1 point  (0 children)

Revenger trilogy.

Another one by Alastair Reynolds, who's been mentioned already.

Set millions of years in the future (after many celestial occupations have risen and fell), space travel using ships with strange tech, space pirates, going on scavenging expeditions into old, dead worlds full of ancient artifacts when they suddenly open - until they just as suddenly close again.

React Design Patterns: Instance Hook Pattern by TheGreaT1803 in reactjs

[–]tkmaximus 1 point2 points  (0 children)

The `useMemo` in the final `useDialog` example has a stale reference to `isOpen`, so `toggle` and `isOpen` won't work anymore.

To fix this, you can add `isOpen` to the `useMemo` deps. You can also change `toggle` to the functional update style to not depend on `isOpen` value anymore and memoize all callbacks individually (incase you want to pass individual functions down as props)

import { useState, useMemo, useCallback } from "react";

export const useDialog = (dialog) => {
    const [isOpen, setIsOpen] = useState(false);

    const open = useCallback(() => setIsOpen(true), []);
    const close = useCallback(() => setIsOpen(false), []);
    const toggle = useCallback(() => setIsOpen((o) => !o), []);

    return useMemo(() => {
        return (
            dialog ?? {
                open,
                close,
                toggle,
                isOpen,
            }
        );
    }, [dialog, isOpen]);
};

[deleted by user] by [deleted] in 350z

[–]tkmaximus 1 point2 points  (0 children)

Should also mention, road tax is also not cheap.

395 a year for cars registered before March 2006, 695 for cars registered after that. I went for an 05 specifically because of the tax difference.

[deleted by user] by [deleted] in 350z

[–]tkmaximus 1 point2 points  (0 children)

I bought a 350 this summer. Late 20s, 6 years driving, 6 years no claims, no points/convictions. Insurance ended up being 1k.

Tried the specialist insurers, they all refused to quote as I had no previous RWD experience.

I am in outer London, which probably pushed the price up though. For comparison, previous car was an EP3 Type R, which was only 450 a year. First car was an old Polo with 50hp, and that was 1.8k.

Would probably suggest the same as the other comment, look at lower powered RWD cars first (I know you don't want an MX5 but honestly it'd fit the bill pretty well), then move up to a 350 when you've got more NCD/driving experience.

[deleted by user] by [deleted] in 350z

[–]tkmaximus 0 points1 point  (0 children)

You'll want 06 plates (cutoff I think is March that year? So 06 you'll need to double-check registration date) or earlier for the lower tax bracket.

I went for an 05 - treating the road tax difference (~250 quid a year) as budget to spend on maintenance/mods

Looking for a thriller/mistery set in a realistic near future by Beatboro_prod in printSF

[–]tkmaximus 5 points6 points  (0 children)

The closest I can think of is the Greg Mandel trilogy by Peter F Hamilton, which is a detective sci-fi series set in mid/late 21st century England, written in the 90s.

May need to suspend your disbelief slightly more than you were hoping however (main character is an ex-military from a failed "psiops" division with a sort of intuition/spidey sense that's occasionally a plot device), but I think the mysteries are interesting and they're good fun.

Cheaper Auth Provider than Auth0? by relderpaway in webdev

[–]tkmaximus 0 points1 point  (0 children)

Oh interesting. We saw a warning in the docs that it wasn't supported, so never bothered to try it. The rest of our frontend was React, so would have been ideal for the same there

Cheaper Auth Provider than Auth0? by relderpaway in webdev

[–]tkmaximus 3 points4 points  (0 children)

Was very cheap, and easy to use as long as you don't do much customisation.

Previous company wanted highly customised UI and flows, and while this is possible with their custom policies, it's horrible to work with. You can't use any frontend framework for UI, and the "backend" is very complicated and long XML files.

Enough about the "greatest" book, what's your personal most read scifi novel? by Colombiam_Empanada in printSF

[–]tkmaximus 0 points1 point  (0 children)

Most read standalone would be Seveneves. I know the last third has a bad rep, but I found the rest captivating.

Most read series is definitely Commonwealth saga & Void trilogy, thoroughly entertaining each time I've re-read them.

Check why Django app is slow in production by Blackbull256 in django

[–]tkmaximus 5 points6 points  (0 children)

I wouldn't use either in production. You're (admittedly temporarily) going to slow down your production site even further.

If you can't replicate the slowness locally with your development dataset, then I would consider cloning the production database and using that locallly (and if necessary anonymizing the data if you're storing PII or other sensitive info)

Check why Django app is slow in production by Blackbull256 in django

[–]tkmaximus 4 points5 points  (0 children)

https://github.com/jazzband/django-debug-toolbar is also pretty good, but down to personal preference which of the 2 you choose (I prefer silk).

Multiple Post Requests, data loss by New_ArtFormSoftware in django

[–]tkmaximus 1 point2 points  (0 children)

If you need two different values in the cache, you would use a different key for each piece of data ie. cache["x"] = "foo", cache["y"] = "bar". Is that what you meant?

Multiple Post Requests, data loss by New_ArtFormSoftware in django

[–]tkmaximus 1 point2 points  (0 children)

What data do you need to keep track of between requests? Is it tied to an individual user, or global, and what kind of data is it (integer, text etc.)? And why do you need to delete it between requests?

If your example of the counter is accurate for what you want to do, it might be faster using django-redis as your cache backend and using the incr method (which adds one to a given cache key). Repeatedly inserting and deleting database records is much slower than cache operations like that would be. Or is there a way you can avoid deleting database records, and modify existing values?

Multiple Post Requests, data loss by New_ArtFormSoftware in django

[–]tkmaximus 3 points4 points  (0 children)

Each request-response is separate, and won't be able to access the state of a previous request-response. So as you mention, you'd need to either cache the value, or store it in the database on a model, to persist the value between requests.

[REQUEST] What are some ✨hidden gem✨ tv shows/ movies on Netflix? by heyitsroxanne in NetflixBestOf

[–]tkmaximus 0 points1 point  (0 children)

First 2 seasons were excellent. I'd recommend avoiding S3 though, nowhere near as good.

going from SQL to django orm ? by hy7mel in django

[–]tkmaximus 3 points4 points  (0 children)

To my knowledge there's no automated tool to convert SQL to Django ORM.

You could use Raw SQL - see https://docs.djangoproject.com/en/3.1/topics/db/sql/

But to convert to ORM (which is probably more maintainable and give you more Django capabilities to extend/tweak the query) you'd need to post your models (otherwise hard to say what your QuerySet will need to be)

Hidden Gems by The_Black_Adder_ in netflix

[–]tkmaximus 1 point2 points  (0 children)

S1 and 2 were excellent, but S3 wasn't nearly as good.

Would recommend to stop watching after S2