• 4 Posts
  • 38 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle



  • Oh sure. I agree with that. Obviously many people have limited options.

    I just think think it’s a monumentally bigger ask no matter where the change has to be made (policy or individual choice).

    Like our best solution for transportation (in the US at least) is to just keep making larger free ways. Even gas powered buses running on decades old technology could make a significant impact on the climate crisis, but people either don’t want to ride them or cities don’t want to build them.

    Any way, I’m just frustrated with the attitude that we’re going to technology our way out of this hole without needing to change or sacrifice anything (like we pulled off with ozone).

    When it comes to energy use, there’s such a thing induced demand. If it’s cheaper, people will use it more. Hell, look at how much energy it takes to use AI to write an email.

    There’s no induced demand with refrigerants.



  • Eh. The solution to the ozone layer was to replace refrigerant A with refrigerant B. A 1:1 swap that required very little effort from anybody.

    Getting off fossil fuels more or less mandates an entire global paradigm shift in how we do basically everything. The entire global economy of the past 200 years has been built off an unsustainable energy source.

    Sure, we can replace gas with batteries, but every step of the way is going to require small changes in how people do things, and they’re going to be very resistant to that.


  • It’s a lot of work. At the end of the day, I spent about $1k to get about $100 worth of gold, so it’s really not lucrative. I just wanted a fun story behind an engagement ring.

    I actually mined the gold from electronics and those gold plated Pokémon cards they sold at Burget King for Pokémon the Motion Picture, but that’s another process.

    Here’s how it goes:

    1. Clean up your electronics. You ideally want just circuit board contacts. Like the strip of contacts on a stick of ram. Cut/break those off and dispose of the rest.

    2. Soak in copper chloride. Use Hydrochloric acid (sold as concrete cleaner) and hydrogen peroxide. It’ll start eating at the copper on the circuit boards. 2HCl + H2O2 + 2Cu -> 2CuCl + 2H2O

    3. Keep dissolving. This part takes a while. It helps to use a stir bar and bubbler to keep the fluid moving. CuCl will eat more copper and produce CuCl2, but you can “recharge it” by adding more HCl and bubbling in oxygen (or use hydrogen peroxide, but that’s more expensive).

    4. Now you should have a bunch of flakes of gold that was plated onto the copper as well as the bare circuit boards floating around in a dark green solution of copper chloride. Pour through a coffee filter and wash with water to remove all the copper chloride.

    5. To recycle the copper chloride, mix with sulfuric acid (sold as battery acid). CuCl + H2SO4 -> HCl + CuSO4. Boil off and condense the HCl to re-use. You won’t be able to get “fuming” 30% stuff like you buy at the store because the azeotrope of HCl is 20%. Then you can plate out the copper from the copper sulfate and reuse the resulting sulfuric acid. Copper sulfate is a super pretty blue by the way.

    You do copper sulfate because plating copper out of CuCl2 will release HCl gas which is nasty.

    1. Now you have to extract the gold from all the random bits of circuit boards. Mix Nitric acid and more HCl to make “aqua regia.” Gold is slightly soluble in HNO4, but it’ll the get stolen by the HCl to make “chloroauric acid” which looks exactly like piss. Nitric acid is the only ingredient that’s hard to get. I found a seller on eBay, but there are also methods for manufacturing it at home from other compounds.
    1. Wash/filter the components like you did with the copper chloride to get all the chloroauric acid out. Then sprinkle some sodium metabisulfite in which will react with the nitric acid and produce sulfur dioxide gas which reacts with the chloroauric acid to make metallic gold, sulfuric acid, and Hydrochloric acid.

    Filter through another coffee filter and distill resulting solution to recover HCl and H2SO4.

    1. At this point the gold is an insanely fine powder. Like it’ll take hours just to settle to the bottom of the solution. I ended up having to filter it several times to get it all out.

    Dry the filter paper, ball it up, and toss it in a heated crucible (I used a blow torch) with some borax to act as a flux. Eventually the paper burns away and you’re left with a tiny bead of gold.

    So yeah, you can reuse the copper, Hydrochloric acid, and sulfuric acid, and the other byproducts are harmless salts and gases.






  • I believe the optimization came because the denominator was a power of two. In my memory, the function counted up all of the bytes being sent and checked to see that the sum was a multiple of 16 (I think 16 bytes made a single USB endpoint or something; I still don’t fully understand USB).

    For starters, you can split up a larger modulo into smaller ones:

    X = (A + B); X % n = (A % n + B % n) % n

    So our 16 bit number X can be split into an upper and lower byte:

    X = (X & 0xFF) + (X >> 8)

    so

    X % 16 = ((X & 0xFF) % 16 + (X >>8) % 16) % 16

    This is probably what the compiler was doing in the background anyway, but the real magic came from this neat trick:

    x % 2^n = x & (2^n - 1).

    so

    x % 16 = x & 15

    So a 16 bit modulo just became three bitwise ANDs.

    Edit: and before anybody thinks I’m good a math, I’m pretty sure I found a forum post where someone was solving exactly my problem, and I just copy/pasted it in.

    Edit2: I’m pretty sure I left it here, but I think you can further optimize by just ignoring the upper byte entirely. Again, only because 16 is a power of 2 and works nicely with bitwise arithmatic.









  • ch00f@lemmy.worldOPtoSelfhosted@lemmy.world[Question] Rate my upgrade!
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    8 months ago

    Yeah, but we always run them in native formats, so it’s not a big load on the processor. We only watch the 4K stuff at home where it’s got a hardwired gigabit ethernet connection.

    If you saw my other comment, I’m kind of talking myself out of this upgrade since I managed to get qsv working on my current rig.


  • That shouldn’t be the case. I’d look into getting this fixed properly before spending a ton of money for new hardware that you may not actually need. It smells like to me that encode or decode part aren’t actually being done in hardware here.

    Right you are!

    Dug into it a little more. There were some ffmpeg flags that weren’t being enabled by the latest release of Photoprism. Had to move to the test build. https://github.com/photoprism/photoprism/discussions/4093

    While it’s faster than real time now, Photoprism still won’t start streaming until the preview is fully generated, so longer video clips can take a minute or two to start playing. It only has to happen once per file, but it’s still annoying. There’s a feature to pre-transcode video, but it’s only to get in to a streamable format. It doesn’t check bitrate/size until you actually start to play.

    I might write a script to pre-generate the preview files, but either way, I don’t think I need to upgrade the server quite yet.