Skip to content

Instantly share code, notes, and snippets.

View ddanderson's full-sized avatar

Don Anderson ddanderson

View GitHub Profile
@ddanderson
ddanderson / BdbOrderedInt.cpp
Created February 19, 2011 19:14
A C++ demonstration class that forces values to be stored in MSB format, suitable for use with Berkeley DB
#include <cstring>
// Forces values to be stored in MSB format
// Assumes 32 bit int!
class BdbOrderedInt
{
private:
unsigned char bytes[4];
public:
@ddanderson
ddanderson / bdb_convert_file
Created February 13, 2011 10:39
A demonstration of how to convert a Berkeley DB file. Discussion here: libdb.wordpress.com
#!/usr/bin/perl
#
# Copyright (c) 2011
# Donald D. Anderson. All rights reserved.
#
# Redistribution and use in source and binary forms are permitted.
# This software is provided 'as is' and any express or
# implied warranties, including, but not limited to, the implied
# warranties of merchantability, fitness for a particular purpose, or
# non-infringement, are disclaimed.