Skip to content

Instantly share code, notes, and snippets.

View mfurquimdev's full-sized avatar
🐧

Mateus Furquim mfurquimdev

🐧
View GitHub Profile
@mfurquimdev
mfurquimdev / probabilidade
Created September 24, 2013 23:27
Triângulo de Pascal para variados números de padrões.
#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main()
{
int numero_de_lados;
// cin >> numero_de_lados;
@mfurquimdev
mfurquimdev / 0_reuse_code.js
Created September 26, 2013 17:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mfurquimdev
mfurquimdev / linked_list.c
Last active August 29, 2015 14:04
A linked list implemented in c
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
typedef struct Node_t
{
int data;
struct Node_t* next;
}node_t;
@mfurquimdev
mfurquimdev / vector.c
Last active August 29, 2015 14:04
A vector implemented in c
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
typedef struct Vector_t
{
unsigned int* data;
unsigned int current_size;
unsigned int total_length;
@mfurquimdev
mfurquimdev / testbench.sh
Created August 2, 2014 04:03
Run a program several times and measure the average time spent to run the program in microseconds
#!/bin/bash
sum=0;
for (( i = 0; i < 10; i++ )); do
begin=`date +%s%N`
#####################################################
#############The Program Should Run Here#############
#####################################################
@mfurquimdev
mfurquimdev / time_example.cpp
Created August 16, 2014 20:53
Operators for struct timeval
#include <iostream>
#include <stdlib.h>
#include <sys/time.h>
#include "timeval_operators.h"
using namespace std;
int main(int argc, char* argv[])
{
timeval t0, t1;
@mfurquimdev
mfurquimdev / Makefile
Created August 16, 2014 21:03
Scheduler simulator
#
# "makefile" for the CPU scheduler simulation.
#
CC=gcc
CFLAGS=-c -Wall -g -W -std=c99 -ansi -pedantic
all: gentasks simsched
gentasks.o: gentasks.c
@mfurquimdev
mfurquimdev / run.sh
Created August 16, 2014 21:07
Virtual Memory simulator
#!/bin/bash
./simvm --file=trace01.out --framesize=9 --numframes=200 --scheme=fifo > fifo.txt
./simvm --file=trace02.out --framesize=9 --numframes=200 --scheme=fifo | tee -a fifo.txt
./simvm --file=trace03.out --framesize=9 --numframes=200 --scheme=fifo | tee -a fifo.txt
./simvm --file=trace04.out --framesize=9 --numframes=200 --scheme=fifo | tee -a fifo.txt
./simvm --file=trace05.out --framesize=9 --numframes=200 --scheme=fifo | tee -a fifo.txt
./simvm --file=trace01.out --framesize=9 --numframes=200 --scheme=lru > lru.txt
./simvm --file=trace02.out --framesize=9 --numframes=200 --scheme=lru | tee -a lru.txt
./simvm --file=trace03.out --framesize=9 --numframes=200 --scheme=lru | tee -a lru.txt
@mfurquimdev
mfurquimdev / demosemaphore.c
Created August 16, 2014 21:19
Operating System Tutorials
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#define N 5 // The number of producers/customers
#define M 10 // The size of the buffer
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown)
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96.
This combination of tools provides an exciting improvement in usability for
[reproducible analysis](http://stats.stackexchange.com/a/15006/183).
Specifically, this post
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96;
(2) provides a basic example of producing console output and plots using R Markdown;
(3) highlights several code chunk options such as caching and controlling how input and output is displayed;
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and
(5) discusses the implications of R Markdown.