• 0 Posts
  • 24 Comments
Joined 1 year ago
cake
Cake day: July 31st, 2023

help-circle






  • paholg@lemm.eetoProgrammer Humor@programming.devExam Answer
    link
    fedilink
    English
    arrow-up
    21
    ·
    9 months ago

    Works even better in Ruby, as the code as given is valid, you just need to monkey patch length:

    #!/usr/bin/env ruby
    
    module DayLength
      def length
        if ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].include? self
          "24 hours"
        else
          super
        end
      end
    end
    
    class String
      prepend DayLength
    end
    
    day = "Monday"
    
    x = day.length
    
    print(x)
    

  • paholg@lemm.eetoProgrammer Humor@programming.devExam Answer
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    9 months ago

    It could be Ruby; puts is more common, but there is a print. With some silly context, the answer could even be correct:

    #!/usr/bin/env ruby
    
    module DayLength
      def length
        if ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].include? self
          "24 hours"
        else
          super
        end
      end
    end
    
    class String
      prepend DayLength
    end
    
    day = "Monday"
    
    x = day.length
    
    print(x)
    







  • paholg@lemm.eetoMemes@lemmy.mlScore
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 year ago

    Yeah, the few at the top bring in revenue, but most don’t. Speculating on future revenue is not helpful.

    If you’d read the links I shared, you’d see the revenue figures include alumni donations, and they’re still a net negative for the majority of schools.





  • paholg@lemm.eetoMemes@lemmy.mlno window
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Dishwashers do a pre-wash to get most of the big stuff off, then a main wash to finish up. If you use the capsule-things, there’s only soap for the main wash.

    If your dishwasher has two compartments, then put detergent in both as one is for the pre-wash and one for the main wash.

    If it doesn’t have two compartments, then just put some detergent loose with the dishes for the pre-wash.