Placeholder
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
CREATE TABLE foo ( | |
id INTEGER PRIMARY KEY, | |
v1 INTEGER NOT NULL, | |
v2 INTEGER NOT NULL, | |
v3 INTEGER NOT NULL | |
); | |
ALTER TABLE foo | |
ADD CONSTRAINT uniq_except_v3_zero | |
EXCLUDE USING GIST (v1 WITH =, v2 WITH =, v3 WITH =) WHERE (v3 <> 0); |
Came up in hardfinhq/go-date#13
Consider
package main
import (
"fmt"
"os"
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
/1930s.html | |
/1960s.html | |
/1970s.html | |
/1980s.html | |
/1990s.html | |
/2000s.html | |
/2010s.html |
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
import graphql.language | |
import networkx as nx | |
import tabulate | |
def _find_field_fragment_dependencies( | |
field_node: graphql.language.ast.FieldNode, | |
) -> list[str]: | |
if field_node.selection_set is None: | |
return [] |
The TL;DR here is that if the standard encoding/json
machinery in
Go sees a null
in a JSON field or a nil
pointer in a Go field (of type
*T
), then it will not invoke the UnmarshalJSON()
/ MarshalJSON()
on
your type.
$ go run ./main.go
t1 = main.T{Shift:(*main.Point)(nil)} (nil stays nil, UnmarshalJSON() not invoked)
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
# Copyright (c) 2023 - Present. Hardfin, Inc. All rights reserved. | |
# Hardfin Confidential - Restricted | |
import csv | |
import io | |
import pathlib | |
import subprocess | |
import tempfile | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
It turns out a lot (2**52
). Anything where the 12 exponent bits
are all 1, independent of the values of the other 52 bits).
$ python main.py
binary(1.0) = 0011111111110000000000000000000000000000000000000000000000000000
binary(2.0) = 0100000000000000000000000000000000000000000000000000000000000000
binary(-1.0) = 1011111111110000000000000000000000000000000000000000000000000000
NewerOlder