Ensures the speed parameter is valid for jQuery
@param string|int $speed
@return string
165198
private function _validate_speed($speed) {
		if (in_array($speed, array (
				'slow','normal','fast'
		))) {
			$speed='"'.$speed.'"';
		} elseif (preg_match("/[^0-9]/", $speed)) {
			$speed='';
		}

		return $speed;
	}
292912
private function _getExtension($file = null)
	{
		if (!is_null($file))
		{
			$dot = strrpos($file, '.') + 1;

			return strtolower(substr($file, $dot));
		}

		return '##INVALID_FILE##';
	}
741829
public function getJSURL($mode = 'ajax')
    {
        return $this->owner->jsURL([$this->urlTrigger => $mode, '__atk_callback'=>1], (bool) $this->postTrigger);
    }
592344
public function i18nUtc(string $format = '', int $time = 0): string
    {
        return $this->i18n($format, $time, true);
    }
1039210
public static function time( $format = false )
	{	
		$time = microtime( true ) - CCF_PROFILER_TME;
		
		if ( $format )
		{
			return CCStr::microtime( $time );
		}
		
		return $time;
	}
66070
protected function getMaxUncompressionSpeedFormat(FormatInterface $format, array $methods)
    {
        $maxSpeed = MethodInterface::SPEED_LEVEL_LOWEST;

        foreach ($methods as $method) {
            if ($method->isSupported() && $method->isFormatSupported($format)) {
                $maxSpeed = max($maxSpeed, $method->getUncompressionSpeedLevel($format));
            }
        }

        if ($format instanceof ComposedFormatInterface) {
            $maxSpeedComposed = MethodInterface::SPEED_LEVEL_LOWEST;
            $subformats = $format->getComposedFormats();
            foreach ($subformats as $subformat) {
                $maxSpeedComposed = max($maxSpeedComposed, $this->getMaxUncompressionSpeedFormat($subformat, $methods) / count($subformats));
            }
        }

        return $maxSpeed;
    }
1222855
protected function _underscore($url) {
		foreach (['controller', 'plugin', 'action'] as $element) {
			if (!empty($url[$element])) {
				$url[$element] = Inflector::underscore($url[$element]);
			}
		}
		return $url;
	}
746550
public boolean setFanSpeed(int speed) throws CommandExecutionException {
        if (speed < 0 || speed > 100) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
        JSONArray params = new JSONArray();
        params.put(speed);
        return sendOk("set_custom_mode", params);
    }
981978
public static function validateTimestamp($data, callable $filter=null) {

        return (
            (string) (int) $data === (string) $data
            && ($data <= PHP_INT_MAX)
            && ($data >= ~PHP_INT_MAX)
        ) ? self::applyFilter($data, $filter) : false;

    }
479304
public static function formatMS($time): string
    {
        $time = round($time * 1000, 3);
        $dec = 3;

        if (!$time || $time >= 10 || $time >= 100) {
            $dec = 0;
        } elseif ($time < 10 && $time >= 0.1) {
            $dec = 1;
        } elseif ($time <= 0.01) {
            $dec = 3;
        }

        return number_format($time, $dec, '.', ' ') . ' ms';
    }
193407
public function bestUrl(string $action): string
    {
        if ($this->viaAjax($action) || $this->viaApi($action)) {
            return home_url('/'); // Both ride on index.
        } elseif ($this->Wp->is_admin && ($this->s::isOwnMenuPage() || $this->s::isOwnMenuPageTab())) {
            return $this->urlRemove($this->c::currentUrl());
        } elseif ($this->Wp->is_admin && $action === '§dismiss-notice') {
            return $this->urlRemove($this->c::currentUrl());
        } elseif ($this->Wp->is_admin) {
            return self_admin_url('/');
        }
        return home_url('/'); // Fallback (default).
    }
247079
static function longTimeString($time) {
        str_replace('now', date('h:i:s t'), $time);

        if (!self::parsable($time)) return null;

        $r = self::fromString($time);

        return $r->format('h:i:s a');
    }
740802
public static function unixtimeFormat($time)
    {
        $v = time() - $time;
        $v = $v > 0 ? $v : 0;
        if ($v < 60) {
            $format = '刚刚';
        } else if ($v < 60 * 60) {
            $format = strval(floor($v / 60)) . '分钟前';
        } else if ($v < 60 * 60 * 24) {
            $format = strval(floor($v / 60 / 60)) . '小时前';
        } else {
            $format = strval(floor($v / 60 / 60 / 24)) . '天前';
        }
        return $format;
    }
113394
public static function validateTime($value, $delay)
	{
		// Get the decrypted time
		$value = self::getEncrypter()->decrypt($value);

		// The current time should be greater than the time the form was built + the speed option
		return (is_numeric($value) && time() > ($value + $delay));
	}
976082
protected function shutterSpeed() {

		$shutter = $this->raw( 'shutter_speed' );

		// If a shutter speed is given, format the float into a fraction.
		if ( $shutter ) {

			$shutter = $speed = floatval( strip_tags( $shutter ) );

			if ( ( 1 / $speed ) > 1 ) {
				$shutter = sprintf( '<sup>%s</sup>&#8260;', number_format_i18n( 1 ) );

				if ( number_format( ( 1 / $speed ), 1 ) ==  number_format( ( 1 / $speed ), 0 ) ) {

					$shutter .= sprintf(
						'<sub>%s</sub>',
						number_format_i18n( ( 1 / $speed ), 0, '.', '' )
					);

				} else {

					$shutter .= sprintf(
						'<sub>%s</sub>',
						number_format_i18n( ( 1 / $speed ), 1, '.', '' )
					);
				}
			}

			// Translators: %s is the shutter speed of a camera.
			$shutter = sprintf( __( '%s sec', 'hybrid-core' ), $shutter );
		}

		return $shutter;
	}
834413
public static function strrev($s)
	{
		if (! ReflectionTypeHint::isValid()) return false;
		if (is_null($s)) return $s;

		if (0) #TODO test speed
		{
			$s = self::_convert($s, 'UTF-8', 'UTF-32');
			if (! is_string($s)) return false;
			$s = implode('', array_reverse(str_split($s, 4)));
			return self::_convert($s, 'UTF-32', 'UTF-8');
		}

		if (! is_array($a = self::str_split($s))) return false;
		return implode('', array_reverse($a));
	}
866501
public function getNextWebfileForTimestamp($time)
    {
        $webfiles = $this->getWebfilesAsStream()->getWebfiles();

        ksort($webfiles);

        foreach ($webfiles as $key => $value) {
            if ($key > $time) {
                return $value;
            }
        }
        return null;
    }