Skip to content

Instantly share code, notes, and snippets.

View wsuzume's full-sized avatar

Yoshinobu Ogura wsuzume

View GitHub Profile
@wsuzume
wsuzume / compiler.cpp
Last active March 24, 2016 13:42
useage: ./compiler source dest
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int rmindent(char *buf)
{
int i;
for (i = 0; ; i++) {
if (buf[i] != ' ') {
@wsuzume
wsuzume / prvm.cpp
Last active March 24, 2016 13:43
useage: ./prvm program
#include <stdio.h>
#include <stdlib.h>
int chaser; //code chaser
int prgsize; //program size
int add(int *src)
{
printf("add %d %d = ", src[chaser+1], src[chaser+2]);
chaser += 3;
@wsuzume
wsuzume / stopwatch.h
Created July 4, 2015 12:30
simple timer
#pragma once
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
typedef struct stopwatch_t *StopWatch;
struct stopwatch_t {
struct timeval start;