Beispiel #1
0
function p($val, $flag = 0, $return = false)
{
    pprint($val, $return);
    if ($flag) {
        exit('ok');
    }
}
        $most_common_user = most_common_user($most_common_user, $users);
    }
    echo "</tbody></table></div><br/><hr><br/>";
    arsort($most_common);
    echo "<h3>Palavras mais citadas:</h3>";
    echo "<ul>";
    foreach ($most_common as $key => $val) {
        echo "<li>{$key} = {$val}</li>";
    }
    echo "</ul>";
    arsort($most_common_user);
    echo "<h3>Usu&aacute;rios que mais escreveram:</h3>";
    echo "<ul>";
    foreach ($most_common_user as $key => $val) {
        echo "<li>{$key} = {$val}</li>";
    }
    echo "</ul>";
}
$list = array("é", "e", "te", "me", "um", "uma", "no", "RT", "a");
echo "<h2>Lava Jato</h2>";
$result = search("Lava jato", "5", "popular");
pprint($result, "tabela1", $list);
echo "<h2>#ForaPT</h2>";
$result2 = search("#forapt", "5", "recent");
pprint($result2, "tabela2", $list);
echo "<h2>#E32015 Batman</h2>";
$result3 = search("#e32015 batman", "5", "recent");
pprint($result3, "tabela3", $list);
?>
	</body>
</html>
Beispiel #3
0
                if ($currentNestLevel != 0) {
                    array_push($newLines, '\\item' . $itemText);
                } else {
                    array_push($newLines, $itemText);
                }
            }
            $nestLevel = $currentNestLevel;
        }
        for ($i = 0; $i < $nestLevel; $i++) {
            array_push($newLines, '\\end{itemize' . str_repeat('i', $nestLevel - $i) . '}');
        }
        $outText = implode(PHP_EOL, $newLines);
        return $outText;
    }
}
pprint("");
function pprint($text)
{
    $keys = array("FilePath", "IOError", "abs", "acos", "acosh", "all", "and", "any", "appendFile", "approxRational", "asTypeOf", "asin", "\n\t\tasinh", "atan", "atan2", "atanh", "basicIORun", "break", "catch", "ceiling", "chr", "compare", "concat", "concatMap", "\n\t\tconst", "cos", "cosh", "curry", "cycle", "decodeFloat", "denominator", "digitToInt", "div", "divMod", "drop", "\n\t\tdropWhile", "either", "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", "enumFromTo", "\n\t\terror", "even", "exp", "exponent", "fail", "filter", "flip", "floatDigits", "floatRadix", "floatRange", "floor", "\n\t\tfmap", "foldl", "foldl1", "foldr", "foldr1", "fromDouble", "fromEnum", "fromInt", "fromInteger", "fromIntegral", "\n\t\tfromRational", "fst", "gcd", "getChar", "getContents", "getLine", "head", "id", "inRange", "index", "init", "intToDigit", "\n\t\tinteract", "ioError", "isAlpha", "isAlphaNum", "isAscii", "isControl", "isDenormalized", "isDigit", "isHexDigit", "\n\t\tisIEEE", "isInfinite", "isLower", "isNaN", "isNegativeZero", "isOctDigit", "isPrint", "isSpace", "isUpper", "iterate", "\n\t\tlast", "lcm", "length", "lex", "lexDigits", "lexLitChar", "lines", "log", "logBase", "lookup", "map", "mapM", "mapM_", "max", "\n\t\tmaxBound", "maximum", "maybe", "min", "minBound", "minimum", "mod", "negate", "not", "notElem", "null", "numerator", "odd", "\n\t\tor", "ord", "otherwise", "pi", "pred", "primExitWith", "print", "product", "properFraction", "putChar", "putStr", "putStrLn", "quot", "\n\t\tquotRem", "range", "rangeSize", "read", "readDec", "readFile", "readFloat", "readHex", "readIO", "readInt", "readList", "readLitChar", "\n\t\treadLn", "readOct", "readParen", "readSigned", "reads", "readsPrec", "realToFrac", "recip", "rem", "repeat", "replicate", "return", "\n\t\treverse", "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", "sequence", "sequence_", "show", "showChar", "showInt", "\n\t\tshowList", "showLitChar", "showParen", "showSigned", "showString", "shows", "showsPrec", "significand", "signum", "sin", "\n\t\tsinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", "tail", "take", "takeWhile", "tan", "tanh", "threadToIOResult", "toEnum", "\n\t\ttoInt", "toInteger", "toLower", "toRational", "toUpper", "truncate", "uncurry", "undefined", "unlines", "until", "unwords", "unzip", "\n\t\tunzip3", "userError", "words", "writeFile", "zip", "zip3", "zipWith", "zipWith3", "listArray", "doParse", "Bool", "Char", "Double", "Either", "\n    Float", "IO", "Integer", "Int", "Maybe", "Ordering", "Rational", "Ratio", "ReadS", "ShowS", "String", "quot", "rem", "div", "mod", "elem", "notElem", "seq", "\n    EQ", "False", "GT", "Just", "LT", "Left", "Nothing", "Right", "True", "Show", "Eq", "Ord", "Num", "Word8", "InPacket");
    usort($keys, 'sortByLength');
    foreach ($keys as $key) {
        $pattern = '/([^{|\\w|\\d])(' . $key . ')([^\\w|\\d])/';
        $text = preg_replace($pattern, '\\1\\textcolor{hgreen}{\\textbf{\\2}}\\3', $text);
    }
    $keys = array("case", "class", "data", "deriving", "do", "else", "if", "import", "in", "infixl", "infixr", "instance", "let", "\n\t\tmodule", "of", "primitive", "then", "type", "where");
    usort($keys, 'sortByLength');
    foreach ($keys as $key) {
        $pattern = '/([^{|\\w|\\d])(' . $key . ')([^\\w|\\d])/';
        $text = preg_replace($pattern, '\\1\\textcolor{hpink}{\\textbf{\\2}}\\3', $text);
    }
    $text = str_replace("\\(", "\\\\(", $text);