Skip to content

Instantly share code, notes, and snippets.

View Ulu2005's full-sized avatar

Kowa Ulu2005

View GitHub Profile
@Ulu2005
Ulu2005 / app.py
Created November 25, 2012 08:50
A little case of using wxPython with matplotlib
# -*- coding: utf-8 -*-
import os
import wx
from scipy import interpolate
import numpy as np
import matplotlib.pyplot as plt
class MainFrame ( wx.Frame ):
#!/usr/bin/env python
#
# This script shows how to use Flask within a WSGI wrapper for CGI.
# Flask is a WSGI framework, so we need to translate CGI into WSGI.
#
# Authors: Athula Balachandran <abalacha@cs.cmu.edu>,
# Charles Rang <rang@cs.cmu.edu>,
# Wolfgang Richter <wolf@cs.cmu.edu>
import os, sys
#!/usr/bin/env python
import socket
import requests
import os
import time
from grader import grader, tester
import hashlib
import random
from subprocess import Popen, PIPE, STDOUT
import os.path
@Ulu2005
Ulu2005 / lisod.py
Created September 14, 2015 00:07
Lisod prototype
#!/usr/bin/env python
import os
import datetime
import BaseHTTPServer
import SocketServer
# hard-coded configurtion
@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 / 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.
*