• 0 Posts
  • 12 Comments
Joined 1 year ago
cake
Cake day: June 22nd, 2023

help-circle








  • Yes, it’s very efficient and the core of what complession formats like .zip do.

    The main difference to your idea is that computers count in binary like 0, 1, 10, 11, 100, 101 and so on and that you don’t want to assign these very low codes words directly. Say you’d have assigned 1 the most common word, then that will would be encoded very short, but you’d sort of take the one away from all the other codes, as you don’t know if 11 is twice the most common word or once the 11th (3rd in decimal) common word.

    Huffman essentially computes the most optimal word assignments mathematically.

    The main other difference between your suggestion and most compression algorithms is that you wouldn’t use a huge dictionary in real time and loading it and looking into it would be very slow. Most compression algorithms have a rather small dictionary buildin and/or they build one on the fly looking at the data that they want to compress.



  • In most cases it will work fine as the first thing a good power supply does to the incoming electricity is converting the AC to DC using a full bridge rectifier. If you already supply DC, the current will just flow through it without a problem and the power supply simply continues to do its stuff.

    However note that the DC input voltage needs to be relatively high. About sqrt(2)~=1.4 times as high as the rated AC voltage should be fine. So if you have a power adapter that’s rated for 120 to 240 VAC, you should give it something between 170 and 340 VDC. This is obviously very high (and dangerous). Plugging in a normal car battery or the output of a usb charger or something like that will likely do nothing.


  • Basic recipe for nice tofu:

    • freeze the tofu. This is important as it changes the structure (it becomes dryer and more “meaty”), this is a common technique in asia.
    • after unfreezing it, dry it with paper towels or something like that, cut it into die sized cubes if you want, sprinkle it with potato starch and fry it in a wok or hot pan with some oil. It should get brown and crispy.
    • sprinkle a few drops of Japanese soy sauce on it while it the pan and continue to fry it. The soy sauce adds taste and makes it caramelise.
    • add cooked rice, vegetables or whatever you want.

    You can leave out some steps above. Without the freezing the texture won’t be as firm, without the starch it won’t be as crispy and without the soy sauce it won’t taste as good. I’m just saying that because sometimes it has to go fast or you’re missing ingredients, so you can compromise if needed. Doing all is of course best.