Skip to content

Instantly share code, notes, and snippets.

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];
@pervognsen
pervognsen / BTree.cpp
Created April 24, 2016 20:40
A B+-tree implementation with find, insert and delete in 176 lines of code.
enum { BMAX = 32, BMIN = BMAX / 2, BHEIGHT = 6 };
struct BNode {
uint32_t length;
Key keys[BMAX];
union {
BNode *children[BMAX];
Value values[BMAX];
};
};
@sirex
sirex / notes.rst
Last active October 10, 2015 11:52
Naujasis balsavimo internetu įstatymas (2015-07-15)

(Atnaujinta 2015-10-10)

2014-11-06 buvo svarstyti įstatymo projektai dėl balsavimo internetu [1]_. Esu pakomentavęs [2]_ siūlomus pataisymus ir šiais metais vėl ruošiamas patobulintas įstatymo projektas dėl balsavimo internetu [3]_.

Tai gi mano komentarai naujai siūlomam įstatymo projektui [3]_.

15 straipsnis. Balsavimo internetu auditas
@sirex
sirex / notes.rst
Last active August 29, 2015 14:12
Balsavimo internetu diskusijos konspektas
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active August 23, 2025 00:09
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@magnetikonline
magnetikonline / README.md
Last active July 15, 2025 06:29
Setting Nginx FastCGI response buffer sizes.
@anoved
anoved / star.scad
Created March 18, 2014 15:48
OpenSCAD pointed star module
// points = number of points (minimum 3)
// outer = radius to outer points
// inner = radius to inner points
module Star(points, outer, inner) {
// polar to cartesian: radius/angle to x/y
function x(r, a) = r * cos(a);
function y(r, a) = r * sin(a);
// angular width of each pie slice of the star
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 22, 2025 10:47
Backend Architectures Keywords and References
@eznj
eznj / star_wars.ino
Last active September 26, 2023 18:24
Arduino Star Wars Song
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
const int b = 466;
const int cH = 523;
@kokx
kokx / Facebook Hackercup Solutions.md
Last active December 11, 2015 21:09
Solutions to Facebook Hackercup. Feel free to fork and make improvements! I didn't really take much time to write this, so help on clarifying the text is very much appreciated!

Disclaimer: I have no idea if this are indeed the correct answers. I just solved the exercises like this. I think that they are right though.

I have added my own code to this gist. It is ugly as hell, just like you can expect from code created in a contest like this.

Beautiful Strings

Difficulty: easy

It is simple to see that a greedy solution is good enough.