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 python | |
# Original at http://tech.yipit.com/2011/11/16/183772396/ | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') |
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
# include <stdio.h> | |
# include <stdlib.h> | |
# include <ctype.h> | |
# include <string.h> | |
# include <stdbool.h> | |
# include <mpi.h> | |
# define MAX 100001 | |
int VectorSort[MAX]; | |
int size = 0; |
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
# include <stdio.h> | |
# include <stdlib.h> | |
# include <ctype.h> | |
# include <string.h> | |
# include <stdbool.h> | |
# include <mpi.h> | |
/* declaração das funcoes | |
*/ | |
void random_numbers(int *v, int tamanho); |
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
executar paralelo: mpicc -pg mergesort_paralelo.c -o mergesortparalelo && mpirun.openmpi -np 8 ./mergesortparalelo | |
executar sequencial: gcc -pg mergesort_sequencial.c -o mergesortsequencial && ./mergesortsequencial | |
pegar tempo paralelo: gprof -b mergesortparalelo gmon.out | more | |
pegar tempo sequencial: gprof -b mergesortsequencial gmon.out | more | |
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
# include <stdio.h> | |
#define BUFFER_SIZE 5 | |
struct _buffer{ | |
int count; // numero de itens no buffer | |
int in; // próxima posiçãolivre | |
int out; // proxima posição cheia | |
int itens[BUFFER_SIZE]; | |
}; |
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
# coding: utf-8 | |
import os | |
import random | |
from structures import * | |
class SchedulingAlgorithm(object): | |
""" | |
Classe base para todos os algoritmos |
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
# coding: utf-8 | |
import unittest | |
from scheduling_algorithms import FCFS, SJF, SRTF, RoundRobin, FilaMultiNivelComFeedBack | |
from structures import Process, PCB | |
class ScheduleAlgorithm(unittest.TestCase): | |
def test_fcfs(self): | |
p1 = Process(PCB(24 ,0 ,1)) |
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
hp + potion | |
hp - dano | |
critico = dano ** 2 |
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
{% extends '/gerenciar/base.html' %} | |
{% block js %} | |
<script type="text/javascript" src="/static/angular/js/angular.min.js"></script> | |
<script type="text/javascript" src="/static/jogos/jogo_form.js"></script> | |
<script type="text/javascript"> | |
var jogoApp = angular.module('jogoApp', ['jogoModulo']).controller("JogoController", function($scope){ | |
$scope.jogo={tit: 'Teste', map: 'Teste', qtd: '1', tmp: 'Sem limite', grp: 'Jogo Aberto'}; | |
$scope.mostra=false; | |
$scope.formOnOff=function(){ |
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 json | |
# Apenas um exemplo de como fazemos | |
# jeito errado | |
with open('dados.json', 'w') as f: | |
f.write('{dados:' + json.dumps(['dados']) + '}') | |
# jeito certo | |
with open('dados.json', 'w') as f: |