Get the farthest date from the instance.

@param Verta $v1
@param Verta $v2

@return static
325694
public function farthest(Verta $v1, Verta $v2)
    {
        return $this->diffSeconds($v1) > $this->diffSeconds($v2) ? $v1 : $v2;
    }
414023
public static function smallerThan(Version $v1, Version $v2)
    {
        // If it's equal it can not be smaller
        if (self::equals($v1, $v2)) {
            return false;
        }

        // If it's not equal, and not greater, it must be smaller
        return !self::greaterThan($v1, $v2);
    }
47221
public static double[][] timesTranspose(final double[] v1, final double[] v2) {
    final double[][] re = new double[v1.length][v2.length];
    for(int j = 0; j < v2.length; j++) {
      for(int i = 0; i < v1.length; i++) {
        re[i][j] = v1[i] * v2[j];
      }
    }
    return re;
  }
831182
public static function compareVersion($v1, $v2)
    {
        if(empty($v1)){
            return 0;
        }

        $l1  = explode('.',$v1);
        $l2  = explode('.',$v2);
        $len = count($l1) > count($l2) ? count($l1): count($l2);

        for ($i = 0; $i < $len; $i++){
            $n1 = isset($l1[$i])?$l1[$i]:0;
            $n2 = isset($l2[$i])?$l2[$i]:0;
            if ($n1 > $n2){
                return true;//需要更新
            }else if ($n1 < $n2){
                return false;//不需要更新
            }
        }
        return false;
    }
521795
public double distance(double[] v1, double[] v2) {
    final int dim1 = v1.length, dim2 = v2.length;
    final int mindim = dim1 < dim2 ? dim1 : dim2;
    double agg = preDistance(v1, v2, 0, mindim);
    if(dim1 > mindim) {
      agg += preNorm(v1, mindim, dim1);
    }
    else if(dim2 > mindim) {
      agg += preNorm(v2, mindim, dim2);
    }
    return agg;
  }
221665
public function staticSortCompare($str1, $str2)
    {
        if ($this->sortby[0] == '-') {
            return strcmp(
                $str2[substr($this->sortby, 1)],
                $str1[substr($this->sortby, 1)]
            );
        }

        return strcmp(
            $str1[$this->sortby],
            $str2[$this->sortby]
        );
    }
880088
public function farthest($date1, $date2)
    {
        return $this->diffInSeconds($date1) > $this->diffInSeconds($date2) ? $date1 : $date2;
    }
842811
private static function preReleaseEquals(PreRelease $v1, PreRelease $v2)
    {
        // If they don't match on the versionable level they can not match
        if (!self::versionableEquals($v1, $v2)) {
            return false;
        }

        // Both other parts need to match
        if ($v1->getGreek() !== $v2->getGreek()) {
            return false;
        }
        if ($v1->getReleaseNumber() !== $v2->getReleaseNumber()) {
            return false;
        }

        return true;
    }
24304
public function setLastLogin($v)
    {
        $dt = PropelDateTime::newInstance($v, null, 'DateTime');
        if ($this->last_login !== null || $dt !== null) {
            $currentDateAsString = ($this->last_login !== null && $tmpDt = new DateTime($this->last_login)) ? $tmpDt->format('Y-m-d H:i:s') : null;
            $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
            if ($currentDateAsString !== $newDateAsString) {
                $this->last_login = $newDateAsString;
                $this->modifiedColumns[] = UserPeer::LAST_LOGIN;
            }
        } // if either are not null


        return $this;
    }
638025
public static function niceTimeDiff($d1, $d2, $limitPeriods = 2)
    {
        if (!is_int($d1)) {
            $d1 = self::strtotime($d1);
        }
        if (!is_int($d2)) {
            $d2 = self::strtotime($d2);
        }
        if (empty($d1) or empty($d2)) {
            return false;
        }
        $max = max($d1, $d2);
        $min = min($d1, $d2);
        $diff = $max - $min;

        return self::niceDuration($diff, $limitPeriods);
    }
190809
public static Vector getMaximum(Vector v1, Vector v2) {
        return new Vector(Math.max(v1.x, v2.x), Math.max(v1.y, v2.y), Math.max(v1.z, v2.z));
    }
1060435
public function twiceMonthly($first = 1, $second = 16)
    {
        $days = $first.','.$second;

        return $this->spliceIntoPosition(1, 0)
            ->spliceIntoPosition(2, 0)
            ->spliceIntoPosition(3, $days);
    }
821274
public static function upTo2Weeks()
    {
        return self::getOrCreate('up-to-2-weeks', function () {
            return new DateDiffCalculator([
                RangeRule::createForNegativeValues(2 * DateUnits::WEEK, INF, function (DateDiffRequest $request) {
                    return DateDiffResult::createFullDate($request);
                }),
                Rules::weeksAgo(),
                Rules::yesterday(),
                Rules::daysAgo(),
                Rules::hoursAgo(),
                Rules::minutesAgo(),
                Rules::secondsAgo()
            ]);
        });
    }
391648
public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
    {
        return Carbon::instance(
            CronExpression::factory(
                $this->getExpression()
            )->getNextRunDate($currentTime, $nth, $allowCurrentDate)
        );
    }
659147
public function between(Verta $v1, Verta $v2, $equal = true)
    {
        if ($v1->gt($v2)) {
            $temp = $v1;
            $v1 = $v2;
            $v2 = $temp;
        }

        if ($equal) {
            return $this->gte($v1) && $this->lte($v2);
        }

        return $this->gt($v1) && $this->lt($v2);
    }
219210
public function closest(ChronosInterface $dt1, ChronosInterface $dt2)
    {
        return $this->diffInSeconds($dt1) < $this->diffInSeconds($dt2) ? $dt1 : $dt2;
    }
1264489
public function diffHours(Verta $v = null)
    {
        return (int) ($this->diffSeconds($v) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
    }