Skip to content

Instantly share code, notes, and snippets.

View TopRoupi's full-sized avatar
💬

Breno Nunes TopRoupi

💬
  • Brazil, SP São Paulo
  • 21:13 (UTC -03:00)
View GitHub Profile
#include <stdio.h>
void corta(char txt[],int ini,int fim){
ini -= 1;
int i;
for (i = 0; txt[fim+i] != '\0'; i++)
txt[ini+i] = txt[fim+i];
txt[ini+i] = '\0';
}
#include <stdio.h>
void corta(char txt[],int ini,int fim){
ini -= 1;
int i;
for (i = 0; txt[fim+i] != '\0'; i++)
txt[ini+i] = txt[fim+i];
txt[ini+i] = '\0';
}
function submit_messages(){
$('#message_content').on('keydown', (event) => {
if(event.keyCode === 13){
$('input').click();
event.target.value = '';
}
})
}
@[Link(ldflags: "#{__DIR__}/somador.o")]
lib Somador
fun sum(n1 : Int32, n2 : Int32) : Int32
end
p Somador.sum 2, 3
import multiprocessing
import time
nums = [5, 6, 7, 8, 9, 10]
def fatorial(n):
time.sleep(1)
r = 1
for i in range(1, n+1):
r *= i
import multiprocessing
import time
from matplotlib import pyplot as plt
def fatorial(n):
r = 1
for i in range(1, n+1):
r *= i
return r
from random import sample
import multiprocessing
from copy import copy, deepcopy
from time import clock, time, sleep
from pylab import plot, title, legend, xlabel, ylabel, grid, show, ticklabel_format, hist, scatter, axis
import sys
def tempo(f,*a):
'''Devolve o tempo de execução (aproximado) de uma função f com argumentos *a'''
i = time()
def markdown(content)
return '' if content.blank?
markdown = Redcarpet::Markdown.new(Redcarpet::Render::XHTML,
autolink: true,
space_after_headers: true,
tables: true)
markdown.render(content)
sanitize(markdown.render(content)).html_safe
end
module ApplicationHelper
def markdown(content)
return '' if content.blank?
markdown = Redcarpet::Markdown.new(Redcarpet::Render::XHTML,
autolink: true,
space_after_headers: true,
tables: true)
markdown.render(content)
sanitize(markdown.render(content)).html_safe
#include <stdio.h>
#define TAM 10
int main(void) {
typedef struct pilha{
char vet[TAM];
int topo;
} tpilha;
void create(tpilha *p){