Get lorem ipsum text.
Thanks Charalambos Tsangarides : https://blog.ergatides.com
WARNING! Needs an internet connection.
@param int number of 'what'
@param string what
@param int start with lorem ipsum?
@return string lorem ipsum text
764925
public static function loremIpsum($amount = 3, $what = 'paras', $startWithLoremIpsum = 0) {

        $lipsum = simplexml_load_file("http://www.lipsum.com/feed/xml?amount=$amount&what=$what&start=$startWithLoremIpsum")->lipsum;

        if (!empty($lipsum)) {

            return $lipsum;
        }

        return 'Random text could not be loaded...';
    }
57055
public static boolean recog(final String text, final int start, final int len){
        if(!RECOGNITION_TOOL_ENABLED){
            return false;
        }
        return isEnglishAndNumberMix(text, start, len) 
                || isFraction(text, start, len)
                || isQuantifier(text, start, len)
                || isChineseNumber(text, start, len);
    }
391816
public function whereStartsWith($expr, $value, $length = null)
    {
        return $value === '' ? $this : $this->whereLike($expr, $length === null ? $value . '%' : str_pad($value, $length, '_'));
    }
683337
public static function text($param = array())
    {

        $defParam = array(
            'amount' => 128,
            'what' => 'bytes',
            'start' => 'yes',
            'lang' => 'en'
        );

        if (is_integer($param)) {
            $param = array('amount' => $param);
        }

        $param = array_merge($defParam, $param);

        $json = Utils::getJSON('http://json-lipsum.appspot.com/?' . http_build_query($param));

        if (isset($json->lipsum) && strpos('--', $json->lipsum)) {
            return implode(' -- ', $json->lipsum);
        } elseif (isset($json->lipsum)) {
            return $json->lipsum;
        } else {
            return 'Error Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
        }

    }
633283
public String fetch(int lineNumber) {
        E.illegalArgumentIf(lineNumber < 0, "line number must not be negative number: " + lineNumber);
        E.illegalArgumentIf(lineNumber >= lines(), "line number is out of range: " + lineNumber);
        List<String> list = fetch(lineNumber, 1);
        return list.isEmpty() ? null : list.get(0);
    }
382904
protected function getStringsBetween($string, $start, $end)
    {

        $pattern = sprintf(
                '/%s(.*?)%s/', preg_quote($start), preg_quote($end)
        );

        preg_match_all($pattern, $string, $matches);

        return $matches[1];
    }
537009
def prev_content(self, start, amount=1):
        """"""
        while start > 0 and self.code[start] in (' ', '\t', '\n'):
            start -= 1

        return self.code[(start or amount) - amount: start]
510811
function gettext($string)
    {
        global $PPHP;
        $req = grab('request');

        $default = $PPHP['config']['global']['default_lang'];
        $current = $req['lang'];

        $res = $string;
        try {
            if (self::$_gettext !== null) {
                $res = self::$_gettext->gettext($string);
            };
        } catch (\Exception $e) {
            echo $e->getMessage();
        };
        return $res;
    }
590498
public function substring($start, $length = null){
		
		if(!$this->offsetExists($start)){
			throw new \OutOfRangeException('$start is an invalid index');
		}
		
		if($length !== null && !\is_numeric($length) || $length < 0){
			throw new \InvalidArgumentException('$length is invalid');
		}
		
		return new static(\mb_substr($this->_Value, $start, $length, $this->_Encoding),
				$this->_Encoding);
		
	}
1280719
public String getReason()
    {
        if (_reason!=null)
            return _reason;
        _reason=(String)__statusMsg.get(TypeUtil.newInteger(_status));
        if (_reason==null)
            _reason="unknown";
        return _reason;
    }
935062
public int getLineNumber(Location start) {
        if (mLineNumberTable == null || start.getLocation() < 0) {
            return -1;
        }
        else {
            return mLineNumberTable.getLineNumber(start);
        }
    }
244738
public function start( string $prefix ) : SplString
    {
        $quoted = preg_quote( $prefix, '/' );
        return $this->setString( $prefix.preg_replace( '/^(?:'.$quoted.')+/u', '', $this->__toString() ) );
    }
1352609
public function question_number($number) {
        if (is_numeric($number)) {
            $number = html_writer::span(get_string('question'), 'accesshide') . ' ' . $number;
        }
        return html_writer::tag('span', $number, array('class' => 'slotnumber'));
    }
475113
protected function literal($what, $eatWhitespace = null) {
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;

// shortcut on single letter
if (!isset($what[1]) && isset($this->buffer[$this->count])) {
if ($this->buffer[$this->count] == $what) {
if (!$eatWhitespace) {
$this->count++;
return true;
}
// goes below...
} else {
return false;
}
}

if (!isset(self::$literalCache[$what])) {
self::$literalCache[$what] = \ATPCore\Lessc::preg_quote($what);
}

return $this->match(self::$literalCache[$what], $m, $eatWhitespace);
}
504658
public static boolean isNumber(final String text, final int start, final int len){
        for(int i=start; i<start+len; i++){
            char c = text.charAt(i);
            if(!isNumber(c)){
                return false;
            }
        }
        //指定的字符串已经识别为数字串
        //下面要判断数字串是否完整
        if(start>0){
            //判断前一个字符，如果为数字字符则识别失败
            char c = text.charAt(start-1);
            if(isNumber(c)){
                return false;
            }
        }
        if(start+len < text.length()){
            //判断后一个字符，如果为数字字符则识别失败
            char c = text.charAt(start+len);
            if(isNumber(c)){
                return false;
            }
        }
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("识别出数字：" + text.substring(start, start + len));
        }
        return true;
    }
541000
public static function startsWith($value, $start)
    {

        if (is_array($value)) {
            return self::first($value) == $start;
        }

        return mb_strpos("$value", "$start") === 0;

    }
1164264
def next_content(self, start, amount=1):
        """"""
        while start < len(self.code) and self.code[start] in (' ', '\t', '\n'):
            start += 1

        return self.code[start: start + amount]