Skip to content

Instantly share code, notes, and snippets.

View Ulu2005's full-sized avatar

Kowa Ulu2005

View GitHub Profile
@Ulu2005
Ulu2005 / task51.tex
Created February 22, 2015 21:58
wrong prove
\question{5}{Short Circuitry}
\subsubsection*{Task 5.1}
\begin{description}
\item[Theorem:] \textit{For all types} \texttt{t1, t2} \textit{and values} \texttt{f : t1 -> bool, g : t2 -> bool, x : t1, y : t2,}
\begin{align*}
\texttt{(fn (a,b) => a orelse b) (f x, g y)} \cong \texttt{f x orelse g y}
\end{align*}
\item[Proof:] \quad\\
By mathmatical induction on \texttt{f x}.\\
@Ulu2005
Ulu2005 / malloc-hint2.txt
Created November 2, 2014 19:29
hints malloc lab
(text of an email to the class from Dave O'Hallaron)
I've noticed that a number of you are having trouble getting started
with Lab 6. The purpose of this note is to help you get started by
guiding you through the initial steps I take when I do the lab.
This lab is too hard to do all at once, so I break it up into more
managable pieces. I start by developing a simple implicit list
allocator. Later, I will improve this code with a faster and more
memory efficient free list organization. But by starting with the
@Ulu2005
Ulu2005 / ppp.c
Last active August 29, 2015 14:08
/* run command */
if (tok.builtins == BUILTIN_NONE) {
sigemptyset(&mask);
sigaddset(&mask, SIGCHLD);
sigaddset(&mask, SIGINT);
sigaddset(&mask, SIGTSTP);
sigprocmask(SIG_BLOCK, &mask, &prev);
/* Children process */
if ((pid = fork()) == 0) {
/*
* waitfg - Block until process pid is no longer the foreground process
*/
void waitfg(pid_t pid) {
sigset_t mask, nomask, old;
struct job_t *j = getjobpid(jobs, pid);
sigfillset (&mask);
sigemptyset (&nomask);
sigprocmask (SIG_SETMASK, &mask, &old);
/*
* csapp.h - prototypes and definitions for the CS:APP3e book
*/
/* $begin csapp.h */
#ifndef __CSAPP_H__
#define __CSAPP_H__
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@Ulu2005
Ulu2005 / vi cheat sheet.md
Created October 7, 2014 20:07
Vi Cheat Sheet

Cursor movement

h - move left
j - move down
k - move up
l - move right
w - jump by start of words (punctuation considered words)
W - jump by words (spaces separate words)

e - jump to end of words (punctuation considered words)

@Ulu2005
Ulu2005 / csapp.c
Last active August 29, 2015 14:07
csapp
/*
* csapp.c - Functions for the CS:APP3e book
*
* Updated 10/2014 droh:
* - Added safe_printf, anasync-signal-safe wrapper for printf
*
* Updated 8/2014 droh:
* - New versions of open_clientfd and open_listenfd are reentrant and
* protocol independent.
*
@Ulu2005
Ulu2005 / fsmouse.cpp
Last active August 29, 2015 14:06
soji fsopengl lib mouse func usage
#include "fssimplewindow.h"
#include <stdio.h>
#include <stdlib.h>
typedef struct cursor *PtrCursor;
struct cursor
{
int lb, mb, rb, mx, my;
};

Bomb Lab necessities

The bomb lab is most easily completed if you understand the following tools and commands. Also, if I am describing a program, assume that you run it from command line.

Strings

In case you have never used strings before it basically just tells you all the strings in an executable. If I were to run it on the bomb I would simply run