Skip to content

Instantly share code, notes, and snippets.

/* author: Dutor
* from : http://www.dutor.net/index.php/2011/04/recursive-iterative-quick-sort/ */
int
partition(int *a, int n) //~ seperate a[], using a[0] as pivot
{
int l = 0, r = n;
int pivot = a[l];
while(l < r)
{
@flaneur2020
flaneur2020 / echo.c
Created April 14, 2011 11:17
simple echo server
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
//
@flaneur2020
flaneur2020 / readsector.s
Created January 30, 2011 03:39
read_sector
; from http://www.mouseos.com/arch/processor_mode.html
;----------------------------------------------------------------------
;
; read_sector(int sector, char *buf) - read one floppy sector(LBA mode)
; input: di - sector
; si - buf
;----------------------------------------------------------------------
read_sector:
@flaneur2020
flaneur2020 / .vimrc
Created November 14, 2010 11:07
my .vimrc
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
syntax on
filetype plugin on
"about tab
set autoindent