• 0 Posts
  • 16 Comments
Joined 3 years ago
cake
Cake day: June 11th, 2023

help-circle
  • Exactly this. I use Shelly relays in the switch boxes and use the physical switch as an input to the Shelly relay. I have a couple AliExpress zigbee relays too that work well.

    The trick is with three/four way switches where the smart relay needs continuous power and to be physically located at the end of the chain where power is actually switched to the light or outlet. Took me a while to figure that out but an SPDT relay with 120V coil solves that. The problem is space: fitting the relay to provide continuous power to the smart relay and the smart relay itself into a standard junction box with a physical switch and all the usual mess of wiring is not easy.







  • It’s just like the DEF tanks on 18 wheelers. I buy a 10L jug of it from Walmart for something like $10. In my trunk there’s a panel you remove and under it there’s a small cap very similar to the gas cap. Remove that, hook up the DEF bottle hose (the bottles come with a 12-15" corrugated hose) and very slowly pour it in. You don’t want to spill that stuff, it’s nasty not because it’s urea, but because when it dries it kind of crystallizes and makes a real bloody awful mess.

    Replace the cap, replace the panel cover, close the trunk and you’re done for another 9-15mos.







  • I mainly use it to generate unit tests and it frequently makes shit up that clearly won’t work. Like directly invoking non-exported functions that I deliberately choose not to export, because they don’t need to be exported.

    If you work where I work, their solution is to just #include "the_file.c" so they have access to all the functions/variables I painstakingly marked static specifically to prevent them from trying to unit test the internals.




  • Agreed except for the variables. You can pry the iterators i, j, k, the pointers p and q, and the temporary buffer buf, from my cold, dead hands.

    Short variable names increase code clarity, particularly when the functions employing them are concise and named appropriately. There’s not much worse than using something like sourcedata[databufferiterator] instead of src[i]. It reminds me of authors who think that big words make them sound more intelligent. Needing or advocating auto complete in IDEs is a symptom of this kind of code smell, IMO.

    Code should be clear and concise; it’s also why I fight for 8 character indentation; if your code is creeping across the screen it’s a damn good indication that the function might be too complex and should be broken up.