This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3 -m cProfile distrincha.py < test.txt | |
Total of words: 42740 | |
120568 function calls in 229.015 seconds | |
Ordered by: standard name | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
102 0.002 0.000 0.004 0.000 codecs.py:297(decode) | |
1 0.181 0.181 229.015 229.015 distrincha.py:1() | |
5000 0.184 0.000 0.325 0.000 distrincha.py:12() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def distrincha(): | |
words = set() | |
plain_text = list() | |
codded_text= list() | |
# need for speed | |
_words_add = words.add | |
_codded_text_append = codded_text.append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import string | |
LINES, WORDS, CHARS = [int(sys.argv[x]) for x in (range(1,1+3))] | |
randomize = random.Random() | |
random_number = randomize.randint | |
choice_one = randomize.choice | |
possible_letters = string.ascii_letters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
words = set() | |
plain_text = list() | |
codded_text= list() | |
# read content | |
plain_text = [l.strip().split() for l in sys.stdin] | |
# build a word list from content | |
for line in plain_text: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use JSON; | |
use Util::Password; | |
my $password = Util::Password::Encrypt('{#MinhaSenhaSuuuuperSegura#}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Util::Password; | |
use strict; | |
use warnings; | |
use Crypt::Eksblowfish::Bcrypt; | |
use Crypt::Random; | |
sub Encrypt { | |
my $password = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use JSON; | |
my $root_user = { | |
email => '[email protected]', | |
name => 'Chail Root Admin', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use NativeCall; | |
constant $LIBNAME = 'libsqlite3'; | |
sub sqlite3_open (Str, Array[OpaquePointer]) returns Int is native($LIBNAME) { * } | |
sub sqlite3_exec (OpaquePointer, Str, OpaquePointer, OpaquePointer,OpaquePointer) returns Int is native($LIBNAME) { * } | |
sub sqlite3_errmsg (OpaquePointer) returns Str is native($LIBNAME) { * } | |
sub sqlite3_close (OpaquePointer) returns Int is native($LIBNAME) { * } | |
my @handler := CArray[OpaquePointer].new; | |
@handler[0] = OpaquePointer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> our sub Sqlite3LibVersion is symbol('sqlite3_libversion') returns Str is native('libsqlite3') { } | |
sub Sqlite3LibVersion( --> Str) { #`(Sub+{NativeCallSymbol[Str]}+{Native[Sub+{NativeCallSymbol[Str]},Str]}|140598245394280) ... } | |
> Sqlite3LibVersion() | |
3.8.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> our sub Sqlite3VersionNumber is symbol('sqlite3_libversion_number') returns Int is native('libsqlite3') { * } | |
sub Sqlite3VersionNumber( --> Int) { #`(Sub+{NativeCallSymbol[Str]}+{Native[Sub+{NativeCallSymbol[Str]},Str]}|140598248149192) ... } | |
> Sqlite3VersionNumber(); | |
3008008 |