Skip to content

Instantly share code, notes, and snippets.

@pib
pib / float_bug.go
Last active March 3, 2016 00:11
Demonstration of float scan bug in github.com/go-sql-driver/mysql
package main
import (
"database/sql"
"fmt"
"log"
_ "github.com/go-sql-driver/mysql"
)
{
"query": {
"bool": {
"should": [
{
"simple_query_string": {
"fields": [
"name^3",
"description",
"service_location",
@pib
pib / sexp.py
Created November 23, 2009 07:57
A simple Python s-expression parser.
from string import whitespace
atom_end = set('()"\'') | set(whitespace)
def parse(sexp):
stack, i, length = [[]], 0, len(sexp)
while i < length:
c = sexp[i]
print c, stack