Skip Navigation
Using The Wind And Magnets To Make Heat
  • Handling a pet peeve of mine. 3 seconds into the video, he talks about induction stovetops and shows a picture of a glass top radiant stove.

    Radiant stoves are just slightly better than electric resistive stoves. They are not induction though they can look similar. People try them and hate them and assume induction is terrible when it isn't.

  • First proof of leeches jumping captured on video
  • Leeches are such cool creatures. I had a run-in with them while canoeing in Manitoba. Just one or two latched on. It’s really incredible how they can move their bodies around in the water yet maintain the exact texture and fluidity of the water itself. You’d never be able to feel one if it brushed up against you.

    Also crazy how well whatever numbing chemical they produce works.

    If you want to safely observe one up close, you can get them to latch on to your finger nail where they can’t do any damage.

  • The moon
  • Best explanation I’ve seen is that humans judge distance and size assuming a relatively flat surface (a dozen miles or so in any direction is fairly flat even though the Earth is round).

    Things far along the horizon tend to be small because they’re far away. This isn’t the case for the Moon. So our brains assume it’s far away, but it’s the same apparent size, ergo, it must be massive.

    Like we know Mt Rainier is massive and far away, so given this photo, we might assume the moon is massive.

    Higher in the sky, there’s no real point of reference. Also, you might visually process the sky as a flat layer above the ground, so the same parallax trick applies. I.e. the sky above you is closer than the sky/ground at the horizon. Therefore Moon is “closer” and appears smaller.

  • Maintain fire supremacy at all costs!
    1
    The time I spent three months investigating a 7-year old bug and fixed it in 1 line of code
  • 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 power 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.

  • Video where YouTuber intentionally makes a very lazy “reaction” video to make a point about copyright.
  • Good guess, but no. This was a one-off style thing from a creator who doesn’t normally react. And the “reactions” were extremely low effort. Like they said virtually the same thing for every video.

    They were so certain that it wasn’t going to work that part of the stunt was finding a sponsor who would actually sponsor the video. Ended up with some vpn.

    I might be mixing up this last part with another video though.

  • Video where YouTuber intentionally makes a very lazy “reaction” video to make a point about copyright.

    In my head this was Ian Kung, but I can’t find it on his channel.

    The creator was trying to make a point about how broken copyright enforcement is on YouTube by basically watching cool videos and “reacting” by saying the same thing after each one loosely tailored to the content. They were all based around the phrase “my wife” or something like that.

    Like “wow, what a cute lazy dog. It’s almost as lazy as my wife,” “if you think that’s a big whale, you should meet my wife,” or something to that effect.

    2
    The time I spent three months investigating a 7-year old bug and fixed it in 1 line of code

    I originally told the story over on the other site, but I thought I’d share it here. With a bonus!

    I was working on a hardware accessory for the OG iPad. The accessory connected to the iPad over USB and provided MIDI in/out and audio in/out appropriate for a musician trying to lay down some tracks in Garage Band.

    It was a winner of a product because at its core, it was based on a USB product we had already been making for PCs for almost a decade. All we needed was a little microcontroller to put the iPad into USB host mode (this was in the 30-pin connector days), and then allow it to connect to what was basically a finished product.

    This product was so old in fact that nobody knew how to compile the source code. When it came time to get it working, someone had to edit the binaries to change the USB descriptors to reflect the new product name and that it drew <10mA from the iPad's USB port (the original device was port-powered, but the iPad would get angry if you requested more than 10mA even if you were self-powered). This was especially silly because the original product had a 4-character name, but the new product had a 7-character name. We couldn't make room for the extra bytes, so we had to truncate the name to fit it into the binary without breaking anything.

    Anyway, product ships and we notice a problem. Every once in a while, a MIDI message is missed. For those of you not familiar, MIDI is used to transmit musical notes that can be later turned into audio by whatever processor/voice you want. A typical message contains the note (A, B, F-sharp, etc), a velocity (how hard you hit the key), and whether it's a key on or key off. So pressing and releasing a piano key generate two separate messages.

    Missing the occasional note message wouldn't typically be a big deal except for instrument voices with infinite sustain like a pipe organ. If you had the pipe organ voice selected when using our device, it's possible that it would receive a key on, but not a key off. This would result in the iPad assuming that you were holding the key down indefinitely.

    There isn't an official spec for what to do if you receive another key-on of the same note without a key-off in between, but Apple handled this in the worst way possible. The iPad would only consider the key released if the number of key-ons and key-offs matched. So the only way to release this pipe organ key was to hope for it to skip a subsequent key-on message for the same key and then finally receive the key-off. The odds of this happening are approximately 0%, so most users had to resort to force quitting the app.

    Rumors flooded the customer message boards about what could cause this behavior, maybe it was the new iOS update? Maybe you had to close all your other apps? There was a ton of hairbrained theories floating around, but nobody had any definitive explanation.

    Well I was new to the company and fresh out of college, so I was tasked with figuring this one out.

    First step was finding a way to generate the bug. I wrote a python script that would hammer scales into our product and just listened for a key to get stuck. I can still recall the cacophony of what amounted to an elephant on cocaine slamming on a keyboard for hours on end.

    Eventually, I could reproduce the bug about every 10 minutes. One thing I noticed is that it only happened if multiple keys were pressed simultaneously. Pressing one key at a time would never produce the issue.

    Using a fancy cable that is only available to Apple hardware developers, I was able to interrogate the USB traffic going between our product and the iPad. After a loooot of hunting (the USB debugger could only sample a small portion, so I had to hit the trigger right when I heard the stuck note), I was able to show that the offending note-off event was never making it to the iPad. So Apple was not to blame; our firmware was randomly not passing MIDI messages along.

    Next step was getting the source to compile. I don't remember a lot of the details, but it depended on "hex3bin" which I assume was some neckbeard's version of hex2bin that was "better" for some reasons. I also ended up needing to find a Perl script that was buried deep in some university website. I assume that these tools were widely available when the firmware was written 7 years prior, but they took some digging. I still don't know anything about Perl, but I got it to run.

    With firmware compiling, I was able to insert instructions to blink certain LEDs (the device had a few debug LEDs inside that weren't visible to the user) at certain points in the firmware. There was no live debugger available for the simple 8-bit processor on this thing, so that's all I had.

    What it came down to was a timing issue. The processor needed to handle audio traffic as well as MIDI traffic. It would pause whatever it was doing while handling the audio packets. The MIDI traffic was buffered, so if a key-on or key-off came in while the audio was being handled, it would be addressed immediately after the audio was done.

    But it was only single buffered. So if a second MIDI message came in while audio was being handled, the second note would overwrite the first, and that first note would be forever lost. There is a limit to how fast MIDI notes can come in over USB, and it was just barely faster than it took to process the audio. So if the first note came in just after the processor cut to handling audio, the next note could potentially come in just before the processor cut back.

    Now for the solution. Knowing very little about USB audio processing, but having cut my teeth in college on 8-bit 8051 processors, I knew what kind of functions tended to be slow. I did a Ctrl+F for "%" and found a 16-bit modulo right in the audio processing code.

    This 16-bit modulo was just a final check that the correct number of bytes or bits were being sent (expecting remainder zero), so the denominator was going to be the same every time. The way it was written, the compiler assumed that the denominator could be different every time, so in the background it included an entire function for handling 16-bit modulos on an 8-bit processor.

    I googled "optimize modulo," and quickly learned that given a fixed denominator, any 16-bit modulo can be rewritten as three 8-bit modulos.

    I tried implementing this single-line change, and the audio processor quickly dropped from 90us per packet to like 20us per packet. This 100% fixed the bug.

    Unfortunately, there was no way to field-upgrade the firmware, so that was still a headache for customer service.

    As to why this bug never showed up in the preceding 7 years that the USB version of the product was being sold, it was likely because most users only used the device as an audio recorder or MIDI recorder. With only MIDI enabled, no audio is processed, and the bug wouldn't happen. The iPad however enabled every feature all the time. So the bug was always there. It's just that nobody noticed it. Edit: also, many MIDI apps don't do what Apple does and require matching key on/key off events. So if a key gets stuck, pressing it again will unstick it.

    So three months of listening to Satan banging his fists on a pipe organ lead to a single line change to fix a seven year old bug.

    TL;DR: 16-bit modulo on an 8-bit processor is slow and caused packets to get dropped.

    The bonus is at 4:40 in this video https://youtu.be/DBfojDxpZLY?si=oCUlFY0YrruiUeQq

    27
    Any thoughts for custom-sizing a thin glass sheet to protect an LCD screen?

    So my wife cracked the screen of her Playdate console. I got a replacement memory LCD (Sharp LS027B7DH01A), but the LCD is mounted with optically clear adhesive directly to a piece of glass which is adhered around the edges to the console’s faceplate.

    The glass measures 65.15x41.64mm by 0.65mm thick. Definitely not a standard size. I can’t find anywhere to buy glass so thin and so large.

    My first thought was to cut a phone screen protector down to size with a glass cutter. My first attempt failed because the screen protector I bought was actually coated in plastic on both sides. Even if I got a straight cut, I couldn’t find a way to slice through the plastic layers cleanly.

    Any ideas on where to find cuttable glass sheets this thin? I could try more screen protectors, but there’s no way to know if they’ll work before buying them.

    6
    Home Improvement @lemmy.world ch00f @lemmy.world
    I’d like to build a ducting system to actively push air from one room to another. Is that a thing?

    So my home office is in our basement while my wife’s is in a finished attic space. We have a mini split system, but it has to be all heat or all cooling, and many days it’s cold in my office, but hot in my wife’s office.

    Thanks to a defunct chimney, I have a pretty decent path from the attic to the basement that could easily accommodate some kind of ducting.

    I’d like to make a system that can push air from my office to hers or vice versa as needed. I think this would really help the house in general as cold air tends to pool in the basement.

    I’ve seen plenty of ducting booster fans, but I’d like something with a speed (or at least direction) control accessible from the outside.

    Does something like this exist? It would need to force air through maybe 30-40’ of ducting.

    18
    [Question] Rate my upgrade!

    Per my previous post, I’m working on updating my server that’s running a J3455 Celeron with 16gigs of ram.

    Goals:

    • Support at least six hard drives (currently have six drives in software RAID 6). Can move 7th main drive to nvme.
    • Be faster at transcoding video. This is primarily so I can use PhotoPrism for video clips. Real-time transcoding 4K 80mbps video down to something streamabke would be nice. Despite getting QuickSync to work on the Celeron, I can’t pull more than 20fps unless I drop the output to like 640x480. Current build has no PCIe x16 slot.
    • Energy efficiency. Trying to avoid a dedicated video card.
    • Support more RAM. Currently maxed at 16gb.
    • Price: around $500
    • Server-grade hardware would be nice, but I want newer versions of quicksync and can’t afford newer server hardware. Motherboard choice is selected primarily because of chipset, number of SATA ports, and I found one open box.

    https://pcpartpicker.com/list/JX2gHG

    Hoping to move my main drive to the NVME and keep the other six drives as-is without needing a reinstall.

    Thoughts?

    7
    [Question] What to spend money on for server upgrade?

    I've been running a headless Ubuntu server for about 10 years or so. At first, it was just a file/print server, so I bought a super low power motherboard/processor to cut down on the energy bill. It's a passively cooled Intel Celeron J3455 "maxed out" with 16BG of RAM.

    Since then it's ballooned into a Plex/Shinobi/Photoprism/Samba/Frigate/MQTT/Matrix/Piwigo monster. It has six drives in RAID6 and a 7th for system storage (three of the drives are through a PCI card). I'm planning on moving my server closet, and I'll be upgrading the case into a rack-mount style case. While I'm at it, I figured I could upgrade the hardware as well. I was curious what I should look for in hardware.

    I've built a number of gaming PCs in the past, but I've never looked at server hardware. What features should I look for? Also, is there anything specific (besides a general purpose video card) that I can buy to speed up video encoding? It'd be nice to be able to real-time transcode video with Plex.

    20
    Photography @lemmy.world ch00f @lemmy.world
    Why are there no midrange 4K camcorders?

    A few years ago, I picked up a Canon Vixia HF R800 HD camcorder used off eBay for $200. I was tired of filling up my phone with long-form video recordings (family weddings, etc), and I liked having the large optical zoom.

    I was thinking of upgrading this year to 4k, and it seems that everything is either $150 scamware off Temu or at least $1k jobs from Canon or Sony.

    Obviously I expect a price hike for 4k, but is it that much more expensive to make a 4k camcorder? Five years later, and they're still 5x more expensive than 1080p?

    6
    Killing an application in a terminal has a different effect than killing it in the UI. Help?

    I'm trying to write a simple bash script that opens up GQRX, sends it some TCP commands, then closes it down.

    Unfortunately, I've found that when I close the program like this, the next time it opens, it will pop up a window saying "crash detected" and ask me to review the configuration file. This prevents the app from loading unless someone is present to click the dialog box.

    This error only seems to happen when I try to close the program using the bash script. Closing it by just clicking the X doesn't cause this problem next time it's launched.

    I think I'm closing the app too aggressively which terminates it before it can wrap up its affairs, and it interprets this as a crash. What's the best way to close the app to keep this from happening?

    I've tried:

    • pkill -3 gqrx
    • pkill -13 gqrx

    But the problem persists. Is there an even softer way to close an application?

    20
    I sort of left the hobbyist electronics world back in 2018, and now everything seems to have an embedded Raspberry Pi in it. What's the best way to catch up?

    I'm an EE by trade focusing on embedded devices, but most of my work is in relatively low-power STM32 applications. When I stopped following developments in hobby kits, it was mostly Arduino Unos slowly driving I2C OLED displays.

    Now suddenly, there are embedded Raspberry Pis and ESP32s doing realtime facial recognition and video feeds.

    Is there a good place to look to catch up on what's now possible with these embedded devices?

    Also, while I enjoy the ease of the hobby kits, I'm also interested in more mass-production-focused solutions.

    19
    Where do guns go when people are done using them?

    Do guns wear out? Do they end up in landfill? You always hear about guns being sold, but never about what happens to them at the end of their useful life.

    31
    Need help deriving the PID constants (kp, ki, kd) of a single stage analog PID controller.

    I'm working on implementing the PID compensator on the top of page 20 here. I've already got a circuit working, but it oscillates a ton, and I was hoping to tune it with a better strategy than just guess and check.

    The datasheet doesn't go into a lot of detail on how it's supposed to work, but I found a whitepaper that covers single-stage PID compensators in more detail here.

    I've got this compensator working, I've modeled it in spice and the poles and zeroes show up where they should, but I have no idea how to actually tune it to my system.

    My understanding is that I need to fit the equation (3) on the second link to the form kp + kds + ki/s, but it's an algebraic nightmare.

    What I'm hoping for is some derivation of the PID constants in terms of the components in my system. Then I can work on one of the many tuning methods. The datasheet even assigns names to components implying that they're responsible for setting one of the constants (Cd and Rd for derivative term for example), but I'm fairly certain they can't be completely isolated like that.

    Also, if the answer is just that I need to re-learn how to do partial fractions, I'm okay with that.

    4
    Suggestions for moving server closet to the basement (extending a dozen shielded cat6 10-15 feet)

    So I need to move my server closet out of the guest room closet and into the basement so the closet can be used as a closet again.

    I’ve got like 15 shielded cat6 with insulated risers patched into the back of a rack mount patch panel.

    My goal is to end up with all of the existing cable extended 15’ or so to the new patch panel location, with maybe some kind of small door in the wall of the original closet so I can access the splices if anything goes wrong.

    I invested in shielded cat6 when networking the house to future proof everything, and I have solid home runs to every location. I’m currently only running gigabit speeds, but I’d like to preserve the integrity of the original cables as much as possible.

    With that in mind, what’s the best method for this extension? I’ve seen shielded punchdown junction boxes as well as female/female inline couplers. Keep in mind that there will be a bunch of them, so any advice on keeping things organized is appreciated.

    3
    Is there an easy way to generate a list of CMYK color values that will appear identical to the human eye under 589nm light?

    I picked up a low pressure sodium lamp and am working on a Halloween demonstration. I’m hoping to make a display that appears one way under normal light, but looks totally different under the monochromatic 589nm sodium vapor light.

    So basically, I’m looking to generate a color wheel where I pick a shade of gray and get a list of colors that would look that gray under sodium vapor light.

    …I feel like there must be a Python library for thing or something…

    18
    [Rant] Very new to DND, not sure if my campaign sucks or if this game just isn't for me.

    Update: thanks all for the very helpful advice! I think it’s really special that not one of you dunked on my DM. You all seem very supportive of a broad range of play styles and that’s a sign of a very healthy community.

    I reached out to one of the more experienced players in our party, and I’ll be pinging our DM at some point over the next week. I’ll see if we can switch gears or if not leave peaceably. Thanks again.

    Recently got into DND. Watched two seasons of Dimension 20 and loved them. A friend of mine offered to try DMing for our friend group. We meet every two weeks for 3-4 hours. We're playing Pathfinder using the Foundry online interface so we can play remotely.

    Apologize if I mess up any terminology, I'm new.

    I am two hours into this week's game right now (in another tab), and I'm so fucking bored. We're in some underground tunnel system, and just getting bombarded by completely arbitrary enemies.

    Last round we spent three hours fighting a mimic and a gelatinous cube, and there was no explanation for why they were even in the cave in the first place. We haven't had a conversation with an NPC in three sessions. End of the round we come across some weird tunnel system with giant moths on one side and giant larvae on the other. No explanation for why they're there. We start coming up with a plan on how to kill them so we can get the loot they're guarding, but it was the end of the session.

    This week, right when we start and try to do something about the moths, we get attacked by morlocks that came up the tunnel behind us, fight them for an hour and a half, and the remaining ones just run off. So now we're finally dealing with the moths.

    Anyway, we're doing this on a giant map in Foundry. Nothing is theater of the mind. It's all very literal, and it feels like I'm playing an incredibly slow PC game just sliding my token down tunnels. Nobody is really roleplaying. We rarely get any details during our battles beyond "they look really hurt."

    I don't expect anybody I know to be at the level of Brennan or whatever at DMing, but there is just no entertainment value for what we're doing here, we're constantly in combat, none of my skills are useful (because we're just fighting mindless monsters), and it's like a solid 10 minutes between my turns.

    Like end of last round, I floated the idea of trying to mount and tame one of the moths (I'm a halfling, and they're big), and my DM just said "I mean, that's pretty dangerous. If you're ok rolling a new character, you can try it." Like geez, sorry for trying to make it interesting. At least give me an in-game reason for why I shouldn't do it.

    I really want to quit. Any advice?

    25
    Gaming @lemmy.world ch00f @lemmy.world
    What game mechanic did you discover way too late?

    In the original Sims, I was 11, and didn’t realize skills improvement would get your sims better jobs.

    My sims were all top ranked in the military because that was the best job that required no skills.

    29
    Spooky or funny/horror YouTube videos for Halloween?

    Here’s what I have so far:

    https://youtu.be/_u6Tt3PqIfQ?si=D8SimyX2Q8kgntNU https://youtu.be/K477N9scQEw?si=VzU4lhE-JHaCX7Sh https://youtu.be/QNwCojCJ3-Q?si=dijpvnVFo8PCeW8q https://youtu.be/SPZWfXLTDuo?si=RdoFjz1Gho3EQ2JI https://youtu.be/wbfu39l0kxg?si=Rp3JK5aNCNgZojEF https://youtu.be/H4dGpz6cnHo?si=fONrK8o2Z_YhClRa

    26
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)CH
    ch00f @lemmy.world
    Posts 25
    Comments 441