This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** \file simple_hash.h | |
* | |
* This simple hashing routine was created after finding the hsearch function | |
* a bit inadequate, due to the lack of a reentrant function in posix and | |
* the inability to do simple operations such as delete... and for fun. | |
*/ | |
#include <string.h> | |
#include <stdio.h> | |
#include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* An example of prototype programming in C | |
*/ | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include "proto.h" | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Recover from an Audacity crash by reassembling the saved data files | |
if [ $# != 2 ]; then | |
echo "ERROR: Not enough arguments" | |
echo "$0 [SOURCE PATH] [DESTINATION]" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A method for storing and retrieving hierarchical data in sqlite3 | |
-- by using a trigger and a temporary table. | |
-- I needed this but had trouble finding information on it. | |
-- This is for sqlite3, it mostly won't work on anything else, however | |
-- most databases have better ways to do this anyway. | |
PRAGMA recursive_triggers = TRUE; -- This is not possible before 3.6.18 | |
-- When creating the Node table either use a primary key or some other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Execute a cgi script | |
# Created in order to allow legacy cgi to be used in modern web apps | |
# Main cgiexec module | |
from subprocess import Popen, PIPE | |
import re | |
# CGI must be dead, i can't get hold of a standard | |
# For now i am referenceing Apache mod_cgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tweet processor, inserts link markup for users and hashtags | |
# I became frustrated with third party tools which do not link to users and hashtags, so i wrote this. | |
# Public Domain - please use this, i am happy to rewrite it in any other language. | |
# Dylan Evans <[email protected]> | |
import re | |
def html_hashtag(tag, html_class='hashtag'): | |
"HTML hashtag - create a search link" | |
return '<a class="%s" href="http://www.twitter.com/search/%s">%s</a>' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Generate a (roughly normal) sample population for a given mean & standard deviation. | |
# This was intended for use modelling hypothetical demographics in a sim game. | |
"""\ | |
Demonstration of the StatGen class | |
This script demonstrates the StatGen class which generates a normalized sample | |
from a mean and standard deviation. The algorithm can be adjusted, tweaked and | |
broken in many different ways which can provide some interesting results, but |