Skip Navigation
Burning LiPO Batteries • IMPORTANT LESSONS LEARNED • Do LiPO Bags Actually Work?
  • Good LiPo bags work for small batteries. The batteries in most ebikes would burn through those. You can find video tests that show this. For ebike-sized batteries you need an ammo can. Even then if you want to ensure your home doesn't get poisoned with fumes, it should be in a ventilated area, garage or outside.

  • The real magic word
  • Linux kids do not accept cookies.

  • Why these immigrants to Canada say they're thinking about leaving, or have already moved on
  • I'm counting on us being close to mostly sane states. When shit begins hitting the fan I think they'll gain significant control over the US simply because they'll be much less fucked economically than the South. So I imagine that even if there is some sovereignty dispute or a "takeover" it would be closer to moving to NY or California than moving to Florida or Texas. Of course these are super wild guesses. If the US goes full dictatorship it will be a Southern dictator who could usurp national power for decades... So go Stormy go!

  • got him
  • I don't think it's worse, I think it's equivalent. Also I don't like the risk of resource leaks which is inherent to multi-returns beyond input validation. And that's true beyond C because memory isn't the only resource that can be leaked.

    It's not about how readable the branches are, it's about having to read all of them to ensure you understand the control flow so that you don't leak. Length of functions is a red herring. You want me to read the contents of short blocks to ensure the control flow is correct. I don't want to read the contents of those blocks, other than the conditional and loop statements. Reading short blocks is better than reading long blocks. Reading just the control flow lines is better than reading short blocks.

  • Why these immigrants to Canada say they're thinking about leaving, or have already moved on
  • Indeed. With that said there are some cultural cases too. I know of several families who did well financially but left years ago because Canada was getting too woke for them. Some went back to Eastern Europe where racism is alright, and others went to Florida. Still these kind of cases are probably the minority. 😄

    Personally I do have the grass-is-greener periods now and then but I'm sticking with Canada due to what I think is likely one of the safest places to be in 2050. I'm trying not to think about how drought, heat and extreme weather will affect many other parts of the world. I think we still have a chance to keep this place decent socioeconomically and politically.

  • Immich x FUTO Q&A
  • Me too, I subbed for monthly.

    The one thing I can see FUTO can do is provide capital up front for developers to work which could be recouped over time as more users begin to use and pay for the software. That makes sense and in a competent, not neoliberal economy, the government might have a fund doing something like that. What I'm a bit worried about is that this might not be all Eron's up to. But again, we'll take his money when he gives it, so long as the work is open source. And we'll see where we end up in a few years. 😅

  • got him
  • Again, if you can write it with conditionals and returns, you can write it with equivalent number of conditionals and a single nested scope. No further scopes are needed. The conditional will even look nearly identically.

  • got him
  • I never said longer functions are not less clear. I said my argument is valid irrespective of the length of the function which shows that the problems I claim multiple returns bring are independent of function length. 😊

    Any validation you can write with a few early returns you can write with an equivalent conditional/s followed by a single nested block under it, followed by a single return. The reader is free to leave if the validation fails nearly the same, they have to glance that the scope ends at the end of the function. Looks at conditional - that's validation, looks at the nested block - everything here runs only after validation, looks after the block - a return. As I mentioned in another comment, validation is a trivial case to do either way. Returns inside business logic past validation is where the problematic bugs of this class show up which requires more thorough reading to avoid.

    If you gave me a PR with early returns only during validation, I probably won't ask you to rewrite it. If I see them further down, it's not going in.

  • got him
  • I'm sure you are capable of rewriting that in 3 lines and a single nested scope followed by a single return. In fact in languages that use exceptions you have to use at least one subscope.

    Notice that in my example I didn't even broach the example with error conditions, cause it's trivial to write cleanly either way. Instead I talked about returns inside business logic. You can't unfuck that. 🐞

  • got him
  • Early returns are very similar to gotos. One level of nesting to take care of validation is trivial in comparison. You're replacing logical clarity for minimal visual clarity. This is true regardless of the size of the function which shows that the size of the function isn't the determinant. You're not alone in your opinion, clearly, and I'm not going to convince you it's a bad practice but I'll just say what I think about it. 😅 This practice doesn't make it my team's codebase.

  • OpenAI plans to announce Google search competitor on Monday, sources say
  • Is this going to be the mule produced by breeding OpenAI with the Bing team?

  • got him
    • Time Troll
  • Immich x FUTO Q&A
  • Weird feeling about this. $5-$20 flat fee sounds like a lower price than what I'd imagine donations would bring. I imagine most who would donate would give at least $5-20, and then some would subscribe monthly. The dev team is obviously gonna get funding from Eron for now which would likely be higher today than what they get in donations.

  • got him
  • Maintainability.

    You can't read a block of code and as quickly and understand its control flow without reading every line, especially in regards to resource cleanup.

    For example say you have:

    ...
    if this:
        something
        or other
        and many more...
        ...
    else:
        yet another thing 
        and some more
        ...
    
    do some cleanup
    return
    ...
    

    Say you aren't exactly interested in what happens inside each branch. If you can assume that there's one return at the end of the block, you can see the if and else, you can reason about what values would trigger each branch, you can also see that no matter which branch is executed, the cleanup step will be executed before returning. Straightforward. I don't have to read all the lines of the branches to ensure the cleanup will be executed. If I can't assume a single return, I have to read all those lines too to ensure none of them jumps out of the function skipping the cleanup. Not having to think about such cases reduces the amount of reading needed and it makes reasoning about the block simpler. The bigger the blocks, the more the branches, the stronger the effect. You have one less foot-shotgun to think about. The easier you make it for your brain, the fewer mistakes it's gonna make. For all those days when you haven't slept enough.

    E: Oh also refactoring blocks of code out into functions is trivial when you don't have multiple returns. Extracting a block with a return in it breaks the parent control flow and requires changes in the implementation.

    E2: Shorter blocks do not obviate this argument. They just make things less bad. But they make almost everything less bad. Shorter blocks and single returns make things even better.

  • got him
  • Fuck.

  • 'Pretty remarkable': UBC study finds e-bike rebates led to decreased car use
  • I guess you're right that cheap cadence sensored ebikes might not feel that great, especially to people used to nice pushbikes.

  • 'Pretty remarkable': UBC study finds e-bike rebates led to decreased car use
  • Time to install a front hub. Small geared like the Bafang G311 for lightweight or Grin All-Axle for the same reliability as the rest of your bike. 😁

    I run a rear G310 with 11sp drivetrain but to be honest if I knew everything I do now when I designed the build, I'd have left my drivetrain intact and used a front hub instead. It's way easier to do, fewer compromises and it could even end up lighter.

  • 'Pretty remarkable': UBC study finds e-bike rebates led to decreased car use
  • I don't see this mentioned often, but ebikes just feel good to ride. People are hesitant until they try them. Once they try them, it's over. Especially if it's a nice torque-assist ebike they tried.

  • 'Pretty remarkable': UBC study finds e-bike rebates led to decreased car use
  • Read the article. 😊 I mean, it's even in the one sentence summary.

  • got him
  • Uses multiple returns... I'm switching to Windows.

  • Mississauga @lemmy.ca Avid Amoeba @lemmy.ca
    Cyclist seriously injured after being struck by vehicle in Mississauga

    The south section of Mississauga Road.

    0
    Clean your physical connectors!

    Have some new old stock SATA drives vomiting at you?

    [ 234.811385] ata1.00: status: { DRDY } [ 234.811392] ata1: hard resetting link [ 240.139340] ata1: link is slow to respond, please be patient (ready=0) [ 244.855349] ata1: COMRESET failed (errno=-16) [ 244.855375] ata1: hard resetting link [ 250.199443] ata1: link is slow to respond, please be patient (ready=0) [ 254.875508] ata1: COMRESET failed (errno=-16) [ 254.875533] ata1: hard resetting link [ 260.211562] ata1: link is slow to respond, please be patient (ready=0) [ 289.919779] ata1: COMRESET failed (errno=-16) [ 289.919810] ata1: limiting SATA link speed to 3.0 Gbps [ 289.919816] ata1: hard resetting link [ 294.963876] ata1: COMRESET failed (errno=-16) [ 294.963904] ata1: reset failed, giving up [ 294.963909] ata1.00: disable device

    Grab your contact cleaner and clean their SATA connectors!

    I just bought a new 1TB Crucial MX500 made in god knows what year and installed it in a virgin SATA port of a M710q made in 2016 and I got the vomit you see above every time I loaded the drive. Reseated all the connectors. More vomit. Scratched my head a couple of times reaching for the trash bin and I had a brainwave that there might be oxidation from sitting naked with the elements. Took out the DeoxIt Gold, dabbed all the connectors on the SATA path, cycled them a few times, powered on and loaded the drive. No more vomit.

    13
    DF64 Gen 2 on sale 30% off in Canada
    coffeeaddicts.ca DF64 Gen 2 Single Dose Coffee Grinder With DLC Burrs

    The second generation of the DF64 incorporates all the learnings from the first generation as well as the DF64V and DF83. the DF64 Gen 2 features an improved 250W motor, a plasma generator to reduce static and built-in anti-popcorn lid.

    DF64 Gen 2 Single Dose Coffee Grinder With DLC Burrs

    Coffee Addicts have their DF64 Gen 2 for CAD $420 at the moment. Still in-stock at the time of writing. I was considering a DF54 but at this price I couldn't not jump on the 64.

    E: Seems like many other distributors have the discount now.

    11
    PSA: Nova Launcher is owned by an analytics company
    www.androidpolice.com Nova Launcher has been acquired by analytics company Branch

    Hopefully, this isn’t the end of an era for Android launchers

    Nova Launcher has been acquired by analytics company Branch

    Since a few folks seem unaware of this, I'm posting anew for visibility.

    327
    Google widely rolling out new April OTA for Pixel 7, Fold, and 8 owners [U]
    9to5google.com Google widely rolling out new April OTA for Pixel 7, Fold, and 8 owners [U]

    Google released new Android 14 QPR2 builds with the April 2024 patch for the Pixel 7/Pro, 7a, Fold, and 8/Pro, though there no update...

    Google widely rolling out new April OTA for Pixel 7, Fold, and 8 owners [U]

    Received this today. I thought it was some emergency security fix given the odd update time.

    0
    Tech industry warns budget's capital gains proposals could cause 'irreparable harm'
    www.collingwoodtoday.ca Tech industry warns budget's capital gains proposals could cause 'irreparable harm'

    TORONTO — The federal budget is being met with disdain from Canada's innovation industry, including tech darling Shopify, which called the capital gains measures in the fiscal plan a potential cause of "irreparable harm.

    Tech industry warns budget's capital gains proposals could cause 'irreparable harm'

    Sounds like the tax is on point!

    11
    If you've recently started experiencing input delay / lag in GNOME Terminal in Ubuntu 22.04

    cross-posted from: https://lemmy.ca/post/19442327

    > It's a known bug from upstream mutter. A fix is being worked on and there's a PPA with the updated packages by the Ubuntu developer working on the fix. It resolved the problem on my end.

    47
    Ubuntu (Linux) @lemmy.ml Avid Amoeba @lemmy.ca
    If you've recently started experiencing input delay / lag in GNOME Terminal in Ubuntu 22.04

    It's a known bug from upstream mutter. A fix is being worked on and there's a PPA with the updated packages by the Ubuntu developer working on the fix. It resolved the problem on my end.

    0
    Thought I was being clever...

    ...in using my Framework 2.5GbE cards to speed up a large data transfer to 2.5Gb. Got 0.28 instead. 🤭

    These aren't the USB-A to USB-C adapters I was looking for. 😂

    13
    DF54 vs. DF64 | How Much Difference Can 10 Millimeters Make?

    It seems both produce nearly identical grind profile. The DF54 is slower.

    I'm considering replacing a Sette with a DF54.

    Does anyone have the DF54? Impressions?

    8
    Card-Check Union Certification In B.C. Has Been A Major Success
    www.readthemaple.com Card-Check Union Certification In B.C. Has Been A Major Success

    The number of union applications grew by 48.8 per cent in 2023 from the previous year due in part to the new model.

    Card-Check Union Certification In B.C. Has Been A Major Success
    0
    Backing up Immich

    The backup doc from Immich states that one should use Postgres' dump functionality to backup the database, as well as copy the upload location.

    Is there any counter indication to doing this instead:

    • Create a dir immich with subdirs db and library
    • Mount the db dir as a volume for the database
    • Mount the library dir as a volume for the upload location
    • Backup the whole immich dir without dumping the Postgres db. (Stop Immich while before doing this)
    6
    Hidden cameras reveal how big banks are upselling you (Marketplace)

    I'm not old enough to know, have Canadian banks been less profit driven and corrupt in the decades past?

    I've seen none of this from the credit union I switched to a few years ago.

    Also that was a pretty shitty look for the finance minister dodging the CBC. She could've stopped and spared a few words, even if just lip service. Perhaps as a finance minister, she's got the Big 5 permanently in one of her ears.

    10
    micromobility - Ebikes, scooters, longboards: Whatever floats your goat, this is micromobility @lemmy.world Avid Amoeba @lemmy.ca
    Grin's Perspective on Ebike Battery Fires, 20 Years of Experience - Live from the BC Bike Show

    Good talk on ebike battery fires by Jason from Grin/ebikes.ca

    3
    A long-awaited change to Canadian banking is coming
    globalnews.ca A long-awaited change to Canadian banking is coming. What to know - National | Globalnews.ca

    Change is in the works that will give Canadian consumers and businesses significantly more control over their financial data, in what’s known as open banking.

    A long-awaited change to Canadian banking is coming. What to know - National | Globalnews.ca

    > Open banking works by giving consumers the option to share their banking data with other firms. The most common use is granting access to budgeting or money management apps and companies, so that a customer can pool different bank accounts and credit cards into one place.

    Ah yes, finally what we've been missing in our financial system! 🤭

    17
    Importing Google Photos Takeout to Immich

    I'm trying to decide how to import my Google Photos Takeout backup. I see two general ways:

    • Import it by uploading it to Immich (immich-go, etc.)
    • Add it as an External library

    Has anyone done it one way or the other? Any recommendation, pros/cons or gotchas?

    14
    avidamoeba Avid Amoeba @lemmy.ca
    Posts 99
    Comments 2.5K