Skip to content

Instantly share code, notes, and snippets.

View rafaelcorsi's full-sized avatar
👨‍🏫

Rafael Corsi rafaelcorsi

👨‍🏫
View GitHub Profile
@rafaelcorsi
rafaelcorsi / gist:f475bf658ad6dc8958e3
Created March 6, 2015 21:58
Export the drawn from a pdf using inkscape and command line
#!/bin/bash
# License under GLP 2
# uses inkscape to export only the drawn from a PDF
FILE1=$1
inkscape \
--without-gui \
--file=$1 \
-D --export-pdf=$1
@rafaelcorsi
rafaelcorsi / AtmelStudio7-make-to-linux.sh
Last active May 29, 2020 07:04
Convert Atmel Studio 7 generated makefile (windows paths) to linux, so you can compile your project from linux
#!/bin/sh
# Rafael Corsi
# [email protected]
#
# Script to convert makefile generate from atmel studio 7 (windows)
# to linux path, assuming that you have gcc on PATH
#
# on Arch
# - sudo pacman -S arm-none-eabi-gcc
/**************************************************************************
* Rafael Corsi - Insper
* [email protected]
*
* Computação Embarcada
*
* 08-PIO-ENTRADA
************************************************************************/
# Rafael Corsi @ insper.edu.br
# Dez/2017
# Disciplina Elementos de Sistemas
#
# Convert program memmory to altera mif file
# that can be used to load FPGA and to Simulate (modelsim)
# http://quartushelp.altera.com/13.0/mergedProjects/reference/glossary/def_mif.htm
#
# TODO:
ffmpeg -r 24 -f image2 -start_number 4571 -i G003%d.JPG -s hd1080 -vcodec libx264 timelapse.mp4
/**
* Retorna o código binário do mnemônico para realizar uma operação de cálculo.
* @param mnemnonic vetor de mnemônicos "instrução" a ser analisada.
* @return Opcode (String de 8 bits) com código em linguagem de máquina para a instrução.
*/
public static String comp(String[] mnemnonic) throws InvalidCompException {
int movInt = 0;
if ( mnemnonic.length == 0 || mnemnonic[0].equals("")) {
@rafaelcorsi
rafaelcorsi / parse.py
Last active February 12, 2022 00:30
mutirão C parse CI
import os
import csv
import re
from subprocess import Popen, PIPE
pdir = '.'
qstring = 'Código da Questão'
rstring = 'Classi cação da resposta'
header = ['NAME', 'QA1', 'QA2', 'QA3', 'QA4', 'QA5', 'QB1', 'QB2', 'QB3', 'QC1', 'QC2', 'QC3',
/*
* mcu6050.h
*
* Created: 25/04/2017 10:49:12
* Author: embeddedComputer
*/
// I2Cdev library collection - MPU6050 I2C device class
// Based on InvenSense MPU-6050 register map document rev. 2.0, 5/19/2011 (RM-MPU-6000A-00)
@rafaelcorsi
rafaelcorsi / Dockerfile
Created July 10, 2023 14:39
Dockerfile - opensource toolchain for Intel/Altera Cyclone V FPGAs
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y curl build-essential git clang bison flex \
libreadline-dev gawk tcl-dev libffi-dev git \
graphviz xdot pkg-config python3 libboost-system-dev \
libboost-python-dev libboost-filesystem-dev zlib1g-dev \
wget unzip make g++ libftdi1-dev libhidapi-dev libudev-dev cmake \
@rafaelcorsi
rafaelcorsi / mark.py
Last active November 19, 2023 13:47
MO445A - project - python image marker
import cv2
import os
import numpy as np
def draw_line(event, x, y, flags, param):
global drawing, last_point, color, line_type, points, img_display
# Check if CTRL key is pressed
ctrl_pressed = flags & cv2.EVENT_FLAG_CTRLKEY