Skip to content

Instantly share code, notes, and snippets.

View tloriato's full-sized avatar

Tiago Loriato tloriato

View GitHub Profile
unless order == orders_s.last do
if ( order.amount - (buy_amount + amount_of) <= 0)
#isso quer dizer que a rodada de compra termina nessa ordem
end
else #a rodada pelo book continua
buy_amount =+ order.amount
amount_of =- order.amount
end
end
@tloriato
tloriato / promises.md
Created August 31, 2017 21:28 — forked from VictorTaelin/promises.md
promises de novo

(edit: clique aqui para um fork desse texto melhor editado, feito pelo Kewerson Hugo; não vou mexer no original pq deu resultado, e eu gostaria de observar se isso pode ser parcialmente atribuido ao seu estilo)

o pq de funcões assíncronas

funcoes de javascript quase sempre são assincronas. isso acontece porque js lida muito com coisas como http requests, leitura de disco... operacoes que levam muito tempo. imagina se seu programa travasse toda vez que vc fizesse um request http? pra evitar isso, o request é feito em background, o programa continua rodando, e depois o resultado é enviado pra vc num callback

request("www.google.com", function callback(resultado) { ... })
//=============================================================================================
// KG - Skill Tree
//=============================================================================================
/*:
@plugindesc Este plugin cria uma tela de árvore de habilidades.
@author King Gerar
@param OptAddOnMainMenu
@desc Deseja adicionar um comando que leva à árvore de habilidades ao menu principal? (Yes ou No)

One method is to use a System of Contracts as outlined below:

Contract "Register" - will contain pairs "name - address" for all contracts of your system;

  1. Contract Backend;
  2. Contract Frontend using Backend;
  3. Deploy Register & get address of it;
  4. Deploy Backend & register address of Backend into already deployed Register;
  5. Hardcode the address of Register into source of Backend. Before any call Backend from Frontend you should call your Register and get the actual address of Backend.
0x3F9F67211aDeF22a4b6dF0bEf0f0787D14c57E41
04436e144a1e1fa70d8f76ba2565e705efe97fe3fd9d351ed94fab21411a272bd950b5fc6bafe8c3d2e7e9c3d005a6c8610102c597cc0771df2bb37198361d93df;romanornr
int fullSize = stringlenInt + dirnamelenInt + 1;
char * fullPath = malloc(sizeof(char) * (fullSize));
memset(fullPath, 0, fullSize);
memcpy(fullPath, stringPath, stringlenInt);
fullPath[stringlenInt] = '/';
memcpy(fullPath + stringlenInt + 1, dirname, dirnamelenInt);
fullPath[fullSize] = '\0';
printf("\nFuncionaplsz%sz\n");
if (WIFEXITED(status) != 0) {
int stat = WEXITSTATUS(status);
if(stat !=0)
{
memset(response,0,BUFSIZ);
if (buf[0] == 'D' && (buf[1] == 'C' || buf[1] == 'R')) {
int fullSize = stringlenInt + dirnamelenInt + 1;
char * fullPath = malloc(sizeof(char) * (fullSize) + 4);
memset(fullPath, 0, fullSize);
memcpy(fullPath, stringPath, stringlenInt);
fullPath[stringlenInt] = '/';
memcpy(fullPath + stringlenInt + 1, dirname, dirnamelenInt);
strcat(fullPath,"/a.a");
fullPath[fullSize + 4] = '\0';