Skip to content

Instantly share code, notes, and snippets.

@m-mizutani
m-mizutani / ptree.h
Created August 8, 2011 22:00
Patricia Tree Template in C++
#ifndef __PTREE_H__
#define __PTREE_H__
#include <sys/types.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@jl2
jl2 / Makefile
Last active November 4, 2017 20:39
A simple trie data structure in C++.
trie: main.cpp Makefile
clang++ -O3 -std=c++11 -stdlib=libc++ -Wall -o trie main.cpp -lboost_system
@smhanov
smhanov / dawg.py
Last active July 15, 2024 18:58
Use a DAWG as a map
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article.
#
# Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata."
# Computational linguistics 26.1 (2000): 3-16.
#
# Updated 2014 to use DAWG as a mapping; see
# Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies",
# Software-Practice and Experience 1993
@rebo
rebo / graphql_list.rs
Last active November 20, 2019 07:13
GraphQL backed list
use super::{Model, Msg};
use enclose::enclose as e;
use seed::{prelude::*, *};
use seed_comp_helpers::graphql_list::use_graphql_list;
use seed_comp_helpers::on_click;
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)]
pub struct Country {
name: String,