Hey, there.

  • 0 Posts
  • 8 Comments
Joined 1 year ago
cake
Cake day: June 30th, 2023

help-circle





  • For a serious reoly, I think the expression “If they have eggs, buy two” is redundant. If they didn’t have eggs, the kid just can’t and won’t buy any eggs.

    I think the proper command would be, “Please buy 1 bottle of milk and two eggs.” That way, the kid won’t be confused and it’s still a proper valid command.

    Unfortunately though, the sentence is ambiguous even to non-programmers. It is unknown whether the if condition applies to

    • buying two eggs (buy two eggs)
    • buying two bottles of milk (buy two bottles instead)
    • or buying a bottle of milk (buy another bottle)

    Simply because they didn’t specify which to buy.

    For a non-serious reply,

    cart.add(supermarket.takeProduct(ProductType.milk, 1));
    
    if (supermarket.getProduct(type: ProductType.eggs).length > 0) {
        cart.add(supermarket.takeProduct(Product type.milk, 2));
    }
    
    cart.checkout();
    

    The kid should have bought a total of 3 bottles.



  • Unless the disc is burned as a data CD containing MP3 files, then they are supposed to be audio CDs containing lossless PCM data (almost literally WAV). This is definitely the case unless the MP3 is converted to WAV then burned as an audio CD.

    If you want to store the audio from an audio CD losslessly, then there are no benefits in choosing WAV over FLAC. That is just wasting storage, since a FLAC will store the WAV without any loss.

    If you don’t mind changing some bits resulting in a lossy but virtually indistinguishable-from-the-original quality, then use a modern lossy codec like Opus (or even AAC or even Vorbis). That way, you save a ton of space without affecting the sound quality, assuming you chose a high enough bitrate setting.