This file contains hidden or 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
public class Java { | |
public static void main(String[] args) { | |
int count = 0; | |
for(int i=0; i<1000; i++){ | |
count += i; | |
} | |
System.out.println(count); // corrigido conforme comentario | |
} | |
} |
This file contains hidden or 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
#!/bin/bash | |
# to get the list of files to exclude | |
# ls -al | grep ^- | egrep "^[a-z-]+x " | grep -v .sh$ | cut -d' ' -f 9 > arq_exc | |
# then | |
for i in $(cat arq_exc); do | |
rm - $i | |
done |
This file contains hidden or 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
// I want to share a tricky thing that happened with me | |
// * I was programming in C style using feature of C++ (on g++) | |
// I have this structure | |
typedef struct { | |
vector<float *> * lst_vertices; | |
vector<int *> * lst_faces; | |
float referencia[3];// o ponto sobre o qual vai ser realizadas as transformacoes | |
} Obj3d; |
This file contains hidden or 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
# Can I use finditer ? | |
# Yes | |
# ... | |
def generate_tokens(pat, text): | |
scanner = pat.finditer(text) | |
for i in scanner: | |
yield Token(i.lastgroup, i.group()) | |
This file contains hidden or 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
# font | |
# http://chimera.labs.oreilly.com/books/1230000000393/ch02.html#_writing_a_simple_recursive_descent_parser | |
""" | |
grammar | |
expr ::= expr + term | |
| expr - term | |
| term |
This file contains hidden or 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
# mais informações sobre yield generator/coroutine | |
# http://www.dabeaz.com/generators/ | |
# motivação | |
# http://www.dabeaz.com/coroutines/Coroutines.pdf pg: 68 | |
""" | |
>>> gen = foo1(lambda : [1,2,3,6,90]) |
This file contains hidden or 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
*.db | |
tmp/ | |
app/output/ |
This file contains hidden or 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
-- cnpj valido tem tamanho 14 | |
-- usar as funcoes length e concat | |
-- | |
UPDATE `cliente` ta, | |
(SELECT cnpj, id from `cliente` where length(cnpj) = 13) tb | |
SET ta.cnpj = concat('0', tb.cnpj) | |
where ta.id = tb.id |
This file contains hidden or 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
download | |
http://stackoverflow.com/questions/12997871/download-file-using-htmlunit?noredirect=1&lq=1 | |
http://stackoverflow.com/questions/25136439/htmlunit-download-file/28471835#28471835 |
This file contains hidden or 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
<?php | |
// mandar dados do usuario na url para confirmacao de email | |
// gerar arquivo ini com key mais iv | |
// ******************************** | |
$fileObj = fopen('senha.ini', 'w'); | |
$sh = openssl_random_pseudo_bytes(32); | |
$iv = openssl_random_pseudo_bytes(16); | |
fwrite($fileObj, "senha = " . bin2hex($sh) . PHP_EOL); |
OlderNewer