Find common give names of unknown sexes.

@param int $threshold
@param int $maxtoshow

@return string
549255
public function commonGivenUnknownTable(int $threshold = 1, int $maxtoshow = 10): string
    {
        return $this->commonGivenQuery('U', 'table', false, $threshold, $maxtoshow);
    }
836929
public function getTtl(): ?int
    {
        $maxAge = $this->getMaxAge();

        return null !== $maxAge ? $maxAge - $this->getAge() : null;
    }
512211
public Set<T> getKeysAboveCountThreshold(double threshold) {
    Set<T> keys = Sets.newHashSet();
    for (T key : counts.keySet()) {
      if (counts.get(key) > threshold) {
        keys.add(key);
      }
    }
    return keys;
  }
1214740
public function isLight($color, $threshold=50): bool
    {
        return Plugin::$plugin->color->isLight($color, $threshold);
    }
1043501
public function build(array $tokenProbabilities, $threshold = 50)
    {
        $sentences = [''];

        foreach ($tokenProbabilities as $idx => $tokenProbability) {
            $token = $tokenProbability->getToken();

            $sentenceIdx = count($sentences) - 1;
            $sentences[$sentenceIdx] .= $token->getPrintableValue();

            $meetsThreshold = $tokenProbability->getProbability() >= $threshold;
            $currentSentenceIsEmpty = empty(trim($sentences[$sentenceIdx]));

            if ($meetsThreshold && !$currentSentenceIsEmpty) {
                $sentences[] = '';
            }
        }

        if ('' === $sentences[count($sentences) - 1]) {
            unset($sentences[count($sentences) - 1]);
        }

        $sentences = array_map('ltrim', $sentences);

        return $sentences;
    }
705567
public function asNtext1line($value, $maxlen = null)
    {
        if ($value === null) {
            return $this->nullDisplay;
        }
        $suffix = '';
        if ((false !== ($n = strpos($value, "\n"))) || (false !== ($n = strpos($value, "\r")))) {
        	if (($n > 0) && (substr($value, $n - 1, 1) == "\r")) {
        		$n--;
        	}
        	$value = substr($value, 0, $n - 1);
        	$suffix = ' ...';	 
        }
        if ($maxlen) {
        	if ((strlen($value) + strlen($suffix) > $maxlen)) {
				$suffix = ' ...';
				$value = substr($value, 0, $maxlen - strlen($suffix));        		
        	}
        }
        return Html::encode($value . $suffix);
    }
724971
private function getReviewHelpful($top_area)
    {
        $helpful = $top_area->find('table', 0);
        $helpful = $helpful->find('td', 1)->find('strong', 0)->plaintext;

        return trim($helpful);
    }
191170
public function commonGivenMale(int $threshold = 1, int $maxtoshow = 10): string
    {
        return $this->commonGivenQuery('M', 'nolist', false, $threshold, $maxtoshow);
    }
721664
public function fullName(): string
    {
        if ($this->canShowName()) {
            $tmp = $this->getAllNames();

            return $tmp[$this->getPrimaryName()]['full'];
        }

        return I18N::translate('Private');
    }
394111
public function getGenderByValue($value)
    {

        // query whether or not, the requested gender ID is available
        if (isset($this->availableGenders[$value])) {
            return (integer) $this->availableGenders[$value];
        }

        // throw an exception, if not
        throw new \Exception(
            $this->appendExceptionSuffix(
                sprintf('Found invalid gender %s', $value)
            )
        );
    }
1232044
public static function getWebsitesCountToDisplay()
    {
        $count = max(Config::getInstance()->General['site_selector_max_sites'],
            Config::getInstance()->General['autocomplete_min_sites']);
        return (int)$count;
    }
309281
public function commonGiven(int $threshold = 1, int $maxtoshow = 10): string
    {
        return $this->commonGivenQuery('B', 'nolist', false, $threshold, $maxtoshow);
    }
591155
public function get_short_question_name($stringtoshorten, $characterlimit)
    {
        if (!empty($stringtoshorten)) {
            $returnstring = format_string($stringtoshorten);
            if (strlen($returnstring) > $characterlimit) {
                $returnstring = shorten_text($returnstring, $characterlimit, true);
            }
            return $returnstring;
        } else {
            return '';
        }
    }
118064
public function findUsersOwnersOfMostWorkspaces($max, $organizations = null)
    {
        $orgasJoin = '';
        $orgasCondition = '';
        if (null !== $organizations) {
            $orgasJoin = 'JOIN ws.organizations orgas';
            $orgasCondition = 'AND orgas IN (:organizations)';
        }

        $dql = "
            SELECT CONCAT(CONCAT(u.firstName,' '), u.lastName) AS name, u.username, COUNT(DISTINCT ws.id) AS total
            FROM Claroline\CoreBundle\Entity\Workspace\Workspace ws
            JOIN ws.creator u
            ${orgasJoin}
            WHERE u.isRemoved = false
            ${orgasCondition}
            GROUP BY u.id
            ORDER BY total DESC
        ";
        $query = $this->_em->createQuery($dql);

        if (null !== $organizations) {
            $query->setParameter('organizations', $organizations);
        }

        if ($max > 1) {
            $query->setMaxResults($max);
        }

        return $query->getResult();
    }
388056
public function commonGivenFemaleList(int $threshold = 1, int $maxtoshow = 10): string
    {
        return $this->commonGivenQuery('F', 'list', false, $threshold, $maxtoshow);
    }
718124
public function getFullName()
    {

        $genderGreetings = $this->util->getTranslated()->getGenderHello($this->getLanguage());

        $greeting = isset($genderGreetings[$this->getGender()]) ? $genderGreetings[$this->getGender()] : '';

        return $greeting . ' ' . $this->getName();
    }
381019
private function getTotalSexQuery(string $sex): int
    {
        return DB::table('individuals')
            ->where('i_file', '=', $this->tree->id())
            ->where('i_sex', '=', $sex)
            ->count();
    }