Skip to content

Instantly share code, notes, and snippets.

@rbertucat
rbertucat / gist:1973809
Created March 4, 2012 16:42 — forked from mpictor/gist:1967483
part 21 encode/decode binary
def values = ["0", "1", "111011", "100100101010", "001101", "01000", "10101010110111110110000"]
def binaries = []
values.each { value ->
def i = Long.parseLong(value, 2)
def rem = (4 - i.toString().size()%4)%4
binaries << (rem + Long.toHexString(i)).toUpperCase()
}
assert binaries == ["30", "31", "23B", "092A", "2D", "38", "1556FB0"]
def uncode = []
@rbertucat
rbertucat / test_schema.exp
Created September 13, 2011 14:19 — forked from mpictor/test_schema.exp
Small schema with MULTIPLE INHERITANCE error
-- $ make p21read_sdai_TEST_SCHEMA
-- build\TEST_SCHEMA\SdaiTEST_SCHEMA.cc:337:65: error: 'class SdaiPerson_and_organization_address' has no member named 'people_'
-- Errors in input
SCHEMA test_schema;
TYPE classification_item = SELECT (
person_and_organization_address,
address);
END_TYPE;