This file contains 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
package net.quenchnetworks.panthera.feedimport.util; | |
import java.util.*; | |
import java.sql.*; | |
public class LoggingConnection implements Connection | |
{ | |
public static class LogEntry | |
{ | |
public String sql; |
This file contains 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
<?php | |
/** | |
* Calculate differences between two dates with precise semantics. Based on PHPs DateTime::diff() | |
* implementation by Derick Rethans. Ported to PHP by Emil H, 2011-05-02. No rights reserved. | |
* | |
* See here for original code: | |
* http://svn.php.net/viewvc/php/php-src/trunk/ext/date/lib/tm2unixtime.c?revision=302890&view=markup | |
* http://svn.php.net/viewvc/php/php-src/trunk/ext/date/lib/interval.c?revision=298973&view=markup | |
*/ |
This file contains 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
# bigdecoder.py, by [email protected], 2009-03-01 | |
# | |
# decoder for .BIG-format files utilized by Red Alert 3 and C&C: Zero Hours | |
# among others. .big is a trivial archival format. quite frankly, this is | |
# probably the simplest compound file format imaginable. | |
# | |
# this script is written for microsoft windows. it can probably be easily | |
# adapted for other platforms, but i haven't tried. | |
# | |
# file structure: |
This file contains 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
/** | |
* WordTrainer 2008-12-02 | |
* Simple language training in Java. This program accepts text-files | |
* containing where each line contains two words in two diffrent languages | |
* separated by a comma (,). The first line follows the same format but | |
* specifies the language. | |
* | |
* Sample gloss-file: | |
* Engelska,Svenska | |
* cloud,moln |
This file contains 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
<?php | |
/** | |
* spellcheck.php | |
* | |
* @version 0.1 | |
* @author Emil Hernvall <[email protected]> | |
* @license Public Domain | |
*/ | |
/** |
This file contains 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
def Denary2Binary(n): | |
'''convert denary integer n to binary string bStr''' | |
bStr = '' | |
if n < 0: raise ValueError, "must be a positive integer" | |
if n == 0: return '0' | |
while n > 0: | |
bStr = str(n % 2) + bStr | |
n = n >> 1 | |
return bStr |
This file contains 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
/** | |
* Emil Hernvall - 2007-12-15 | |
* Given a hand of n cards and k attempts, use recursion to shuffle the cards | |
* into a given order. | |
*/ | |
#include <stdio.h> | |
int compare(int* first, int* second, int size) | |
{ |
This file contains 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
// perm.c - setuid to another user and give group members write permission | |
// to files with certain extensions. | |
// Emil Hernvall, 2008-04-14 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dirent.h> | |
#include <string.h> |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <errno.h> | |
int mkdirp(const char *path, mode_t mode) | |
{ | |
char *pos, *base; | |
char **dirs; |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#define DEBUG 1 | |
#define HASHTABLE_HASH_A 41 | |
#define HASHTABLE_COMPRESSION_A 77 | |
#define HASHTABLE_COMPRESSION_B 42 | |
#define HASHTABLE_BUCKET_INITIALSIZE 2 |