Skip to content

Instantly share code, notes, and snippets.

View thaisviana's full-sized avatar
:octocat:

Thais thaisviana

:octocat:
View GitHub Profile
{"value":1277.8807,"description":"sum of:","details":[{"value":1071.0992,"description":"sum of:","details":[{"value":18.746872,"description":"sum of:","details":[{"value":13.116461,"description":"weight(_pt_all:\"(exame pericia) pericial\"~2 in 2063381) [PerFieldSimilarity], result of:","details":[{"value":13.116461,"description":"score(freq=3.0), computed as boost * idf * tf from:","details":[{"value":2.2,"description":"boost","details":[]},{"value":7.4051723,"description":"idf, sum of:","details":[{"value":1.8479005,"description":"idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:","details":[{"value":23313910,"description":"n, number of documents containing term","details":[]},{"value":147961299,"description":"N, total number of documents with field","details":[]}]},{"value":2.9448743,"description":"idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:","details":[{"value":7784048,"description":"n, number of documents containing term","details":[]},{"value":147961299,"description":"N, total numb
from multiprocessing import Process, Queue
import time
from random import randint
def calcula_percent(q_entrada,q_saida):
# Realiza o cálculo
lista_fatiada = q_entrada.get()
resultado = []
for elemento in lista_fatiada:
resultado.append(elemento * 0.1)
@thaisviana
thaisviana / arq_serve.py
Created September 3, 2021 11:55
arq_serve.py
import socket, os
PORTA = 9091
socket_servidor = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = socket.gethostbyname("")
socket_servidor.bind((host, PORTA))
socket_servidor.listen()
print("Servidor de nome", host, "esperando conexão na porta", PORTA)
while True:
@thaisviana
thaisviana / arq_client.py
Created September 3, 2021 11:54
arq_client.py
import socket, sys, os
# Cria o socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
nome_arq = input('Entre com o nome do arquivo: ')
"/Users/thaisviana/Downloads/infnet.png"
try:
# Tenta se conectar ao servidor
s.connect((socket.gethostbyname(""), 9091))
# Envia o nome do arquivo:
@thaisviana
thaisviana / Quadradinho.py
Created August 12, 2021 12:06
Quadradinho
import pygame
from random import randint
from CONSTANTS import largura_tela, altura_tela, q_largura, q_altura
class Quadradinho():
def __init__(self):
self.largura = q_largura
self.altura = q_altura
self.x = randint(0, largura_tela-self.largura)
self.y = randint(0, altura_tela-self.altura)
@thaisviana
thaisviana / main.py
Created August 12, 2021 12:05
Jogo Quadradinho
import pygame
from CONSTANTS import largura_tela, altura_tela, cor, tempo_total_do_jogo,numero_inicial_de_quadradinhos
from Quadradinho import Quadradinho
from time import sleep
def mostra_tempo(tempo, pontos):
font = pygame.font.Font(None, 24)
text = font.render(f"Tempo: {tempo}s | Pontuação: {pontos}", 1, cor['BRANCO'])
textpos = text.get_rect(centerx=tela.get_width()/2)
tela.blit(text, textpos)
@thaisviana
thaisviana / matplot_pygame.py
Created June 7, 2021 10:54
matplot_pygame.py
import pygame
from pygame.locals import *
from grafico import desenha_grafico
pygame.init()
window = pygame.display.set_mode((600, 800), DOUBLEBUF)
screen = pygame.display.get_surface()
param1, param2 = 0 , 0
canvas, raw_data = desenha_grafico(param1, param2)
@thaisviana
thaisviana / grafico.py
Created June 7, 2021 10:53
grafico.py
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.backends.backend_agg as agg
import pylab
matplotlib.use("Agg")
def desenha_grafico(param1, param2):
datestr A_minus A_plus AB_minus AB_plus B_minus B_plus O_minus O_plus total
20130101 0 1 2 3 4 5 6 7 28
20130102 0 1 2 3 4 5 6 7 28
20130103 0 1 2 3 4 5 6 7 28
20130104 0 1 2 3 4 5 6 7 28
20130105 0 1 2 3 4 5 6 7 28
20130106 0 1 2 3 4 5 6 7 28
20130107 0 1 2 3 4 5 6 7 28
20130108 0 1 2 3 4 5 6 7 28
20130109 0 1 2 3 4 5 6 7 28
import pygame
BRANCO = (255,255,255)
PRETO = (0,0,0)
LARANJA = (246,130,0)
VERMELHO = (230,0,0)
pygame.init()
largura_tela, altura_tela = 1024, 800
tela = pygame.display.set_mode((largura_tela, altura_tela))