About 395 results
Open links in new tab
  1. How to implement Ruby max_by to return all elements which have …

    Dec 16, 2020 · Ruby max_by method finds the maximal element form an array. Sometimes the maximal elements are with multipicity, in this case max_by chooses only one of them, …

  2. ruby - Max and Min Value ... Need method to return two variable …

    Oct 30, 2010 · The program is supposed to return the max and min values of an array. My goal was to have two variables (max and min) outside of the method, so that as the method ran …

  3. ruby on rails - How can I fetch a model instance, plus its includes ...

    Jul 12, 2015 · To get a list of shows a user is subscribed to, I can say current_user.subscriptions(includes: :tv_show).all. Here's where I get stuck, though: I want to …

  4. How can I assign a variable the largest 32 bit signed value in ruby ...

    Jun 6, 2019 · I want to be able to assign a variable the number 2147483647, the maximum 32-bit signed integer value. Is there some way that I can retrieve a value from the class, such as …

  5. fixnum - Ruby max integer - Stack Overflow

    Feb 11, 2009 · I need to be able to determine a systems maximum integer in Ruby. Anybody know how, or if it's possible?

  6. Finding the element of a Ruby array with the maximum value for a ...

    Nov 7, 2011 · If I have a ruby array of a certain type of objects, and they all have a particular field, how do I find the element of the array the has the largest value for that field?

  7. How do I create a ruby Hello world? - Stack Overflow

    Apr 1, 2009 · I know in PHP you have to intrepret a page like index.php, but in Ruby how does it work? I don't know what is the Ruby extension like index.php for PHP. Could you help me?

  8. How to find the key of the largest value hash? - Stack Overflow

    May 18, 2011 · This runs through each key-value pair and returns (or in this case puts's) the key (s) where the value is equal to the max of all values. This should return more than one key if …

  9. ruby - How do I find the index of the maximum value of an array ...

    I tried the solution recommended here -- In Ruby, what is the cleanest way of obtaining the index of the largest value in an array? array = [nil, nil, nil, nil, nil, 0.9655172413793104, nil, nil] ...

  10. Phusion Passenger status crashing with too long socket name

    Nov 17, 2021 · I am trying passenger on Ubuntu 18.04, pretty much generic install and the passenger-status call crashes. Not super clear how to set the path that it uses for local socket …