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
enum { BMAX = 32, BCUT = BMAX / 2, BHEIGHT = 6 }; | |
typedef uint8_t BIndex; | |
struct BNode { | |
BIndex length; | |
Key keys[BMAX]; | |
union { | |
BNode *children[BMAX]; | |
Value values[BMAX]; |
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
If you're on Archlinux you shouuuuld just be able to drop these two files in a dir by themselves, chmod +x them, and run "install.sh". | |
If you're on a different Unix you can probably adapt this without too much effort to your system, especially the part about . | |
If you're not in Winter 2015 you probably need to tweak update.sh. | |
Sorry for the poor documentation and poor testing! And also the almost complete lack of error handling! | |
Hopefully this helps someone else in the future! this represents 13 hours of my life! | |
Tip: make your empty dir a git repo so that then you can just do | |
``` | |
git clean -df && git clean -xfd |
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
# INSTALL INSTRUCTIONS: save as ~/.gdbinit | |
# | |
# DESCRIPTION: A user-friendly gdb configuration file. | |
# | |
# REVISION : 7.3 (16/04/2010) | |
# | |
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit, | |
# truthix the cyberpunk, fG!, gln | |
# | |
# FEEDBACK: https://www.reverse-engineering.net |
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
*~ | |
*.pyc | |
.vagrant | |
venv |
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
#!/usr/bin/env python | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
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
#!/usr/bin/env python | |
"""Solution for project euler problem #12. | |
Based on: | |
http://stackoverflow.com/questions/571488/project-euler-12-in-python/571526#571526 | |
""" | |
def ndiv(n, prime_factors): | |
"""Return number of divisors of `n`. | |